aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAdam Frisby2007-07-29 07:54:49 +0000
committerAdam Frisby2007-07-29 07:54:49 +0000
commit50250a3a3af625be69851f1ecf56015abe5bf320 (patch)
tree18945d049b848b4bd5d28930eda3ed7d9c438ab9
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.
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs46
-rw-r--r--prebuild.xml24
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;
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()
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"/>