From 6ce5b6e439e304ba8ce27a9e5bad3146feedd7f0 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 27 Apr 2007 21:11:02 +0000 Subject: Major ass commit Added new "Datastore" parameter to simconfig.xml which is passed to storage engines via a new Initialise() function. --- .../LocalStorageBerkeleyDB/BDBLocalStorage.cs | 5 ++++ .../LocalStorageDb4o/Db4LocalStorage.cs | 29 ++++++++++++++-------- .../LocalStorageSQLite/SQLiteLocalStorage.cs | 5 ++++ 3 files changed, 28 insertions(+), 11 deletions(-) (limited to 'OpenSim.Storage') diff --git a/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs b/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs index 2bcd91c..d4db8c0 100644 --- a/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs +++ b/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs @@ -56,6 +56,11 @@ namespace OpenSim.Storage.LocalStorageBDB //vendorDb = (DbBTree)db.Open(null, VendorDbName, null, DbType.BTree, Db.OpenFlags.Create, 0); } + public void Initialise(string file) + { + // Blank + } + public void StorePrim(PrimData prim) { DbEntry key = new DbEntry(); diff --git a/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs b/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs index 488da58..3c17f1f 100644 --- a/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs +++ b/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs @@ -41,21 +41,28 @@ namespace OpenSim.Storage.LocalStorageDb4o public class Db4LocalStorage : ILocalStorage { private IObjectContainer db; + private string datastore; public Db4LocalStorage() { - try - { - db = Db4oFactory.OpenFile("localworld.yap"); - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Db4LocalStorage creation"); - } - catch(Exception e) - { - db.Close(); - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Db4LocalStorage :Constructor - Exception occured"); - OpenSim.Framework.Console.MainConsole.Instance.WriteLine(e.ToString()); - } + } + + public void Initialise(string dfile) + { + datastore = dfile; + try + { + db = Db4oFactory.OpenFile(datastore); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Db4LocalStorage creation"); + } + catch (Exception e) + { + db.Close(); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Db4LocalStorage :Constructor - Exception occured"); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(e.ToString()); + } + } public void StorePrim(PrimData prim) { diff --git a/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs b/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs index ff7b146..35875a1 100644 --- a/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs +++ b/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs @@ -59,6 +59,11 @@ namespace OpenSim.Storage.LocalStorageSQLite } } + public void Initialise(string file) + { + // Blank + } + public void StorePrim(PrimData prim) { IDbCommand cmd = db.CreateCommand(); -- cgit v1.1