diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs | 46 |
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; | |||
3 | using System.Text; | 3 | using System.Text; |
4 | 4 | ||
5 | using OpenSim.Region.Environment.Scenes; | 5 | using OpenSim.Region.Environment.Scenes; |
6 | using OpenSim.Region.Environment.LandManagement; | ||
6 | using OpenSim.Region.Environment; | 7 | using OpenSim.Region.Environment; |
7 | using OpenSim.Region.Interfaces; | 8 | using OpenSim.Region.Interfaces; |
8 | using OpenSim.Framework.Console; | 9 | using OpenSim.Framework.Console; |
9 | using libsecondlife; | 10 | using libsecondlife; |
10 | 11 | ||
11 | using Db4objects.Db4o; | 12 | using Db4objects.Db4o; |
13 | using Db4objects.Db4o.Query; | ||
12 | 14 | ||
13 | namespace OpenSim.DataStore.NullStorage | 15 | namespace 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() |