aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/Config.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Config.cs')
-rw-r--r--src/Config.cs30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/Config.cs b/src/Config.cs
index 55bcdfe..3a9c355 100644
--- a/src/Config.cs
+++ b/src/Config.cs
@@ -131,19 +131,23 @@ namespace OpenSim
131 } 131 }
132 132
133 public World LoadWorld() { 133 public World LoadWorld() {
134 OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Looking for a world object in local DB"); 134 OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Loading world....");
135 // IObjectSet world_result = db.Get(typeof(OpenSim.world.World)); 135 World blank = new World();
136 // if(world_result.Count==1) { 136 OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Looking for a heightmap in local DB");
137 // OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Found an OpenSim.world.World object in local database, loading"); 137 IObjectSet world_result = db.Get(new float[65536]);
138 //return (World)world_result.Next(); 138 if(world_result.Count>0) {
139 // } else { 139 OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Found a heightmap in local database, loading");
140 OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Could not find the world or too many worlds! Constructing blank one"); 140 blank.LandMap=(float[])world_result.Next();
141 World blank = new World(); 141 } else {
142 OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Saving initial world state to disk"); 142 OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - No heightmap found, generating new one");
143 //db.Set(blank); 143 for(int i =0; i < 65536; i++) {
144 //db.Commit(); 144 blank.LandMap[i] = 21.4989f;
145 return blank; 145 }
146 // } 146 OpenSim_Main.localcons.WriteLine("Config.cs:LoadWorld() - Saving heightmap to local database");
147 db.Set(blank.LandMap);
148 db.Commit();
149 }
150 return blank;
147 } 151 }
148 152
149 public void LoadFromGrid() { 153 public void LoadFromGrid() {