aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.Storage
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/OpenSim.Storage')
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs31
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj.user2
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs301
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj9
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj.user2
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build5
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDParcelQuery.cs52
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDPrimQuery.cs52
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDQuery.cs25
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj.user2
-rw-r--r--OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs44
11 files changed, 371 insertions, 154 deletions
diff --git a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs
index 30abd84..ab3c34c 100644
--- a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs
+++ b/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs
@@ -1,5 +1,6 @@
1/* 1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/ 2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
3* 4*
4* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
@@ -8,14 +9,14 @@
8* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the 12* * Neither the name of the OpenSim Project nor the
12* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
14* 15*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -85,6 +86,28 @@ namespace OpenSim.Storage.LocalStorageBDB
85 { 86 {
86 87
87 } 88 }
89
90 public void SaveParcels(ParcelData[] parcel_data)
91 {
92 }
93
94 public void SaveParcel(ParcelData parcel)
95 {
96 }
97
98 public void RemoveParcel(ParcelData parcel)
99 {
100 }
101
102 public void RemoveAllParcels()
103 {
104 }
105
106 public void LoadParcels(ILocalStorageParcelReceiver recv)
107 {
108 recv.NoParcelDataFromStorage();
109 }
110
88 public void ShutDown() 111 public void ShutDown()
89 { 112 {
90 sim.GetDb().Close(); 113 sim.GetDb().Close();
diff --git a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj.user b/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj.user
index 9bfaf67..082d673 100644
--- a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj.user
+++ b/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj.user
@@ -2,7 +2,7 @@
2 <PropertyGroup> 2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath> 5 <ReferencePath>C:\sugilite\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion> 6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView> 7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust> 8 <ProjectTrust>0</ProjectTrust>
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs
index a50795a..93f55d6 100644
--- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs
+++ b/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs
@@ -1,5 +1,6 @@
1/* 1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/ 2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
3* 4*
4* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
@@ -8,14 +9,14 @@
8* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the 12* * Neither the name of the OpenSim Project nor the
12* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
14* 15*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -28,133 +29,120 @@ using System;
28using System.Collections.Generic; 29using System.Collections.Generic;
29using Db4objects.Db4o; 30using Db4objects.Db4o;
30using Db4objects.Db4o.Query; 31using Db4objects.Db4o.Query;
32
31using libsecondlife; 33using libsecondlife;
32using OpenSim.Framework.Interfaces; 34using OpenSim.Framework.Interfaces;
33using OpenSim.Framework.Types; 35using OpenSim.Framework.Types;
36using OpenSim.Framework.Console;
34 37
35 38
36namespace OpenSim.Storage.LocalStorageDb4o 39namespace OpenSim.Storage.LocalStorageDb4o
37{ 40{
38 /// <summary> 41 /// <summary>
39 /// 42 ///
40 /// </summary> 43 /// </summary>
41 public class Db4LocalStorage : ILocalStorage 44 public class Db4LocalStorage : ILocalStorage
42 { 45 {
43 private IObjectContainer db; 46 private IObjectContainer db;
44 private string datastore; 47 private string datastore;
45 48
46 public Db4LocalStorage() 49 public Db4LocalStorage()
47 { 50 {
48 51
49 } 52 }
50 53
51 public void Initialise(string dfile) 54 public void Initialise(string dfile)
52 { 55 {
53 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"Db4LocalStorage Opening " + dfile); 56 OpenSim.Framework.Console.MainConsole.Instance.Warn("Db4LocalStorage Opening " + dfile);
54 datastore = dfile; 57 datastore = dfile;
55 try 58 try
56 { 59 {
57 db = Db4oFactory.OpenFile(datastore); 60 db = Db4oFactory.OpenFile(datastore);
58 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Db4LocalStorage creation"); 61 OpenSim.Framework.Console.MainConsole.Instance.Verbose("Db4LocalStorage creation");
59 } 62 }
60 catch (Exception e) 63 catch (Exception e)
61 { 64 {
62 db.Close(); 65 db.Close();
63 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");
64 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString()); 67 OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString());
65 } 68 }
66 } 69 }
67 70
68 public void StorePrim(PrimData prim) 71 public void StorePrim(PrimData prim)
69 { 72 {
70 IObjectSet result = db.Query(new UUIDQuery(prim.FullID)); 73 IObjectSet result = db.Query(new UUIDPrimQuery(prim.FullID));
71 if(result.Count>0) 74 if (result.Count > 0)
72 { 75 {
73 //prim already in storage 76 //prim already in storage
74 //so update it 77 //so update it
75 PrimData found = (PrimData) result.Next(); 78 PrimData found = (PrimData)result.Next();
76 found.PathBegin = prim.PathBegin; 79 found.PathBegin = prim.PathBegin;
77 found.PathCurve= prim.PathCurve; 80 found.PathCurve = prim.PathCurve;
78 found.PathEnd = prim.PathEnd; 81 found.PathEnd = prim.PathEnd;
79 found.PathRadiusOffset = prim.PathRadiusOffset; 82 found.PathRadiusOffset = prim.PathRadiusOffset;
80 found.PathRevolutions = prim.PathRevolutions; 83 found.PathRevolutions = prim.PathRevolutions;
81 found.PathScaleX= prim.PathScaleX; 84 found.PathScaleX = prim.PathScaleX;
82 found.PathScaleY = prim.PathScaleY; 85 found.PathScaleY = prim.PathScaleY;
83 found.PathShearX = prim.PathShearX; 86 found.PathShearX = prim.PathShearX;
84 found.PathShearY = prim.PathShearY; 87 found.PathShearY = prim.PathShearY;
85 found.PathSkew = prim.PathSkew; 88 found.PathSkew = prim.PathSkew;
86 found.PathTaperX = prim.PathTaperX; 89 found.PathTaperX = prim.PathTaperX;
87 found.PathTaperY = prim.PathTaperY; 90 found.PathTaperY = prim.PathTaperY;
88 found.PathTwist = prim.PathTwist; 91 found.PathTwist = prim.PathTwist;
89 found.PathTwistBegin = prim.PathTwistBegin; 92 found.PathTwistBegin = prim.PathTwistBegin;
90 found.PCode = prim.PCode; 93 found.PCode = prim.PCode;
91 found.ProfileBegin = prim.ProfileBegin; 94 found.ProfileBegin = prim.ProfileBegin;
92 found.ProfileCurve = prim.ProfileCurve; 95 found.ProfileCurve = prim.ProfileCurve;
93 found.ProfileEnd = prim.ProfileEnd; 96 found.ProfileEnd = prim.ProfileEnd;
94 found.ProfileHollow = prim.ProfileHollow; 97 found.ProfileHollow = prim.ProfileHollow;
95 found.Position = prim.Position; 98 found.Position = prim.Position;
96 found.Rotation = prim.Rotation; 99 found.Rotation = prim.Rotation;
97 found.Texture = prim.Texture; 100 found.Texture = prim.Texture;
98 db.Set(found); 101 db.Set(found);
99 db.Commit(); 102 db.Commit();
100 } 103 }
101 else 104 else
102 { 105 {
103 //not in storage 106 //not in storage
104 db.Set(prim); 107 db.Set(prim);
105 db.Commit(); 108 db.Commit();
106 } 109 }
107 } 110 }
108 111
109 public void RemovePrim(LLUUID primID) 112 public void RemovePrim(LLUUID primID)
110 { 113 {
111 IObjectSet result = db.Query(new UUIDQuery(primID)); 114 IObjectSet result = db.Query(new UUIDPrimQuery(primID));
112 if(result.Count>0) 115 if (result.Count > 0)
113 { 116 {
114 PrimData found = (PrimData) result.Next(); 117 PrimData found = (PrimData)result.Next();
115 db.Delete(found); 118 db.Delete(found);
116 } 119 }
117 } 120 }
118 121
119 122
120 public void LoadPrimitives(ILocalStorageReceiver receiver) 123 public void LoadPrimitives(ILocalStorageReceiver receiver)
121 { 124 {
122 IObjectSet result = db.Get(typeof(PrimData)); 125 IObjectSet result = db.Get(typeof(PrimData));
123 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);
124 foreach (PrimData prim in result) { 127 foreach (PrimData prim in result)
125 receiver.PrimFromStorage(prim); 128 {
126 } 129 receiver.PrimFromStorage(prim);
127 } 130 }
131 }
128 132
129 public float[] LoadWorld() 133 public float[] LoadWorld()
130 { 134 {
131 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"LoadWorld() - Loading world...."); 135 OpenSim.Framework.Console.MainConsole.Instance.Verbose("LoadWorld() - Loading world....");
132 //World blank = new World();
133 float[] heightmap = null; 136 float[] heightmap = null;
134 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");
135 IObjectSet world_result = db.Get(typeof(MapStorage)); 138 IObjectSet world_result = db.Get(typeof(MapStorage));
136 if (world_result.Count > 0) 139 if (world_result.Count > 0)
137 { 140 {
138 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");
139 MapStorage map = (MapStorage)world_result.Next(); 142 MapStorage map = (MapStorage)world_result.Next();
140 //blank.LandMap = map.Map; 143 //blank.LandMap = map.Map;
141 heightmap = map.Map; 144 heightmap = map.Map;
142 } 145 }
143 else
144 {
145 /*
146 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LoadWorld() - No heightmap found, generating new one");
147 HeightmapGenHills hills = new HeightmapGenHills();
148 // blank.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false);
149 // heightmap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false);
150 heightmap = new float[256, 256];
151 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LoadWorld() - Saving heightmap to local database");
152 MapStorage map = new MapStorage();
153 map.Map = heightmap; //blank.LandMap;
154 db.Set(map);
155 db.Commit();
156 */
157 }
158 return heightmap; 146 return heightmap;
159 } 147 }
160 148
@@ -163,7 +151,7 @@ namespace OpenSim.Storage.LocalStorageDb4o
163 IObjectSet world_result = db.Get(typeof(MapStorage)); 151 IObjectSet world_result = db.Get(typeof(MapStorage));
164 if (world_result.Count > 0) 152 if (world_result.Count > 0)
165 { 153 {
166 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"SaveWorld() - updating saved copy of heightmap in local database"); 154 OpenSim.Framework.Console.MainConsole.Instance.Verbose("SaveWorld() - updating saved copy of heightmap in local database");
167 MapStorage map = (MapStorage)world_result.Next(); 155 MapStorage map = (MapStorage)world_result.Next();
168 db.Delete(map); 156 db.Delete(map);
169 } 157 }
@@ -173,10 +161,111 @@ namespace OpenSim.Storage.LocalStorageDb4o
173 db.Commit(); 161 db.Commit();
174 } 162 }
175 163
176 public void ShutDown() 164 public void SaveParcel(ParcelData parcel)
177 { 165 {
178 db.Commit(); 166 IObjectSet result = db.Query(new UUIDParcelQuery(parcel.globalID));
179 db.Close(); 167 if (result.Count > 0)
180 } 168 {
181 } 169 //Old Parcel
182} 170 ParcelData updateParcel = (ParcelData)result.Next();
171 updateParcel.AABBMax = parcel.AABBMax;
172 updateParcel.AABBMin = parcel.AABBMin;
173 updateParcel.area = parcel.area;
174 updateParcel.auctionID = parcel.auctionID;
175 updateParcel.authBuyerID = parcel.authBuyerID;
176 updateParcel.category = parcel.category;
177 updateParcel.claimDate = parcel.claimDate;
178 updateParcel.claimPrice = parcel.claimPrice;
179 updateParcel.groupID = parcel.groupID;
180 updateParcel.groupPrims = parcel.groupPrims;
181 updateParcel.isGroupOwned = parcel.isGroupOwned;
182 updateParcel.landingType = parcel.landingType;
183 updateParcel.mediaAutoScale = parcel.mediaAutoScale;
184 updateParcel.mediaID = parcel.mediaID;
185 updateParcel.mediaURL = parcel.mediaURL;
186 updateParcel.musicURL = parcel.musicURL;
187 updateParcel.localID = parcel.localID;
188 updateParcel.ownerID = parcel.ownerID;
189 updateParcel.passHours = parcel.passHours;
190 updateParcel.passPrice = parcel.passPrice;
191 updateParcel.parcelBitmapByteArray = (byte[])parcel.parcelBitmapByteArray.Clone();
192 updateParcel.parcelDesc = parcel.parcelDesc;
193 updateParcel.parcelFlags = parcel.parcelFlags;
194 updateParcel.parcelName = parcel.parcelName;
195 updateParcel.parcelStatus = parcel.parcelStatus;
196 updateParcel.salePrice = parcel.salePrice;
197 updateParcel.snapshotID = parcel.snapshotID;
198 updateParcel.userLocation = parcel.userLocation;
199 updateParcel.userLookAt = parcel.userLookAt;
200
201 db.Set(updateParcel);
202 }
203 else
204 {
205 db.Set(parcel);
206 }
207 db.Commit();
208 }
209
210 public void SaveParcels(ParcelData[] parcel_data)
211 {
212 MainConsole.Instance.Notice("Parcel Backup: Saving Parcels...");
213 int i;
214 for (i = 0; i < parcel_data.GetLength(0); i++)
215 {
216
217 SaveParcel(parcel_data[i]);
218
219 }
220 MainConsole.Instance.Notice("Parcel Backup: Parcel Save Complete");
221 }
222
223 public void RemoveParcel(ParcelData parcel)
224 {
225 IObjectSet result = db.Query(new UUIDParcelQuery(parcel.globalID));
226 if (result.Count > 0)
227 {
228 db.Delete(result[0]);
229 }
230 db.Commit();
231 }
232 public void RemoveAllParcels()
233 {
234 MainConsole.Instance.Notice("Parcel Backup: Removing all parcels...");
235 IObjectSet result = db.Get(typeof(ParcelData));
236 if (result.Count > 0)
237 {
238 foreach (ParcelData parcelData in result)
239 {
240 RemoveParcel(parcelData);
241 }
242 }
243 }
244
245 public void LoadParcels(ILocalStorageParcelReceiver recv)
246 {
247 MainConsole.Instance.Notice("Parcel Backup: Loading Parcels...");
248 IObjectSet result = db.Get(typeof(ParcelData));
249 if (result.Count > 0)
250 {
251 MainConsole.Instance.Notice("Parcel Backup: Parcels exist in database.");
252 foreach (ParcelData parcelData in result)
253 {
254
255 recv.ParcelFromStorage(parcelData);
256 }
257 }
258 else
259 {
260 MainConsole.Instance.Notice("Parcel Backup: No parcels exist. Creating basic parcel.");
261 recv.NoParcelDataFromStorage();
262 }
263 MainConsole.Instance.Notice("Parcel Backup: Parcels Restored");
264 }
265 public void ShutDown()
266 {
267 db.Commit();
268 db.Close();
269 }
270 }
271} \ No newline at end of file
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj b/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj
index 9b4ff5d..7d90947 100644
--- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj
+++ b/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj
@@ -93,13 +93,16 @@
93 <Compile Include="AssemblyInfo.cs"> 93 <Compile Include="AssemblyInfo.cs">
94 <SubType>Code</SubType> 94 <SubType>Code</SubType>
95 </Compile> 95 </Compile>
96 <Compile Include="Db4LocalStorage.cs"> 96 <Compile Include="MapStorage.cs">
97 <SubType>Code</SubType> 97 <SubType>Code</SubType>
98 </Compile> 98 </Compile>
99 <Compile Include="MapStorage.cs"> 99 <Compile Include="UUIDPrimQuery.cs">
100 <SubType>Code</SubType> 100 <SubType>Code</SubType>
101 </Compile> 101 </Compile>
102 <Compile Include="UUIDQuery.cs"> 102 <Compile Include="UUIDParcelQuery.cs">
103 <SubType>Code</SubType>
104 </Compile>
105 <Compile Include="Db4LocalStorage.cs">
103 <SubType>Code</SubType> 106 <SubType>Code</SubType>
104 </Compile> 107 </Compile>
105 </ItemGroup> 108 </ItemGroup>
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj.user b/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj.user
index 9bfaf67..082d673 100644
--- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj.user
+++ b/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj.user
@@ -2,7 +2,7 @@
2 <PropertyGroup> 2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath> 5 <ReferencePath>C:\sugilite\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion> 6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView> 7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust> 8 <ProjectTrust>0</ProjectTrust>
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build b/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build
index da2db14..9789712 100644
--- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build
+++ b/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build
@@ -12,9 +12,10 @@
12 </resources> 12 </resources>
13 <sources failonempty="true"> 13 <sources failonempty="true">
14 <include name="AssemblyInfo.cs" /> 14 <include name="AssemblyInfo.cs" />
15 <include name="Db4LocalStorage.cs" />
16 <include name="MapStorage.cs" /> 15 <include name="MapStorage.cs" />
17 <include name="UUIDQuery.cs" /> 16 <include name="UUIDPrimQuery.cs" />
17 <include name="UUIDParcelQuery.cs" />
18 <include name="Db4LocalStorage.cs" />
18 </sources> 19 </sources>
19 <references basedir="${project::get-base-directory()}"> 20 <references basedir="${project::get-base-directory()}">
20 <lib> 21 <lib>
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDParcelQuery.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDParcelQuery.cs
new file mode 100644
index 0000000..d24fb5f
--- /dev/null
+++ b/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDParcelQuery.cs
@@ -0,0 +1,52 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System;
29using System.Collections.Generic;
30using System.Text;
31using Db4objects.Db4o;
32using Db4objects.Db4o.Query;
33using libsecondlife;
34using OpenSim.Framework.Interfaces;
35using OpenSim.Framework.Types;
36
37namespace OpenSim.Storage.LocalStorageDb4o
38{
39 public class UUIDParcelQuery : Predicate
40 {
41 private LLUUID globalIDSearch;
42
43 public UUIDParcelQuery(LLUUID find)
44 {
45 globalIDSearch = find;
46 }
47 public bool Match(ParcelData parcel)
48 {
49 return (parcel.globalID == globalIDSearch);
50 }
51 }
52}
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDPrimQuery.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDPrimQuery.cs
new file mode 100644
index 0000000..b2e8a91
--- /dev/null
+++ b/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDPrimQuery.cs
@@ -0,0 +1,52 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System;
29using System.Collections.Generic;
30using System.Text;
31using Db4objects.Db4o;
32using Db4objects.Db4o.Query;
33using libsecondlife;
34using OpenSim.Framework.Interfaces;
35using OpenSim.Framework.Types;
36
37namespace OpenSim.Storage.LocalStorageDb4o
38{
39 public class UUIDPrimQuery : Predicate
40 {
41 private LLUUID _findID;
42
43 public UUIDPrimQuery(LLUUID find)
44 {
45 _findID = find;
46 }
47 public bool Match(PrimData prim)
48 {
49 return (prim.FullID == _findID);
50 }
51 }
52}
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDQuery.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDQuery.cs
deleted file mode 100644
index ba9e139..0000000
--- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDQuery.cs
+++ /dev/null
@@ -1,25 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using Db4objects.Db4o;
5using Db4objects.Db4o.Query;
6using libsecondlife;
7using OpenSim.Framework.Interfaces;
8using OpenSim.Framework.Types;
9
10namespace OpenSim.Storage.LocalStorageDb4o
11{
12 public class UUIDQuery : Predicate
13 {
14 private LLUUID _findID;
15
16 public UUIDQuery(LLUUID find)
17 {
18 _findID = find;
19 }
20 public bool Match(PrimData prim)
21 {
22 return (prim.FullID == _findID);
23 }
24 }
25}
diff --git a/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj.user b/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj.user
index 9bfaf67..082d673 100644
--- a/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj.user
+++ b/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj.user
@@ -2,7 +2,7 @@
2 <PropertyGroup> 2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath> 5 <ReferencePath>C:\sugilite\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion> 6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView> 7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust> 8 <ProjectTrust>0</ProjectTrust>
diff --git a/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs
index 11eca0f..ee8b9ff 100644
--- a/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs
+++ b/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs
@@ -1,5 +1,6 @@
1/* 1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/ 2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
3* 4*
4* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
@@ -8,14 +9,14 @@
8* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the 12* * Neither the name of the OpenSim Project nor the
12* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
14* 15*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -36,7 +37,6 @@ using libsecondlife;
36using OpenSim.Framework.Interfaces; 37using OpenSim.Framework.Interfaces;
37using OpenSim.Framework.Types; 38using OpenSim.Framework.Types;
38 39
39
40namespace OpenSim.Storage.LocalStorageSQLite 40namespace OpenSim.Storage.LocalStorageSQLite
41{ 41{
42 public class SQLiteLocalStorage : ILocalStorage 42 public class SQLiteLocalStorage : ILocalStorage
@@ -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();
@@ -167,6 +167,28 @@ namespace OpenSim.Storage.LocalStorageSQLite
167 167
168 } 168 }
169 169
170 public void SaveParcels(ParcelData[] parcel_manager)
171 {
172
173 }
174
175 public void SaveParcel(ParcelData parcel)
176 {
177 }
178
179 public void RemoveParcel(ParcelData parcel)
180 {
181 }
182
183 public void RemoveAllParcels()
184 {
185 }
186
187 public void LoadParcels(ILocalStorageParcelReceiver recv)
188 {
189 recv.NoParcelDataFromStorage();
190 }
191
170 public void ShutDown() 192 public void ShutDown()
171 { 193 {
172 db.Close(); 194 db.Close();