aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAdam Frisby2007-04-27 21:11:02 +0000
committerAdam Frisby2007-04-27 21:11:02 +0000
commit6ce5b6e439e304ba8ce27a9e5bad3146feedd7f0 (patch)
treefa25cc297d83f70080b21f78e3bc04d32df5b00f
parent* Added new commandline option -config <configfile.xml> (diff)
downloadopensim-SC-6ce5b6e439e304ba8ce27a9e5bad3146feedd7f0.zip
opensim-SC-6ce5b6e439e304ba8ce27a9e5bad3146feedd7f0.tar.gz
opensim-SC-6ce5b6e439e304ba8ce27a9e5bad3146feedd7f0.tar.bz2
opensim-SC-6ce5b6e439e304ba8ce27a9e5bad3146feedd7f0.tar.xz
Major ass commit
Added new "Datastore" parameter to simconfig.xml which is passed to storage engines via a new Initialise() function.
-rw-r--r--OpenSim.Framework/Interfaces/ILocalStorage.cs1
-rw-r--r--OpenSim.RegionServer/RegionInfo.cs13
-rw-r--r--OpenSim.RegionServer/world/World.cs4
-rw-r--r--OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs5
-rw-r--r--OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs29
-rw-r--r--OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs5
6 files changed, 46 insertions, 11 deletions
diff --git a/OpenSim.Framework/Interfaces/ILocalStorage.cs b/OpenSim.Framework/Interfaces/ILocalStorage.cs
index a4d2ba1..4dd8868 100644
--- a/OpenSim.Framework/Interfaces/ILocalStorage.cs
+++ b/OpenSim.Framework/Interfaces/ILocalStorage.cs
@@ -36,6 +36,7 @@ namespace OpenSim.Framework.Interfaces
36 /// </summary> 36 /// </summary>
37 public interface ILocalStorage 37 public interface ILocalStorage
38 { 38 {
39 void Initialise(string datastore);
39 void StorePrim(PrimData prim); 40 void StorePrim(PrimData prim);
40 void RemovePrim(LLUUID primID); 41 void RemovePrim(LLUUID primID);
41 void LoadPrimitives(ILocalStorageReceiver receiver); 42 void LoadPrimitives(ILocalStorageReceiver receiver);
diff --git a/OpenSim.RegionServer/RegionInfo.cs b/OpenSim.RegionServer/RegionInfo.cs
index 2f8bfa1..a1923f5 100644
--- a/OpenSim.RegionServer/RegionInfo.cs
+++ b/OpenSim.RegionServer/RegionInfo.cs
@@ -36,6 +36,8 @@ namespace OpenSim
36 public string UserRecvKey = ""; 36 public string UserRecvKey = "";
37 private bool isSandbox; 37 private bool isSandbox;
38 38
39 public string DataStore;
40
39 public RegionInfo() 41 public RegionInfo()
40 { 42 {
41 43
@@ -144,6 +146,17 @@ namespace OpenSim
144 { 146 {
145 this.RegionLocY = (uint)Convert.ToUInt32(attri); 147 this.RegionLocY = (uint)Convert.ToUInt32(attri);
146 } 148 }
149
150 // Local storage datastore
151 attri = "";
152 attri = configData.GetAttribute("Datastore");
153 if (attri == "")
154 {
155 string datastore = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Filename for local storage", "localworld.yap");
156 configData.SetAttribute("Datastore", datastore);
157 this.DataStore = datastore;
158 }
159
147 //Sim Listen Port 160 //Sim Listen Port
148 attri = ""; 161 attri = "";
149 attri = configData.GetAttribute("SimListenPort"); 162 attri = configData.GetAttribute("SimListenPort");
diff --git a/OpenSim.RegionServer/world/World.cs b/OpenSim.RegionServer/world/World.cs
index 0e5dbf0..5443d38 100644
--- a/OpenSim.RegionServer/world/World.cs
+++ b/OpenSim.RegionServer/world/World.cs
@@ -44,6 +44,8 @@ namespace OpenSim.world
44 private AssetCache _assetCache; 44 private AssetCache _assetCache;
45 private Mutex updateLock; 45 private Mutex updateLock;
46 46
47 public string m_datastore;
48
47 /// <summary> 49 /// <summary>
48 /// Creates a new World class, and a region to go with it. 50 /// Creates a new World class, and a region to go with it.
49 /// </summary> 51 /// </summary>
@@ -257,6 +259,8 @@ namespace OpenSim.world
257 { 259 {
258 ILocalStorage plug = (ILocalStorage)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); 260 ILocalStorage plug = (ILocalStorage)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
259 store = plug; 261 store = plug;
262
263 store.Initialise(this.m_datastore);
260 break; 264 break;
261 } 265 }
262 266
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
56 //vendorDb = (DbBTree)db.Open(null, VendorDbName, null, DbType.BTree, Db.OpenFlags.Create, 0); 56 //vendorDb = (DbBTree)db.Open(null, VendorDbName, null, DbType.BTree, Db.OpenFlags.Create, 0);
57 } 57 }
58 58
59 public void Initialise(string file)
60 {
61 // Blank
62 }
63
59 public void StorePrim(PrimData prim) 64 public void StorePrim(PrimData prim)
60 { 65 {
61 DbEntry key = new DbEntry(); 66 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
41 public class Db4LocalStorage : ILocalStorage 41 public class Db4LocalStorage : ILocalStorage
42 { 42 {
43 private IObjectContainer db; 43 private IObjectContainer db;
44 private string datastore;
44 45
45 public Db4LocalStorage() 46 public Db4LocalStorage()
46 { 47 {
47 try 48
48 {
49 db = Db4oFactory.OpenFile("localworld.yap");
50 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Db4LocalStorage creation");
51 }
52 catch(Exception e)
53 {
54 db.Close();
55 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Db4LocalStorage :Constructor - Exception occured");
56 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(e.ToString());
57 }
58 } 49 }
50
51 public void Initialise(string dfile)
52 {
53 datastore = dfile;
54 try
55 {
56 db = Db4oFactory.OpenFile(datastore);
57 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Db4LocalStorage creation");
58 }
59 catch (Exception e)
60 {
61 db.Close();
62 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Db4LocalStorage :Constructor - Exception occured");
63 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(e.ToString());
64 }
65 }
59 66
60 public void StorePrim(PrimData prim) 67 public void StorePrim(PrimData prim)
61 { 68 {
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
59 } 59 }
60 } 60 }
61 61
62 public void Initialise(string file)
63 {
64 // Blank
65 }
66
62 public void StorePrim(PrimData prim) 67 public void StorePrim(PrimData prim)
63 { 68 {
64 IDbCommand cmd = db.CreateCommand(); 69 IDbCommand cmd = db.CreateCommand();