diff options
Diffstat (limited to 'OpenSim/Framework/General/Types')
-rw-r--r-- | OpenSim/Framework/General/Types/NetworkServersInfo.cs | 216 | ||||
-rw-r--r-- | OpenSim/Framework/General/Types/RegionInfo.cs | 244 |
2 files changed, 125 insertions, 335 deletions
diff --git a/OpenSim/Framework/General/Types/NetworkServersInfo.cs b/OpenSim/Framework/General/Types/NetworkServersInfo.cs index 6259d7b..40557be 100644 --- a/OpenSim/Framework/General/Types/NetworkServersInfo.cs +++ b/OpenSim/Framework/General/Types/NetworkServersInfo.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using OpenSim.Framework.Console; | 29 | using OpenSim.Framework.Console; |
30 | using OpenSim.Framework.Interfaces; | 30 | using OpenSim.Framework.Interfaces; |
31 | using OpenSim.Framework.Configuration; | ||
31 | 32 | ||
32 | namespace OpenSim.Framework.Types | 33 | namespace OpenSim.Framework.Types |
33 | { | 34 | { |
@@ -44,175 +45,76 @@ namespace OpenSim.Framework.Types | |||
44 | public string UserRecvKey = ""; | 45 | public string UserRecvKey = ""; |
45 | public bool isSandbox; | 46 | public bool isSandbox; |
46 | 47 | ||
47 | public uint DefaultHomeLocX = 1000; | 48 | public uint DefaultHomeLocX = 0; |
48 | public uint DefaultHomeLocY = 1000; | 49 | public uint DefaultHomeLocY = 0; |
49 | 50 | ||
50 | public int HttpListenerPort = 9000; | 51 | public int HttpListenerPort = 9000; |
51 | public int RemotingListenerPort = 8895; | 52 | public int RemotingListenerPort = 8895; |
52 | 53 | ||
53 | public void InitConfig(bool sandboxMode, IGenericConfig configData) | 54 | private ConfigurationMember configMember; |
54 | { | ||
55 | this.isSandbox = sandboxMode; | ||
56 | |||
57 | try | ||
58 | { | ||
59 | string attri = ""; | ||
60 | |||
61 | attri = ""; | ||
62 | attri = configData.GetAttribute("HttpListenerPort"); | ||
63 | if (attri == "") | ||
64 | { | ||
65 | string location = MainLog.Instance.CmdPrompt("Http Listener Port", "9000"); | ||
66 | configData.SetAttribute("HttpListenerPort", location); | ||
67 | this.HttpListenerPort = Convert.ToInt32(location); | ||
68 | } | ||
69 | else | ||
70 | { | ||
71 | this.HttpListenerPort = Convert.ToInt32(attri); | ||
72 | } | ||
73 | |||
74 | attri = ""; | ||
75 | attri = configData.GetAttribute("RemotingListenerPort"); | ||
76 | if (attri == "") | ||
77 | { | ||
78 | string location = MainLog.Instance.CmdPrompt("Remoting Listener Port", "8895"); | ||
79 | configData.SetAttribute("RemotingListenerPort", location); | ||
80 | this.RemotingListenerPort = Convert.ToInt32(location); | ||
81 | } | ||
82 | else | ||
83 | { | ||
84 | this.RemotingListenerPort = Convert.ToInt32(attri); | ||
85 | } | ||
86 | |||
87 | if (sandboxMode) | ||
88 | { | ||
89 | // default home location X | ||
90 | attri = ""; | ||
91 | attri = configData.GetAttribute("DefaultLocationX"); | ||
92 | if (attri == "") | ||
93 | { | ||
94 | string location = MainLog.Instance.CmdPrompt("Default Home Location X", "1000"); | ||
95 | configData.SetAttribute("DefaultLocationX", location); | ||
96 | this.DefaultHomeLocX = (uint)Convert.ToUInt32(location); | ||
97 | } | ||
98 | else | ||
99 | { | ||
100 | this.DefaultHomeLocX = (uint)Convert.ToUInt32(attri); | ||
101 | } | ||
102 | |||
103 | // default home location Y | ||
104 | attri = ""; | ||
105 | attri = configData.GetAttribute("DefaultLocationY"); | ||
106 | if (attri == "") | ||
107 | { | ||
108 | string location = MainLog.Instance.CmdPrompt("Default Home Location Y", "1000"); | ||
109 | configData.SetAttribute("DefaultLocationY", location); | ||
110 | this.DefaultHomeLocY = (uint)Convert.ToUInt32(location); | ||
111 | } | ||
112 | else | ||
113 | { | ||
114 | this.DefaultHomeLocY = (uint)Convert.ToUInt32(attri); | ||
115 | } | ||
116 | } | ||
117 | if (!isSandbox) | ||
118 | { | ||
119 | //Grid Server | ||
120 | attri = ""; | ||
121 | attri = configData.GetAttribute("GridServerURL"); | ||
122 | if (attri == "") | ||
123 | { | ||
124 | this.GridURL = MainLog.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:8001/"); | ||
125 | configData.SetAttribute("GridServerURL", this.GridURL); | ||
126 | } | ||
127 | else | ||
128 | { | ||
129 | this.GridURL = attri; | ||
130 | } | ||
131 | 55 | ||
132 | //Grid Send Key | 56 | public NetworkServersInfo(string description, string filename) |
133 | attri = ""; | 57 | { |
134 | attri = configData.GetAttribute("GridSendKey"); | 58 | configMember = new ConfigurationMember(filename, description, loadConfigurationOptions, handleConfigurationItem); |
135 | if (attri == "") | 59 | configMember.performConfigurationRetrieve(); |
136 | { | 60 | } |
137 | this.GridSendKey = MainLog.Instance.CmdPrompt("Key to send to grid server", "null"); | ||
138 | configData.SetAttribute("GridSendKey", this.GridSendKey); | ||
139 | } | ||
140 | else | ||
141 | { | ||
142 | this.GridSendKey = attri; | ||
143 | } | ||
144 | 61 | ||
145 | //Grid Receive Key | 62 | public void loadConfigurationOptions() |
146 | attri = ""; | 63 | { |
147 | attri = configData.GetAttribute("GridRecvKey"); | ||
148 | if (attri == "") | ||
149 | { | ||
150 | this.GridRecvKey = MainLog.Instance.CmdPrompt("Key to expect from grid server", "null"); | ||
151 | configData.SetAttribute("GridRecvKey", this.GridRecvKey); | ||
152 | } | ||
153 | else | ||
154 | { | ||
155 | this.GridRecvKey = attri; | ||
156 | } | ||
157 | 64 | ||
158 | //Grid Server | 65 | configMember.addConfigurationOption("HttpListenerPort", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "HTTP Listener Port", "9000"); |
159 | attri = ""; | 66 | configMember.addConfigurationOption("RemotingListenerPort", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Remoting Listener Port", "8895"); |
160 | attri = configData.GetAttribute("UserServerURL"); | 67 | configMember.addConfigurationOption("DefaultLocationX", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Default Home Location (X Axis)", "1000"); |
161 | if (attri == "") | 68 | configMember.addConfigurationOption("DefaultLocationY", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Default Home Location (Y Axis)", "1000"); |
162 | { | ||
163 | this.UserURL= MainLog.Instance.CmdPrompt("User server URL", "http://127.0.0.1:8002/"); | ||
164 | configData.SetAttribute("UserServerURL", this.UserURL); | ||
165 | } | ||
166 | else | ||
167 | { | ||
168 | this.UserURL = attri; | ||
169 | } | ||
170 | 69 | ||
171 | //Grid Send Key | 70 | configMember.addConfigurationOption("GridServerURL", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Grid Server URL", "http://127.0.0.1:8001"); |
172 | attri = ""; | 71 | configMember.addConfigurationOption("GridSendKey", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to grid server", "null"); |
173 | attri = configData.GetAttribute("UserSendKey"); | 72 | configMember.addConfigurationOption("GridRecvKey", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from grid server", "null"); |
174 | if (attri == "") | ||
175 | { | ||
176 | this.UserSendKey = MainLog.Instance.CmdPrompt("Key to send to user server", "null"); | ||
177 | configData.SetAttribute("UserSendKey", this.UserSendKey); | ||
178 | } | ||
179 | else | ||
180 | { | ||
181 | this.UserSendKey = attri; | ||
182 | } | ||
183 | 73 | ||
184 | //Grid Receive Key | 74 | configMember.addConfigurationOption("UserServerURL", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "User Server URL", "http://127.0.0.1:8002"); |
185 | attri = ""; | 75 | configMember.addConfigurationOption("UserSendKey", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to user server", "null"); |
186 | attri = configData.GetAttribute("UserRecvKey"); | 76 | configMember.addConfigurationOption("UserRecvKey", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from user server", "null"); |
187 | if (attri == "") | ||
188 | { | ||
189 | this.UserRecvKey = MainLog.Instance.CmdPrompt("Key to expect from user server", "null"); | ||
190 | configData.SetAttribute("UserRecvKey", this.UserRecvKey); | ||
191 | } | ||
192 | else | ||
193 | { | ||
194 | this.UserRecvKey = attri; | ||
195 | } | ||
196 | 77 | ||
197 | attri = ""; | 78 | configMember.addConfigurationOption("AssetServerURL", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Asset Server URL", "http://127.0.0.1:8003"); |
198 | attri = configData.GetAttribute("AssetServerURL"); | 79 | } |
199 | if (attri == "") | ||
200 | { | ||
201 | this.AssetURL = MainLog.Instance.CmdPrompt("Asset server URL", "http://127.0.0.1:8003/"); | ||
202 | configData.SetAttribute("AssetServerURL", this.GridURL); | ||
203 | } | ||
204 | else | ||
205 | { | ||
206 | this.AssetURL = attri; | ||
207 | } | ||
208 | 80 | ||
209 | } | 81 | public void handleConfigurationItem(string configuration_key, object configuration_object) |
210 | configData.Commit(); | 82 | { |
211 | } | 83 | switch (configuration_key) |
212 | catch (Exception e) | ||
213 | { | 84 | { |
214 | MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); | 85 | case "HttpListenerPort": |
215 | MainLog.Instance.Warn(e.ToString()); | 86 | this.HttpListenerPort = (int)configuration_object; |
87 | break; | ||
88 | case "RemotingListenerPort": | ||
89 | this.RemotingListenerPort = (int)configuration_object; | ||
90 | break; | ||
91 | case "DefaultLocationX": | ||
92 | this.DefaultHomeLocX = (uint)configuration_object; | ||
93 | break; | ||
94 | case "DefaultLocationY": | ||
95 | this.DefaultHomeLocY = (uint)configuration_object; | ||
96 | break; | ||
97 | case "GridServerURL": | ||
98 | this.GridURL = (string)configuration_object; | ||
99 | break; | ||
100 | case "GridSendKey": | ||
101 | this.GridSendKey = (string)configuration_object; | ||
102 | break; | ||
103 | case "GridRecvKey": | ||
104 | this.GridRecvKey = (string)configuration_object; | ||
105 | break; | ||
106 | case "UserServerURL": | ||
107 | this.UserURL = (string)configuration_object; | ||
108 | break; | ||
109 | case "UserSendKey": | ||
110 | this.UserSendKey = (string)configuration_object; | ||
111 | break; | ||
112 | case "UserRecvKey": | ||
113 | this.UserRecvKey = (string)configuration_object; | ||
114 | break; | ||
115 | case "AssetServerURL": | ||
116 | this.AssetURL = (string)configuration_object; | ||
117 | break; | ||
216 | } | 118 | } |
217 | } | 119 | } |
218 | } | 120 | } |
diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs index 251d7f8..b7c35c7 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/Types/RegionInfo.cs | |||
@@ -34,6 +34,8 @@ using OpenSim.Framework.Console; | |||
34 | using OpenSim.Framework.Interfaces; | 34 | using OpenSim.Framework.Interfaces; |
35 | using OpenSim.Framework.Utilities; | 35 | using OpenSim.Framework.Utilities; |
36 | 36 | ||
37 | using OpenSim.Framework.Configuration; | ||
38 | |||
37 | namespace OpenSim.Framework.Types | 39 | namespace OpenSim.Framework.Types |
38 | { | 40 | { |
39 | public class RegionInfo | 41 | public class RegionInfo |
@@ -71,11 +73,11 @@ namespace OpenSim.Framework.Types | |||
71 | } | 73 | } |
72 | 74 | ||
73 | } | 75 | } |
74 | 76 | ||
75 | return new IPEndPoint(ia, m_internalEndPoint.Port); | 77 | return new IPEndPoint(ia, m_internalEndPoint.Port); |
76 | } | 78 | } |
77 | } | 79 | } |
78 | 80 | ||
79 | private string m_externalHostName; | 81 | private string m_externalHostName; |
80 | public string ExternalHostName | 82 | public string ExternalHostName |
81 | { | 83 | { |
@@ -117,7 +119,6 @@ namespace OpenSim.Framework.Types | |||
117 | } | 119 | } |
118 | } | 120 | } |
119 | 121 | ||
120 | // Only used for remote regions , ie ones not in the current instance | ||
121 | private uint m_remotingPort; | 122 | private uint m_remotingPort; |
122 | public uint RemotingPort | 123 | public uint RemotingPort |
123 | { | 124 | { |
@@ -142,14 +143,18 @@ namespace OpenSim.Framework.Types | |||
142 | 143 | ||
143 | public EstateSettings estateSettings; | 144 | public EstateSettings estateSettings; |
144 | 145 | ||
145 | public RegionInfo() | 146 | public ConfigurationMember configMember; |
147 | public RegionInfo(string description, string filename) | ||
146 | { | 148 | { |
147 | estateSettings = new EstateSettings(); | 149 | estateSettings = new EstateSettings(); |
150 | configMember = new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration); | ||
151 | configMember.performConfigurationRetrieve(); | ||
148 | } | 152 | } |
149 | 153 | ||
150 | public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) | 154 | public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) |
151 | : this() | ||
152 | { | 155 | { |
156 | |||
157 | estateSettings = new EstateSettings(); | ||
153 | m_regionLocX = regionLocX; | 158 | m_regionLocX = regionLocX; |
154 | m_regionLocY = regionLocY; | 159 | m_regionLocY = regionLocY; |
155 | 160 | ||
@@ -157,187 +162,70 @@ namespace OpenSim.Framework.Types | |||
157 | m_externalHostName = externalUri; | 162 | m_externalHostName = externalUri; |
158 | } | 163 | } |
159 | 164 | ||
160 | public void InitConfig(bool sandboxMode, IGenericConfig configData) | 165 | public void loadConfigurationOptions() |
161 | { | ||
162 | this.isSandbox = sandboxMode; | ||
163 | try | ||
164 | { | ||
165 | string attri = ""; | ||
166 | |||
167 | // Sim UUID | ||
168 | string simId = configData.GetAttribute("SimUUID"); | ||
169 | if (String.IsNullOrEmpty( simId )) | ||
170 | { | ||
171 | this.SimUUID = LLUUID.Random(); | ||
172 | } | ||
173 | else | ||
174 | { | ||
175 | this.SimUUID = new LLUUID(simId); | ||
176 | } | ||
177 | configData.SetAttribute("SimUUID", this.SimUUID.ToString()); | ||
178 | |||
179 | this.RegionName = GetString(configData, "SimName", "OpenSim test", "Region Name"); | ||
180 | |||
181 | //m_regionLocX = (uint) GetInt(configData, "SimLocationX", 1000, "Grid Location X"); | ||
182 | |||
183 | attri = ""; | ||
184 | attri = configData.GetAttribute("SimLocationX"); | ||
185 | if (attri == "") | ||
186 | { | ||
187 | string location = MainLog.Instance.CmdPrompt("Grid Location X", "1000"); | ||
188 | configData.SetAttribute("SimLocationX", location); | ||
189 | m_regionLocX = (uint)Convert.ToUInt32(location); | ||
190 | } | ||
191 | else | ||
192 | { | ||
193 | m_regionLocX = (uint)Convert.ToUInt32(attri); | ||
194 | } | ||
195 | // Sim/Grid location Y | ||
196 | attri = ""; | ||
197 | attri = configData.GetAttribute("SimLocationY"); | ||
198 | if (attri == "") | ||
199 | { | ||
200 | string location = MainLog.Instance.CmdPrompt("Grid Location Y", "1000"); | ||
201 | configData.SetAttribute("SimLocationY", location); | ||
202 | m_regionLocY = (uint)Convert.ToUInt32(location); | ||
203 | } | ||
204 | else | ||
205 | { | ||
206 | m_regionLocY = (uint)Convert.ToUInt32(attri); | ||
207 | } | ||
208 | |||
209 | m_regionHandle = null; | ||
210 | |||
211 | this.DataStore = GetString(configData, "Datastore", "localworld.yap", "Filename for local storage"); | ||
212 | |||
213 | string internalAddress = GetString(configData, "InternalIPAddress", "0.0.0.0", "Internal IP Address for UDP client connections").ToString(); | ||
214 | int internalPort = GetIPPort(configData, "InternalIPPort", "9000", "Internal IP Port for UDP client connections"); | ||
215 | IPAddress internalIPAddress = Util.GetHostFromDNS(internalAddress); | ||
216 | m_internalEndPoint = new IPEndPoint(internalIPAddress, internalPort); | ||
217 | |||
218 | m_externalHostName = GetString(configData, "ExternalHostName", "127.0.0.1", "External Host Name"); | ||
219 | |||
220 | estateSettings.terrainFile = | ||
221 | GetString(configData, "TerrainFile", "default.r32", "GENERAL SETTING: Default Terrain File"); | ||
222 | |||
223 | attri = ""; | ||
224 | attri = configData.GetAttribute("TerrainMultiplier"); | ||
225 | if (attri == "") | ||
226 | { | ||
227 | string re = MainLog.Instance.CmdPrompt("GENERAL SETTING: Terrain Height Multiplier", "60.0"); | ||
228 | this.estateSettings.terrainMultiplier = Convert.ToDouble(re, CultureInfo.InvariantCulture); | ||
229 | configData.SetAttribute("TerrainMultiplier", this.estateSettings.terrainMultiplier.ToString()); | ||
230 | } | ||
231 | else | ||
232 | { | ||
233 | this.estateSettings.terrainMultiplier = Convert.ToDouble(attri); | ||
234 | } | ||
235 | |||
236 | attri = ""; | ||
237 | attri = configData.GetAttribute("MasterAvatarFirstName"); | ||
238 | if (attri == "") | ||
239 | { | ||
240 | this.MasterAvatarFirstName = MainLog.Instance.CmdPrompt("First name of Master Avatar (Land and Region Owner)", "Test"); | ||
241 | |||
242 | configData.SetAttribute("MasterAvatarFirstName", this.MasterAvatarFirstName); | ||
243 | } | ||
244 | else | ||
245 | { | ||
246 | this.MasterAvatarFirstName = attri; | ||
247 | } | ||
248 | |||
249 | attri = ""; | ||
250 | attri = configData.GetAttribute("MasterAvatarLastName"); | ||
251 | if (attri == "") | ||
252 | { | ||
253 | this.MasterAvatarLastName = MainLog.Instance.CmdPrompt("Last name of Master Avatar (Land and Region Owner)", "User"); | ||
254 | |||
255 | configData.SetAttribute("MasterAvatarLastName", this.MasterAvatarLastName); | ||
256 | } | ||
257 | else | ||
258 | { | ||
259 | this.MasterAvatarLastName = attri; | ||
260 | } | ||
261 | |||
262 | if (isSandbox) //Sandbox Mode Specific Settings | ||
263 | { | ||
264 | attri = ""; | ||
265 | attri = configData.GetAttribute("MasterAvatarSandboxPassword"); | ||
266 | if (attri == "") | ||
267 | { | ||
268 | this.MasterAvatarSandboxPassword = MainLog.Instance.CmdPrompt("Password of Master Avatar (Needed for sandbox mode account creation only)", "test"); | ||
269 | |||
270 | //Should I store this? | ||
271 | configData.SetAttribute("MasterAvatarSandboxPassword", this.MasterAvatarSandboxPassword); | ||
272 | } | ||
273 | else | ||
274 | { | ||
275 | this.MasterAvatarSandboxPassword = attri; | ||
276 | } | ||
277 | } | ||
278 | |||
279 | configData.Commit(); | ||
280 | } | ||
281 | catch (Exception e) | ||
282 | { | ||
283 | MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); | ||
284 | MainLog.Instance.Warn(e.ToString()); | ||
285 | } | ||
286 | |||
287 | MainLog.Instance.Verbose("Sim settings loaded:"); | ||
288 | MainLog.Instance.Verbose("UUID: " + this.SimUUID.ToStringHyphenated()); | ||
289 | MainLog.Instance.Verbose("Name: " + this.RegionName); | ||
290 | MainLog.Instance.Verbose("Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); | ||
291 | MainLog.Instance.Verbose("Region Handle: " + this.RegionHandle.ToString()); | ||
292 | MainLog.Instance.Verbose("Listening on IP end point: " + m_internalEndPoint.ToString() ); | ||
293 | MainLog.Instance.Verbose("Sandbox Mode? " + isSandbox.ToString()); | ||
294 | |||
295 | } | ||
296 | |||
297 | private uint GetInt(IGenericConfig configData, string p, int p_3, string p_4) | ||
298 | { | 166 | { |
299 | throw new Exception("The method or operation is not implemented."); | 167 | configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "UUID of Simulator (Default is recommended, random UUID)", LLUUID.Random().ToString()); |
300 | } | 168 | configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Simulator Name", "OpenSim Test"); |
301 | 169 | configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (X Axis)", "1000"); | |
302 | private string GetString(IGenericConfig configData, string attrName, string defaultvalue, string prompt) | 170 | configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (Y Axis)", "1000"); |
303 | { | 171 | configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Filename for local storage", "localworld.yap"); |
304 | string s = configData.GetAttribute(attrName); | 172 | configMember.addConfigurationOption("internal_ip_address", ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, "Internal IP Address for incoming UDP client connections", "0.0.0.0"); |
173 | configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", "9000"); | ||
174 | configMember.addConfigurationOption("external_host_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "External Host Name", "127.0.0.1"); | ||
175 | configMember.addConfigurationOption("terrain_file", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Default Terrain File", "default.r32"); | ||
176 | configMember.addConfigurationOption("terrain_multiplier", ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, "Terrain Height Multiplier", "60.0"); | ||
177 | configMember.addConfigurationOption("master_avatar_first", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "First Name of Master Avatar", "Test"); | ||
178 | configMember.addConfigurationOption("master_avatar_last", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Last Name of Master Avatar", "User"); | ||
179 | configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "(Sandbox Mode Only)Password for Master Avatar account", "test"); | ||
305 | 180 | ||
306 | if (String.IsNullOrEmpty( s )) | ||
307 | { | ||
308 | s = MainLog.Instance.CmdPrompt(prompt, defaultvalue); | ||
309 | configData.SetAttribute(attrName, s ); | ||
310 | } | ||
311 | return s; | ||
312 | } | 181 | } |
313 | 182 | ||
314 | private IPAddress GetIPAddress(IGenericConfig configData, string attrName, string defaultvalue, string prompt) | 183 | public void handleIncomingConfiguration(string configuration_key, object configuration_result) |
315 | { | 184 | { |
316 | string addressStr = configData.GetAttribute(attrName); | 185 | switch (configuration_key) |
317 | |||
318 | IPAddress address; | ||
319 | |||
320 | if (!IPAddress.TryParse(addressStr, out address)) | ||
321 | { | 186 | { |
322 | address = MainLog.Instance.CmdPromptIPAddress(prompt, defaultvalue); | 187 | case "sim_UUID": |
323 | configData.SetAttribute(attrName, address.ToString()); | 188 | this.SimUUID = (LLUUID)configuration_result; |
189 | break; | ||
190 | case "sim_name": | ||
191 | this.RegionName = (string)configuration_result; | ||
192 | break; | ||
193 | case "sim_location_x": | ||
194 | this.m_regionLocX = (uint)configuration_result; | ||
195 | break; | ||
196 | case "sim_location_y": | ||
197 | this.m_regionLocY = (uint)configuration_result; | ||
198 | break; | ||
199 | case "datastore": | ||
200 | this.DataStore = (string)configuration_result; | ||
201 | break; | ||
202 | case "internal_ip_address": | ||
203 | IPAddress address = (IPAddress)configuration_result; | ||
204 | this.m_internalEndPoint = new IPEndPoint(address, 0); | ||
205 | break; | ||
206 | case "internal_ip_port": | ||
207 | this.m_internalEndPoint.Port = (int)configuration_result; | ||
208 | break; | ||
209 | case "external_host_name": | ||
210 | this.m_externalHostName = (string)configuration_result; | ||
211 | break; | ||
212 | case "terrain_file": | ||
213 | this.estateSettings.terrainFile = (string)configuration_result; | ||
214 | break; | ||
215 | case "terrain_multiplier": | ||
216 | this.estateSettings.terrainMultiplier = (double)configuration_result; | ||
217 | break; | ||
218 | case "master_avatar_first": | ||
219 | this.MasterAvatarFirstName = (string)configuration_result; | ||
220 | break; | ||
221 | case "master_avatar_last": | ||
222 | this.MasterAvatarLastName = (string)configuration_result; | ||
223 | break; | ||
224 | case "master_avatar_pass": | ||
225 | this.MasterAvatarSandboxPassword = (string)configuration_result; | ||
226 | break; | ||
324 | } | 227 | } |
325 | return address; | ||
326 | } | 228 | } |
327 | |||
328 | private int GetIPPort(IGenericConfig configData, string attrName, string defaultvalue, string prompt) | ||
329 | { | ||
330 | string portStr = configData.GetAttribute(attrName); | ||
331 | 229 | ||
332 | int port; | ||
333 | |||
334 | if (!int.TryParse(portStr, out port)) | ||
335 | { | ||
336 | port = MainLog.Instance.CmdPromptIPPort(prompt, defaultvalue); | ||
337 | configData.SetAttribute(attrName, port.ToString()); | ||
338 | } | ||
339 | |||
340 | return port; | ||
341 | } | ||
342 | } | 230 | } |
343 | } | 231 | } |