RegionInfo.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSim Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  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
  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
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using System;
  28. using System.Collections.Generic;
  29. using System.Net;
  30. using System.Net.Sockets;
  31. using System.Xml;
  32. using libsecondlife;
  33. using Nini.Config;
  34. namespace OpenSim.Framework
  35. {
  36. [Serializable]
  37. public class SimpleRegionInfo
  38. {
  39. // private static readonly log4net.ILog m_log
  40. // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
  41. protected bool Allow_Alternate_Ports;
  42. public bool m_allow_alternate_ports;
  43. protected string m_externalHostName;
  44. /// <value>
  45. /// The port by which http communication occurs with the region (most noticeably, CAPS communication)
  46. /// </value>
  47. protected uint m_httpPort;
  48. protected IPEndPoint m_internalEndPoint;
  49. protected uint? m_regionLocX;
  50. protected uint? m_regionLocY;
  51. protected uint m_remotingPort;
  52. protected string m_serverURI;
  53. public LLUUID RegionID = LLUUID.Zero;
  54. public string RemotingAddress;
  55. public SimpleRegionInfo()
  56. {
  57. }
  58. public SimpleRegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri)
  59. {
  60. m_regionLocX = regionLocX;
  61. m_regionLocY = regionLocY;
  62. m_internalEndPoint = internalEndPoint;
  63. m_externalHostName = externalUri;
  64. }
  65. public SimpleRegionInfo(uint regionLocX, uint regionLocY, string externalUri, uint port)
  66. {
  67. m_regionLocX = regionLocX;
  68. m_regionLocY = regionLocY;
  69. m_externalHostName = externalUri;
  70. m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int) port);
  71. }
  72. public SimpleRegionInfo(RegionInfo ConvertFrom)
  73. {
  74. m_regionLocX = ConvertFrom.RegionLocX;
  75. m_regionLocY = ConvertFrom.RegionLocY;
  76. m_internalEndPoint = ConvertFrom.InternalEndPoint;
  77. m_externalHostName = ConvertFrom.ExternalHostName;
  78. m_remotingPort = ConvertFrom.RemotingPort;
  79. m_httpPort = ConvertFrom.HttpPort;
  80. m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports;
  81. RemotingAddress = ConvertFrom.RemotingAddress;
  82. RegionID = LLUUID.Zero;
  83. ServerURI = ConvertFrom.ServerURI;
  84. }
  85. public uint RemotingPort
  86. {
  87. get { return m_remotingPort; }
  88. set { m_remotingPort = value; }
  89. }
  90. public uint HttpPort
  91. {
  92. get { return m_httpPort; }
  93. set { m_httpPort = value; }
  94. }
  95. public string ServerURI
  96. {
  97. get { return m_serverURI; }
  98. set { m_serverURI = value; }
  99. }
  100. /// <value>
  101. /// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw.
  102. ///
  103. /// XXX Isn't this really doing too much to be a simple getter, rather than an explict method?
  104. /// </value>
  105. public IPEndPoint ExternalEndPoint
  106. {
  107. get
  108. {
  109. // Old one defaults to IPv6
  110. //return new IPEndPoint(Dns.GetHostAddresses(m_externalHostName)[0], m_internalEndPoint.Port);
  111. IPAddress ia = null;
  112. // If it is already an IP, don't resolve it - just return directly
  113. if (IPAddress.TryParse(m_externalHostName, out ia))
  114. return new IPEndPoint(ia, m_internalEndPoint.Port);
  115. // Reset for next check
  116. ia = null;
  117. foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName))
  118. {
  119. if (ia == null)
  120. ia = Adr;
  121. if (Adr.AddressFamily == AddressFamily.InterNetwork)
  122. {
  123. ia = Adr;
  124. break;
  125. }
  126. }
  127. return new IPEndPoint(ia, m_internalEndPoint.Port);
  128. }
  129. set { m_externalHostName = value.ToString(); }
  130. }
  131. public string ExternalHostName
  132. {
  133. get { return m_externalHostName; }
  134. set { m_externalHostName = value; }
  135. }
  136. public IPEndPoint InternalEndPoint
  137. {
  138. get { return m_internalEndPoint; }
  139. set { m_internalEndPoint = value; }
  140. }
  141. public uint RegionLocX
  142. {
  143. get { return m_regionLocX.Value; }
  144. set { m_regionLocX = value; }
  145. }
  146. public uint RegionLocY
  147. {
  148. get { return m_regionLocY.Value; }
  149. set { m_regionLocY = value; }
  150. }
  151. public ulong RegionHandle
  152. {
  153. get { return Util.UIntsToLong((RegionLocX * (uint) Constants.RegionSize), (RegionLocY * (uint) Constants.RegionSize)); }
  154. }
  155. public int getInternalEndPointPort()
  156. {
  157. return m_internalEndPoint.Port;
  158. }
  159. }
  160. public class RegionInfo : SimpleRegionInfo
  161. {
  162. // private static readonly log4net.ILog m_log
  163. // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
  164. public bool commFailTF = false;
  165. public ConfigurationMember configMember;
  166. public LLUUID CovenantID = LLUUID.Zero;
  167. public string DataStore = String.Empty;
  168. public bool isSandbox = false;
  169. private EstateSettings m_estateSettings;
  170. private RegionSettings m_regionSettings;
  171. // public bool m_allow_alternate_ports;
  172. public LLUUID MasterAvatarAssignedUUID = LLUUID.Zero;
  173. public string MasterAvatarFirstName = String.Empty;
  174. public string MasterAvatarLastName = String.Empty;
  175. public string MasterAvatarSandboxPassword = String.Empty;
  176. public LLUUID originRegionID = LLUUID.Zero;
  177. public string proxyUrl = "";
  178. public string RegionName = String.Empty;
  179. public string regionSecret = LLUUID.Random().ToString();
  180. public LLUUID lastMapUUID = LLUUID.Zero;
  181. public string lastMapRefresh = "0";
  182. public List<RegionBanListItem> regionBanlist = new List<RegionBanListItem>();
  183. // Apparently, we're applying the same estatesettings regardless of whether it's local or remote.
  184. public RegionInfo(string description, string filename, bool skipConsoleConfig)
  185. {
  186. configMember =
  187. new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig);
  188. configMember.performConfigurationRetrieve();
  189. }
  190. public RegionInfo(string description, XmlNode xmlNode, bool skipConsoleConfig)
  191. {
  192. configMember =
  193. new ConfigurationMember(xmlNode, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig);
  194. configMember.performConfigurationRetrieve();
  195. }
  196. public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) :
  197. base(regionLocX, regionLocY, internalEndPoint, externalUri)
  198. {
  199. }
  200. public RegionInfo()
  201. {
  202. }
  203. public RegionInfo(SerializableRegionInfo ConvertFrom)
  204. {
  205. m_regionLocX = ConvertFrom.RegionLocX;
  206. m_regionLocY = ConvertFrom.RegionLocY;
  207. m_internalEndPoint = ConvertFrom.InternalEndPoint;
  208. m_externalHostName = ConvertFrom.ExternalHostName;
  209. m_remotingPort = ConvertFrom.RemotingPort;
  210. m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports;
  211. RemotingAddress = ConvertFrom.RemotingAddress;
  212. RegionID = LLUUID.Zero;
  213. proxyUrl = ConvertFrom.ProxyUrl;
  214. originRegionID = ConvertFrom.OriginRegionID;
  215. RegionName = ConvertFrom.RegionName;
  216. ServerURI = ConvertFrom.ServerURI;
  217. }
  218. public RegionInfo(SimpleRegionInfo ConvertFrom)
  219. {
  220. m_regionLocX = ConvertFrom.RegionLocX;
  221. m_regionLocY = ConvertFrom.RegionLocY;
  222. m_internalEndPoint = ConvertFrom.InternalEndPoint;
  223. m_externalHostName = ConvertFrom.ExternalHostName;
  224. m_remotingPort = ConvertFrom.RemotingPort;
  225. m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports;
  226. RemotingAddress = ConvertFrom.RemotingAddress;
  227. RegionID = LLUUID.Zero;
  228. ServerURI = ConvertFrom.ServerURI;
  229. }
  230. public EstateSettings EstateSettings
  231. {
  232. get
  233. {
  234. if (m_estateSettings == null)
  235. {
  236. m_estateSettings = new EstateSettings();
  237. }
  238. return m_estateSettings;
  239. }
  240. }
  241. public RegionSettings RegionSettings
  242. {
  243. get
  244. {
  245. if (m_regionSettings == null)
  246. {
  247. m_regionSettings = new RegionSettings();
  248. }
  249. return m_regionSettings;
  250. }
  251. set { m_regionSettings = value; }
  252. }
  253. public void SetEndPoint(string ipaddr, int port)
  254. {
  255. IPAddress tmpIP = IPAddress.Parse(ipaddr);
  256. IPEndPoint tmpEPE = new IPEndPoint(tmpIP, port);
  257. m_internalEndPoint = tmpEPE;
  258. }
  259. //not in use, should swap to nini though.
  260. public void LoadFromNiniSource(IConfigSource source)
  261. {
  262. LoadFromNiniSource(source, "RegionInfo");
  263. }
  264. //not in use, should swap to nini though.
  265. public void LoadFromNiniSource(IConfigSource source, string sectionName)
  266. {
  267. string errorMessage = String.Empty;
  268. RegionID = new LLUUID(source.Configs[sectionName].GetString("Region_ID", LLUUID.Random().ToString()));
  269. RegionName = source.Configs[sectionName].GetString("sim_name", "OpenSim Test");
  270. m_regionLocX = Convert.ToUInt32(source.Configs[sectionName].GetString("sim_location_x", "1000"));
  271. m_regionLocY = Convert.ToUInt32(source.Configs[sectionName].GetString("sim_location_y", "1000"));
  272. // this.DataStore = source.Configs[sectionName].GetString("datastore", "OpenSim.db");
  273. string ipAddress = source.Configs[sectionName].GetString("internal_ip_address", "0.0.0.0");
  274. IPAddress ipAddressResult;
  275. if (IPAddress.TryParse(ipAddress, out ipAddressResult))
  276. {
  277. m_internalEndPoint = new IPEndPoint(ipAddressResult, 0);
  278. }
  279. else
  280. {
  281. errorMessage = "needs an IP Address (IPAddress)";
  282. }
  283. m_internalEndPoint.Port =
  284. source.Configs[sectionName].GetInt("internal_ip_port", (int) NetworkServersInfo.DefaultHttpListenerPort);
  285. string externalHost = source.Configs[sectionName].GetString("external_host_name", "127.0.0.1");
  286. if (externalHost != "SYSTEMIP")
  287. {
  288. m_externalHostName = externalHost;
  289. }
  290. else
  291. {
  292. m_externalHostName = Util.GetLocalHost().ToString();
  293. }
  294. MasterAvatarFirstName = source.Configs[sectionName].GetString("master_avatar_first", "Test");
  295. MasterAvatarLastName = source.Configs[sectionName].GetString("master_avatar_last", "User");
  296. MasterAvatarSandboxPassword = source.Configs[sectionName].GetString("master_avatar_pass", "test");
  297. if (errorMessage != String.Empty)
  298. {
  299. // a error
  300. }
  301. }
  302. public bool ignoreIncomingConfiguration(string configuration_key, object configuration_result)
  303. {
  304. return true;
  305. }
  306. public void SaveRegionToFile(string description, string filename)
  307. {
  308. configMember = new ConfigurationMember(filename, description, loadConfigurationOptionsFromMe,
  309. ignoreIncomingConfiguration, false);
  310. configMember.performConfigurationRetrieve();
  311. }
  312. public bool CheckIfUserBanned(LLUUID user)
  313. {
  314. RegionBanListItem[] bl = regionBanlist.ToArray();
  315. bool banned = false;
  316. for (int i = 0; i < bl.Length; i++)
  317. {
  318. if (bl[i] == null)
  319. continue;
  320. if (bl[i].bannedUUID == user)
  321. {
  322. banned = true;
  323. break;
  324. }
  325. }
  326. return banned;
  327. }
  328. public void loadConfigurationOptionsFromMe()
  329. {
  330. configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID_NULL_FREE,
  331. "UUID of Region (Default is recommended, random UUID)",
  332. RegionID.ToString(), true);
  333. configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  334. "Region Name", RegionName, true);
  335. configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
  336. "Grid Location (X Axis)", m_regionLocX.ToString(), true);
  337. configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
  338. "Grid Location (Y Axis)", m_regionLocY.ToString(), true);
  339. //configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false);
  340. configMember.addConfigurationOption("internal_ip_address",
  341. ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS,
  342. "Internal IP Address for incoming UDP client connections",
  343. m_internalEndPoint.Address.ToString(),
  344. true);
  345. configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
  346. "Internal IP Port for incoming UDP client connections",
  347. m_internalEndPoint.Port.ToString(), true);
  348. configMember.addConfigurationOption("allow_alternate_ports",
  349. ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
  350. "Allow sim to find alternate UDP ports when ports are in use?",
  351. m_allow_alternate_ports.ToString(), true);
  352. configMember.addConfigurationOption("external_host_name",
  353. ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  354. "External Host Name", m_externalHostName, true);
  355. configMember.addConfigurationOption("master_avatar_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  356. "Master Avatar UUID", MasterAvatarAssignedUUID.ToString(), true);
  357. configMember.addConfigurationOption("estate_covanant_uuid",
  358. ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "Estate Covenant",
  359. CovenantID.ToString(), true);
  360. configMember.addConfigurationOption("master_avatar_first",
  361. ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  362. "First Name of Master Avatar", MasterAvatarFirstName, true);
  363. configMember.addConfigurationOption("master_avatar_last",
  364. ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  365. "Last Name of Master Avatar", MasterAvatarLastName, true);
  366. configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
  367. "(Sandbox Mode Only)Password for Master Avatar account",
  368. MasterAvatarSandboxPassword, true);
  369. configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  370. "Last Map UUID", lastMapUUID.ToString(), true);
  371. configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  372. "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true);
  373. }
  374. public void loadConfigurationOptions()
  375. {
  376. configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  377. "UUID of Region (Default is recommended, random UUID)",
  378. LLUUID.Random().ToString(), true);
  379. configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  380. "Region Name", "OpenSim Test", false);
  381. configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
  382. "Grid Location (X Axis)", "1000", false);
  383. configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
  384. "Grid Location (Y Axis)", "1000", false);
  385. //configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false);
  386. configMember.addConfigurationOption("internal_ip_address",
  387. ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS,
  388. "Internal IP Address for incoming UDP client connections", "0.0.0.0",
  389. false);
  390. configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
  391. "Internal IP Port for incoming UDP client connections",
  392. NetworkServersInfo.DefaultHttpListenerPort.ToString(), false);
  393. configMember.addConfigurationOption("allow_alternate_ports", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
  394. "Allow sim to find alternate UDP ports when ports are in use?",
  395. "false", true);
  396. configMember.addConfigurationOption("external_host_name",
  397. ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  398. "External Host Name", "127.0.0.1", false);
  399. configMember.addConfigurationOption("master_avatar_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  400. "Master Avatar UUID", LLUUID.Zero.ToString(), true);
  401. configMember.addConfigurationOption("estate_covanant_uuid",
  402. ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "Estate Covenant",
  403. LLUUID.Zero.ToString(), true);
  404. configMember.addConfigurationOption("master_avatar_first",
  405. ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  406. "First Name of Master Avatar", "Test", false,
  407. (ConfigurationOption.ConfigurationOptionShouldBeAsked)
  408. shouldMasterAvatarDetailsBeAsked);
  409. configMember.addConfigurationOption("master_avatar_last",
  410. ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  411. "Last Name of Master Avatar", "User", false,
  412. (ConfigurationOption.ConfigurationOptionShouldBeAsked)
  413. shouldMasterAvatarDetailsBeAsked);
  414. configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
  415. "(Sandbox Mode Only)Password for Master Avatar account", "test", false,
  416. (ConfigurationOption.ConfigurationOptionShouldBeAsked)
  417. shouldMasterAvatarDetailsBeAsked);
  418. configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  419. "Last Map UUID", lastMapUUID.ToString(), true);
  420. configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  421. "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true);
  422. }
  423. public bool shouldMasterAvatarDetailsBeAsked(string configuration_key)
  424. {
  425. if (MasterAvatarAssignedUUID == LLUUID.Zero)
  426. {
  427. return true;
  428. }
  429. return false;
  430. }
  431. public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
  432. {
  433. switch (configuration_key)
  434. {
  435. case "sim_UUID":
  436. RegionID = (LLUUID) configuration_result;
  437. originRegionID = (LLUUID) configuration_result;
  438. break;
  439. case "sim_name":
  440. RegionName = (string) configuration_result;
  441. break;
  442. case "sim_location_x":
  443. m_regionLocX = (uint) configuration_result;
  444. break;
  445. case "sim_location_y":
  446. m_regionLocY = (uint) configuration_result;
  447. break;
  448. case "datastore":
  449. DataStore = (string) configuration_result;
  450. break;
  451. case "internal_ip_address":
  452. IPAddress address = (IPAddress) configuration_result;
  453. m_internalEndPoint = new IPEndPoint(address, 0);
  454. break;
  455. case "internal_ip_port":
  456. m_internalEndPoint.Port = (int) configuration_result;
  457. break;
  458. case "allow_alternate_ports":
  459. m_allow_alternate_ports = (bool) configuration_result;
  460. break;
  461. case "external_host_name":
  462. if ((string) configuration_result != "SYSTEMIP")
  463. {
  464. m_externalHostName = (string) configuration_result;
  465. }
  466. else
  467. {
  468. m_externalHostName = Util.GetLocalHost().ToString();
  469. }
  470. break;
  471. case "master_avatar_uuid":
  472. MasterAvatarAssignedUUID = (LLUUID) configuration_result;
  473. break;
  474. case "estate_covanant_uuid":
  475. CovenantID = (LLUUID) configuration_result;
  476. break;
  477. case "master_avatar_first":
  478. MasterAvatarFirstName = (string) configuration_result;
  479. break;
  480. case "master_avatar_last":
  481. MasterAvatarLastName = (string) configuration_result;
  482. break;
  483. case "master_avatar_pass":
  484. string tempMD5Passwd = (string) configuration_result;
  485. MasterAvatarSandboxPassword = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + String.Empty);
  486. break;
  487. case "lastmap_uuid":
  488. lastMapUUID = (LLUUID)configuration_result;
  489. break;
  490. case "lastmap_refresh":
  491. lastMapRefresh = (string)configuration_result;
  492. break;
  493. }
  494. return true;
  495. }
  496. public void SaveEstatecovenantUUID(LLUUID notecard)
  497. {
  498. if (null == configMember) return;
  499. configMember.forceSetConfigurationOption("estate_covanant_uuid", notecard.ToString());
  500. }
  501. public void SaveLastMapUUID(LLUUID mapUUID)
  502. {
  503. if (null == configMember) return;
  504. lastMapUUID = mapUUID;
  505. lastMapRefresh = Util.UnixTimeSinceEpoch().ToString();
  506. configMember.forceSetConfigurationOption("lastmap_uuid", mapUUID.ToString());
  507. configMember.forceSetConfigurationOption("lastmap_refresh", lastMapRefresh);
  508. }
  509. }
  510. }