aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.Config/SimConfigDb4o/DbSimConfig.cs
diff options
context:
space:
mode:
authorMW2007-04-02 10:46:59 +0000
committerMW2007-04-02 10:46:59 +0000
commit1ea4ba3a18cf0ccdc512a1cc800e44bc5cf16210 (patch)
tree4022048c8ad28d31a2dd9c87f27bab213a731468 /OpenSim.Config/SimConfigDb4o/DbSimConfig.cs
parentFinished putting user server config into Db4o (diff)
downloadopensim-SC_OLD-1ea4ba3a18cf0ccdc512a1cc800e44bc5cf16210.zip
opensim-SC_OLD-1ea4ba3a18cf0ccdc512a1cc800e44bc5cf16210.tar.gz
opensim-SC_OLD-1ea4ba3a18cf0ccdc512a1cc800e44bc5cf16210.tar.bz2
opensim-SC_OLD-1ea4ba3a18cf0ccdc512a1cc800e44bc5cf16210.tar.xz
Moved database storage of the world map to the Db4LocalStorage so its in the same database as in world prims are stored.
Diffstat (limited to 'OpenSim.Config/SimConfigDb4o/DbSimConfig.cs')
-rw-r--r--OpenSim.Config/SimConfigDb4o/DbSimConfig.cs42
1 files changed, 1 insertions, 41 deletions
diff --git a/OpenSim.Config/SimConfigDb4o/DbSimConfig.cs b/OpenSim.Config/SimConfigDb4o/DbSimConfig.cs
index 250f3fd..9b51b45 100644
--- a/OpenSim.Config/SimConfigDb4o/DbSimConfig.cs
+++ b/OpenSim.Config/SimConfigDb4o/DbSimConfig.cs
@@ -29,7 +29,6 @@ using System.Collections.Generic;
29using OpenSim; 29using OpenSim;
30using OpenSim.Framework.Utilities; 30using OpenSim.Framework.Utilities;
31using OpenSim.Framework.Interfaces; 31using OpenSim.Framework.Interfaces;
32using OpenSim.Framework.Terrain;
33//using OpenSim.world; 32//using OpenSim.world;
34using Db4objects.Db4o; 33using Db4objects.Db4o;
35 34
@@ -96,6 +95,7 @@ namespace OpenSim.Config.SimConfigDb4o
96 LoadDefaults(); 95 LoadDefaults();
97 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Writing out default settings to local database"); 96 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Writing out default settings to local database");
98 db.Set(this); 97 db.Set(this);
98 db.Commit();
99 } 99 }
100 } catch(Exception e) { 100 } catch(Exception e) {
101 db.Close(); 101 db.Close();
@@ -114,46 +114,6 @@ namespace OpenSim.Config.SimConfigDb4o
114 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Grid URL: " + this.GridURL); 114 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Grid URL: " + this.GridURL);
115 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Grid key: " + this.GridSendKey); 115 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Grid key: " + this.GridSendKey);
116 } 116 }
117
118 public override float[] LoadWorld()
119 {
120 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Loading world....");
121 //World blank = new World();
122 float[] heightmap = null;
123 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Looking for a heightmap in local DB");
124 IObjectSet world_result = db.Get(typeof(MapStorage));
125 if(world_result.Count>0) {
126 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Found a heightmap in local database, loading");
127 MapStorage map=(MapStorage)world_result.Next();
128 //blank.LandMap = map.Map;
129 heightmap = map.Map;
130 } else {
131 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - No heightmap found, generating new one");
132 HeightmapGenHills hills = new HeightmapGenHills();
133 // blank.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false);
134 heightmap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false);
135 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Saving heightmap to local database");
136 MapStorage map= new MapStorage();
137 map.Map = heightmap; //blank.LandMap;
138 db.Set(map);
139 db.Commit();
140 }
141 return heightmap;
142 }
143
144 public override void SaveMap(float[] heightmap)
145 {
146 IObjectSet world_result = db.Get(typeof(MapStorage));
147 if(world_result.Count>0) {
148 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - updating saved copy of heightmap in local database");
149 MapStorage map=(MapStorage)world_result.Next();
150 db.Delete(map);
151 }
152 MapStorage map1= new MapStorage();
153 map1.Map = heightmap; //OpenSim_Main.local_world.LandMap;
154 db.Set(map1);
155 db.Commit();
156 }
157 117
158 public override void LoadFromGrid() { 118 public override void LoadFromGrid() {
159 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadFromGrid() - dummy function, DOING ABSOLUTELY NOTHING AT ALL!!!"); 119 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadFromGrid() - dummy function, DOING ABSOLUTELY NOTHING AT ALL!!!");