diff options
author | mingchen | 2007-06-04 14:09:19 +0000 |
---|---|---|
committer | mingchen | 2007-06-04 14:09:19 +0000 |
commit | 17421593528f4126256dea6d0c844da9c218fdb7 (patch) | |
tree | 69025fb439a08c24787a226b708f7b271610c548 /OpenSim/OpenSim.Storage | |
parent | Small bugfix. (diff) | |
download | opensim-SC_OLD-17421593528f4126256dea6d0c844da9c218fdb7.zip opensim-SC_OLD-17421593528f4126256dea6d0c844da9c218fdb7.tar.gz opensim-SC_OLD-17421593528f4126256dea6d0c844da9c218fdb7.tar.bz2 opensim-SC_OLD-17421593528f4126256dea6d0c844da9c218fdb7.tar.xz |
Parcel Manager Changes:
*Added Parcel Backup Support for DB4. Other storages currently do not save
*Added parcelIDList in ParcelManager to speed up parcel fetching at position
*Added ParcelData.cs and ParcelData class for better storage support
*Documentation for parcel added
*2 Parcel Related bug fixes
Diffstat (limited to 'OpenSim/OpenSim.Storage')
3 files changed, 63 insertions, 1 deletions
diff --git a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs index d4db8c0..7c8ee88 100644 --- a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs +++ b/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs | |||
@@ -86,6 +86,17 @@ namespace OpenSim.Storage.LocalStorageBDB | |||
86 | { | 86 | { |
87 | 87 | ||
88 | } | 88 | } |
89 | |||
90 | public void SaveParcels(ParcelData[] parcel_data) | ||
91 | { | ||
92 | } | ||
93 | |||
94 | |||
95 | public void LoadParcels(ILocalStorageParcelReceiver recv) | ||
96 | { | ||
97 | recv.NoParcelDataFromStorage(); | ||
98 | } | ||
99 | |||
89 | public void ShutDown() | 100 | public void ShutDown() |
90 | { | 101 | { |
91 | sim.GetDb().Close(); | 102 | sim.GetDb().Close(); |
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs index 5dceb7f..087db96 100644 --- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs +++ b/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs | |||
@@ -28,11 +28,13 @@ using System; | |||
28 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using Db4objects.Db4o; | 29 | using Db4objects.Db4o; |
30 | using Db4objects.Db4o.Query; | 30 | using Db4objects.Db4o.Query; |
31 | |||
31 | using libsecondlife; | 32 | using libsecondlife; |
32 | using OpenSim.Framework.Interfaces; | 33 | using OpenSim.Framework.Interfaces; |
33 | using OpenSim.Framework.Types; | 34 | using OpenSim.Framework.Types; |
34 | using OpenSim.Framework.Terrain; | 35 | using OpenSim.Framework.Terrain; |
35 | 36 | ||
37 | |||
36 | namespace OpenSim.Storage.LocalStorageDb4o | 38 | namespace OpenSim.Storage.LocalStorageDb4o |
37 | { | 39 | { |
38 | /// <summary> | 40 | /// <summary> |
@@ -173,10 +175,49 @@ namespace OpenSim.Storage.LocalStorageDb4o | |||
173 | db.Commit(); | 175 | db.Commit(); |
174 | } | 176 | } |
175 | 177 | ||
178 | public void SaveParcels(ParcelData[] parcel_data) | ||
179 | { | ||
180 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: Saving Parcels..."); | ||
181 | IObjectSet result = db.Get(typeof(ParcelData)); | ||
182 | foreach (ParcelData parcel in result) | ||
183 | { | ||
184 | db.Delete(parcel); | ||
185 | } | ||
186 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: Removing old entries complete. Adding new entries."); | ||
187 | int i; | ||
188 | for (i = 0; i < parcel_data.GetLength(0); i++) | ||
189 | { | ||
190 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Adding : " + i); | ||
191 | db.Set(parcel_data[i]); | ||
192 | |||
193 | } | ||
194 | db.Commit(); | ||
195 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: Parcel Save Complete"); | ||
196 | } | ||
197 | |||
198 | public void LoadParcels(ILocalStorageParcelReceiver recv) | ||
199 | { | ||
200 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: Loading Parcels..."); | ||
201 | IObjectSet result = db.Get(typeof(ParcelData)); | ||
202 | if (result.Count > 0) | ||
203 | { | ||
204 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: Parcels exist in database."); | ||
205 | foreach (ParcelData parcelData in result) | ||
206 | { | ||
207 | recv.ParcelFromStorage(parcelData); | ||
208 | } | ||
209 | } | ||
210 | else | ||
211 | { | ||
212 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: No parcels exist. Creating basic parcel."); | ||
213 | recv.NoParcelDataFromStorage(); | ||
214 | } | ||
215 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: Parcels Restored"); | ||
216 | } | ||
176 | public void ShutDown() | 217 | public void ShutDown() |
177 | { | 218 | { |
178 | db.Commit(); | 219 | db.Commit(); |
179 | db.Close(); | 220 | db.Close(); |
180 | } | 221 | } |
181 | } | 222 | } |
182 | } | 223 | } \ No newline at end of file |
diff --git a/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs index 368405b..1f4c6be 100644 --- a/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs +++ b/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs | |||
@@ -167,6 +167,16 @@ namespace OpenSim.Storage.LocalStorageSQLite | |||
167 | 167 | ||
168 | } | 168 | } |
169 | 169 | ||
170 | public void SaveParcels(ParcelData[] parcel_manager) | ||
171 | { | ||
172 | |||
173 | } | ||
174 | |||
175 | public void LoadParcels(ILocalStorageParcelReceiver recv) | ||
176 | { | ||
177 | recv.NoParcelDataFromStorage(); | ||
178 | } | ||
179 | |||
170 | public void ShutDown() | 180 | public void ShutDown() |
171 | { | 181 | { |
172 | db.Close(); | 182 | db.Close(); |