clockwerk-opensim – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 vero 1 /*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27  
28 using System.Collections.Generic;
29 using OpenMetaverse;
30 using OpenSim.Framework;
31 using OpenSim.Region.Framework.Interfaces;
32 using OpenSim.Region.Framework.Scenes;
33  
34 namespace OpenSim.Data.Null
35 {
36 /// <summary>
37 /// NULL DataStore, do not store anything
38 /// </summary>
39 public class NullSimulationData : ISimulationDataStore
40 {
41 public NullSimulationData()
42 {
43 }
44  
45 public NullSimulationData(string connectionString)
46 {
47 Initialise(connectionString);
48 }
49  
50 public void Initialise(string dbfile)
51 {
52 return;
53 }
54  
55 public void Dispose()
56 {
57 }
58  
59 public void StoreRegionSettings(RegionSettings rs)
60 {
61 }
62  
63 public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
64 {
65 //This connector doesn't support the windlight module yet
66 //Return default LL windlight settings
67 return new RegionLightShareData();
68 }
69  
70 public void RemoveRegionWindlightSettings(UUID regionID)
71 {
72 }
73  
74 public void StoreRegionWindlightSettings(RegionLightShareData wl)
75 {
76 //This connector doesn't support the windlight module yet
77 }
78  
79 #region Environment Settings
80  
81 private Dictionary<UUID, string> EnvironmentSettings = new Dictionary<UUID, string>();
82  
83 public string LoadRegionEnvironmentSettings(UUID regionUUID)
84 {
85 lock (EnvironmentSettings)
86 {
87 if (EnvironmentSettings.ContainsKey(regionUUID))
88 return EnvironmentSettings[regionUUID];
89 }
90 return string.Empty;
91 }
92  
93 public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings)
94 {
95 lock (EnvironmentSettings)
96 {
97 EnvironmentSettings[regionUUID] = settings;
98 }
99 }
100  
101 public void RemoveRegionEnvironmentSettings(UUID regionUUID)
102 {
103 lock (EnvironmentSettings)
104 {
105 if (EnvironmentSettings.ContainsKey(regionUUID))
106 EnvironmentSettings.Remove(regionUUID);
107 }
108 }
109 #endregion
110  
111 public RegionSettings LoadRegionSettings(UUID regionUUID)
112 {
113 RegionSettings rs = new RegionSettings();
114 rs.RegionUUID = regionUUID;
115 return rs;
116 }
117  
118 public void StoreObject(SceneObjectGroup obj, UUID regionUUID)
119 {
120 }
121  
122 public void RemoveObject(UUID obj, UUID regionUUID)
123 {
124 }
125  
126 public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items)
127 {
128 }
129  
130 public List<SceneObjectGroup> LoadObjects(UUID regionUUID)
131 {
132 return new List<SceneObjectGroup>();
133 }
134  
135 Dictionary<UUID, TerrainData> m_terrains = new Dictionary<UUID, TerrainData>();
136 public void StoreTerrain(TerrainData ter, UUID regionID)
137 {
138 if (m_terrains.ContainsKey(regionID))
139 m_terrains.Remove(regionID);
140 m_terrains.Add(regionID, ter);
141 }
142  
143 // Legacy. Just don't do this.
144 public void StoreTerrain(double[,] ter, UUID regionID)
145 {
146 TerrainData terrData = new HeightmapTerrainData(ter);
147 StoreTerrain(terrData, regionID);
148 }
149  
150 // Legacy. Just don't do this.
151 // Returns 'null' if region not found
152 public double[,] LoadTerrain(UUID regionID)
153 {
154 if (m_terrains.ContainsKey(regionID))
155 {
156 return m_terrains[regionID].GetDoubles();
157 }
158 return null;
159 }
160  
161 public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ)
162 {
163 if (m_terrains.ContainsKey(regionID))
164 {
165 return m_terrains[regionID];
166 }
167 return null;
168 }
169  
170 public void RemoveLandObject(UUID globalID)
171 {
172 }
173  
174 public void StoreLandObject(ILandObject land)
175 {
176 }
177  
178 public List<LandData> LoadLandObjects(UUID regionUUID)
179 {
180 return new List<LandData>();
181 }
182  
183 public void Shutdown()
184 {
185 }
186  
187 public void SaveExtra(UUID regionID, string name, string value)
188 {
189 }
190  
191 public void RemoveExtra(UUID regionID, string name)
192 {
193 }
194  
195 public Dictionary<string, string> GetExtra(UUID regionID)
196 {
197 return null;
198 }
199 }
200 }