diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs | 46 | ||||
-rw-r--r-- | prebuild.xml | 24 |
2 files changed, 63 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() |
diff --git a/prebuild.xml b/prebuild.xml index d57eaf8..ad287d2 100644 --- a/prebuild.xml +++ b/prebuild.xml | |||
@@ -598,6 +598,30 @@ | |||
598 | <ReferencePath>../../../../bin/</ReferencePath> | 598 | <ReferencePath>../../../../bin/</ReferencePath> |
599 | <Reference name="System" localCopy="false"/> | 599 | <Reference name="System" localCopy="false"/> |
600 | <Reference name="System.Xml"/> | 600 | <Reference name="System.Xml"/> |
601 | <Reference name="libsecondlife.dll"/> | ||
602 | <Reference name="OpenSim.Framework"/> | ||
603 | <Reference name="OpenSim.Region.Environment"/> | ||
604 | <Reference name="OpenSim.Framework.Console"/> | ||
605 | <Files> | ||
606 | <Match pattern="*.cs" recurse="true"/> | ||
607 | </Files> | ||
608 | </Project> | ||
609 | |||
610 | <Project name="OpenSim.DataStore.DB4o" path="OpenSim/Region/Storage/OpenSim.DataStore.DB4o" type="Library"> | ||
611 | <Configuration name="Debug"> | ||
612 | <Options> | ||
613 | <OutputPath>../../../../bin/</OutputPath> | ||
614 | </Options> | ||
615 | </Configuration> | ||
616 | <Configuration name="Release"> | ||
617 | <Options> | ||
618 | <OutputPath>../../../../bin/</OutputPath> | ||
619 | </Options> | ||
620 | </Configuration> | ||
621 | |||
622 | <ReferencePath>../../../../bin/</ReferencePath> | ||
623 | <Reference name="System" localCopy="false"/> | ||
624 | <Reference name="System.Xml"/> | ||
601 | <Reference name="Db4objects.Db4o.dll"/> | 625 | <Reference name="Db4objects.Db4o.dll"/> |
602 | <Reference name="libsecondlife.dll"/> | 626 | <Reference name="libsecondlife.dll"/> |
603 | <Reference name="OpenSim.Framework"/> | 627 | <Reference name="OpenSim.Framework"/> |