From 01536d901aaa5c31cb5d2b83e9afe8555767f146 Mon Sep 17 00:00:00 2001 From: gareth Date: Tue, 6 Mar 2007 20:22:17 +0000 Subject: [PATCH] Attempted to fix Db4o/world thing (and failed, but it still runs!) will need a new class for the world data Removed excess debug output --- src/Config.cs | 30 +++++++++++++++++------------- src/OpenSimClient.cs | 1 - src/world/World.cs | 3 --- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Config.cs b/src/Config.cs index 55bcdfe7a7..3a9c3551ce 100644 --- a/src/Config.cs +++ b/src/Config.cs @@ -131,19 +131,23 @@ namespace OpenSim } public World LoadWorld() { - OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Looking for a world object in local DB"); - // IObjectSet world_result = db.Get(typeof(OpenSim.world.World)); - // if(world_result.Count==1) { - // OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Found an OpenSim.world.World object in local database, loading"); - //return (World)world_result.Next(); - // } else { - OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Could not find the world or too many worlds! Constructing blank one"); - World blank = new World(); - OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Saving initial world state to disk"); - //db.Set(blank); - //db.Commit(); - return blank; - // } + OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Loading world...."); + World blank = new World(); + OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Looking for a heightmap in local DB"); + IObjectSet world_result = db.Get(new float[65536]); + if(world_result.Count>0) { + OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Found a heightmap in local database, loading"); + blank.LandMap=(float[])world_result.Next(); + } else { + OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - No heightmap found, generating new one"); + for(int i =0; i < 65536; i++) { + blank.LandMap[i] = 21.4989f; + } + OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Saving heightmap to local database"); + db.Set(blank.LandMap); + db.Commit(); + } + return blank; } public void LoadFromGrid() { diff --git a/src/OpenSimClient.cs b/src/OpenSimClient.cs index 0e956c3302..655ebfe9a7 100644 --- a/src/OpenSimClient.cs +++ b/src/OpenSimClient.cs @@ -231,7 +231,6 @@ namespace OpenSim return; } - OpenSim_Main.localcons.WriteLine("Sending PacketAck"); int i = 0; diff --git a/src/world/World.cs b/src/world/World.cs index 2f73bd5a3d..83788cd2fa 100644 --- a/src/world/World.cs +++ b/src/world/World.cs @@ -26,9 +26,6 @@ namespace OpenSim.world OpenSim_Main.localcons.WriteLine("World.cs - creating LandMap"); terrainengine = new TerrainDecode(); LandMap = new float[65536]; - for(int i =0; i < 65536; i++) { - LandMap[i] = 21.4989f; - } }