RegionInfo.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  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 string DataStore = String.Empty;
  167. public bool isSandbox = false;
  168. private EstateSettings m_estateSettings;
  169. private RegionSettings m_regionSettings;
  170. // public bool m_allow_alternate_ports;
  171. public LLUUID MasterAvatarAssignedUUID = LLUUID.Zero;
  172. public string MasterAvatarFirstName = String.Empty;
  173. public string MasterAvatarLastName = String.Empty;
  174. public string MasterAvatarSandboxPassword = String.Empty;
  175. public LLUUID originRegionID = LLUUID.Zero;
  176. public string proxyUrl = "";
  177. public string RegionName = String.Empty;
  178. public string regionSecret = LLUUID.Random().ToString();
  179. public LLUUID lastMapUUID = LLUUID.Zero;
  180. public string lastMapRefresh = "0";
  181. // Apparently, we're applying the same estatesettings regardless of whether it's local or remote.
  182. public RegionInfo(string description, string filename, bool skipConsoleConfig)
  183. {
  184. configMember =
  185. new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig);
  186. configMember.performConfigurationRetrieve();
  187. }
  188. public RegionInfo(string description, XmlNode xmlNode, bool skipConsoleConfig)
  189. {
  190. configMember =
  191. new ConfigurationMember(xmlNode, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig);
  192. configMember.performConfigurationRetrieve();
  193. }
  194. public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) :
  195. base(regionLocX, regionLocY, internalEndPoint, externalUri)
  196. {
  197. }
  198. public RegionInfo()
  199. {
  200. }
  201. public RegionInfo(SerializableRegionInfo ConvertFrom)
  202. {
  203. m_regionLocX = ConvertFrom.RegionLocX;
  204. m_regionLocY = ConvertFrom.RegionLocY;
  205. m_internalEndPoint = ConvertFrom.InternalEndPoint;
  206. m_externalHostName = ConvertFrom.ExternalHostName;
  207. m_remotingPort = ConvertFrom.RemotingPort;
  208. m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports;
  209. RemotingAddress = ConvertFrom.RemotingAddress;
  210. RegionID = LLUUID.Zero;
  211. proxyUrl = ConvertFrom.ProxyUrl;
  212. originRegionID = ConvertFrom.OriginRegionID;
  213. RegionName = ConvertFrom.RegionName;
  214. ServerURI = ConvertFrom.ServerURI;
  215. }
  216. public RegionInfo(SimpleRegionInfo ConvertFrom)
  217. {
  218. m_regionLocX = ConvertFrom.RegionLocX;
  219. m_regionLocY = ConvertFrom.RegionLocY;
  220. m_internalEndPoint = ConvertFrom.InternalEndPoint;
  221. m_externalHostName = ConvertFrom.ExternalHostName;
  222. m_remotingPort = ConvertFrom.RemotingPort;
  223. m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports;
  224. RemotingAddress = ConvertFrom.RemotingAddress;
  225. RegionID = LLUUID.Zero;
  226. ServerURI = ConvertFrom.ServerURI;
  227. }
  228. public EstateSettings EstateSettings
  229. {
  230. get
  231. {
  232. if (m_estateSettings == null)
  233. {
  234. m_estateSettings = new EstateSettings();
  235. }
  236. return m_estateSettings;
  237. }
  238. set { m_estateSettings = value; }
  239. }
  240. public RegionSettings RegionSettings
  241. {
  242. get
  243. {
  244. if (m_regionSettings == null)
  245. {
  246. m_regionSettings = new RegionSettings();
  247. }
  248. return m_regionSettings;
  249. }
  250. set { m_regionSettings = value; }
  251. }
  252. public void SetEndPoint(string ipaddr, int port)
  253. {
  254. IPAddress tmpIP = IPAddress.Parse(ipaddr);
  255. IPEndPoint tmpEPE = new IPEndPoint(tmpIP, port);
  256. m_internalEndPoint = tmpEPE;
  257. }
  258. //not in use, should swap to nini though.
  259. public void LoadFromNiniSource(IConfigSource source)
  260. {
  261. LoadFromNiniSource(source, "RegionInfo");
  262. }
  263. //not in use, should swap to nini though.
  264. public void LoadFromNiniSource(IConfigSource source, string sectionName)
  265. {
  266. string errorMessage = String.Empty;
  267. RegionID = new LLUUID(source.Configs[sectionName].GetString("Region_ID", LLUUID.Random().ToString()));
  268. RegionName = source.Configs[sectionName].GetString("sim_name", "OpenSim Test");
  269. m_regionLocX = Convert.ToUInt32(source.Configs[sectionName].GetString("sim_location_x", "1000"));
  270. m_regionLocY = Convert.ToUInt32(source.Configs[sectionName].GetString("sim_location_y", "1000"));
  271. // this.DataStore = source.Configs[sectionName].GetString("datastore", "OpenSim.db");
  272. string ipAddress = source.Configs[sectionName].GetString("internal_ip_address", "0.0.0.0");
  273. IPAddress ipAddressResult;
  274. if (IPAddress.TryParse(ipAddress, out ipAddressResult))
  275. {
  276. m_internalEndPoint = new IPEndPoint(ipAddressResult, 0);
  277. }
  278. else
  279. {
  280. errorMessage = "needs an IP Address (IPAddress)";
  281. }
  282. m_internalEndPoint.Port =
  283. source.Configs[sectionName].GetInt("internal_ip_port", (int) NetworkServersInfo.DefaultHttpListenerPort);
  284. string externalHost = source.Configs[sectionName].GetString("external_host_name", "127.0.0.1");
  285. if (externalHost != "SYSTEMIP")
  286. {
  287. m_externalHostName = externalHost;
  288. }
  289. else
  290. {
  291. m_externalHostName = Util.GetLocalHost().ToString();
  292. }
  293. MasterAvatarFirstName = source.Configs[sectionName].GetString("master_avatar_first", "Test");
  294. MasterAvatarLastName = source.Configs[sectionName].GetString("master_avatar_last", "User");
  295. MasterAvatarSandboxPassword = source.Configs[sectionName].GetString("master_avatar_pass", "test");
  296. if (errorMessage != String.Empty)
  297. {
  298. // a error
  299. }
  300. }
  301. public bool ignoreIncomingConfiguration(string configuration_key, object configuration_result)
  302. {
  303. return true;
  304. }
  305. public void SaveRegionToFile(string description, string filename)
  306. {
  307. configMember = new ConfigurationMember(filename, description, loadConfigurationOptionsFromMe,
  308. ignoreIncomingConfiguration, false);
  309. configMember.performConfigurationRetrieve();
  310. }
  311. public void loadConfigurationOptionsFromMe()
  312. {
  313. configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID_NULL_FREE,
  314. "UUID of Region (Default is recommended, random UUID)",
  315. RegionID.ToString(), true);
  316. configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  317. "Region Name", RegionName, true);
  318. configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
  319. "Grid Location (X Axis)", m_regionLocX.ToString(), true);
  320. configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
  321. "Grid Location (Y Axis)", m_regionLocY.ToString(), true);
  322. //configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false);
  323. configMember.addConfigurationOption("internal_ip_address",
  324. ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS,
  325. "Internal IP Address for incoming UDP client connections",
  326. m_internalEndPoint.Address.ToString(),
  327. true);
  328. configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
  329. "Internal IP Port for incoming UDP client connections",
  330. m_internalEndPoint.Port.ToString(), true);
  331. configMember.addConfigurationOption("allow_alternate_ports",
  332. ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
  333. "Allow sim to find alternate UDP ports when ports are in use?",
  334. m_allow_alternate_ports.ToString(), true);
  335. configMember.addConfigurationOption("external_host_name",
  336. ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  337. "External Host Name", m_externalHostName, true);
  338. configMember.addConfigurationOption("master_avatar_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  339. "Master Avatar UUID", MasterAvatarAssignedUUID.ToString(), true);
  340. configMember.addConfigurationOption("master_avatar_first",
  341. ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  342. "First Name of Master Avatar", MasterAvatarFirstName, true);
  343. configMember.addConfigurationOption("master_avatar_last",
  344. ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  345. "Last Name of Master Avatar", MasterAvatarLastName, true);
  346. configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
  347. "(Sandbox Mode Only)Password for Master Avatar account",
  348. MasterAvatarSandboxPassword, true);
  349. configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  350. "Last Map UUID", lastMapUUID.ToString(), true);
  351. configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  352. "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true);
  353. }
  354. public void loadConfigurationOptions()
  355. {
  356. configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  357. "UUID of Region (Default is recommended, random UUID)",
  358. LLUUID.Random().ToString(), true);
  359. configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  360. "Region Name", "OpenSim Test", false);
  361. configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
  362. "Grid Location (X Axis)", "1000", false);
  363. configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
  364. "Grid Location (Y Axis)", "1000", false);
  365. //configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false);
  366. configMember.addConfigurationOption("internal_ip_address",
  367. ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS,
  368. "Internal IP Address for incoming UDP client connections", "0.0.0.0",
  369. false);
  370. configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
  371. "Internal IP Port for incoming UDP client connections",
  372. NetworkServersInfo.DefaultHttpListenerPort.ToString(), false);
  373. configMember.addConfigurationOption("allow_alternate_ports", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
  374. "Allow sim to find alternate UDP ports when ports are in use?",
  375. "false", true);
  376. configMember.addConfigurationOption("external_host_name",
  377. ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  378. "External Host Name", "127.0.0.1", false);
  379. configMember.addConfigurationOption("master_avatar_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  380. "Master Avatar UUID", LLUUID.Zero.ToString(), true);
  381. configMember.addConfigurationOption("master_avatar_first",
  382. ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  383. "First Name of Master Avatar", "Test", false,
  384. (ConfigurationOption.ConfigurationOptionShouldBeAsked)
  385. shouldMasterAvatarDetailsBeAsked);
  386. configMember.addConfigurationOption("master_avatar_last",
  387. ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  388. "Last Name of Master Avatar", "User", false,
  389. (ConfigurationOption.ConfigurationOptionShouldBeAsked)
  390. shouldMasterAvatarDetailsBeAsked);
  391. configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
  392. "(Sandbox Mode Only)Password for Master Avatar account", "test", false,
  393. (ConfigurationOption.ConfigurationOptionShouldBeAsked)
  394. shouldMasterAvatarDetailsBeAsked);
  395. configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  396. "Last Map UUID", lastMapUUID.ToString(), true);
  397. configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  398. "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true);
  399. }
  400. public bool shouldMasterAvatarDetailsBeAsked(string configuration_key)
  401. {
  402. if (MasterAvatarAssignedUUID == LLUUID.Zero)
  403. {
  404. return true;
  405. }
  406. return false;
  407. }
  408. public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
  409. {
  410. switch (configuration_key)
  411. {
  412. case "sim_UUID":
  413. RegionID = (LLUUID) configuration_result;
  414. originRegionID = (LLUUID) configuration_result;
  415. break;
  416. case "sim_name":
  417. RegionName = (string) configuration_result;
  418. break;
  419. case "sim_location_x":
  420. m_regionLocX = (uint) configuration_result;
  421. break;
  422. case "sim_location_y":
  423. m_regionLocY = (uint) configuration_result;
  424. break;
  425. case "datastore":
  426. DataStore = (string) configuration_result;
  427. break;
  428. case "internal_ip_address":
  429. IPAddress address = (IPAddress) configuration_result;
  430. m_internalEndPoint = new IPEndPoint(address, 0);
  431. break;
  432. case "internal_ip_port":
  433. m_internalEndPoint.Port = (int) configuration_result;
  434. break;
  435. case "allow_alternate_ports":
  436. m_allow_alternate_ports = (bool) configuration_result;
  437. break;
  438. case "external_host_name":
  439. if ((string) configuration_result != "SYSTEMIP")
  440. {
  441. m_externalHostName = (string) configuration_result;
  442. }
  443. else
  444. {
  445. m_externalHostName = Util.GetLocalHost().ToString();
  446. }
  447. break;
  448. case "master_avatar_uuid":
  449. MasterAvatarAssignedUUID = (LLUUID) configuration_result;
  450. break;
  451. case "master_avatar_first":
  452. MasterAvatarFirstName = (string) configuration_result;
  453. break;
  454. case "master_avatar_last":
  455. MasterAvatarLastName = (string) configuration_result;
  456. break;
  457. case "master_avatar_pass":
  458. string tempMD5Passwd = (string) configuration_result;
  459. MasterAvatarSandboxPassword = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + String.Empty);
  460. break;
  461. case "lastmap_uuid":
  462. lastMapUUID = (LLUUID)configuration_result;
  463. break;
  464. case "lastmap_refresh":
  465. lastMapRefresh = (string)configuration_result;
  466. break;
  467. }
  468. return true;
  469. }
  470. public void SaveLastMapUUID(LLUUID mapUUID)
  471. {
  472. if (null == configMember) return;
  473. lastMapUUID = mapUUID;
  474. lastMapRefresh = Util.UnixTimeSinceEpoch().ToString();
  475. configMember.forceSetConfigurationOption("lastmap_uuid", mapUUID.ToString());
  476. configMember.forceSetConfigurationOption("lastmap_refresh", lastMapRefresh);
  477. }
  478. }
  479. }