From 1ea4ba3a18cf0ccdc512a1cc800e44bc5cf16210 Mon Sep 17 00:00:00 2001 From: MW Date: Mon, 2 Apr 2007 10:46:59 +0000 Subject: Moved database storage of the world map to the Db4LocalStorage so its in the same database as in world prims are stored. --- OpenSim.Config/SimConfigDb4o/DbSimConfig.cs | 42 +---------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) (limited to 'OpenSim.Config/SimConfigDb4o/DbSimConfig.cs') 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; using OpenSim; using OpenSim.Framework.Utilities; using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Terrain; //using OpenSim.world; using Db4objects.Db4o; @@ -96,6 +95,7 @@ namespace OpenSim.Config.SimConfigDb4o LoadDefaults(); OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Writing out default settings to local database"); db.Set(this); + db.Commit(); } } catch(Exception e) { db.Close(); @@ -114,46 +114,6 @@ namespace OpenSim.Config.SimConfigDb4o OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Grid URL: " + this.GridURL); OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Grid key: " + this.GridSendKey); } - - public override float[] LoadWorld() - { - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Loading world...."); - //World blank = new World(); - float[] heightmap = null; - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Looking for a heightmap in local DB"); - IObjectSet world_result = db.Get(typeof(MapStorage)); - if(world_result.Count>0) { - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Found a heightmap in local database, loading"); - MapStorage map=(MapStorage)world_result.Next(); - //blank.LandMap = map.Map; - heightmap = map.Map; - } else { - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - No heightmap found, generating new one"); - HeightmapGenHills hills = new HeightmapGenHills(); - // blank.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false); - heightmap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false); - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Saving heightmap to local database"); - MapStorage map= new MapStorage(); - map.Map = heightmap; //blank.LandMap; - db.Set(map); - db.Commit(); - } - return heightmap; - } - - public override void SaveMap(float[] heightmap) - { - IObjectSet world_result = db.Get(typeof(MapStorage)); - if(world_result.Count>0) { - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - updating saved copy of heightmap in local database"); - MapStorage map=(MapStorage)world_result.Next(); - db.Delete(map); - } - MapStorage map1= new MapStorage(); - map1.Map = heightmap; //OpenSim_Main.local_world.LandMap; - db.Set(map1); - db.Commit(); - } public override void LoadFromGrid() { OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadFromGrid() - dummy function, DOING ABSOLUTELY NOTHING AT ALL!!!"); -- cgit v1.1