From ff2eb24022f906ea20e673756d2b72162e707491 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Thu, 21 Aug 2008 11:04:57 +0000 Subject: - corrects statement about {asset,user,inventory} source configuration as those all work with MySQL (and are in fact required it seems); adds examples as well - adds region_file_template functionality for the create_region XmlRpc call of RemoteAdminPlugin - cleans up and fixes typo in UserProfileData --- .../RemoteController/RemoteAdminPlugin.cs | 11 +++++++--- OpenSim/Framework/UserProfileData.cs | 8 ++++++-- bin/OpenSim.ini.example | 24 ++++++++++++++++++---- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index c79122c..ec28350 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -33,6 +33,7 @@ using System.Reflection; using System.Timers; using libsecondlife; using log4net; +using Nini.Config; using Nwc.XmlRpc; using OpenSim.Framework; using OpenSim.Framework.Servers; @@ -47,6 +48,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController private OpenSimBase m_app; private BaseHttpServer m_httpd; + private IConfig m_config; private string requiredPassword = String.Empty; // TODO: required by IPlugin, but likely not at all right @@ -69,8 +71,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (openSim.ConfigSource.Source.Configs["RemoteAdmin"] != null && openSim.ConfigSource.Source.Configs["RemoteAdmin"].GetBoolean("enabled", false)) { + m_config = openSim.ConfigSource.Source.Configs["RemoteAdmin"]; m_log.Info("[RADMIN]: Remote Admin Plugin Enabled"); - requiredPassword = openSim.ConfigSource.Source.Configs["RemoteAdmin"].GetString("access_password", String.Empty); + requiredPassword = m_config.GetString("access_password", String.Empty); m_app = openSim; m_httpd = openSim.HttpServer; @@ -436,10 +439,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (persist) { string regionConfigPath = Path.Combine(Path.Combine(Util.configDir(), "Regions"), - String.Format("{0}x{1}-{2}.xml", + String.Format(m_config.GetString("region_file_template", "{0}x{1}-{2}.xml"), region.RegionLocX.ToString(), region.RegionLocY.ToString(), - regionID.ToString())); + regionID.ToString(), + region.InternalEndPoint.Port.ToString(), + region.RegionName.Replace(" ", "_").Replace(":", "_").Replace("/", "_"))); m_log.DebugFormat("[RADMIN] CreateRegion: persisting region {0} to {1}", region.RegionID, regionConfigPath); region.SaveRegionToFile("dynamic region", regionConfigPath); diff --git a/OpenSim/Framework/UserProfileData.cs b/OpenSim/Framework/UserProfileData.cs index d0b4c25..2d06148 100644 --- a/OpenSim/Framework/UserProfileData.cs +++ b/OpenSim/Framework/UserProfileData.cs @@ -145,7 +145,9 @@ namespace OpenSim.Framework private LLUUID _partner; /// - /// The regionhandle of the users preffered home region. If multiple sims occupy the same spot, the grid may decide which region the user logs into + /// The regionhandle of the users preferred home region. If + /// multiple sims occupy the same spot, the grid may decide + /// which region the user logs into /// public virtual ulong HomeRegion { @@ -159,7 +161,9 @@ namespace OpenSim.Framework private LLUUID _homeRegionID; /// - /// The regionID of the users home region. This is unique; even if the position of the region changes within the grid, this will refer to the same region. + /// The regionID of the users home region. This is unique; + /// even if the position of the region changes within the + /// grid, this will refer to the same region. /// public LLUUID HomeRegionID { diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 4801bfc..01633fa 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -131,18 +131,22 @@ asset_plugin = "OpenSim.Data.SQLite.dll" ; asset_plugin = "OpenSim.Data.MySQL.dll" ; for mysql ; asset_plugin = "OpenSim.Data.NHibernate.dll" ; for nhibernate -; the Asset DB source. This only works for sqlite and nhibernate for now -; Asset Source SQLite Exampe +; the Asset DB source. This only works for sqlite, mysql, and nhibernate for now +; Asset Source SQLite example ; asset_source = "URI=file:Asset.db,version=3" -; Asset Source NHibernate Example (DIALECT;DRIVER;CONNECTSTRING) +; Asset Source NHibernate example (DIALECT;DRIVER;CONNECTSTRING) ; asset_source = "SQLiteDialect;SqliteClientDriver;URI=file:Asset.db,version=3" +; Asset Source MySQL example +;asset_source = "Data Source=localhost;Database=opensim;User ID=opensim;Password=****;" ; Inventory database provider inventory_plugin = "OpenSim.Data.SQLite.dll" ; inventory_plugin = "OpenSim.Data.MySQL.dll" ; inventory_plugin = "OpenSim.Data.NHibernate.dll" ; for nhibernate -; Inventory Source NHibernate Example (DIALECT;DRIVER;CONNECTSTRING) +; Inventory Source NHibernate example (DIALECT;DRIVER;CONNECTSTRING) ; inventory_source = "SQLiteDialect;SqliteClientDriver;URI=file:Inventory.db,version=3" +; Inventory Source MySQL example +;inventory_source = "Data Source=localhost;Database=opensim;User ID=opensim;Password=****;" ; User Data Database provider @@ -151,6 +155,8 @@ userDatabase_plugin = "OpenSim.Data.SQLite.dll" ; userDatabase_plugin = "OpenSim.Data.NHibernate.dll" ; for nhibernate ; User Source NHibernate Example (DIALECT;DRIVER;CONNECTSTRING) ; user_source = "SQLiteDialect;SqliteClientDriver;URI=file:User.db,version=3" +; User Source MySQL example +;user_source = "Data Source=localhost;Database=opensim;User ID=opensim;Password=****;" default_location_x = 1000 default_location_y = 1000 @@ -329,6 +335,16 @@ mesh_physical_lod = 16 enabled = false access_password = unknown +; the create_region XmlRpc call uses region_file_template to generate +; the file name of newly create regions (if they are created +; persistent). the parameter available are: +; {0} - X location +; {1} - Y location +; {2} - region UUID +; {3} - region port +; {4} - region name with " ", ":", "/" mapped to "_" + +region_file_template = "{0}x{1}-{2}.xml" [RestPlugins] enabled = false -- cgit v1.1