aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorAdam Frisby2007-07-29 07:54:49 +0000
committerAdam Frisby2007-07-29 07:54:49 +0000
commit50250a3a3af625be69851f1ecf56015abe5bf320 (patch)
tree18945d049b848b4bd5d28930eda3ed7d9c438ab9 /OpenSim
parent* OpenSim now performs compatibility checks at startup and warns the user if ... (diff)
downloadopensim-SC-50250a3a3af625be69851f1ecf56015abe5bf320.zip
opensim-SC-50250a3a3af625be69851f1ecf56015abe5bf320.tar.gz
opensim-SC-50250a3a3af625be69851f1ecf56015abe5bf320.tar.bz2
opensim-SC-50250a3a3af625be69851f1ecf56015abe5bf320.tar.xz
* Highly experimental: Added DB4o DataStore support. Untested.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs46
1 files changed, 39 insertions, 7 deletions
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs
index 71275c3..4497a2b 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs
@@ -3,15 +3,34 @@ using System.Collections.Generic;
3using System.Text; 3using System.Text;
4 4
5using OpenSim.Region.Environment.Scenes; 5using OpenSim.Region.Environment.Scenes;
6using OpenSim.Region.Environment.LandManagement;
6using OpenSim.Region.Environment; 7using OpenSim.Region.Environment;
7using OpenSim.Region.Interfaces; 8using OpenSim.Region.Interfaces;
8using OpenSim.Framework.Console; 9using OpenSim.Framework.Console;
9using libsecondlife; 10using libsecondlife;
10 11
11using Db4objects.Db4o; 12using Db4objects.Db4o;
13using Db4objects.Db4o.Query;
12 14
13namespace OpenSim.DataStore.NullStorage 15namespace OpenSim.DataStore.DB4oStorage
14{ 16{
17
18 public class SceneObjectQuery : Predicate
19 {
20 private LLUUID globalIDSearch;
21
22 public SceneObjectQuery(LLUUID find)
23 {
24 globalIDSearch = find;
25 }
26
27 public bool Match(SceneObject obj)
28 {
29 return obj.rootUUID == globalIDSearch;
30 }
31 }
32
33
15 public class DB4oDataStore : IRegionDataStore 34 public class DB4oDataStore : IRegionDataStore
16 { 35 {
17 private IObjectContainer db; 36 private IObjectContainer db;
@@ -30,12 +49,25 @@ namespace OpenSim.DataStore.NullStorage
30 49
31 public void RemoveObject(LLUUID obj) 50 public void RemoveObject(LLUUID obj)
32 { 51 {
33 52 IObjectSet result = db.Query(new SceneObjectQuery(obj));
53 if (result.Count > 0)
54 {
55 SceneObject item = (SceneObject)result.Next();
56 db.Delete(item);
57 }
34 } 58 }
35 59
36 public List<SceneObject> LoadObjects() 60 public List<SceneObject> LoadObjects()
37 { 61 {
38 return new List<SceneObject>(); 62 IObjectSet result = db.Get(typeof(SceneObject));
63 List<SceneObject> retvals = new List<SceneObject>();
64
65 foreach (Object obj in result)
66 {
67 retvals.Add((SceneObject)obj);
68 }
69
70 return retvals;
39 } 71 }
40 72
41 public void StoreTerrain(double[,] ter) 73 public void StoreTerrain(double[,] ter)
@@ -48,19 +80,19 @@ namespace OpenSim.DataStore.NullStorage
48 return null; 80 return null;
49 } 81 }
50 82
51 public void RemoveParcel(uint id) 83 public void RemoveLandObject(uint id)
52 { 84 {
53 85
54 } 86 }
55 87
56 public void StoreParcel(OpenSim.Region.Environment.Parcel parcel) 88 public void StoreParcel(Land parcel)
57 { 89 {
58 90
59 } 91 }
60 92
61 public List<OpenSim.Region.Environment.Parcel> LoadParcels() 93 public List<Land> LoadLandObjects()
62 { 94 {
63 return new List<OpenSim.Region.Environment.Parcel>(); 95 return new List<Land>();
64 } 96 }
65 97
66 public void Shutdown() 98 public void Shutdown()