*** 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)
This commit is contained in:
lbsa71
2007-11-15 19:53:10 +00:00
parent 886f8b5548
commit 3aed77bd2c
10 changed files with 39 additions and 58 deletions

View File

@@ -64,24 +64,24 @@ namespace OpenSim
protected LocalLoginService m_loginService;
protected string m_storageDll = "OpenSim.DataStore.NullStorage.dll";
protected string m_storageDll;
protected string m_startupCommandsFile = "";
protected string m_shutdownCommandsFile = "";
protected string m_startupCommandsFile;
protected string m_shutdownCommandsFile;
protected List<UDPServer> m_udpServers = new List<UDPServer>();
protected List<RegionInfo> m_regionData = new List<RegionInfo>();
private bool m_verbose;
private bool m_physicalPrim;
private readonly string m_logFilename = ("region-console.log");
private readonly string m_logFilename = "region-console.log";
private bool m_permissions = false;
private bool m_standaloneAuthenticate = false;
private string m_standaloneWelcomeMessage = null;
private string m_standaloneInventoryPlugin = "OpenSim.Framework.Data.SQLite.dll";
private string m_standaloneAssetPlugin = "OpenSim.Framework.Data.SQLite.dll";
private string m_standaloneUserPlugin = "OpenSim.Framework.Data.SQLite.dll";
private string m_standaloneInventoryPlugin;
private string m_standaloneAssetPlugin;
private string m_standaloneUserPlugin;
private string m_assetStorage = "sqlite";
@@ -219,6 +219,7 @@ namespace OpenSim
m_permissions = startupConfig.GetBoolean("serverside_object_permissions", false);
m_storageDll = startupConfig.GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll");
m_storageConnectionString = startupConfig.GetString("storage_connection_string","");
m_startupCommandsFile = startupConfig.GetString("startup_console_commands_file", "");
m_shutdownCommandsFile = startupConfig.GetString("shutdown_console_commands_file", "");
@@ -357,9 +358,9 @@ namespace OpenSim
new RegionInfo("DEFAULT REGION CONFIG", fileName);
}
protected override StorageManager CreateStorageManager(RegionInfo regionInfo)
protected override StorageManager CreateStorageManager(string connectionstring)
{
return new StorageManager(m_storageDll, regionInfo.DataStore, regionInfo.RegionName);
return new StorageManager(m_storageDll, connectionstring);
}
protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,

View File

@@ -55,6 +55,9 @@ namespace OpenSim.Region.ClientStack
protected CommunicationsManager m_commsManager;
protected SceneManager m_sceneManager = new SceneManager();
protected StorageManager m_storageManager;
protected string m_storageConnectionString;
public SceneManager SceneManager
{
@@ -70,6 +73,8 @@ namespace OpenSim.Region.ClientStack
{
ClientView.TerrainManager = new TerrainManager(new SecondLife());
m_storageManager = CreateStorageManager(m_storageConnectionString );
Initialize();
m_httpServer = new BaseHttpServer(m_httpServerPort);
@@ -88,7 +93,7 @@ namespace OpenSim.Region.ClientStack
protected abstract LogBase CreateLog();
protected abstract PhysicsScene GetPhysicsScene();
protected abstract StorageManager CreateStorageManager(RegionInfo regionInfo);
protected abstract StorageManager CreateStorageManager(string connectionstring);
protected PhysicsScene GetPhysicsScene(string engine, string meshEngine)
{
@@ -103,8 +108,7 @@ namespace OpenSim.Region.ClientStack
AgentCircuitManager circuitManager = new AgentCircuitManager();
udpServer = new UDPServer(regionInfo.InternalEndPoint.Port, m_assetCache, m_log, circuitManager);
StorageManager storageManager = CreateStorageManager(regionInfo);
Scene scene = CreateScene(regionInfo, storageManager, circuitManager);
Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager);
udpServer.LocalScene = scene;

View File

@@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Interfaces
/// </summary>
/// <param name="filename">The file to save the database to (may not be applicable)</param>
/// <param name="dbname">The name of the database to store to (may not be applicable)</param>
void Initialise(string filename, string dbname);
void Initialise(string filename);
void StoreObject(SceneObjectGroup obj, LLUUID regionUUID);
void RemoveObject(LLUUID uuid, LLUUID regionUUID);

View File

@@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment
m_dataStore = storage;
}
public StorageManager(string dllName, string dataStoreFile, string dataStoreDB)
public StorageManager(string dllName, string connectionstring)
{
MainLog.Instance.Verbose("DATASTORE", "Attempting to load " + dllName);
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
@@ -62,19 +62,15 @@ namespace OpenSim.Region.Environment
{
IRegionDataStore plug =
(IRegionDataStore) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
plug.Initialise(dataStoreFile, dataStoreDB);
plug.Initialise(connectionstring);
m_dataStore = plug;
MainLog.Instance.Verbose("DATASTORE", "Added IRegionDataStore Interface");
}
typeInterface = null;
}
}
pluginAssembly = null;
//TODO: Add checking and warning to make sure it initialised.
}
}

