From bbe1e196963fe8609a1070793b8439c293261d24 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Fri, 17 Apr 2009 05:52:46 +0000 Subject: * Some more work on refactoring configs; * Moved the constants out into a separate DefaultConfig * Pulled configMember up * Some minor CCC --- OpenSim/Framework/AssetConfig.cs | 19 ++++---- .../Communications/Services/GridInfoService.cs | 4 +- OpenSim/Framework/ConfigBase.cs | 1 + OpenSim/Framework/DefaultSettings.cs | 19 ++++++++ OpenSim/Framework/EstateSettings.cs | 52 ++++++++++----------- OpenSim/Framework/GridConfig.cs | 41 ++++++++--------- OpenSim/Framework/InventoryConfig.cs | 27 +++++------ OpenSim/Framework/MessageServerConfig.cs | 43 ++++++++---------- OpenSim/Framework/NetworkServersInfo.cs | 22 ++++----- OpenSim/Framework/RegionInfo.cs | 8 ++-- OpenSim/Framework/UserConfig.cs | 53 ++++++++++------------ OpenSim/Region/Application/ConfigurationLoader.cs | 12 ++--- .../Communications/Hypergrid/HGGridServices.cs | 4 +- .../Region/Communications/OGS1/OGS1GridServices.cs | 2 +- OpenSim/Region/DataSnapshot/DataSnapshotManager.cs | 8 ++-- .../Shared/Api/Implementation/LSL_Api.cs | 2 +- 16 files changed, 160 insertions(+), 157 deletions(-) create mode 100644 OpenSim/Framework/DefaultSettings.cs (limited to 'OpenSim') diff --git a/OpenSim/Framework/AssetConfig.cs b/OpenSim/Framework/AssetConfig.cs index 804a270..f9e6954 100644 --- a/OpenSim/Framework/AssetConfig.cs +++ b/OpenSim/Framework/AssetConfig.cs @@ -35,33 +35,30 @@ namespace OpenSim.Framework /// public class AssetConfig:ConfigBase { - public const uint DefaultHttpPort = 8003; - - private ConfigurationMember configMember; public string DatabaseConnect = String.Empty; public string DatabaseProvider = String.Empty; - public uint HttpPort = DefaultHttpPort; + public uint HttpPort = DefaultSettings.DefaultAssetServerHttpPort; public string AssetSetsLocation = string.Empty; public AssetConfig(string description, string filename) { - configMember = + m_configMember = new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, true); - configMember.performConfigurationRetrieve(); + m_configMember.performConfigurationRetrieve(); } public void loadConfigurationOptions() { - configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Data.MySQL.dll", false); - configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Database connection string", "", false); - configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, - "Http Listener port", DefaultHttpPort.ToString(), false); + m_configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, + "Http Listener port", DefaultSettings.DefaultAssetServerHttpPort.ToString(), false); - configMember.addConfigurationOption("assetset_location", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("assetset_location", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Location of 'AssetSets.xml'", string.Format(".{0}assets{0}AssetSets.xml", Path.DirectorySeparatorChar), false); } diff --git a/OpenSim/Framework/Communications/Services/GridInfoService.cs b/OpenSim/Framework/Communications/Services/GridInfoService.cs index 030ea61..47ea61a 100644 --- a/OpenSim/Framework/Communications/Services/GridInfoService.cs +++ b/OpenSim/Framework/Communications/Services/GridInfoService.cs @@ -104,13 +104,13 @@ namespace OpenSim.Framework.Communications.Services if (grid) _info["login"] = netCfg.GetString( - "user_server_url", "http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString()); + "user_server_url", "http://127.0.0.1:" + DefaultSettings.DefaultUserServerHttpPort.ToString()); else _info["login"] = String.Format( "http://127.0.0.1:{0}/", netCfg.GetString( - "http_listener_port", NetworkServersInfo.DefaultHttpListenerPort.ToString())); + "http_listener_port", DefaultSettings.DefaultRegionHttpPort.ToString())); IssueWarning(); } diff --git a/OpenSim/Framework/ConfigBase.cs b/OpenSim/Framework/ConfigBase.cs index 5479f2f..2617796 100644 --- a/OpenSim/Framework/ConfigBase.cs +++ b/OpenSim/Framework/ConfigBase.cs @@ -6,5 +6,6 @@ namespace OpenSim.Framework { public abstract class ConfigBase { + protected ConfigurationMember m_configMember; } } diff --git a/OpenSim/Framework/DefaultSettings.cs b/OpenSim/Framework/DefaultSettings.cs new file mode 100644 index 0000000..8277914 --- /dev/null +++ b/OpenSim/Framework/DefaultSettings.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenSim.Framework +{ + public static class DefaultSettings + { + public const uint DefaultAssetServerHttpPort = 8003; + public const uint DefaultRegionHttpPort = 9000; + public static uint DefaultRegionRemotingPort = 8895; // This is actually assigned to, but then again, the remoting is obsolete, right? + public const uint DefaultUserServerHttpPort = 8002; + public const bool DefaultUserServerHttpSSL = false; + public const uint DefaultMessageServerHttpPort = 8006; + public const bool DefaultMessageServerHttpSSL = false; + public const uint DefaultGridServerHttpPort = 8001; + public const uint DefaultInventoryServerHttpPort = 8004; + } +} diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs index b84d1d7..4552a2f 100644 --- a/OpenSim/Framework/EstateSettings.cs +++ b/OpenSim/Framework/EstateSettings.cs @@ -35,7 +35,7 @@ namespace OpenSim.Framework public class EstateSettings { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private ConfigurationMember configMember; + private readonly ConfigurationMember m_configMember; public delegate void SaveDelegate(EstateSettings rs); @@ -43,12 +43,12 @@ namespace OpenSim.Framework // Only the client uses these // - private uint m_EstateID = 100; + private uint m_estateId = 100; public uint EstateID { - get { return m_EstateID; } - set { m_EstateID = value; } + get { return m_estateId; } + set { m_estateId = value; } } private string m_EstateName; @@ -273,20 +273,20 @@ namespace OpenSim.Framework public EstateSettings() { - if (configMember == null) + if (m_configMember == null) { try { // Load legacy defaults // - configMember = + m_configMember = new ConfigurationMember(Path.Combine(Util.configDir(), "estate_settings.xml"), "ESTATE SETTINGS", loadConfigurationOptions, handleIncomingConfiguration, true); l_EstateManagers.Clear(); - configMember.performConfigurationRetrieve(); + m_configMember.performConfigurationRetrieve(); } catch (Exception) { @@ -360,75 +360,75 @@ namespace OpenSim.Framework public void loadConfigurationOptions() { - configMember.addConfigurationOption("billable_factor", + m_configMember.addConfigurationOption("billable_factor", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "0.0", true); -// configMember.addConfigurationOption("estate_id", +// m_configMember.addConfigurationOption("estate_id", // ConfigurationOption.ConfigurationTypes.TYPE_UINT32, // String.Empty, "100", true); -// configMember.addConfigurationOption("parent_estate_id", +// m_configMember.addConfigurationOption("parent_estate_id", // ConfigurationOption.ConfigurationTypes.TYPE_UINT32, // String.Empty, "1", true); - configMember.addConfigurationOption("redirect_grid_x", + m_configMember.addConfigurationOption("redirect_grid_x", ConfigurationOption.ConfigurationTypes.TYPE_INT32, String.Empty, "0", true); - configMember.addConfigurationOption("redirect_grid_y", + m_configMember.addConfigurationOption("redirect_grid_y", ConfigurationOption.ConfigurationTypes.TYPE_INT32, String.Empty, "0", true); - configMember.addConfigurationOption("price_per_meter", + m_configMember.addConfigurationOption("price_per_meter", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, String.Empty, "1", true); - configMember.addConfigurationOption("estate_name", + m_configMember.addConfigurationOption("estate_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING, String.Empty, "My Estate", true); - configMember.addConfigurationOption("estate_manager_0", + m_configMember.addConfigurationOption("estate_manager_0", ConfigurationOption.ConfigurationTypes.TYPE_UUID, String.Empty, "00000000-0000-0000-0000-000000000000", true); - configMember.addConfigurationOption("estate_manager_1", + m_configMember.addConfigurationOption("estate_manager_1", ConfigurationOption.ConfigurationTypes.TYPE_UUID, String.Empty, "00000000-0000-0000-0000-000000000000", true); - configMember.addConfigurationOption("estate_manager_2", + m_configMember.addConfigurationOption("estate_manager_2", ConfigurationOption.ConfigurationTypes.TYPE_UUID, String.Empty, "00000000-0000-0000-0000-000000000000", true); - configMember.addConfigurationOption("estate_manager_3", + m_configMember.addConfigurationOption("estate_manager_3", ConfigurationOption.ConfigurationTypes.TYPE_UUID, String.Empty, "00000000-0000-0000-0000-000000000000", true); - configMember.addConfigurationOption("estate_manager_4", + m_configMember.addConfigurationOption("estate_manager_4", ConfigurationOption.ConfigurationTypes.TYPE_UUID, String.Empty, "00000000-0000-0000-0000-000000000000", true); - configMember.addConfigurationOption("estate_manager_5", + m_configMember.addConfigurationOption("estate_manager_5", ConfigurationOption.ConfigurationTypes.TYPE_UUID, String.Empty, "00000000-0000-0000-0000-000000000000", true); - configMember.addConfigurationOption("estate_manager_6", + m_configMember.addConfigurationOption("estate_manager_6", ConfigurationOption.ConfigurationTypes.TYPE_UUID, String.Empty, "00000000-0000-0000-0000-000000000000", true); - configMember.addConfigurationOption("estate_manager_7", + m_configMember.addConfigurationOption("estate_manager_7", ConfigurationOption.ConfigurationTypes.TYPE_UUID, String.Empty, "00000000-0000-0000-0000-000000000000", true); - configMember.addConfigurationOption("estate_manager_8", + m_configMember.addConfigurationOption("estate_manager_8", ConfigurationOption.ConfigurationTypes.TYPE_UUID, String.Empty, "00000000-0000-0000-0000-000000000000", true); - configMember.addConfigurationOption("estate_manager_9", + m_configMember.addConfigurationOption("estate_manager_9", ConfigurationOption.ConfigurationTypes.TYPE_UUID, String.Empty, "00000000-0000-0000-0000-000000000000", true); - configMember.addConfigurationOption("region_flags", + m_configMember.addConfigurationOption("region_flags", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, String.Empty, "336723974", true); } @@ -466,7 +466,7 @@ namespace OpenSim.Framework m_BillableFactor = (float) configuration_result; break; // case "estate_id": -// m_EstateID = (uint) configuration_result; +// m_estateId = (uint) configuration_result; // break; // case "parent_estate_id": // m_ParentEstateID = (uint) configuration_result; diff --git a/OpenSim/Framework/GridConfig.cs b/OpenSim/Framework/GridConfig.cs index 640eeaa..679c84b 100644 --- a/OpenSim/Framework/GridConfig.cs +++ b/OpenSim/Framework/GridConfig.cs @@ -31,19 +31,16 @@ namespace OpenSim.Framework { public class GridConfig:ConfigBase { - public static uint DefaultHttpPort = 8001; - public string AllowForcefulBanlines = "TRUE"; public bool AllowRegionRegistration = true; public string AssetRecvKey = String.Empty; public string AssetSendKey = String.Empty; - private ConfigurationMember configMember; public string DatabaseProvider = String.Empty; public string DatabaseConnect = String.Empty; public string DefaultAssetServer = String.Empty; public string DefaultUserServer = String.Empty; - public uint HttpPort = DefaultHttpPort; + public uint HttpPort = DefaultSettings.DefaultGridServerHttpPort; public string SimRecvKey = String.Empty; public string SimSendKey = String.Empty; public string UserRecvKey = String.Empty; @@ -51,49 +48,49 @@ namespace OpenSim.Framework public GridConfig(string description, string filename) { - configMember = + m_configMember = new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, true); - configMember.performConfigurationRetrieve(); + m_configMember.performConfigurationRetrieve(); } public void loadConfigurationOptions() { - configMember.addConfigurationOption("default_asset_server", + m_configMember.addConfigurationOption("default_asset_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Asset Server URI", - "http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString() + "/", + "http://127.0.0.1:" + DefaultSettings.DefaultAssetServerHttpPort.ToString() + "/", false); - configMember.addConfigurationOption("asset_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("asset_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to asset server", "null", false); - configMember.addConfigurationOption("asset_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("asset_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from asset server", "null", false); - configMember.addConfigurationOption("default_user_server", + m_configMember.addConfigurationOption("default_user_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default User Server URI", - "http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString() + "/", false); - configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + "http://127.0.0.1:" + DefaultSettings.DefaultUserServerHttpPort.ToString() + "/", false); + m_configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to user server", "null", false); - configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from user server", "null", false); - configMember.addConfigurationOption("sim_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("sim_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to a simulator", "null", false); - configMember.addConfigurationOption("sim_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("sim_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from a simulator", "null", false); - configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Data.MySQL.dll", false); - configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Database connect string", "", false); - configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, - "Http Listener port", DefaultHttpPort.ToString(), false); + m_configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, + "Http Listener port", DefaultSettings.DefaultGridServerHttpPort.ToString(), false); - configMember.addConfigurationOption("allow_forceful_banlines", + m_configMember.addConfigurationOption("allow_forceful_banlines", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Allow Forceful Banlines", "TRUE", true); - configMember.addConfigurationOption("allow_region_registration", + m_configMember.addConfigurationOption("allow_region_registration", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Allow regions to register immediately upon grid server startup? true/false", "True", diff --git a/OpenSim/Framework/InventoryConfig.cs b/OpenSim/Framework/InventoryConfig.cs index 8141290..aafb6de 100644 --- a/OpenSim/Framework/InventoryConfig.cs +++ b/OpenSim/Framework/InventoryConfig.cs @@ -34,13 +34,10 @@ namespace OpenSim.Framework /// public class InventoryConfig:ConfigBase { - public static uint DefaultHttpPort = 8004; - - private ConfigurationMember configMember; public string DatabaseConnect = String.Empty; public string DatabaseProvider = String.Empty; public string DefaultStartupMsg = String.Empty; - public uint HttpPort = DefaultHttpPort; + public uint HttpPort = DefaultSettings.DefaultInventoryServerHttpPort; public string InventoryServerURL = String.Empty; public string UserServerURL = String.Empty; public string AssetServerURL = String.Empty; @@ -49,34 +46,34 @@ namespace OpenSim.Framework public InventoryConfig(string description, string filename) { - configMember = + m_configMember = new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, true); - configMember.performConfigurationRetrieve(); + m_configMember.performConfigurationRetrieve(); } public void loadConfigurationOptions() { - configMember.addConfigurationOption("default_inventory_server", + m_configMember.addConfigurationOption("default_inventory_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Inventory Server URI (this server's external name)", "http://127.0.0.1:8004", false); - configMember.addConfigurationOption("default_user_server", + m_configMember.addConfigurationOption("default_user_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default User Server URI", "http://127.0.0.1:8002", false); - configMember.addConfigurationOption("default_asset_server", + m_configMember.addConfigurationOption("default_asset_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Asset Server URI", "http://127.0.0.1:8003", false); - configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Data.MySQL.dll", false); - configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Database Connect String", "", false); - configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, - "Http Listener port", DefaultHttpPort.ToString(), false); - configMember.addConfigurationOption("session_lookup", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, + m_configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, + "Http Listener port", DefaultSettings.DefaultInventoryServerHttpPort.ToString(), false); + m_configMember.addConfigurationOption("session_lookup", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Enable session lookup security", "False", false); - configMember.addConfigurationOption("region_access", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, + m_configMember.addConfigurationOption("region_access", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Allow direct region access to users inventories? (Keep True if you don't know what this is about)", "True", false); } diff --git a/OpenSim/Framework/MessageServerConfig.cs b/OpenSim/Framework/MessageServerConfig.cs index 1af9b13..1e4b818 100644 --- a/OpenSim/Framework/MessageServerConfig.cs +++ b/OpenSim/Framework/MessageServerConfig.cs @@ -34,17 +34,14 @@ namespace OpenSim.Framework /// public class MessageServerConfig:ConfigBase { - public static uint DefaultHttpPort = 8006; - public static bool DefaultHttpSSL = false; - private ConfigurationMember configMember; public string DatabaseProvider = String.Empty; public string DatabaseConnect = String.Empty; public string GridCommsProvider = String.Empty; public string GridRecvKey = String.Empty; public string GridSendKey = String.Empty; public string GridServerURL = String.Empty; - public uint HttpPort = DefaultHttpPort; - public bool HttpSSL = DefaultHttpSSL; + public uint HttpPort = DefaultSettings.DefaultMessageServerHttpPort; + public bool HttpSSL = DefaultSettings.DefaultMessageServerHttpSSL; public string MessageServerIP = String.Empty; public string UserRecvKey = String.Empty; public string UserSendKey = String.Empty; @@ -52,44 +49,44 @@ namespace OpenSim.Framework public MessageServerConfig(string description, string filename) { - configMember = + m_configMember = new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, true); - configMember.performConfigurationRetrieve(); + m_configMember.performConfigurationRetrieve(); } public void loadConfigurationOptions() { - configMember.addConfigurationOption("default_user_server", + m_configMember.addConfigurationOption("default_user_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default User Server URI", - "http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString() + "/", false); - configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + "http://127.0.0.1:" + DefaultSettings.DefaultUserServerHttpPort.ToString() + "/", false); + m_configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to user server", "null", false); - configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from user server", "null", false); - configMember.addConfigurationOption("default_grid_server", + m_configMember.addConfigurationOption("default_grid_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Grid Server URI", - "http://127.0.0.1:" + GridConfig.DefaultHttpPort.ToString() + "/", false); - configMember.addConfigurationOption("grid_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + "http://127.0.0.1:" + DefaultSettings.DefaultGridServerHttpPort.ToString() + "/", false); + m_configMember.addConfigurationOption("grid_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to grid server", "null", false); - configMember.addConfigurationOption("grid_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("grid_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from grid server", "null", false); - configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Connection String for Database", "", false); - configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Data.MySQL.dll", false); - configMember.addConfigurationOption("region_comms_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("region_comms_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for comms provider", "OpenSim.Region.Communications.OGS1.dll", false); - configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, - "Http Listener port", DefaultHttpPort.ToString(), false); - configMember.addConfigurationOption("http_ssl", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, - "Use SSL? true/false", DefaultHttpSSL.ToString(), false); - configMember.addConfigurationOption("published_ip", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, + "Http Listener port", DefaultSettings.DefaultMessageServerHttpPort.ToString(), false); + m_configMember.addConfigurationOption("http_ssl", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, + "Use SSL? true/false", DefaultSettings.DefaultMessageServerHttpSSL.ToString(), false); + m_configMember.addConfigurationOption("published_ip", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "My Published IP Address", "127.0.0.1", false); } diff --git a/OpenSim/Framework/NetworkServersInfo.cs b/OpenSim/Framework/NetworkServersInfo.cs index 23b1627..11ea709 100644 --- a/OpenSim/Framework/NetworkServersInfo.cs +++ b/OpenSim/Framework/NetworkServersInfo.cs @@ -32,15 +32,13 @@ namespace OpenSim.Framework { public class NetworkServersInfo { - public static readonly uint DefaultHttpListenerPort = 9000; - public static uint RemotingListenerPort = 8895; public string AssetSendKey = String.Empty; - public string AssetURL = "http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString() + "/"; + public string AssetURL = "http://127.0.0.1:" + DefaultSettings.DefaultAssetServerHttpPort.ToString() + "/"; public string GridRecvKey = String.Empty; public string GridSendKey = String.Empty; public string GridURL = String.Empty; - public uint HttpListenerPort = DefaultHttpListenerPort; + public uint HttpListenerPort = DefaultSettings.DefaultRegionHttpPort; public string InventoryURL = String.Empty; public bool secureInventoryServer = false; public bool isSandbox; @@ -81,31 +79,31 @@ namespace OpenSim.Framework m_defaultHomeLocY = (uint) config.Configs["StandAlone"].GetInt("default_location_y", 1000); HttpListenerPort = - (uint) config.Configs["Network"].GetInt("http_listener_port", (int) DefaultHttpListenerPort); + (uint) config.Configs["Network"].GetInt("http_listener_port", (int) DefaultSettings.DefaultRegionHttpPort); httpSSLPort = - (uint)config.Configs["Network"].GetInt("http_listener_sslport", ((int)DefaultHttpListenerPort+1)); + (uint)config.Configs["Network"].GetInt("http_listener_sslport", ((int)DefaultSettings.DefaultRegionHttpPort+1)); HttpUsesSSL = config.Configs["Network"].GetBoolean("http_listener_ssl", false); HttpSSLCN = config.Configs["Network"].GetString("http_listener_cn", "localhost"); - RemotingListenerPort = - (uint) config.Configs["Network"].GetInt("remoting_listener_port", (int) RemotingListenerPort); + DefaultSettings.DefaultRegionRemotingPort = + (uint) config.Configs["Network"].GetInt("remoting_listener_port", (int) DefaultSettings.DefaultRegionRemotingPort); GridURL = config.Configs["Network"].GetString("grid_server_url", - "http://127.0.0.1:" + GridConfig.DefaultHttpPort.ToString()); + "http://127.0.0.1:" + DefaultSettings.DefaultGridServerHttpPort.ToString()); GridSendKey = config.Configs["Network"].GetString("grid_send_key", "null"); GridRecvKey = config.Configs["Network"].GetString("grid_recv_key", "null"); UserURL = config.Configs["Network"].GetString("user_server_url", - "http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString()); + "http://127.0.0.1:" + DefaultSettings.DefaultUserServerHttpPort.ToString()); UserSendKey = config.Configs["Network"].GetString("user_send_key", "null"); UserRecvKey = config.Configs["Network"].GetString("user_recv_key", "null"); AssetURL = config.Configs["Network"].GetString("asset_server_url", AssetURL); InventoryURL = config.Configs["Network"].GetString("inventory_server_url", "http://127.0.0.1:" + - InventoryConfig.DefaultHttpPort.ToString()); + DefaultSettings.DefaultInventoryServerHttpPort.ToString()); secureInventoryServer = config.Configs["Network"].GetBoolean("secure_inventory_server", true); MessagingURL = config.Configs["Network"].GetString("messaging_server_url", - "http://127.0.0.1:" + MessageServerConfig.DefaultHttpPort); + "http://127.0.0.1:" + DefaultSettings.DefaultMessageServerHttpPort); } } } diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 202b587..8d8b25a 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -366,7 +366,7 @@ namespace OpenSim.Framework errorMessage = "needs an IP Address (IPAddress)"; } m_internalEndPoint.Port = - source.Configs[sectionName].GetInt("internal_ip_port", (int) NetworkServersInfo.DefaultHttpListenerPort); + source.Configs[sectionName].GetInt("internal_ip_port", (int) DefaultSettings.DefaultRegionHttpPort); string externalHost = source.Configs[sectionName].GetString("external_host_name", "127.0.0.1"); if (externalHost != "SYSTEMIP") @@ -412,7 +412,7 @@ namespace OpenSim.Framework "Grid Location (X Axis)", m_regionLocX.ToString(), true); configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (Y Axis)", m_regionLocY.ToString(), true); - //configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false); + //m_configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false); configMember.addConfigurationOption("internal_ip_address", ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, "Internal IP Address for incoming UDP client connections", @@ -468,14 +468,14 @@ namespace OpenSim.Framework "Grid Location (X Axis)", "1000", false); configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (Y Axis)", "1000", false); - //configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false); + //m_configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false); configMember.addConfigurationOption("internal_ip_address", ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, "Internal IP Address for incoming UDP client connections", "0.0.0.0", false); configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", - NetworkServersInfo.DefaultHttpListenerPort.ToString(), false); + DefaultSettings.DefaultRegionHttpPort.ToString(), false); configMember.addConfigurationOption("allow_alternate_ports", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Allow sim to find alternate UDP ports when ports are in use?", "false", true); diff --git a/OpenSim/Framework/UserConfig.cs b/OpenSim/Framework/UserConfig.cs index 49668af..b898f89 100644 --- a/OpenSim/Framework/UserConfig.cs +++ b/OpenSim/Framework/UserConfig.cs @@ -35,9 +35,6 @@ namespace OpenSim.Framework /// public class UserConfig:ConfigBase { - public static uint DefaultHttpPort = 8002; - public static bool DefaultHttpSSL = false; - private ConfigurationMember configMember; public string DatabaseProvider = String.Empty; public string DatabaseConnect = String.Empty; public string DefaultStartupMsg = String.Empty; @@ -45,8 +42,8 @@ namespace OpenSim.Framework public uint DefaultY = 1000; public string GridRecvKey = String.Empty; public string GridSendKey = String.Empty; - public uint HttpPort = DefaultHttpPort; - public bool HttpSSL = DefaultHttpSSL; + public uint HttpPort = DefaultSettings.DefaultUserServerHttpPort; + public bool HttpSSL = DefaultSettings.DefaultUserServerHttpSSL; public uint DefaultUserLevel = 0; public string LibraryXmlfile = ""; @@ -101,61 +98,61 @@ namespace OpenSim.Framework } public UserConfig(string description, string filename) { - configMember = + m_configMember = new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, true); - configMember.performConfigurationRetrieve(); + m_configMember.performConfigurationRetrieve(); } public void loadConfigurationOptions() { - configMember.addConfigurationOption("default_startup_message", + m_configMember.addConfigurationOption("default_startup_message", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Startup Message", "Welcome to OGS", false); - configMember.addConfigurationOption("default_grid_server", + m_configMember.addConfigurationOption("default_grid_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Grid Server URI", - "http://127.0.0.1:" + GridConfig.DefaultHttpPort + "/", false); - configMember.addConfigurationOption("grid_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + "http://127.0.0.1:" + DefaultSettings.DefaultGridServerHttpPort + "/", false); + m_configMember.addConfigurationOption("grid_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to grid server", "null", false); - configMember.addConfigurationOption("grid_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("grid_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from grid server", "null", false); - configMember.addConfigurationOption("default_inventory_server", + m_configMember.addConfigurationOption("default_inventory_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Inventory Server URI", - "http://127.0.0.1:" + InventoryConfig.DefaultHttpPort + "/", + "http://127.0.0.1:" + DefaultSettings.DefaultInventoryServerHttpPort + "/", false); - configMember.addConfigurationOption("default_authentication_server", + m_configMember.addConfigurationOption("default_authentication_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "User Server (this) External URI for authentication keys", - "http://localhost:" + UserConfig.DefaultHttpPort + "/", + "http://localhost:" + DefaultSettings.DefaultUserServerHttpPort + "/", false); - configMember.addConfigurationOption("library_location", + m_configMember.addConfigurationOption("library_location", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Path to library control file", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar), false); - configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Data.MySQL.dll", false); - configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, + m_configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Connection String for Database", "", false); - configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, - "Http Listener port", DefaultHttpPort.ToString(), false); - configMember.addConfigurationOption("http_ssl", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, - "Use SSL? true/false", DefaultHttpSSL.ToString(), false); - configMember.addConfigurationOption("default_X", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, + m_configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, + "Http Listener port", DefaultSettings.DefaultUserServerHttpPort.ToString(), false); + m_configMember.addConfigurationOption("http_ssl", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, + "Use SSL? true/false", DefaultSettings.DefaultUserServerHttpSSL.ToString(), false); + m_configMember.addConfigurationOption("default_X", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Known good region X", "1000", false); - configMember.addConfigurationOption("default_Y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, + m_configMember.addConfigurationOption("default_Y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Known good region Y", "1000", false); - configMember.addConfigurationOption("enable_llsd_login", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, + m_configMember.addConfigurationOption("enable_llsd_login", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Enable LLSD login support [Currently used by libsl based clients/bots]? true/false", true.ToString(), false); - configMember.addConfigurationOption("enable_hg_login", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, + m_configMember.addConfigurationOption("enable_hg_login", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Enable Hypergrid login support [Currently used by GridSurfer-proxied clients]? true/false", true.ToString(), false); - configMember.addConfigurationOption("default_loginLevel", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, + m_configMember.addConfigurationOption("default_loginLevel", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Minimum Level a user should have to login [0 default]", "0", false); } diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index 8aa8dde..f609cc5 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs @@ -252,16 +252,16 @@ namespace OpenSim config.Set("default_location_x", 1000); config.Set("default_location_y", 1000); - config.Set("http_listener_port", NetworkServersInfo.DefaultHttpListenerPort); - config.Set("remoting_listener_port", NetworkServersInfo.RemotingListenerPort); - config.Set("grid_server_url", "http://127.0.0.1:" + GridConfig.DefaultHttpPort.ToString()); + config.Set("http_listener_port", DefaultSettings.DefaultRegionHttpPort); + config.Set("remoting_listener_port", DefaultSettings.DefaultRegionRemotingPort); + config.Set("grid_server_url", "http://127.0.0.1:" + DefaultSettings.DefaultGridServerHttpPort.ToString()); config.Set("grid_send_key", "null"); config.Set("grid_recv_key", "null"); - config.Set("user_server_url", "http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString()); + config.Set("user_server_url", "http://127.0.0.1:" + DefaultSettings.DefaultUserServerHttpPort.ToString()); config.Set("user_send_key", "null"); config.Set("user_recv_key", "null"); - config.Set("asset_server_url", "http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString()); - config.Set("inventory_server_url", "http://127.0.0.1:" + InventoryConfig.DefaultHttpPort.ToString()); + config.Set("asset_server_url", "http://127.0.0.1:" + DefaultSettings.DefaultAssetServerHttpPort.ToString()); + config.Set("inventory_server_url", "http://127.0.0.1:" + DefaultSettings.DefaultInventoryServerHttpPort.ToString()); config.Set("secure_inventory_server", "true"); } diff --git a/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs b/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs index 43faead..05dd8e1 100644 --- a/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs +++ b/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs @@ -552,7 +552,7 @@ namespace OpenSim.Region.Communications.Hypergrid hash["region_image"] = regInfo.RegionSettings.TerrainImageID.ToString(); hash["region_name"] = regInfo.RegionName; hash["internal_port"] = regInfo.InternalEndPoint.Port.ToString(); - hash["remoting_port"] = NetworkServersInfo.RemotingListenerPort.ToString(); + hash["remoting_port"] = DefaultSettings.DefaultRegionRemotingPort.ToString(); //m_log.Debug(">> Here: " + regInfo.InternalEndPoint.Port); @@ -640,7 +640,7 @@ namespace OpenSim.Region.Communications.Hypergrid m_log.Debug(" >> " + loginParams["home_address"] + " <<"); m_log.Debug(" --------- ------------ -------"); loginParams["home_port"] = rinfo.HttpPort.ToString(); - loginParams["home_remoting"] = NetworkServersInfo.RemotingListenerPort.ToString(); ; + loginParams["home_remoting"] = DefaultSettings.DefaultRegionRemotingPort.ToString(); ; } } else diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index f47abe8..aae5d83 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -119,7 +119,7 @@ namespace OpenSim.Region.Communications.OGS1 GridParams["region_locy"] = regionInfo.RegionLocY.ToString(); GridParams["sim_name"] = regionInfo.RegionName; GridParams["http_port"] = serversInfo.HttpListenerPort.ToString(); - GridParams["remoting_port"] = NetworkServersInfo.RemotingListenerPort.ToString(); + GridParams["remoting_port"] = DefaultSettings.DefaultRegionRemotingPort.ToString(); GridParams["map-image-id"] = regionInfo.RegionSettings.TerrainImageID.ToString(); GridParams["originUUID"] = regionInfo.originRegionID.ToString(); GridParams["server_uri"] = regionInfo.ServerURI; diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs index bc7e7b2..9a768ac 100644 --- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs +++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs @@ -64,7 +64,7 @@ namespace OpenSim.Region.DataSnapshot //DataServices and networking private string m_dataServices = "noservices"; - public string m_listener_port = NetworkServersInfo.DefaultHttpListenerPort.ToString(); + public string m_listener_port = DefaultSettings.DefaultRegionHttpPort.ToString(); public string m_hostname = "127.0.0.1"; //Update timers @@ -106,15 +106,15 @@ namespace OpenSim.Region.DataSnapshot m_gridinfo.Add( "gridserverURL", config.Configs["Network"].GetString( - "grid_server_url", "http://127.0.0.1:" + GridConfig.DefaultHttpPort.ToString())); + "grid_server_url", "http://127.0.0.1:" + DefaultSettings.DefaultGridServerHttpPort.ToString())); m_gridinfo.Add( "userserverURL", config.Configs["Network"].GetString( - "user_server_url", "http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString())); + "user_server_url", "http://127.0.0.1:" + DefaultSettings.DefaultUserServerHttpPort.ToString())); m_gridinfo.Add( "assetserverURL", config.Configs["Network"].GetString( - "asset_server_url", "http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString())); + "asset_server_url", "http://127.0.0.1:" + DefaultSettings.DefaultAssetServerHttpPort.ToString())); } m_gridinfo.Add( diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 0964821..c120b24 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -8808,7 +8808,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { shard = config.Configs["Network"].GetString( - "user_server_url", "http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString()); + "user_server_url", "http://127.0.0.1:" + DefaultSettings.DefaultUserServerHttpPort.ToString()); shard = config.Configs["Network"].GetString("shard", shard); } -- cgit v1.1