From 50250a3a3af625be69851f1ecf56015abe5bf320 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 29 Jul 2007 07:54:49 +0000 Subject: [PATCH] * Highly experimental: Added DB4o DataStore support. Untested. --- .../OpenSim.DataStore.DB4o/DB4oDataStore.cs | 46 ++++++++++++++++--- 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 71275c3d65..4497a2b0dc 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; using System.Text; using OpenSim.Region.Environment.Scenes; +using OpenSim.Region.Environment.LandManagement; using OpenSim.Region.Environment; using OpenSim.Region.Interfaces; using OpenSim.Framework.Console; using libsecondlife; using Db4objects.Db4o; +using Db4objects.Db4o.Query; -namespace OpenSim.DataStore.NullStorage +namespace OpenSim.DataStore.DB4oStorage { + + public class SceneObjectQuery : Predicate + { + private LLUUID globalIDSearch; + + public SceneObjectQuery(LLUUID find) + { + globalIDSearch = find; + } + + public bool Match(SceneObject obj) + { + return obj.rootUUID == globalIDSearch; + } + } + + public class DB4oDataStore : IRegionDataStore { private IObjectContainer db; @@ -30,12 +49,25 @@ namespace OpenSim.DataStore.NullStorage public void RemoveObject(LLUUID obj) { - + IObjectSet result = db.Query(new SceneObjectQuery(obj)); + if (result.Count > 0) + { + SceneObject item = (SceneObject)result.Next(); + db.Delete(item); + } } public List LoadObjects() { - return new List(); + IObjectSet result = db.Get(typeof(SceneObject)); + List retvals = new List(); + + foreach (Object obj in result) + { + retvals.Add((SceneObject)obj); + } + + return retvals; } public void StoreTerrain(double[,] ter) @@ -48,19 +80,19 @@ namespace OpenSim.DataStore.NullStorage return null; } - public void RemoveParcel(uint id) + public void RemoveLandObject(uint id) { } - public void StoreParcel(OpenSim.Region.Environment.Parcel parcel) + public void StoreParcel(Land parcel) { } - public List LoadParcels() + public List LoadLandObjects() { - return new List(); + return new List(); } public void Shutdown() diff --git a/prebuild.xml b/prebuild.xml index d57eaf885d..ad287d2f2e 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -595,6 +595,30 @@ + ../../../../bin/ + + + + + + + + + + + + + + + ../../../../bin/ + + + + + ../../../../bin/ + + + ../../../../bin/