RegionInfo.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  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.Net;
  29. using System.Net.Sockets;
  30. using System.Xml;
  31. using Nini.Config;
  32. using OpenMetaverse;
  33. namespace OpenSim.Framework
  34. {
  35. [Serializable]
  36. public class SimpleRegionInfo
  37. {
  38. // private static readonly log4net.ILog m_log
  39. // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
  40. /// <summary>
  41. /// The port by which http communication occurs with the region (most noticeably, CAPS communication)
  42. /// </summary>
  43. public uint HttpPort
  44. {
  45. get { return m_httpPort; }
  46. set { m_httpPort = value; }
  47. }
  48. protected uint m_httpPort;
  49. /// <summary>
  50. /// A well-formed URI for the host region server (namely "http://" + ExternalHostName)
  51. /// </summary>
  52. public string ServerURI
  53. {
  54. get { return m_serverURI; }
  55. set { m_serverURI = value; }
  56. }
  57. protected string m_serverURI;
  58. protected bool Allow_Alternate_Ports;
  59. public bool m_allow_alternate_ports;
  60. protected string m_externalHostName;
  61. protected IPEndPoint m_internalEndPoint;
  62. protected uint? m_regionLocX;
  63. protected uint? m_regionLocY;
  64. protected uint m_remotingPort;
  65. public UUID RegionID = UUID.Zero;
  66. public string RemotingAddress;
  67. public SimpleRegionInfo()
  68. {
  69. }
  70. public SimpleRegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri)
  71. {
  72. m_regionLocX = regionLocX;
  73. m_regionLocY = regionLocY;
  74. m_internalEndPoint = internalEndPoint;
  75. m_externalHostName = externalUri;
  76. }
  77. public SimpleRegionInfo(uint regionLocX, uint regionLocY, string externalUri, uint port)
  78. {
  79. m_regionLocX = regionLocX;
  80. m_regionLocY = regionLocY;
  81. m_externalHostName = externalUri;
  82. m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int) port);
  83. }
  84. public SimpleRegionInfo(RegionInfo ConvertFrom)
  85. {
  86. m_regionLocX = ConvertFrom.RegionLocX;
  87. m_regionLocY = ConvertFrom.RegionLocY;
  88. m_internalEndPoint = ConvertFrom.InternalEndPoint;
  89. m_externalHostName = ConvertFrom.ExternalHostName;
  90. m_remotingPort = ConvertFrom.RemotingPort;
  91. m_httpPort = ConvertFrom.HttpPort;
  92. m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports;
  93. RemotingAddress = ConvertFrom.RemotingAddress;
  94. RegionID = UUID.Zero;
  95. ServerURI = ConvertFrom.ServerURI;
  96. }
  97. public uint RemotingPort
  98. {
  99. get { return m_remotingPort; }
  100. set { m_remotingPort = value; }
  101. }
  102. /// <value>
  103. /// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw.
  104. ///
  105. /// XXX Isn't this really doing too much to be a simple getter, rather than an explict method?
  106. /// </value>
  107. public IPEndPoint ExternalEndPoint
  108. {
  109. get
  110. {
  111. // Old one defaults to IPv6
  112. //return new IPEndPoint(Dns.GetHostAddresses(m_externalHostName)[0], m_internalEndPoint.Port);
  113. IPAddress ia = null;
  114. // If it is already an IP, don't resolve it - just return directly
  115. if (IPAddress.TryParse(m_externalHostName, out ia))
  116. return new IPEndPoint(ia, m_internalEndPoint.Port);
  117. // Reset for next check
  118. ia = null;
  119. foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName))
  120. {
  121. if (ia == null)
  122. ia = Adr;
  123. if (Adr.AddressFamily == AddressFamily.InterNetwork)
  124. {
  125. ia = Adr;
  126. break;
  127. }
  128. }
  129. return new IPEndPoint(ia, m_internalEndPoint.Port);
  130. }
  131. set { m_externalHostName = value.ToString(); }
  132. }
  133. public string ExternalHostName
  134. {
  135. get { return m_externalHostName; }
  136. set { m_externalHostName = value; }
  137. }
  138. public IPEndPoint InternalEndPoint
  139. {
  140. get { return m_internalEndPoint; }
  141. set { m_internalEndPoint = value; }
  142. }
  143. public uint RegionLocX
  144. {
  145. get { return m_regionLocX.Value; }
  146. set { m_regionLocX = value; }
  147. }
  148. public uint RegionLocY
  149. {
  150. get { return m_regionLocY.Value; }
  151. set { m_regionLocY = value; }
  152. }
  153. public ulong RegionHandle
  154. {
  155. get { return Util.UIntsToLong((RegionLocX * (uint) Constants.RegionSize), (RegionLocY * (uint) Constants.RegionSize)); }
  156. }
  157. public int getInternalEndPointPort()
  158. {
  159. return m_internalEndPoint.Port;
  160. }
  161. }
  162. public class RegionInfo : SimpleRegionInfo
  163. {
  164. // private static readonly log4net.ILog m_log
  165. // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
  166. public bool commFailTF = false;
  167. public ConfigurationMember configMember;
  168. public string DataStore = String.Empty;
  169. public string RegionFile = String.Empty;
  170. public bool isSandbox = false;
  171. private EstateSettings m_estateSettings;
  172. private RegionSettings m_regionSettings;
  173. // public bool m_allow_alternate_ports;
  174. public UUID MasterAvatarAssignedUUID = UUID.Zero;
  175. public string MasterAvatarFirstName = String.Empty;
  176. public string MasterAvatarLastName = String.Empty;
  177. public string MasterAvatarSandboxPassword = String.Empty;
  178. public UUID originRegionID = UUID.Zero;
  179. public string proxyUrl = "";
  180. public string RegionName = String.Empty;
  181. public string regionSecret = UUID.Random().ToString();
  182. public UUID lastMapUUID = UUID.Zero;
  183. public string lastMapRefresh = "0";
  184. // Apparently, we're applying the same estatesettings regardless of whether it's local or remote.
  185. // MT: Yes. Estates can't span trust boundaries. Therefore, it can be
  186. // assumed that all instances belonging to one estate are able to
  187. // access the same database server. Since estate settings are lodaed
  188. // from there, that should be sufficient for full remote administration
  189. public RegionInfo(string description, string filename, bool skipConsoleConfig)
  190. {
  191. configMember =
  192. new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig);
  193. configMember.performConfigurationRetrieve();
  194. RegionFile = filename;
  195. }
  196. public RegionInfo(string description, XmlNode xmlNode, bool skipConsoleConfig)
  197. {
  198. configMember =
  199. new ConfigurationMember(xmlNode, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig);
  200. configMember.performConfigurationRetrieve();
  201. }
  202. public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) :
  203. base(regionLocX, regionLocY, internalEndPoint, externalUri)
  204. {
  205. }
  206. public RegionInfo()
  207. {
  208. }
  209. public RegionInfo(SerializableRegionInfo ConvertFrom)
  210. {
  211. m_regionLocX = ConvertFrom.RegionLocX;
  212. m_regionLocY = ConvertFrom.RegionLocY;
  213. m_internalEndPoint = ConvertFrom.InternalEndPoint;
  214. m_externalHostName = ConvertFrom.ExternalHostName;
  215. m_remotingPort = ConvertFrom.RemotingPort;
  216. m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports;
  217. RemotingAddress = ConvertFrom.RemotingAddress;
  218. RegionID = UUID.Zero;
  219. proxyUrl = ConvertFrom.ProxyUrl;
  220. originRegionID = ConvertFrom.OriginRegionID;
  221. RegionName = ConvertFrom.RegionName;
  222. ServerURI = ConvertFrom.ServerURI;
  223. }
  224. public RegionInfo(SimpleRegionInfo ConvertFrom)
  225. {
  226. m_regionLocX = ConvertFrom.RegionLocX;
  227. m_regionLocY = ConvertFrom.RegionLocY;
  228. m_internalEndPoint = ConvertFrom.InternalEndPoint;
  229. m_externalHostName = ConvertFrom.ExternalHostName;
  230. m_remotingPort = ConvertFrom.RemotingPort;
  231. m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports;
  232. RemotingAddress = ConvertFrom.RemotingAddress;
  233. RegionID = UUID.Zero;
  234. ServerURI = ConvertFrom.ServerURI;
  235. }
  236. public EstateSettings EstateSettings
  237. {
  238. get
  239. {
  240. if (m_estateSettings == null)
  241. {
  242. m_estateSettings = new EstateSettings();
  243. }
  244. return m_estateSettings;
  245. }
  246. set { m_estateSettings = value; }
  247. }
  248. public RegionSettings RegionSettings
  249. {
  250. get
  251. {
  252. if (m_regionSettings == null)
  253. {
  254. m_regionSettings = new RegionSettings();
  255. }
  256. return m_regionSettings;
  257. }
  258. set { m_regionSettings = value; }
  259. }
  260. public void SetEndPoint(string ipaddr, int port)
  261. {
  262. IPAddress tmpIP = IPAddress.Parse(ipaddr);
  263. IPEndPoint tmpEPE = new IPEndPoint(tmpIP, port);
  264. m_internalEndPoint = tmpEPE;
  265. }
  266. //not in use, should swap to nini though.
  267. public void LoadFromNiniSource(IConfigSource source)
  268. {
  269. LoadFromNiniSource(source, "RegionInfo");
  270. }
  271. //not in use, should swap to nini though.
  272. public void LoadFromNiniSource(IConfigSource source, string sectionName)
  273. {
  274. string errorMessage = String.Empty;
  275. RegionID = new UUID(source.Configs[sectionName].GetString("Region_ID", UUID.Random().ToString()));
  276. RegionName = source.Configs[sectionName].GetString("sim_name", "OpenSim Test");
  277. m_regionLocX = Convert.ToUInt32(source.Configs[sectionName].GetString("sim_location_x", "1000"));
  278. m_regionLocY = Convert.ToUInt32(source.Configs[sectionName].GetString("sim_location_y", "1000"));
  279. // this.DataStore = source.Configs[sectionName].GetString("datastore", "OpenSim.db");
  280. string ipAddress = source.Configs[sectionName].GetString("internal_ip_address", "0.0.0.0");
  281. IPAddress ipAddressResult;
  282. if (IPAddress.TryParse(ipAddress, out ipAddressResult))
  283. {
  284. m_internalEndPoint = new IPEndPoint(ipAddressResult, 0);
  285. }
  286. else
  287. {
  288. errorMessage = "needs an IP Address (IPAddress)";
  289. }
  290. m_internalEndPoint.Port =
  291. source.Configs[sectionName].GetInt("internal_ip_port", (int) NetworkServersInfo.DefaultHttpListenerPort);
  292. string externalHost = source.Configs[sectionName].GetString("external_host_name", "127.0.0.1");
  293. if (externalHost != "SYSTEMIP")
  294. {
  295. m_externalHostName = externalHost;
  296. }
  297. else
  298. {
  299. m_externalHostName = Util.GetLocalHost().ToString();
  300. }
  301. MasterAvatarFirstName = source.Configs[sectionName].GetString("master_avatar_first", "Test");
  302. MasterAvatarLastName = source.Configs[sectionName].GetString("master_avatar_last", "User");
  303. MasterAvatarSandboxPassword = source.Configs[sectionName].GetString("master_avatar_pass", "test");
  304. if (errorMessage != String.Empty)
  305. {
  306. // a error
  307. }
  308. }
  309. public bool ignoreIncomingConfiguration(string configuration_key, object configuration_result)
  310. {
  311. return true;
  312. }
  313. public void SaveRegionToFile(string description, string filename)
  314. {
  315. configMember = new ConfigurationMember(filename, description, loadConfigurationOptionsFromMe,
  316. ignoreIncomingConfiguration, false);
  317. configMember.performConfigurationRetrieve();
  318. RegionFile = filename;
  319. }
  320. public void loadConfigurationOptionsFromMe()
  321. {
  322. configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_UUID_NULL_FREE,
  323. "UUID of Region (Default is recommended, random UUID)",
  324. RegionID.ToString(), true);
  325. configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  326. "Region Name", RegionName, true);
  327. configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
  328. "Grid Location (X Axis)", m_regionLocX.ToString(), true);
  329. configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
  330. "Grid Location (Y Axis)", m_regionLocY.ToString(), true);
  331. //configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false);
  332. configMember.addConfigurationOption("internal_ip_address",
  333. ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS,
  334. "Internal IP Address for incoming UDP client connections",
  335. m_internalEndPoint.Address.ToString(),
  336. true);
  337. configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
  338. "Internal IP Port for incoming UDP client connections",
  339. m_internalEndPoint.Port.ToString(), true);
  340. configMember.addConfigurationOption("allow_alternate_ports",
  341. ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
  342. "Allow sim to find alternate UDP ports when ports are in use?",
  343. m_allow_alternate_ports.ToString(), true);
  344. configMember.addConfigurationOption("external_host_name",
  345. ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  346. "External Host Name", m_externalHostName, true);
  347. configMember.addConfigurationOption("master_avatar_uuid", ConfigurationOption.ConfigurationTypes.TYPE_UUID,
  348. "Master Avatar UUID", MasterAvatarAssignedUUID.ToString(), true);
  349. configMember.addConfigurationOption("master_avatar_first",
  350. ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  351. "First Name of Master Avatar", MasterAvatarFirstName, true);
  352. configMember.addConfigurationOption("master_avatar_last",
  353. ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  354. "Last Name of Master Avatar", MasterAvatarLastName, true);
  355. configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
  356. "(Sandbox Mode Only)Password for Master Avatar account",
  357. MasterAvatarSandboxPassword, true);
  358. configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_UUID,
  359. "Last Map UUID", lastMapUUID.ToString(), true);
  360. configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  361. "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true);
  362. }
  363. public void loadConfigurationOptions()
  364. {
  365. configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_UUID,
  366. "UUID of Region (Default is recommended, random UUID)",
  367. UUID.Random().ToString(), true);
  368. configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  369. "Region Name", "OpenSim Test", false);
  370. configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
  371. "Grid Location (X Axis)", "1000", false);
  372. configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
  373. "Grid Location (Y Axis)", "1000", false);
  374. //configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false);
  375. configMember.addConfigurationOption("internal_ip_address",
  376. ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS,
  377. "Internal IP Address for incoming UDP client connections", "0.0.0.0",
  378. false);
  379. configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
  380. "Internal IP Port for incoming UDP client connections",
  381. NetworkServersInfo.DefaultHttpListenerPort.ToString(), false);
  382. configMember.addConfigurationOption("allow_alternate_ports", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
  383. "Allow sim to find alternate UDP ports when ports are in use?",
  384. "false", true);
  385. configMember.addConfigurationOption("external_host_name",
  386. ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  387. "External Host Name", "127.0.0.1", false);
  388. configMember.addConfigurationOption("master_avatar_uuid", ConfigurationOption.ConfigurationTypes.TYPE_UUID,
  389. "Master Avatar UUID", UUID.Zero.ToString(), true);
  390. configMember.addConfigurationOption("master_avatar_first",
  391. ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  392. "First Name of Master Avatar", "Test", false,
  393. (ConfigurationOption.ConfigurationOptionShouldBeAsked)
  394. shouldMasterAvatarDetailsBeAsked);
  395. configMember.addConfigurationOption("master_avatar_last",
  396. ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  397. "Last Name of Master Avatar", "User", false,
  398. (ConfigurationOption.ConfigurationOptionShouldBeAsked)
  399. shouldMasterAvatarDetailsBeAsked);
  400. configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
  401. "(Sandbox Mode Only)Password for Master Avatar account", "test", false,
  402. (ConfigurationOption.ConfigurationOptionShouldBeAsked)
  403. shouldMasterAvatarDetailsBeAsked);
  404. configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_UUID,
  405. "Last Map UUID", lastMapUUID.ToString(), true);
  406. configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
  407. "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true);
  408. }
  409. public bool shouldMasterAvatarDetailsBeAsked(string configuration_key)
  410. {
  411. return MasterAvatarAssignedUUID == UUID.Zero;
  412. }
  413. public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
  414. {
  415. switch (configuration_key)
  416. {
  417. case "sim_UUID":
  418. RegionID = (UUID) configuration_result;
  419. originRegionID = (UUID) configuration_result;
  420. break;
  421. case "sim_name":
  422. RegionName = (string) configuration_result;
  423. break;
  424. case "sim_location_x":
  425. m_regionLocX = (uint) configuration_result;
  426. break;
  427. case "sim_location_y":
  428. m_regionLocY = (uint) configuration_result;
  429. break;
  430. case "datastore":
  431. DataStore = (string) configuration_result;
  432. break;
  433. case "internal_ip_address":
  434. IPAddress address = (IPAddress) configuration_result;
  435. m_internalEndPoint = new IPEndPoint(address, 0);
  436. break;
  437. case "internal_ip_port":
  438. m_internalEndPoint.Port = (int) configuration_result;
  439. break;
  440. case "allow_alternate_ports":
  441. m_allow_alternate_ports = (bool) configuration_result;
  442. break;
  443. case "external_host_name":
  444. if ((string) configuration_result != "SYSTEMIP")
  445. {
  446. m_externalHostName = (string) configuration_result;
  447. }
  448. else
  449. {
  450. m_externalHostName = Util.GetLocalHost().ToString();
  451. }
  452. break;
  453. case "master_avatar_uuid":
  454. MasterAvatarAssignedUUID = (UUID) configuration_result;
  455. break;
  456. case "master_avatar_first":
  457. MasterAvatarFirstName = (string) configuration_result;
  458. break;
  459. case "master_avatar_last":
  460. MasterAvatarLastName = (string) configuration_result;
  461. break;
  462. case "master_avatar_pass":
  463. MasterAvatarSandboxPassword = (string)configuration_result;
  464. break;
  465. case "lastmap_uuid":
  466. lastMapUUID = (UUID)configuration_result;
  467. break;
  468. case "lastmap_refresh":
  469. lastMapRefresh = (string)configuration_result;
  470. break;
  471. }
  472. return true;
  473. }
  474. public void SaveLastMapUUID(UUID mapUUID)
  475. {
  476. if (null == configMember) return;
  477. lastMapUUID = mapUUID;
  478. lastMapRefresh = Util.UnixTimeSinceEpoch().ToString();
  479. configMember.forceSetConfigurationOption("lastmap_uuid", mapUUID.ToString());
  480. configMember.forceSetConfigurationOption("lastmap_refresh", lastMapRefresh);
  481. }
  482. }
  483. }