aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorlbsa712007-11-15 19:53:10 +0000
committerlbsa712007-11-15 19:53:10 +0000
commit3aed77bd2c5fecc2a077fdad501774b2b00001b1 (patch)
tree1b2273872ae95bf68999606fb8bfcedca0305638 /OpenSim/Region
parentmake Stopped a bit sloppier which should help address any float round off issues (diff)
downloadopensim-SC_OLD-3aed77bd2c5fecc2a077fdad501774b2b00001b1.zip
opensim-SC_OLD-3aed77bd2c5fecc2a077fdad501774b2b00001b1.tar.gz
opensim-SC_OLD-3aed77bd2c5fecc2a077fdad501774b2b00001b1.tar.bz2
opensim-SC_OLD-3aed77bd2c5fecc2a077fdad501774b2b00001b1.tar.xz
*** BIG CHANGES : REGION STORAGE MOVED : UPDATE YOUR OpenSim.ini FROM OpenSim.ini.example **
* Now moved region storage from region to application, so we have one storage per application, instead of one per region. * Changed so that the region store providers use connectionstrings, not filenames * Removed various unfit fields and properties (call me Darwin)
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs19
-rw-r--r--OpenSim/Region/ClientStack/RegionApplicationBase.cs10
-rw-r--r--OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs2
-rw-r--r--OpenSim/Region/Environment/StorageManager.cs8
-rw-r--r--OpenSim/Region/Examples/SimpleApp/Program.cs4
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs14
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/NullDataStore.cs2
7 files changed, 30 insertions, 29 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index 8677b7e..8d56222 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -64,24 +64,24 @@ namespace OpenSim
64 64
65 protected LocalLoginService m_loginService; 65 protected LocalLoginService m_loginService;
66 66
67 protected string m_storageDll = "OpenSim.DataStore.NullStorage.dll"; 67 protected string m_storageDll;
68 68
69 protected string m_startupCommandsFile = ""; 69 protected string m_startupCommandsFile;
70 protected string m_shutdownCommandsFile = ""; 70 protected string m_shutdownCommandsFile;
71 71
72 protected List<UDPServer> m_udpServers = new List<UDPServer>(); 72 protected List<UDPServer> m_udpServers = new List<UDPServer>();
73 protected List<RegionInfo> m_regionData = new List<RegionInfo>(); 73 protected List<RegionInfo> m_regionData = new List<RegionInfo>();
74 74
75 private bool m_verbose; 75 private bool m_verbose;
76 private bool m_physicalPrim; 76 private bool m_physicalPrim;
77 private readonly string m_logFilename = ("region-console.log"); 77 private readonly string m_logFilename = "region-console.log";
78 private bool m_permissions = false; 78 private bool m_permissions = false;
79 79
80 private bool m_standaloneAuthenticate = false; 80 private bool m_standaloneAuthenticate = false;
81 private string m_standaloneWelcomeMessage = null; 81 private string m_standaloneWelcomeMessage = null;
82 private string m_standaloneInventoryPlugin = "OpenSim.Framework.Data.SQLite.dll"; 82 private string m_standaloneInventoryPlugin;
83 private string m_standaloneAssetPlugin = "OpenSim.Framework.Data.SQLite.dll"; 83 private string m_standaloneAssetPlugin;
84 private string m_standaloneUserPlugin = "OpenSim.Framework.Data.SQLite.dll"; 84 private string m_standaloneUserPlugin;
85 85
86 private string m_assetStorage = "sqlite"; 86 private string m_assetStorage = "sqlite";
87 87
@@ -219,6 +219,7 @@ namespace OpenSim
219 m_permissions = startupConfig.GetBoolean("serverside_object_permissions", false); 219 m_permissions = startupConfig.GetBoolean("serverside_object_permissions", false);
220 220
221 m_storageDll = startupConfig.GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"); 221 m_storageDll = startupConfig.GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll");
222 m_storageConnectionString = startupConfig.GetString("storage_connection_string","");
222 223
223 m_startupCommandsFile = startupConfig.GetString("startup_console_commands_file", ""); 224 m_startupCommandsFile = startupConfig.GetString("startup_console_commands_file", "");
224 m_shutdownCommandsFile = startupConfig.GetString("shutdown_console_commands_file", ""); 225 m_shutdownCommandsFile = startupConfig.GetString("shutdown_console_commands_file", "");
@@ -357,9 +358,9 @@ namespace OpenSim
357 new RegionInfo("DEFAULT REGION CONFIG", fileName); 358 new RegionInfo("DEFAULT REGION CONFIG", fileName);
358 } 359 }
359 360
360 protected override StorageManager CreateStorageManager(RegionInfo regionInfo) 361 protected override StorageManager CreateStorageManager(string connectionstring)
361 { 362 {
362 return new StorageManager(m_storageDll, regionInfo.DataStore, regionInfo.RegionName); 363 return new StorageManager(m_storageDll, connectionstring);
363 } 364 }
364 365
365 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, 366 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
index b0e6419..bcd845f 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
@@ -55,6 +55,9 @@ namespace OpenSim.Region.ClientStack
55 protected CommunicationsManager m_commsManager; 55 protected CommunicationsManager m_commsManager;
56 56
57 protected SceneManager m_sceneManager = new SceneManager(); 57 protected SceneManager m_sceneManager = new SceneManager();
58
59 protected StorageManager m_storageManager;
60 protected string m_storageConnectionString;
58 61
59 public SceneManager SceneManager 62 public SceneManager SceneManager
60 { 63 {
@@ -70,6 +73,8 @@ namespace OpenSim.Region.ClientStack
70 { 73 {
71 ClientView.TerrainManager = new TerrainManager(new SecondLife()); 74 ClientView.TerrainManager = new TerrainManager(new SecondLife());
72 75
76 m_storageManager = CreateStorageManager(m_storageConnectionString );
77
73 Initialize(); 78 Initialize();
74 79
75 m_httpServer = new BaseHttpServer(m_httpServerPort); 80 m_httpServer = new BaseHttpServer(m_httpServerPort);
@@ -88,7 +93,7 @@ namespace OpenSim.Region.ClientStack
88 93
89 protected abstract LogBase CreateLog(); 94 protected abstract LogBase CreateLog();
90 protected abstract PhysicsScene GetPhysicsScene(); 95 protected abstract PhysicsScene GetPhysicsScene();
91 protected abstract StorageManager CreateStorageManager(RegionInfo regionInfo); 96 protected abstract StorageManager CreateStorageManager(string connectionstring);
92 97
93 protected PhysicsScene GetPhysicsScene(string engine, string meshEngine) 98 protected PhysicsScene GetPhysicsScene(string engine, string meshEngine)
94 { 99 {
@@ -103,8 +108,7 @@ namespace OpenSim.Region.ClientStack
103 AgentCircuitManager circuitManager = new AgentCircuitManager(); 108 AgentCircuitManager circuitManager = new AgentCircuitManager();
104 udpServer = new UDPServer(regionInfo.InternalEndPoint.Port, m_assetCache, m_log, circuitManager); 109 udpServer = new UDPServer(regionInfo.InternalEndPoint.Port, m_assetCache, m_log, circuitManager);
105 110
106 StorageManager storageManager = CreateStorageManager(regionInfo); 111 Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager);
107 Scene scene = CreateScene(regionInfo, storageManager, circuitManager);
108 112
109 udpServer.LocalScene = scene; 113 udpServer.LocalScene = scene;
110 114
diff --git a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
index e375343..90cdf0a 100644
--- a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
+++ b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Interfaces
40 /// </summary> 40 /// </summary>
41 /// <param name="filename">The file to save the database to (may not be applicable)</param> 41 /// <param name="filename">The file to save the database to (may not be applicable)</param>
42 /// <param name="dbname">The name of the database to store to (may not be applicable)</param> 42 /// <param name="dbname">The name of the database to store to (may not be applicable)</param>
43 void Initialise(string filename, string dbname); 43 void Initialise(string filename);
44 44
45 void StoreObject(SceneObjectGroup obj, LLUUID regionUUID); 45 void StoreObject(SceneObjectGroup obj, LLUUID regionUUID);
46 void RemoveObject(LLUUID uuid, LLUUID regionUUID); 46 void RemoveObject(LLUUID uuid, LLUUID regionUUID);
diff --git a/OpenSim/Region/Environment/StorageManager.cs b/OpenSim/Region/Environment/StorageManager.cs
index 11f0ce0..b7bd8cc 100644
--- a/OpenSim/Region/Environment/StorageManager.cs
+++ b/OpenSim/Region/Environment/StorageManager.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment
47 m_dataStore = storage; 47 m_dataStore = storage;
48 } 48 }
49 49
50 public StorageManager(string dllName, string dataStoreFile, string dataStoreDB) 50 public StorageManager(string dllName, string connectionstring)
51 { 51 {
52 MainLog.Instance.Verbose("DATASTORE", "Attempting to load " + dllName); 52 MainLog.Instance.Verbose("DATASTORE", "Attempting to load " + dllName);
53 Assembly pluginAssembly = Assembly.LoadFrom(dllName); 53 Assembly pluginAssembly = Assembly.LoadFrom(dllName);
@@ -62,19 +62,15 @@ namespace OpenSim.Region.Environment
62 { 62 {
63 IRegionDataStore plug = 63 IRegionDataStore plug =
64 (IRegionDataStore) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); 64 (IRegionDataStore) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
65 plug.Initialise(dataStoreFile, dataStoreDB); 65 plug.Initialise(connectionstring);
66 66
67 m_dataStore = plug; 67 m_dataStore = plug;
68 68
69 MainLog.Instance.Verbose("DATASTORE", "Added IRegionDataStore Interface"); 69 MainLog.Instance.Verbose("DATASTORE", "Added IRegionDataStore Interface");
70 } 70 }
71
72 typeInterface = null;
73 } 71 }
74 } 72 }
75 73
76 pluginAssembly = null;
77
78 //TODO: Add checking and warning to make sure it initialised. 74 //TODO: Add checking and warning to make sure it initialised.
79 } 75 }
80 } 76 }
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs
index 73b8303..bd88e61 100644
--- a/OpenSim/Region/Examples/SimpleApp/Program.cs
+++ b/OpenSim/Region/Examples/SimpleApp/Program.cs
@@ -175,9 +175,9 @@ namespace SimpleApp
175 new ModuleLoader(m_log, m_config), true); 175 new ModuleLoader(m_log, m_config), true);
176 } 176 }
177 177
178 protected override StorageManager CreateStorageManager(RegionInfo regionInfo) 178 protected override StorageManager CreateStorageManager(string connectionstring)
179 { 179 {
180 return new StorageManager("OpenSim.DataStore.NullStorage.dll", "simpleapp.yap", "simpleapp"); 180 return new StorageManager("OpenSim.DataStore.NullStorage.dll", "simpleapp.yap");
181 } 181 }
182 182
183 protected override PhysicsScene GetPhysicsScene() 183 protected override PhysicsScene GetPhysicsScene()
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
index 44461df..e49e225 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
@@ -50,7 +50,7 @@ namespace OpenSim.DataStore.MonoSqlite
50 private SqliteDataAdapter primDa; 50 private SqliteDataAdapter primDa;
51 private SqliteDataAdapter shapeDa; 51 private SqliteDataAdapter shapeDa;
52 private SqliteDataAdapter terrainDa; 52 private SqliteDataAdapter terrainDa;
53 private String connectionString; 53 private String m_connectionString;
54 54
55 /*********************************************************************** 55 /***********************************************************************
56 * 56 *
@@ -58,14 +58,14 @@ namespace OpenSim.DataStore.MonoSqlite
58 * 58 *
59 **********************************************************************/ 59 **********************************************************************/
60 60
61 public void Initialise(string dbfile, string dbname) 61 public void Initialise(string connectionString)
62 { 62 {
63 connectionString = "URI=file:" + dbfile + ",version=3"; 63 m_connectionString = connectionString;
64 64
65 ds = new DataSet(); 65 ds = new DataSet();
66 66
67 MainLog.Instance.Verbose("DATASTORE", "Sqlite - connecting: " + dbfile); 67 MainLog.Instance.Verbose("DATASTORE", "Sqlite - connecting: " + connectionString);
68 SqliteConnection conn = new SqliteConnection(connectionString); 68 SqliteConnection conn = new SqliteConnection(m_connectionString);
69 69
70 SqliteCommand primSelectCmd = new SqliteCommand(primSelect, conn); 70 SqliteCommand primSelectCmd = new SqliteCommand(primSelect, conn);
71 primDa = new SqliteDataAdapter(primSelectCmd); 71 primDa = new SqliteDataAdapter(primSelectCmd);
@@ -266,7 +266,7 @@ namespace OpenSim.DataStore.MonoSqlite
266 266
267 // the following is an work around for .NET. The perf 267 // the following is an work around for .NET. The perf
268 // issues associated with it aren't as bad as you think. 268 // issues associated with it aren't as bad as you think.
269 SqliteConnection conn = new SqliteConnection(connectionString); 269 SqliteConnection conn = new SqliteConnection(m_connectionString);
270 conn.Open(); 270 conn.Open();
271 MainLog.Instance.Verbose("DATASTORE", "Storing terrain revision r" + revision.ToString()); 271 MainLog.Instance.Verbose("DATASTORE", "Storing terrain revision r" + revision.ToString());
272 String sql = "insert into terrain(RegionUUID, Revision, Heightfield)" + 272 String sql = "insert into terrain(RegionUUID, Revision, Heightfield)" +
@@ -288,7 +288,7 @@ namespace OpenSim.DataStore.MonoSqlite
288 terret.Initialize(); 288 terret.Initialize();
289 // the following is an work around for .NET. The perf 289 // the following is an work around for .NET. The perf
290 // issues associated with it aren't as bad as you think. 290 // issues associated with it aren't as bad as you think.
291 SqliteConnection conn = new SqliteConnection(connectionString); 291 SqliteConnection conn = new SqliteConnection(m_connectionString);
292 conn.Open(); 292 conn.Open();
293 String sql = "select RegionUUID, Revision, Heightfield from terrain" + 293 String sql = "select RegionUUID, Revision, Heightfield from terrain" +
294 " where RegionUUID=:RegionUUID order by Revision desc"; 294 " where RegionUUID=:RegionUUID order by Revision desc";
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/NullDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/NullDataStore.cs
index 4e1f71e..657cfab 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/NullDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/NullDataStore.cs
@@ -36,7 +36,7 @@ namespace OpenSim.DataStore.NullStorage
36{ 36{
37 public class NullDataStore : IRegionDataStore 37 public class NullDataStore : IRegionDataStore
38 { 38 {
39 public void Initialise(string dbfile, string dbname) 39 public void Initialise(string dbfile)
40 { 40 {
41 return; 41 return;
42 } 42 }