diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/General/RegionInfo.cs (renamed from OpenSim/Framework/General/Types/RegionInfo.cs) | 697 |
1 files changed, 347 insertions, 350 deletions
diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/RegionInfo.cs index 49360f8..32f0c76 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/RegionInfo.cs | |||
@@ -1,350 +1,347 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using System; | 28 | using System; |
29 | using System.Globalization; | 29 | using System.Globalization; |
30 | using System.Net; | 30 | using System.Net; |
31 | using System.Net.Sockets; | 31 | using System.Net.Sockets; |
32 | using Nini.Config; | 32 | using Nini.Config; |
33 | using libsecondlife; | 33 | using libsecondlife; |
34 | using OpenSim.Framework.Console; | 34 | using OpenSim.Framework.Console; |
35 | using OpenSim.Framework.Interfaces; | 35 | using OpenSim.Framework.Interfaces; |
36 | using OpenSim.Framework.Utilities; | 36 | using OpenSim.Framework; |
37 | 37 | ||
38 | using OpenSim.Framework.Configuration; | 38 | namespace OpenSim.Framework |
39 | 39 | { | |
40 | 40 | public class SimpleRegionInfo | |
41 | namespace OpenSim.Framework.Types | 41 | { |
42 | { | 42 | public SimpleRegionInfo() |
43 | public class SimpleRegionInfo | 43 | { |
44 | { | 44 | } |
45 | public SimpleRegionInfo() | 45 | |
46 | { | 46 | public SimpleRegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) |
47 | } | 47 | { |
48 | 48 | ||
49 | public SimpleRegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) | 49 | m_regionLocX = regionLocX; |
50 | { | 50 | m_regionLocY = regionLocY; |
51 | 51 | ||
52 | m_regionLocX = regionLocX; | 52 | m_internalEndPoint = internalEndPoint; |
53 | m_regionLocY = regionLocY; | 53 | m_externalHostName = externalUri; |
54 | 54 | } | |
55 | m_internalEndPoint = internalEndPoint; | 55 | |
56 | m_externalHostName = externalUri; | 56 | public SimpleRegionInfo(uint regionLocX, uint regionLocY, string externalUri, int port) |
57 | } | 57 | { |
58 | 58 | ||
59 | public SimpleRegionInfo(uint regionLocX, uint regionLocY, string externalUri, int port) | 59 | m_regionLocX = regionLocX; |
60 | { | 60 | m_regionLocY = regionLocY; |
61 | 61 | ||
62 | m_regionLocX = regionLocX; | 62 | m_externalHostName = externalUri; |
63 | m_regionLocY = regionLocY; | 63 | |
64 | 64 | m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), port); | |
65 | m_externalHostName = externalUri; | 65 | } |
66 | 66 | ||
67 | m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), port); | 67 | public LLUUID RegionID = new LLUUID(); |
68 | } | 68 | |
69 | 69 | private uint m_remotingPort; | |
70 | public LLUUID RegionID = new LLUUID(); | 70 | public uint RemotingPort |
71 | 71 | { | |
72 | private uint m_remotingPort; | 72 | get |
73 | public uint RemotingPort | 73 | { |
74 | { | 74 | return m_remotingPort; |
75 | get | 75 | } |
76 | { | 76 | set |
77 | return m_remotingPort; | 77 | { |
78 | } | 78 | m_remotingPort = value; |
79 | set | 79 | } |
80 | { | 80 | } |
81 | m_remotingPort = value; | 81 | |
82 | } | 82 | public string RemotingAddress; |
83 | } | 83 | |
84 | 84 | ||
85 | public string RemotingAddress; | 85 | public IPEndPoint ExternalEndPoint |
86 | 86 | { | |
87 | 87 | get | |
88 | public IPEndPoint ExternalEndPoint | 88 | { |
89 | { | 89 | // Old one defaults to IPv6 |
90 | get | 90 | //return new IPEndPoint( Dns.GetHostAddresses( m_externalHostName )[0], m_internalEndPoint.Port ); |
91 | { | 91 | |
92 | // Old one defaults to IPv6 | 92 | IPAddress ia = null; |
93 | //return new IPEndPoint( Dns.GetHostAddresses( m_externalHostName )[0], m_internalEndPoint.Port ); | 93 | // If it is already an IP, don't resolve it - just return directly |
94 | 94 | if (IPAddress.TryParse(m_externalHostName, out ia)) | |
95 | IPAddress ia = null; | 95 | return new IPEndPoint(ia, m_internalEndPoint.Port); |
96 | // If it is already an IP, don't resolve it - just return directly | 96 | |
97 | if (IPAddress.TryParse(m_externalHostName, out ia)) | 97 | // Reset for next check |
98 | return new IPEndPoint(ia, m_internalEndPoint.Port); | 98 | ia = null; |
99 | 99 | ||
100 | // Reset for next check | 100 | |
101 | ia = null; | 101 | // New method favors IPv4 |
102 | 102 | foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName)) | |
103 | 103 | { | |
104 | // New method favors IPv4 | 104 | if (ia == null) |
105 | foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName)) | 105 | ia = Adr; |
106 | { | 106 | |
107 | if (ia == null) | 107 | if (Adr.AddressFamily == AddressFamily.InterNetwork) |
108 | ia = Adr; | 108 | { |
109 | 109 | ia = Adr; | |
110 | if (Adr.AddressFamily == AddressFamily.InterNetwork) | 110 | break; |
111 | { | 111 | } |
112 | ia = Adr; | 112 | |
113 | break; | 113 | } |
114 | } | 114 | |
115 | 115 | return new IPEndPoint(ia, m_internalEndPoint.Port); | |
116 | } | 116 | } |
117 | 117 | ||
118 | return new IPEndPoint(ia, m_internalEndPoint.Port); | 118 | set |
119 | } | 119 | { |
120 | 120 | m_externalHostName = value.ToString(); | |
121 | set | 121 | } |
122 | { | 122 | } |
123 | m_externalHostName = value.ToString(); | 123 | |
124 | } | 124 | protected string m_externalHostName; |
125 | } | 125 | public string ExternalHostName |
126 | 126 | { | |
127 | protected string m_externalHostName; | 127 | get |
128 | public string ExternalHostName | 128 | { |
129 | { | 129 | return m_externalHostName; |
130 | get | 130 | } |
131 | { | 131 | set |
132 | return m_externalHostName; | 132 | { |
133 | } | 133 | m_externalHostName = value; |
134 | set | 134 | } |
135 | { | 135 | } |
136 | m_externalHostName = value; | 136 | |
137 | } | 137 | protected IPEndPoint m_internalEndPoint; |
138 | } | 138 | public IPEndPoint InternalEndPoint |
139 | 139 | { | |
140 | protected IPEndPoint m_internalEndPoint; | 140 | get |
141 | public IPEndPoint InternalEndPoint | 141 | { |
142 | { | 142 | return m_internalEndPoint; |
143 | get | 143 | } |
144 | { | 144 | set |
145 | return m_internalEndPoint; | 145 | { |
146 | } | 146 | m_internalEndPoint = value; |
147 | set | 147 | } |
148 | { | 148 | } |
149 | m_internalEndPoint = value; | 149 | |
150 | } | 150 | protected uint? m_regionLocX; |
151 | } | 151 | public uint RegionLocX |
152 | 152 | { | |
153 | protected uint? m_regionLocX; | 153 | get |
154 | public uint RegionLocX | 154 | { |
155 | { | 155 | return m_regionLocX.Value; |
156 | get | 156 | } |
157 | { | 157 | set |
158 | return m_regionLocX.Value; | 158 | { |
159 | } | 159 | m_regionLocX = value; |
160 | set | 160 | } |
161 | { | 161 | } |
162 | m_regionLocX = value; | 162 | |
163 | } | 163 | protected uint? m_regionLocY; |
164 | } | 164 | public uint RegionLocY |
165 | 165 | { | |
166 | protected uint? m_regionLocY; | 166 | get |
167 | public uint RegionLocY | 167 | { |
168 | { | 168 | return m_regionLocY.Value; |
169 | get | 169 | } |
170 | { | 170 | set |
171 | return m_regionLocY.Value; | 171 | { |
172 | } | 172 | m_regionLocY = value; |
173 | set | 173 | } |
174 | { | 174 | } |
175 | m_regionLocY = value; | 175 | |
176 | } | 176 | public ulong RegionHandle |
177 | } | 177 | { |
178 | 178 | get | |
179 | public ulong RegionHandle | 179 | { |
180 | { | 180 | return Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256)); |
181 | get | 181 | } |
182 | { | 182 | } |
183 | return Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256)); | 183 | } |
184 | } | 184 | |
185 | } | 185 | public class RegionInfo : SimpleRegionInfo |
186 | } | 186 | { |
187 | 187 | public string RegionName = ""; | |
188 | public class RegionInfo : SimpleRegionInfo | 188 | |
189 | { | 189 | public string DataStore = ""; |
190 | public string RegionName = ""; | 190 | public bool isSandbox = false; |
191 | 191 | ||
192 | public string DataStore = ""; | 192 | public LLUUID MasterAvatarAssignedUUID = new LLUUID(); |
193 | public bool isSandbox = false; | 193 | public string MasterAvatarFirstName = ""; |
194 | 194 | public string MasterAvatarLastName = ""; | |
195 | public LLUUID MasterAvatarAssignedUUID = new LLUUID(); | 195 | public string MasterAvatarSandboxPassword = ""; |
196 | public string MasterAvatarFirstName = ""; | 196 | |
197 | public string MasterAvatarLastName = ""; | 197 | // Apparently, we're applying the same estatesettings regardless of whether it's local or remote. |
198 | public string MasterAvatarSandboxPassword = ""; | 198 | private static EstateSettings m_estateSettings; |
199 | 199 | public EstateSettings EstateSettings | |
200 | // Apparently, we're applying the same estatesettings regardless of whether it's local or remote. | 200 | { |
201 | private static EstateSettings m_estateSettings; | 201 | get |
202 | public EstateSettings EstateSettings | 202 | { |
203 | { | 203 | if( m_estateSettings == null ) |
204 | get | 204 | { |
205 | { | 205 | m_estateSettings = new EstateSettings(); |
206 | if( m_estateSettings == null ) | 206 | } |
207 | { | 207 | |
208 | m_estateSettings = new EstateSettings(); | 208 | return m_estateSettings; |
209 | } | 209 | } |
210 | 210 | ||
211 | return m_estateSettings; | 211 | } |
212 | } | 212 | |
213 | 213 | public ConfigurationMember configMember; | |
214 | } | 214 | public RegionInfo(string description, string filename) |
215 | 215 | { | |
216 | public ConfigurationMember configMember; | 216 | configMember = new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration); |
217 | public RegionInfo(string description, string filename) | 217 | configMember.performConfigurationRetrieve(); |
218 | { | 218 | } |
219 | configMember = new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration); | 219 | |
220 | configMember.performConfigurationRetrieve(); | 220 | public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) : |
221 | } | 221 | base(regionLocX, regionLocY, internalEndPoint, externalUri) |
222 | 222 | { | |
223 | public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) : | 223 | |
224 | base(regionLocX, regionLocY, internalEndPoint, externalUri) | 224 | |
225 | { | 225 | } |
226 | 226 | ||
227 | 227 | public RegionInfo() | |
228 | } | 228 | { |
229 | 229 | ||
230 | public RegionInfo() | 230 | } |
231 | { | 231 | |
232 | 232 | //not in use, should swap to nini though. | |
233 | } | 233 | public void LoadFromNiniSource(IConfigSource source) |
234 | 234 | { | |
235 | //not in use, should swap to nini though. | 235 | this.LoadFromNiniSource(source, "RegionInfo"); |
236 | public void LoadFromNiniSource(IConfigSource source) | 236 | } |
237 | { | 237 | |
238 | this.LoadFromNiniSource(source, "RegionInfo"); | 238 | //not in use, should swap to nini though. |
239 | } | 239 | public void LoadFromNiniSource(IConfigSource source, string sectionName) |
240 | 240 | { | |
241 | //not in use, should swap to nini though. | 241 | string errorMessage = ""; |
242 | public void LoadFromNiniSource(IConfigSource source, string sectionName) | 242 | this.RegionID = new LLUUID(source.Configs[sectionName].GetString("Region_ID", LLUUID.Random().ToStringHyphenated())); |
243 | { | 243 | this.RegionName = source.Configs[sectionName].GetString("sim_name", "OpenSim Test"); |
244 | string errorMessage = ""; | 244 | this.m_regionLocX = Convert.ToUInt32(source.Configs[sectionName].GetString("sim_location_x", "1000")); |
245 | this.RegionID = new LLUUID(source.Configs[sectionName].GetString("Region_ID", LLUUID.Random().ToStringHyphenated())); | 245 | this.m_regionLocY = Convert.ToUInt32(source.Configs[sectionName].GetString("sim_location_y", "1000")); |
246 | this.RegionName = source.Configs[sectionName].GetString("sim_name", "OpenSim Test"); | 246 | this.DataStore = source.Configs[sectionName].GetString("datastore", "OpenSim.db"); |
247 | this.m_regionLocX = Convert.ToUInt32(source.Configs[sectionName].GetString("sim_location_x", "1000")); | 247 | |
248 | this.m_regionLocY = Convert.ToUInt32(source.Configs[sectionName].GetString("sim_location_y", "1000")); | 248 | string ipAddress = source.Configs[sectionName].GetString("internal_ip_address", "0.0.0.0"); |
249 | this.DataStore = source.Configs[sectionName].GetString("datastore", "OpenSim.db"); | 249 | IPAddress ipAddressResult; |
250 | 250 | if (IPAddress.TryParse(ipAddress, out ipAddressResult)) | |
251 | string ipAddress = source.Configs[sectionName].GetString("internal_ip_address", "0.0.0.0"); | 251 | { |
252 | IPAddress ipAddressResult; | 252 | this.m_internalEndPoint = new IPEndPoint(ipAddressResult, 0); |
253 | if (IPAddress.TryParse(ipAddress, out ipAddressResult)) | 253 | } |
254 | { | 254 | else |
255 | this.m_internalEndPoint = new IPEndPoint(ipAddressResult, 0); | 255 | { |
256 | } | 256 | errorMessage = "needs an IP Address (IPAddress)"; |
257 | else | 257 | } |
258 | { | 258 | this.m_internalEndPoint.Port = source.Configs[sectionName].GetInt("internal_ip_port", NetworkServersInfo.DefaultHttpListenerPort); |
259 | errorMessage = "needs an IP Address (IPAddress)"; | 259 | |
260 | } | 260 | string externalHost = source.Configs[sectionName].GetString("external_host_name", "127.0.0.1"); |
261 | this.m_internalEndPoint.Port = source.Configs[sectionName].GetInt("internal_ip_port", NetworkServersInfo.DefaultHttpListenerPort); | 261 | if (externalHost != "SYSTEMIP") |
262 | 262 | { | |
263 | string externalHost = source.Configs[sectionName].GetString("external_host_name", "127.0.0.1"); | 263 | this.m_externalHostName = externalHost; |
264 | if (externalHost != "SYSTEMIP") | 264 | } |
265 | { | 265 | else |
266 | this.m_externalHostName = externalHost; | 266 | { |
267 | } | 267 | this.m_externalHostName = Util.GetLocalHost().ToString(); |
268 | else | 268 | } |
269 | { | 269 | |
270 | this.m_externalHostName = Util.GetLocalHost().ToString(); | 270 | this.MasterAvatarFirstName = source.Configs[sectionName].GetString("master_avatar_first", "Test"); |
271 | } | 271 | this.MasterAvatarLastName = source.Configs[sectionName].GetString("master_avatar_last", "User"); |
272 | 272 | this.MasterAvatarSandboxPassword = source.Configs[sectionName].GetString("master_avatar_pass", "test"); | |
273 | this.MasterAvatarFirstName = source.Configs[sectionName].GetString("master_avatar_first", "Test"); | 273 | |
274 | this.MasterAvatarLastName = source.Configs[sectionName].GetString("master_avatar_last", "User"); | 274 | if (errorMessage != "") |
275 | this.MasterAvatarSandboxPassword = source.Configs[sectionName].GetString("master_avatar_pass", "test"); | 275 | { |
276 | 276 | // a error | |
277 | if (errorMessage != "") | 277 | } |
278 | { | 278 | } |
279 | // a error | 279 | |
280 | } | 280 | public void loadConfigurationOptions() |
281 | } | 281 | { |
282 | 282 | configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "UUID of Region (Default is recommended, random UUID)", LLUUID.Random().ToString(), true); | |
283 | public void loadConfigurationOptions() | 283 | configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Region Name", "OpenSim Test", false); |
284 | { | 284 | configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (X Axis)", "1000", false); |
285 | configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "UUID of Region (Default is recommended, random UUID)", LLUUID.Random().ToString(), true); | 285 | configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (Y Axis)", "1000", false); |
286 | configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Region Name", "OpenSim Test", false); | 286 | configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false); |
287 | configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (X Axis)", "1000", false); | 287 | configMember.addConfigurationOption("internal_ip_address", ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, "Internal IP Address for incoming UDP client connections", "0.0.0.0", false); |
288 | configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Grid Location (Y Axis)", "1000", false); | 288 | configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", NetworkServersInfo.DefaultHttpListenerPort.ToString(), false); |
289 | configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false); | 289 | configMember.addConfigurationOption("external_host_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "External Host Name", "127.0.0.1", false); |
290 | configMember.addConfigurationOption("internal_ip_address", ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, "Internal IP Address for incoming UDP client connections", "0.0.0.0", false); | 290 | configMember.addConfigurationOption("master_avatar_first", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "First Name of Master Avatar", "Test", false); |
291 | configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", NetworkServersInfo.DefaultHttpListenerPort.ToString(), false); | 291 | configMember.addConfigurationOption("master_avatar_last", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Last Name of Master Avatar", "User", false); |
292 | configMember.addConfigurationOption("external_host_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "External Host Name", "127.0.0.1", false); | 292 | configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "(Sandbox Mode Only)Password for Master Avatar account", "test", false); |
293 | configMember.addConfigurationOption("master_avatar_first", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "First Name of Master Avatar", "Test", false); | 293 | } |
294 | configMember.addConfigurationOption("master_avatar_last", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Last Name of Master Avatar", "User", false); | 294 | |
295 | configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "(Sandbox Mode Only)Password for Master Avatar account", "test", false); | 295 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) |
296 | } | 296 | { |
297 | 297 | switch (configuration_key) | |
298 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | 298 | { |
299 | { | 299 | case "sim_UUID": |
300 | switch (configuration_key) | 300 | this.RegionID = (LLUUID)configuration_result; |
301 | { | 301 | break; |
302 | case "sim_UUID": | 302 | case "sim_name": |
303 | this.RegionID = (LLUUID)configuration_result; | 303 | this.RegionName = (string)configuration_result; |
304 | break; | 304 | break; |
305 | case "sim_name": | 305 | case "sim_location_x": |
306 | this.RegionName = (string)configuration_result; | 306 | this.m_regionLocX = (uint)configuration_result; |
307 | break; | 307 | break; |
308 | case "sim_location_x": | 308 | case "sim_location_y": |
309 | this.m_regionLocX = (uint)configuration_result; | 309 | this.m_regionLocY = (uint)configuration_result; |
310 | break; | 310 | break; |
311 | case "sim_location_y": | 311 | case "datastore": |
312 | this.m_regionLocY = (uint)configuration_result; | 312 | this.DataStore = (string)configuration_result; |
313 | break; | 313 | break; |
314 | case "datastore": | 314 | case "internal_ip_address": |
315 | this.DataStore = (string)configuration_result; | 315 | IPAddress address = (IPAddress)configuration_result; |
316 | break; | 316 | this.m_internalEndPoint = new IPEndPoint(address, 0); |
317 | case "internal_ip_address": | 317 | break; |
318 | IPAddress address = (IPAddress)configuration_result; | 318 | case "internal_ip_port": |
319 | this.m_internalEndPoint = new IPEndPoint(address, 0); | 319 | this.m_internalEndPoint.Port = (int)configuration_result; |
320 | break; | 320 | break; |
321 | case "internal_ip_port": | 321 | case "external_host_name": |
322 | this.m_internalEndPoint.Port = (int)configuration_result; | 322 | if ((string)configuration_result != "SYSTEMIP") |
323 | break; | 323 | { |
324 | case "external_host_name": | 324 | this.m_externalHostName = (string)configuration_result; |
325 | if ((string)configuration_result != "SYSTEMIP") | 325 | } |
326 | { | 326 | else |
327 | this.m_externalHostName = (string)configuration_result; | 327 | { |
328 | } | 328 | this.m_externalHostName = Util.GetLocalHost().ToString(); |
329 | else | 329 | } |
330 | { | 330 | break; |
331 | this.m_externalHostName = Util.GetLocalHost().ToString(); | 331 | case "master_avatar_first": |
332 | } | 332 | this.MasterAvatarFirstName = (string)configuration_result; |
333 | break; | 333 | break; |
334 | case "master_avatar_first": | 334 | case "master_avatar_last": |
335 | this.MasterAvatarFirstName = (string)configuration_result; | 335 | this.MasterAvatarLastName = (string)configuration_result; |
336 | break; | 336 | break; |
337 | case "master_avatar_last": | 337 | case "master_avatar_pass": |
338 | this.MasterAvatarLastName = (string)configuration_result; | 338 | string tempMD5Passwd = (string)configuration_result; |
339 | break; | 339 | this.MasterAvatarSandboxPassword = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + ""); |
340 | case "master_avatar_pass": | 340 | break; |
341 | string tempMD5Passwd = (string)configuration_result; | 341 | } |
342 | this.MasterAvatarSandboxPassword = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + ""); | 342 | |
343 | break; | 343 | return true; |
344 | } | 344 | } |
345 | 345 | ||
346 | return true; | 346 | } |
347 | } | 347 | } |
348 | |||
349 | } | ||
350 | } | ||