OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
NullSimulationData.cs
Go to the documentation of this file.
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 {
40  {
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 
60  {
61  }
62 
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 
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 UUID[] GetObjectIDs(UUID regionID)
188  {
189  return new UUID[0];
190  }
191 
192  public void SaveExtra(UUID regionID, string name, string value)
193  {
194  }
195 
196  public void RemoveExtra(UUID regionID, string name)
197  {
198  }
199 
200  public Dictionary<string, string> GetExtra(UUID regionID)
201  {
202  return null;
203  }
204  }
205 }
void StoreTerrain(double[,] ter, UUID regionID)
RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ)
Load the latest terrain revision from region storage
void RemoveExtra(UUID regionID, string name)
OpenSim.Framework.RegionSettings RegionSettings
void Initialise(string dbfile)
Initialises the data storage engine
A scene object group is conceptually an object in the scene. The object is constituted of SceneObject...
void RemoveObject(UUID obj, UUID regionUUID)
Entirely removes the object, including inventory
NULL DataStore, do not store anything
void RemoveRegionWindlightSettings(UUID regionID)
void StoreRegionSettings(RegionSettings rs)
RegionSettings LoadRegionSettings(UUID regionUUID)
NullSimulationData(string connectionString)
void StoreRegionWindlightSettings(RegionLightShareData wl)
void StoreTerrain(TerrainData ter, UUID regionID)
Store a terrain revision in region storage
void StoreObject(SceneObjectGroup obj, UUID regionUUID)
Stores all object's details apart from inventory
void StorePrimInventory(UUID primID, ICollection< TaskInventoryItem > items)
Store a prim's inventory
List< SceneObjectGroup > LoadObjects(UUID regionUUID)
Load persisted objects from region storage.
Dictionary< string, string > GetExtra(UUID regionID)
void RemoveRegionEnvironmentSettings(UUID regionUUID)
Delete Environment settings from region storage
void StoreRegionEnvironmentSettings(UUID regionUUID, string settings)
Store Environment settings into region storage
void Dispose()
Dispose the database
void RemoveLandObject(UUID globalID)
delete from land where UUID=globalID delete from landaccesslist where LandUUID=globalID ...
string LoadRegionEnvironmentSettings(UUID regionUUID)
Load Environment settings from region storage
void SaveExtra(UUID regionID, string name, string value)
List< LandData > LoadLandObjects(UUID regionUUID)