*Moved network_servers_info.xml into OpenSim.ini under [Network]

afrisby
mingchen 2007-08-17 15:45:49 +00:00
parent 4a9e40ea47
commit d3660ed269
3 changed files with 41 additions and 67 deletions

View File

@ -30,6 +30,7 @@ using OpenSim.Framework.Console;
using OpenSim.Framework.Interfaces; using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Configuration; using OpenSim.Framework.Configuration;
using Nini.Config;
namespace OpenSim.Framework.Types namespace OpenSim.Framework.Types
{ {
public class NetworkServersInfo public class NetworkServersInfo
@ -48,12 +49,9 @@ namespace OpenSim.Framework.Types
public int HttpListenerPort = 9000; public int HttpListenerPort = 9000;
public int RemotingListenerPort = 8895; public int RemotingListenerPort = 8895;
private ConfigurationMember configMember;
public NetworkServersInfo(string description, string filename) public NetworkServersInfo()
{ {
configMember = new ConfigurationMember(filename, description, loadConfigurationOptions, handleConfigurationItem);
configMember.performConfigurationRetrieve();
} }
public NetworkServersInfo(uint defaultHomeLocX, uint defaultHomeLocY) public NetworkServersInfo(uint defaultHomeLocX, uint defaultHomeLocY)
@ -74,65 +72,21 @@ namespace OpenSim.Framework.Types
get { return m_defaultHomeLocY.Value; } get { return m_defaultHomeLocY.Value; }
} }
public void loadConfigurationOptions() public void loadFromConfiguration(IConfigSource config)
{ {
m_defaultHomeLocX = (uint)config.Configs["StandAlone"].GetInt("default_location_x", 1000);
m_defaultHomeLocY = (uint)config.Configs["StandAlone"].GetInt("default_location_y", 1000);
configMember.addConfigurationOption("HttpListenerPort", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "HTTP Listener Port", "9000", false); HttpListenerPort = config.Configs["Network"].GetInt("http_listener_port", 9000);
configMember.addConfigurationOption("RemotingListenerPort", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Remoting Listener Port", "8895", false); RemotingListenerPort = config.Configs["Network"].GetInt("remoting_listener_port", 8895);
configMember.addConfigurationOption("DefaultLocationX", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Default Home Location (X Axis)", "1000", false); GridURL = config.Configs["Network"].GetString("grid_server_url", "http://127.0.0.1:8001");
configMember.addConfigurationOption("DefaultLocationY", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Default Home Location (Y Axis)", "1000", false); 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:8002");
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", "http://127.0.0.1:8003");
configMember.addConfigurationOption("GridServerURL", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Grid Server URL", "http://127.0.0.1:8001", false);
configMember.addConfigurationOption("GridSendKey", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to grid server", "null", false);
configMember.addConfigurationOption("GridRecvKey", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from grid server", "null", false);
configMember.addConfigurationOption("UserServerURL", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "User Server URL", "http://127.0.0.1:8002", false);
configMember.addConfigurationOption("UserSendKey", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to user server", "null", false);
configMember.addConfigurationOption("UserRecvKey", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from user server", "null", false);
configMember.addConfigurationOption("AssetServerURL", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Asset Server URL", "http://127.0.0.1:8003", false);
}
public bool handleConfigurationItem(string configuration_key, object configuration_object)
{
switch (configuration_key)
{
case "HttpListenerPort":
this.HttpListenerPort = (int)configuration_object;
break;
case "RemotingListenerPort":
this.RemotingListenerPort = (int)configuration_object;
break;
case "DefaultLocationX":
this.m_defaultHomeLocX = (uint)configuration_object;
break;
case "DefaultLocationY":
this.m_defaultHomeLocY = (uint)configuration_object;
break;
case "GridServerURL":
this.GridURL = (string)configuration_object;
break;
case "GridSendKey":
this.GridSendKey = (string)configuration_object;
break;
case "GridRecvKey":
this.GridRecvKey = (string)configuration_object;
break;
case "UserServerURL":
this.UserURL = (string)configuration_object;
break;
case "UserSendKey":
this.UserSendKey = (string)configuration_object;
break;
case "UserRecvKey":
this.UserRecvKey = (string)configuration_object;
break;
case "AssetServerURL":
this.AssetURL = (string)configuration_object;
break;
}
return true;
} }
} }
} }

View File

@ -102,6 +102,7 @@ namespace OpenSim
protected void ReadConfigSettings(IConfigSource configSource) protected void ReadConfigSettings(IConfigSource configSource)
{ {
m_networkServersInfo = new NetworkServersInfo();
m_sandbox = !configSource.Configs["Startup"].GetBoolean("gridmode", false); m_sandbox = !configSource.Configs["Startup"].GetBoolean("gridmode", false);
m_physicsEngine = configSource.Configs["Startup"].GetString("physics", "basicphysics"); m_physicsEngine = configSource.Configs["Startup"].GetString("physics", "basicphysics");
m_silent = configSource.Configs["Startup"].GetBoolean("noverbose", false); m_silent = configSource.Configs["Startup"].GetBoolean("noverbose", false);
@ -114,6 +115,8 @@ namespace OpenSim
standaloneWelcomeMessage = configSource.Configs["StandAlone"].GetString("welcome_message", "Welcome to OpenSim"); standaloneWelcomeMessage = configSource.Configs["StandAlone"].GetString("welcome_message", "Welcome to OpenSim");
standaloneInventoryPlugin = configSource.Configs["StandAlone"].GetString("inventory_plugin", "OpenSim.Framework.Data.SQLite.dll"); standaloneInventoryPlugin = configSource.Configs["StandAlone"].GetString("inventory_plugin", "OpenSim.Framework.Data.SQLite.dll");
standaloneUserPlugin = configSource.Configs["StandAlone"].GetString("userDatabase_plugin", "OpenSim.Framework.Data.DB4o.dll"); standaloneUserPlugin = configSource.Configs["StandAlone"].GetString("userDatabase_plugin", "OpenSim.Framework.Data.DB4o.dll");
m_networkServersInfo.loadFromConfiguration(configSource);
} }
/// <summary> /// <summary>
@ -238,7 +241,6 @@ namespace OpenSim
protected override void Initialize() protected override void Initialize()
{ {
m_networkServersInfo = new NetworkServersInfo("NETWORK SERVERS INFO", Path.Combine(Util.configDir(), "network_servers_information.xml"));
m_httpServerPort = m_networkServersInfo.HttpListenerPort; m_httpServerPort = m_networkServersInfo.HttpListenerPort;
m_assetCache = new AssetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey); m_assetCache = new AssetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey);
} }

View File

@ -4,8 +4,26 @@ physics = basicphysics
storage_plugin = "OpenSim.DataStore.NullStorage.dll" storage_plugin = "OpenSim.DataStore.NullStorage.dll"
startup_console_commands_file = "startup_commands.txt" startup_console_commands_file = "startup_commands.txt"
[StandAlone] [StandAlone]
accounts_authenticate = false accounts_authenticate = false
welcome_message = "Welcome to OpenSim" welcome_message = "Welcome to OpenSim"
inventory_plugin = "OpenSim.Framework.Data.SQLite.dll" inventory_plugin = "OpenSim.Framework.Data.SQLite.dll"
userDatabase_plugin = "OpenSim.Framework.Data.DB4o.dll" userDatabase_plugin = "OpenSim.Framework.Data.DB4o.dll"
default_location_x = 1000
default_location_y = 1000
[Network]
http_listener_port = 9000
remoting_listener_port = 8895
grid_server_url = "http://127.0.0.1:8001"
grid_send_key = "null"
grid_recv_key = "null"
user_server_url = "http://127.0.0.1:8002"
user_send_key = "null"
user_recv_key = "null"
asset_server_url = "http://127.0.0.1:8003"