diff options
author | Adam Frisby | 2007-06-05 12:55:12 +0000 |
---|---|---|
committer | Adam Frisby | 2007-06-05 12:55:12 +0000 |
commit | 1e716260c8166005d3bd33f4cda68502a09994bb (patch) | |
tree | 457d68f241ca0d8b28e03fdcd1a93f6aaf75ec44 /OpenSim/OpenSim.Storage | |
parent | * Removing dead comments (diff) | |
download | opensim-SC_OLD-1e716260c8166005d3bd33f4cda68502a09994bb.zip opensim-SC_OLD-1e716260c8166005d3bd33f4cda68502a09994bb.tar.gz opensim-SC_OLD-1e716260c8166005d3bd33f4cda68502a09994bb.tar.bz2 opensim-SC_OLD-1e716260c8166005d3bd33f4cda68502a09994bb.tar.xz |
* Removed MainConsole.Instance.WriteLine completely
* Now exists MainConsole.Instance.Error/Warn/Notice/Verbose -- use those instead
* Removed some instances of System.Console use - aiming to depreciate this in favour of MainConsole completely.
Diffstat (limited to 'OpenSim/OpenSim.Storage')
-rw-r--r-- | OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs | 35 | ||||
-rw-r--r-- | OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs | 12 |
2 files changed, 24 insertions, 23 deletions
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs index 087db96..ce8504d 100644 --- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs +++ b/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs | |||
@@ -33,6 +33,7 @@ using libsecondlife; | |||
33 | using OpenSim.Framework.Interfaces; | 33 | using OpenSim.Framework.Interfaces; |
34 | using OpenSim.Framework.Types; | 34 | using OpenSim.Framework.Types; |
35 | using OpenSim.Framework.Terrain; | 35 | using OpenSim.Framework.Terrain; |
36 | using OpenSim.Framework.Console; | ||
36 | 37 | ||
37 | 38 | ||
38 | namespace OpenSim.Storage.LocalStorageDb4o | 39 | namespace OpenSim.Storage.LocalStorageDb4o |
@@ -52,18 +53,18 @@ namespace OpenSim.Storage.LocalStorageDb4o | |||
52 | 53 | ||
53 | public void Initialise(string dfile) | 54 | public void Initialise(string dfile) |
54 | { | 55 | { |
55 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"Db4LocalStorage Opening " + dfile); | 56 | OpenSim.Framework.Console.MainConsole.Instance.Warn("Db4LocalStorage Opening " + dfile); |
56 | datastore = dfile; | 57 | datastore = dfile; |
57 | try | 58 | try |
58 | { | 59 | { |
59 | db = Db4oFactory.OpenFile(datastore); | 60 | db = Db4oFactory.OpenFile(datastore); |
60 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Db4LocalStorage creation"); | 61 | OpenSim.Framework.Console.MainConsole.Instance.Verbose("Db4LocalStorage creation"); |
61 | } | 62 | } |
62 | catch (Exception e) | 63 | catch (Exception e) |
63 | { | 64 | { |
64 | db.Close(); | 65 | db.Close(); |
65 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"Db4LocalStorage :Constructor - Exception occured"); | 66 | OpenSim.Framework.Console.MainConsole.Instance.Warn("Db4LocalStorage :Constructor - Exception occured"); |
66 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString()); | 67 | OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString()); |
67 | } | 68 | } |
68 | } | 69 | } |
69 | 70 | ||
@@ -122,7 +123,7 @@ namespace OpenSim.Storage.LocalStorageDb4o | |||
122 | public void LoadPrimitives(ILocalStorageReceiver receiver) | 123 | public void LoadPrimitives(ILocalStorageReceiver receiver) |
123 | { | 124 | { |
124 | IObjectSet result = db.Get(typeof(PrimData)); | 125 | IObjectSet result = db.Get(typeof(PrimData)); |
125 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Db4LocalStorage.cs: LoadPrimitives() - number of prims in storages is "+result.Count); | 126 | OpenSim.Framework.Console.MainConsole.Instance.Verbose("Db4LocalStorage.cs: LoadPrimitives() - number of prims in storages is "+result.Count); |
126 | foreach (PrimData prim in result) { | 127 | foreach (PrimData prim in result) { |
127 | receiver.PrimFromStorage(prim); | 128 | receiver.PrimFromStorage(prim); |
128 | } | 129 | } |
@@ -130,14 +131,14 @@ namespace OpenSim.Storage.LocalStorageDb4o | |||
130 | 131 | ||
131 | public float[] LoadWorld() | 132 | public float[] LoadWorld() |
132 | { | 133 | { |
133 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"LoadWorld() - Loading world...."); | 134 | OpenSim.Framework.Console.MainConsole.Instance.Verbose("LoadWorld() - Loading world...."); |
134 | //World blank = new World(); | 135 | //World blank = new World(); |
135 | float[] heightmap = null; | 136 | float[] heightmap = null; |
136 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"LoadWorld() - Looking for a heightmap in local DB"); | 137 | OpenSim.Framework.Console.MainConsole.Instance.Verbose("LoadWorld() - Looking for a heightmap in local DB"); |
137 | IObjectSet world_result = db.Get(typeof(MapStorage)); | 138 | IObjectSet world_result = db.Get(typeof(MapStorage)); |
138 | if (world_result.Count > 0) | 139 | if (world_result.Count > 0) |
139 | { | 140 | { |
140 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"LoadWorld() - Found a heightmap in local database, loading"); | 141 | OpenSim.Framework.Console.MainConsole.Instance.Verbose("LoadWorld() - Found a heightmap in local database, loading"); |
141 | MapStorage map = (MapStorage)world_result.Next(); | 142 | MapStorage map = (MapStorage)world_result.Next(); |
142 | //blank.LandMap = map.Map; | 143 | //blank.LandMap = map.Map; |
143 | heightmap = map.Map; | 144 | heightmap = map.Map; |
@@ -165,7 +166,7 @@ namespace OpenSim.Storage.LocalStorageDb4o | |||
165 | IObjectSet world_result = db.Get(typeof(MapStorage)); | 166 | IObjectSet world_result = db.Get(typeof(MapStorage)); |
166 | if (world_result.Count > 0) | 167 | if (world_result.Count > 0) |
167 | { | 168 | { |
168 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"SaveWorld() - updating saved copy of heightmap in local database"); | 169 | OpenSim.Framework.Console.MainConsole.Instance.Verbose("SaveWorld() - updating saved copy of heightmap in local database"); |
169 | MapStorage map = (MapStorage)world_result.Next(); | 170 | MapStorage map = (MapStorage)world_result.Next(); |
170 | db.Delete(map); | 171 | db.Delete(map); |
171 | } | 172 | } |
@@ -177,31 +178,31 @@ namespace OpenSim.Storage.LocalStorageDb4o | |||
177 | 178 | ||
178 | public void SaveParcels(ParcelData[] parcel_data) | 179 | public void SaveParcels(ParcelData[] parcel_data) |
179 | { | 180 | { |
180 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: Saving Parcels..."); | 181 | MainConsole.Instance.Notice("Parcel Backup: Saving Parcels..."); |
181 | IObjectSet result = db.Get(typeof(ParcelData)); | 182 | IObjectSet result = db.Get(typeof(ParcelData)); |
182 | foreach (ParcelData parcel in result) | 183 | foreach (ParcelData parcel in result) |
183 | { | 184 | { |
184 | db.Delete(parcel); | 185 | db.Delete(parcel); |
185 | } | 186 | } |
186 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: Removing old entries complete. Adding new entries."); | 187 | MainConsole.Instance.Notice("Parcel Backup: Removing old entries complete. Adding new entries."); |
187 | int i; | 188 | int i; |
188 | for (i = 0; i < parcel_data.GetLength(0); i++) | 189 | for (i = 0; i < parcel_data.GetLength(0); i++) |
189 | { | 190 | { |
190 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Adding : " + i); | 191 | MainConsole.Instance.Notice("Adding : " + i); |
191 | db.Set(parcel_data[i]); | 192 | db.Set(parcel_data[i]); |
192 | 193 | ||
193 | } | 194 | } |
194 | db.Commit(); | 195 | db.Commit(); |
195 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: Parcel Save Complete"); | 196 | MainConsole.Instance.Notice("Parcel Backup: Parcel Save Complete"); |
196 | } | 197 | } |
197 | 198 | ||
198 | public void LoadParcels(ILocalStorageParcelReceiver recv) | 199 | public void LoadParcels(ILocalStorageParcelReceiver recv) |
199 | { | 200 | { |
200 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: Loading Parcels..."); | 201 | MainConsole.Instance.Notice("Parcel Backup: Loading Parcels..."); |
201 | IObjectSet result = db.Get(typeof(ParcelData)); | 202 | IObjectSet result = db.Get(typeof(ParcelData)); |
202 | if (result.Count > 0) | 203 | if (result.Count > 0) |
203 | { | 204 | { |
204 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: Parcels exist in database."); | 205 | MainConsole.Instance.Notice("Parcel Backup: Parcels exist in database."); |
205 | foreach (ParcelData parcelData in result) | 206 | foreach (ParcelData parcelData in result) |
206 | { | 207 | { |
207 | recv.ParcelFromStorage(parcelData); | 208 | recv.ParcelFromStorage(parcelData); |
@@ -209,10 +210,10 @@ namespace OpenSim.Storage.LocalStorageDb4o | |||
209 | } | 210 | } |
210 | else | 211 | else |
211 | { | 212 | { |
212 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: No parcels exist. Creating basic parcel."); | 213 | MainConsole.Instance.Notice("Parcel Backup: No parcels exist. Creating basic parcel."); |
213 | recv.NoParcelDataFromStorage(); | 214 | recv.NoParcelDataFromStorage(); |
214 | } | 215 | } |
215 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: Parcels Restored"); | 216 | MainConsole.Instance.Notice("Parcel Backup: Parcels Restored"); |
216 | } | 217 | } |
217 | public void ShutDown() | 218 | public void ShutDown() |
218 | { | 219 | { |
diff --git a/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs index 1f4c6be..02964d3 100644 --- a/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs +++ b/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs | |||
@@ -54,8 +54,8 @@ namespace OpenSim.Storage.LocalStorageSQLite | |||
54 | catch (Exception e) | 54 | catch (Exception e) |
55 | { | 55 | { |
56 | db.Close(); | 56 | db.Close(); |
57 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"SQLiteLocalStorage :Constructor - Exception occured"); | 57 | OpenSim.Framework.Console.MainConsole.Instance.Warn("SQLiteLocalStorage :Constructor - Exception occured"); |
58 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString()); | 58 | OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString()); |
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 | ||
@@ -117,8 +117,8 @@ namespace OpenSim.Storage.LocalStorageSQLite | |||
117 | } | 117 | } |
118 | catch (Exception e) | 118 | catch (Exception e) |
119 | { | 119 | { |
120 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"SQLiteLocalStorage :StorePrim - Exception occured"); | 120 | OpenSim.Framework.Console.MainConsole.Instance.Warn("SQLiteLocalStorage :StorePrim - Exception occured"); |
121 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString()); | 121 | OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString()); |
122 | } | 122 | } |
123 | 123 | ||
124 | cmd.Dispose(); | 124 | cmd.Dispose(); |
@@ -144,8 +144,8 @@ namespace OpenSim.Storage.LocalStorageSQLite | |||
144 | } | 144 | } |
145 | catch (Exception e) | 145 | catch (Exception e) |
146 | { | 146 | { |
147 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"SQLiteLocalStorage :RemovePrim - Exception occured"); | 147 | OpenSim.Framework.Console.MainConsole.Instance.Warn("SQLiteLocalStorage :RemovePrim - Exception occured"); |
148 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString()); | 148 | OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString()); |
149 | } | 149 | } |
150 | 150 | ||
151 | cmd.Dispose(); | 151 | cmd.Dispose(); |