diff options
author | MW | 2007-03-08 13:21:24 +0000 |
---|---|---|
committer | MW | 2007-03-08 13:21:24 +0000 |
commit | f60bc970eb925cd245cc77b1ae700b28d4589163 (patch) | |
tree | d279883582f00232bad87bf17e5727ff263027a4 /src/Config/SimConfig/Db4SimConfig.cs | |
parent | Brought OGS.sql back into trunk (diff) | |
download | opensim-SC_OLD-f60bc970eb925cd245cc77b1ae700b28d4589163.zip opensim-SC_OLD-f60bc970eb925cd245cc77b1ae700b28d4589163.tar.gz opensim-SC_OLD-f60bc970eb925cd245cc77b1ae700b28d4589163.tar.bz2 opensim-SC_OLD-f60bc970eb925cd245cc77b1ae700b28d4589163.tar.xz |
Another attemp to fix the Session Logout bug
World map data is now saved in database and recovered on startup.
Primitives are now backed up to a local database and reloaded on startup.
Diffstat (limited to '')
-rw-r--r-- | src/Config/SimConfig/Db4SimConfig.cs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/Config/SimConfig/Db4SimConfig.cs b/src/Config/SimConfig/Db4SimConfig.cs index cc31328..4a06187 100644 --- a/src/Config/SimConfig/Db4SimConfig.cs +++ b/src/Config/SimConfig/Db4SimConfig.cs | |||
@@ -111,16 +111,19 @@ namespace Db40SimConfig | |||
111 | ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Loading world...."); | 111 | ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Loading world...."); |
112 | World blank = new World(); | 112 | World blank = new World(); |
113 | ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Looking for a heightmap in local DB"); | 113 | ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Looking for a heightmap in local DB"); |
114 | IObjectSet world_result = db.Get(new float[65536]); | 114 | IObjectSet world_result = db.Get(typeof(MapStorage)); |
115 | if(world_result.Count>0) { | 115 | if(world_result.Count>0) { |
116 | ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Found a heightmap in local database, loading"); | 116 | ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Found a heightmap in local database, loading"); |
117 | blank.LandMap=(float[])world_result.Next(); | 117 | MapStorage map=(MapStorage)world_result.Next(); |
118 | blank.LandMap = map.Map; | ||
118 | } else { | 119 | } else { |
119 | ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - No heightmap found, generating new one"); | 120 | ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - No heightmap found, generating new one"); |
120 | HeightmapGenHills hills = new HeightmapGenHills(); | 121 | HeightmapGenHills hills = new HeightmapGenHills(); |
121 | blank.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false); | 122 | blank.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false); |
122 | ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Saving heightmap to local database"); | 123 | ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Saving heightmap to local database"); |
123 | db.Set(blank.LandMap); | 124 | MapStorage map= new MapStorage(); |
125 | map.Map = blank.LandMap; | ||
126 | db.Set(map); | ||
124 | db.Commit(); | 127 | db.Commit(); |
125 | } | 128 | } |
126 | return blank; | 129 | return blank; |
@@ -143,4 +146,14 @@ namespace Db40SimConfig | |||
143 | db.Close(); | 146 | db.Close(); |
144 | } | 147 | } |
145 | } | 148 | } |
149 | |||
150 | public class MapStorage | ||
151 | { | ||
152 | public float[] Map; | ||
153 | |||
154 | public MapStorage() | ||
155 | { | ||
156 | |||
157 | } | ||
158 | } | ||
146 | } | 159 | } |