diff options
author | mingchen | 2007-08-17 15:45:49 +0000 |
---|---|---|
committer | mingchen | 2007-08-17 15:45:49 +0000 |
commit | d3660ed2692863757214f92c02b5b9e9d7f683cf (patch) | |
tree | 2595969e44eb13c34ca5c9231629971aef814f4f /OpenSim/Framework/General/Types | |
parent | * Added support for the IMG-format loader to terrain's load-tile function. (diff) | |
download | opensim-SC_OLD-d3660ed2692863757214f92c02b5b9e9d7f683cf.zip opensim-SC_OLD-d3660ed2692863757214f92c02b5b9e9d7f683cf.tar.gz opensim-SC_OLD-d3660ed2692863757214f92c02b5b9e9d7f683cf.tar.bz2 opensim-SC_OLD-d3660ed2692863757214f92c02b5b9e9d7f683cf.tar.xz |
*Moved network_servers_info.xml into OpenSim.ini under [Network]
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/General/Types/NetworkServersInfo.cs | 76 |
1 files changed, 15 insertions, 61 deletions
diff --git a/OpenSim/Framework/General/Types/NetworkServersInfo.cs b/OpenSim/Framework/General/Types/NetworkServersInfo.cs index ae19aff..4ccd5df 100644 --- a/OpenSim/Framework/General/Types/NetworkServersInfo.cs +++ b/OpenSim/Framework/General/Types/NetworkServersInfo.cs | |||
@@ -30,6 +30,7 @@ using OpenSim.Framework.Console; | |||
30 | using OpenSim.Framework.Interfaces; | 30 | using OpenSim.Framework.Interfaces; |
31 | using OpenSim.Framework.Configuration; | 31 | using OpenSim.Framework.Configuration; |
32 | 32 | ||
33 | using Nini.Config; | ||
33 | namespace OpenSim.Framework.Types | 34 | namespace OpenSim.Framework.Types |
34 | { | 35 | { |
35 | public class NetworkServersInfo | 36 | public class NetworkServersInfo |
@@ -48,15 +49,12 @@ namespace OpenSim.Framework.Types | |||
48 | public int HttpListenerPort = 9000; | 49 | public int HttpListenerPort = 9000; |
49 | public int RemotingListenerPort = 8895; | 50 | public int RemotingListenerPort = 8895; |
50 | 51 | ||
51 | private ConfigurationMember configMember; | ||
52 | 52 | ||
53 | public NetworkServersInfo(string description, string filename) | 53 | public NetworkServersInfo() |
54 | { | 54 | { |
55 | configMember = new ConfigurationMember(filename, description, loadConfigurationOptions, handleConfigurationItem); | ||
56 | configMember.performConfigurationRetrieve(); | ||
57 | } | 55 | } |
58 | 56 | ||
59 | public NetworkServersInfo( uint defaultHomeLocX, uint defaultHomeLocY ) | 57 | public NetworkServersInfo(uint defaultHomeLocX, uint defaultHomeLocY) |
60 | { | 58 | { |
61 | m_defaultHomeLocX = defaultHomeLocX; | 59 | m_defaultHomeLocX = defaultHomeLocX; |
62 | m_defaultHomeLocY = defaultHomeLocY; | 60 | m_defaultHomeLocY = defaultHomeLocY; |
@@ -74,65 +72,21 @@ namespace OpenSim.Framework.Types | |||
74 | get { return m_defaultHomeLocY.Value; } | 72 | get { return m_defaultHomeLocY.Value; } |
75 | } | 73 | } |
76 | 74 | ||
77 | public void loadConfigurationOptions() | 75 | public void loadFromConfiguration(IConfigSource config) |
78 | { | 76 | { |
77 | m_defaultHomeLocX = (uint)config.Configs["StandAlone"].GetInt("default_location_x", 1000); | ||
78 | m_defaultHomeLocY = (uint)config.Configs["StandAlone"].GetInt("default_location_y", 1000); | ||
79 | 79 | ||
80 | configMember.addConfigurationOption("HttpListenerPort", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "HTTP Listener Port", "9000", false); | 80 | HttpListenerPort = config.Configs["Network"].GetInt("http_listener_port", 9000); |
81 | configMember.addConfigurationOption("RemotingListenerPort", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Remoting Listener Port", "8895", false); | 81 | RemotingListenerPort = config.Configs["Network"].GetInt("remoting_listener_port", 8895); |
82 | configMember.addConfigurationOption("DefaultLocationX", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Default Home Location (X Axis)", "1000", false); | 82 | GridURL = config.Configs["Network"].GetString("grid_server_url", "http://127.0.0.1:8001"); |
83 | configMember.addConfigurationOption("DefaultLocationY", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Default Home Location (Y Axis)", "1000", false); | 83 | GridSendKey = config.Configs["Network"].GetString("grid_send_key", "null"); |
84 | GridRecvKey = config.Configs["Network"].GetString("grid_recv_key", "null"); | ||
85 | UserURL = config.Configs["Network"].GetString("user_server_url", "http://127.0.0.1:8002"); | ||
86 | UserSendKey = config.Configs["Network"].GetString("user_send_key", "null"); | ||
87 | UserRecvKey = config.Configs["Network"].GetString("user_recv_key", "null"); | ||
88 | AssetURL = config.Configs["Network"].GetString("asset_server_url", "http://127.0.0.1:8003"); | ||
84 | 89 | ||
85 | configMember.addConfigurationOption("GridServerURL", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Grid Server URL", "http://127.0.0.1:8001", false); | ||
86 | configMember.addConfigurationOption("GridSendKey", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to grid server", "null", false); | ||
87 | configMember.addConfigurationOption("GridRecvKey", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from grid server", "null", false); | ||
88 | |||
89 | configMember.addConfigurationOption("UserServerURL", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "User Server URL", "http://127.0.0.1:8002", false); | ||
90 | configMember.addConfigurationOption("UserSendKey", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to user server", "null", false); | ||
91 | configMember.addConfigurationOption("UserRecvKey", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from user server", "null", false); | ||
92 | |||
93 | configMember.addConfigurationOption("AssetServerURL", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Asset Server URL", "http://127.0.0.1:8003", false); | ||
94 | } | ||
95 | |||
96 | public bool handleConfigurationItem(string configuration_key, object configuration_object) | ||
97 | { | ||
98 | switch (configuration_key) | ||
99 | { | ||
100 | case "HttpListenerPort": | ||
101 | this.HttpListenerPort = (int)configuration_object; | ||
102 | break; | ||
103 | case "RemotingListenerPort": | ||
104 | this.RemotingListenerPort = (int)configuration_object; | ||
105 | break; | ||
106 | case "DefaultLocationX": | ||
107 | this.m_defaultHomeLocX = (uint)configuration_object; | ||
108 | break; | ||
109 | case "DefaultLocationY": | ||
110 | this.m_defaultHomeLocY = (uint)configuration_object; | ||
111 | break; | ||
112 | case "GridServerURL": | ||
113 | this.GridURL = (string)configuration_object; | ||
114 | break; | ||
115 | case "GridSendKey": | ||
116 | this.GridSendKey = (string)configuration_object; | ||
117 | break; | ||
118 | case "GridRecvKey": | ||
119 | this.GridRecvKey = (string)configuration_object; | ||
120 | break; | ||
121 | case "UserServerURL": | ||
122 | this.UserURL = (string)configuration_object; | ||
123 | break; | ||
124 | case "UserSendKey": | ||
125 | this.UserSendKey = (string)configuration_object; | ||
126 | break; | ||
127 | case "UserRecvKey": | ||
128 | this.UserRecvKey = (string)configuration_object; | ||
129 | break; | ||
130 | case "AssetServerURL": | ||
131 | this.AssetURL = (string)configuration_object; | ||
132 | break; | ||
133 | } | ||
134 | |||
135 | return true; | ||
136 | } | 90 | } |
137 | } | 91 | } |
138 | } | 92 | } |