aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authormingchen2007-08-17 15:45:49 +0000
committermingchen2007-08-17 15:45:49 +0000
commitd3660ed2692863757214f92c02b5b9e9d7f683cf (patch)
tree2595969e44eb13c34ca5c9231629971aef814f4f /OpenSim
parent* Added support for the IMG-format loader to terrain's load-tile function. (diff)
downloadopensim-SC-d3660ed2692863757214f92c02b5b9e9d7f683cf.zip
opensim-SC-d3660ed2692863757214f92c02b5b9e9d7f683cf.tar.gz
opensim-SC-d3660ed2692863757214f92c02b5b9e9d7f683cf.tar.bz2
opensim-SC-d3660ed2692863757214f92c02b5b9e9d7f683cf.tar.xz
*Moved network_servers_info.xml into OpenSim.ini under [Network]
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/General/Types/NetworkServersInfo.cs76
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs12
2 files changed, 22 insertions, 66 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;
30using OpenSim.Framework.Interfaces; 30using OpenSim.Framework.Interfaces;
31using OpenSim.Framework.Configuration; 31using OpenSim.Framework.Configuration;
32 32
33using Nini.Config;
33namespace OpenSim.Framework.Types 34namespace 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}
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index 71fa2c0..e58fb2a 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -102,6 +102,7 @@ namespace OpenSim
102 102
103 protected void ReadConfigSettings(IConfigSource configSource) 103 protected void ReadConfigSettings(IConfigSource configSource)
104 { 104 {
105 m_networkServersInfo = new NetworkServersInfo();
105 m_sandbox = !configSource.Configs["Startup"].GetBoolean("gridmode", false); 106 m_sandbox = !configSource.Configs["Startup"].GetBoolean("gridmode", false);
106 m_physicsEngine = configSource.Configs["Startup"].GetString("physics", "basicphysics"); 107 m_physicsEngine = configSource.Configs["Startup"].GetString("physics", "basicphysics");
107 m_silent = configSource.Configs["Startup"].GetBoolean("noverbose", false); 108 m_silent = configSource.Configs["Startup"].GetBoolean("noverbose", false);
@@ -114,6 +115,8 @@ namespace OpenSim
114 standaloneWelcomeMessage = configSource.Configs["StandAlone"].GetString("welcome_message", "Welcome to OpenSim"); 115 standaloneWelcomeMessage = configSource.Configs["StandAlone"].GetString("welcome_message", "Welcome to OpenSim");
115 standaloneInventoryPlugin = configSource.Configs["StandAlone"].GetString("inventory_plugin", "OpenSim.Framework.Data.SQLite.dll"); 116 standaloneInventoryPlugin = configSource.Configs["StandAlone"].GetString("inventory_plugin", "OpenSim.Framework.Data.SQLite.dll");
116 standaloneUserPlugin = configSource.Configs["StandAlone"].GetString("userDatabase_plugin", "OpenSim.Framework.Data.DB4o.dll"); 117 standaloneUserPlugin = configSource.Configs["StandAlone"].GetString("userDatabase_plugin", "OpenSim.Framework.Data.DB4o.dll");
118
119 m_networkServersInfo.loadFromConfiguration(configSource);
117 } 120 }
118 121
119 /// <summary> 122 /// <summary>
@@ -134,9 +137,9 @@ namespace OpenSim
134 if (m_sandbox) 137 if (m_sandbox)
135 { 138 {
136 CommunicationsLocal.LocalSettings settings = new CommunicationsLocal.LocalSettings(standaloneWelcomeMessage, standaloneAuthenticate, standaloneInventoryPlugin, standaloneUserPlugin); 139 CommunicationsLocal.LocalSettings settings = new CommunicationsLocal.LocalSettings(standaloneWelcomeMessage, standaloneAuthenticate, standaloneInventoryPlugin, standaloneUserPlugin);
137 CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, settings); 140 CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, settings);
138 m_commsManager = localComms; 141 m_commsManager = localComms;
139 if(standaloneAuthenticate) 142 if (standaloneAuthenticate)
140 { 143 {
141 this.CreateAccount = localComms.doCreate; 144 this.CreateAccount = localComms.doCreate;
142 } 145 }
@@ -164,7 +167,7 @@ namespace OpenSim
164 167
165 // Load all script engines found 168 // Load all script engines found
166 OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineLoader ScriptEngineLoader = new OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineLoader(m_log); 169 OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineLoader ScriptEngineLoader = new OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineLoader(m_log);
167 170
168 for (int i = 0; i < configFiles.Length; i++) 171 for (int i = 0; i < configFiles.Length; i++)
169 { 172 {
170 //Console.WriteLine("Loading region config file"); 173 //Console.WriteLine("Loading region config file");
@@ -174,7 +177,7 @@ namespace OpenSim
174 UDPServer udpServer; 177 UDPServer udpServer;
175 Scene scene = SetupScene(regionInfo, out udpServer); 178 Scene scene = SetupScene(regionInfo, out udpServer);
176 179
177 180
178 OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface ScriptEngine = ScriptEngineLoader.LoadScriptEngine("DotNetEngine"); 181 OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface ScriptEngine = ScriptEngineLoader.LoadScriptEngine("DotNetEngine");
179 scene.AddScriptEngine(ScriptEngine, m_log); 182 scene.AddScriptEngine(ScriptEngine, m_log);
180 // TODO: TEMP load default script 183 // TODO: TEMP load default script
@@ -238,7 +241,6 @@ namespace OpenSim
238 241
239 protected override void Initialize() 242 protected override void Initialize()
240 { 243 {
241 m_networkServersInfo = new NetworkServersInfo("NETWORK SERVERS INFO", Path.Combine(Util.configDir(), "network_servers_information.xml"));
242 m_httpServerPort = m_networkServersInfo.HttpListenerPort; 244 m_httpServerPort = m_networkServersInfo.HttpListenerPort;
243 m_assetCache = new AssetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey); 245 m_assetCache = new AssetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey);
244 } 246 }