View File

@@ -175,9 +175,9 @@ namespace SimpleApp
new ModuleLoader(m_log, m_config), true);
}
protected override StorageManager CreateStorageManager(RegionInfo regionInfo)
protected override StorageManager CreateStorageManager(string connectionstring)
{
return new StorageManager("OpenSim.DataStore.NullStorage.dll", "simpleapp.yap", "simpleapp");
return new StorageManager("OpenSim.DataStore.NullStorage.dll", "simpleapp.yap");
}
protected override PhysicsScene GetPhysicsScene()

View File

@@ -50,7 +50,7 @@ namespace OpenSim.DataStore.MonoSqlite
private SqliteDataAdapter primDa;
private SqliteDataAdapter shapeDa;
private SqliteDataAdapter terrainDa;
private String connectionString;
private String m_connectionString;
/***********************************************************************
*
@@ -58,14 +58,14 @@ namespace OpenSim.DataStore.MonoSqlite
*
**********************************************************************/
public void Initialise(string dbfile, string dbname)
public void Initialise(string connectionString)
{
connectionString = "URI=file:" + dbfile + ",version=3";
m_connectionString = connectionString;
ds = new DataSet();
MainLog.Instance.Verbose("DATASTORE", "Sqlite - connecting: " + dbfile);
SqliteConnection conn = new SqliteConnection(connectionString);
MainLog.Instance.Verbose("DATASTORE", "Sqlite - connecting: " + connectionString);
SqliteConnection conn = new SqliteConnection(m_connectionString);
SqliteCommand primSelectCmd = new SqliteCommand(primSelect, conn);
primDa = new SqliteDataAdapter(primSelectCmd);
@@ -266,7 +266,7 @@ namespace OpenSim.DataStore.MonoSqlite
// the following is an work around for .NET. The perf
// issues associated with it aren't as bad as you think.
SqliteConnection conn = new SqliteConnection(connectionString);
SqliteConnection conn = new SqliteConnection(m_connectionString);
conn.Open();
MainLog.Instance.Verbose("DATASTORE", "Storing terrain revision r" + revision.ToString());
String sql = "insert into terrain(RegionUUID, Revision, Heightfield)" +
@@ -288,7 +288,7 @@ namespace OpenSim.DataStore.MonoSqlite
terret.Initialize();
// the following is an work around for .NET. The perf
// issues associated with it aren't as bad as you think.
SqliteConnection conn = new SqliteConnection(connectionString);
SqliteConnection conn = new SqliteConnection(m_connectionString);
conn.Open();
String sql = "select RegionUUID, Revision, Heightfield from terrain" +
" where RegionUUID=:RegionUUID order by Revision desc";

View File

@@ -36,7 +36,7 @@ namespace OpenSim.DataStore.NullStorage
{
public class NullDataStore : IRegionDataStore
{
public void Initialise(string dbfile, string dbname)
public void Initialise(string dbfile)
{
return;
}