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. --- .../LocalStorageDb4o/Db4LocalStorage.cs | 29 ++++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs') 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) { -- cgit v1.1