EstateSettings.cs 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015
  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.IO;
  29. using libsecondlife;
  30. using OpenSim.Framework.Console;
  31. namespace OpenSim.Framework
  32. {
  33. public class EstateSettings
  34. {
  35. private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
  36. //Settings to this island
  37. private float m_billableFactor;
  38. public float billableFactor
  39. {
  40. get { return m_billableFactor; }
  41. set
  42. {
  43. m_billableFactor = value;
  44. configMember.forceSetConfigurationOption("billable_factor", m_billableFactor.ToString());
  45. }
  46. }
  47. private uint m_estateID;
  48. public uint estateID
  49. {
  50. get { return m_estateID; }
  51. set
  52. {
  53. m_estateID = value;
  54. configMember.forceSetConfigurationOption("estate_id", m_estateID.ToString());
  55. }
  56. }
  57. private uint m_parentEstateID;
  58. public uint parentEstateID
  59. {
  60. get { return m_parentEstateID; }
  61. set
  62. {
  63. m_parentEstateID = value;
  64. configMember.forceSetConfigurationOption("parent_estate_id", m_parentEstateID.ToString());
  65. }
  66. }
  67. private byte m_maxAgents;
  68. public byte maxAgents
  69. {
  70. get { return m_maxAgents; }
  71. set
  72. {
  73. m_maxAgents = value;
  74. configMember.forceSetConfigurationOption("max_agents", m_maxAgents.ToString());
  75. }
  76. }
  77. private float m_objectBonusFactor;
  78. public float objectBonusFactor
  79. {
  80. get { return m_objectBonusFactor; }
  81. set
  82. {
  83. m_objectBonusFactor = value;
  84. configMember.forceSetConfigurationOption("object_bonus_factor", m_objectBonusFactor.ToString());
  85. }
  86. }
  87. private int m_redirectGridX;
  88. public int redirectGridX
  89. {
  90. get { return m_redirectGridX; }
  91. set
  92. {
  93. m_redirectGridX = value;
  94. configMember.forceSetConfigurationOption("redirect_grid_x", m_redirectGridX.ToString());
  95. }
  96. }
  97. private int m_redirectGridY;
  98. public int redirectGridY
  99. {
  100. get { return m_redirectGridY; }
  101. set
  102. {
  103. m_redirectGridY = value;
  104. configMember.forceSetConfigurationOption("redirect_grid_y", m_redirectGridY.ToString());
  105. }
  106. }
  107. private Simulator.RegionFlags m_regionFlags;
  108. public Simulator.RegionFlags regionFlags
  109. {
  110. get { return m_regionFlags; }
  111. set
  112. {
  113. m_regionFlags = value;
  114. configMember.forceSetConfigurationOption("region_flags", ((uint)m_regionFlags).ToString());
  115. }
  116. }
  117. private Simulator.SimAccess m_simAccess;
  118. public Simulator.SimAccess simAccess
  119. {
  120. get { return m_simAccess; }
  121. set
  122. {
  123. m_simAccess = value;
  124. configMember.forceSetConfigurationOption("sim_access", ((byte)m_simAccess).ToString());
  125. }
  126. }
  127. private float m_sunHour;
  128. public float sunHour
  129. {
  130. get { return m_sunHour; }
  131. set
  132. {
  133. m_sunHour = value;
  134. configMember.forceSetConfigurationOption("sun_hour", m_sunHour.ToString());
  135. }
  136. }
  137. private float m_terrainRaiseLimit;
  138. public float terrainRaiseLimit
  139. {
  140. get { return m_terrainRaiseLimit; }
  141. set
  142. {
  143. m_terrainRaiseLimit = value;
  144. configMember.forceSetConfigurationOption("terrain_raise_limit", m_terrainRaiseLimit.ToString());
  145. }
  146. }
  147. private float m_terrainLowerLimit;
  148. public float terrainLowerLimit
  149. {
  150. get { return m_terrainLowerLimit; }
  151. set
  152. {
  153. m_terrainLowerLimit = value;
  154. configMember.forceSetConfigurationOption("terrain_lower_limit", m_terrainLowerLimit.ToString());
  155. }
  156. }
  157. private bool m_useFixedSun;
  158. public bool useFixedSun
  159. {
  160. get { return m_useFixedSun; }
  161. set
  162. {
  163. m_useFixedSun = value;
  164. configMember.forceSetConfigurationOption("use_fixed_sun", m_useFixedSun.ToString());
  165. }
  166. }
  167. private int m_pricePerMeter;
  168. public int pricePerMeter
  169. {
  170. get { return m_pricePerMeter; }
  171. set
  172. {
  173. m_pricePerMeter = value;
  174. configMember.forceSetConfigurationOption("price_per_meter", m_pricePerMeter.ToString());
  175. }
  176. }
  177. private ushort m_regionWaterHeight;
  178. public ushort regionWaterHeight
  179. {
  180. get { return m_regionWaterHeight; }
  181. set
  182. {
  183. m_regionWaterHeight = value;
  184. configMember.forceSetConfigurationOption("region_water_height", m_regionWaterHeight.ToString());
  185. }
  186. }
  187. private bool m_regionAllowTerraform;
  188. public bool regionAllowTerraform
  189. {
  190. get { return m_regionAllowTerraform; }
  191. set
  192. {
  193. m_regionAllowTerraform = value;
  194. configMember.forceSetConfigurationOption("region_allow_terraform", m_regionAllowTerraform.ToString());
  195. }
  196. }
  197. // Region Information
  198. // Low resolution 'base' textures. No longer used.
  199. private LLUUID m_terrainBase0;
  200. public LLUUID terrainBase0
  201. {
  202. get { return m_terrainBase0; }
  203. set
  204. {
  205. m_terrainBase0 = value;
  206. configMember.forceSetConfigurationOption("terrain_base_0", m_terrainBase0.ToString());
  207. }
  208. }
  209. private LLUUID m_terrainBase1;
  210. public LLUUID terrainBase1
  211. {
  212. get { return m_terrainBase1; }
  213. set
  214. {
  215. m_terrainBase1 = value;
  216. configMember.forceSetConfigurationOption("terrain_base_1", m_terrainBase1.ToString());
  217. }
  218. }
  219. private LLUUID m_terrainBase2;
  220. public LLUUID terrainBase2
  221. {
  222. get { return m_terrainBase2; }
  223. set
  224. {
  225. m_terrainBase2 = value;
  226. configMember.forceSetConfigurationOption("terrain_base_2", m_terrainBase2.ToString());
  227. }
  228. }
  229. private LLUUID m_terrainBase3;
  230. public LLUUID terrainBase3
  231. {
  232. get { return m_terrainBase3; }
  233. set
  234. {
  235. m_terrainBase3 = value;
  236. configMember.forceSetConfigurationOption("terrain_base_3", m_terrainBase3.ToString());
  237. }
  238. }
  239. // Higher resolution terrain textures
  240. private LLUUID m_terrainDetail0;
  241. public LLUUID terrainDetail0
  242. {
  243. get { return m_terrainDetail0; }
  244. set
  245. {
  246. m_terrainDetail0 = value;
  247. configMember.forceSetConfigurationOption("terrain_detail_0", m_terrainDetail0.ToString());
  248. }
  249. }
  250. private LLUUID m_terrainDetail1;
  251. public LLUUID terrainDetail1
  252. {
  253. get { return m_terrainDetail1; }
  254. set
  255. {
  256. m_terrainDetail1 = value;
  257. configMember.forceSetConfigurationOption("terrain_detail_1", m_terrainDetail1.ToString());
  258. }
  259. }
  260. private LLUUID m_terrainDetail2;
  261. public LLUUID terrainDetail2
  262. {
  263. get { return m_terrainDetail2; }
  264. set
  265. {
  266. m_terrainDetail2 = value;
  267. configMember.forceSetConfigurationOption("terrain_detail_2", m_terrainDetail2.ToString());
  268. }
  269. }
  270. private LLUUID m_terrainDetail3;
  271. public LLUUID terrainDetail3
  272. {
  273. get { return m_terrainDetail3; }
  274. set
  275. {
  276. m_terrainDetail3 = value;
  277. configMember.forceSetConfigurationOption("terrain_detail_3", m_terrainDetail3.ToString());
  278. }
  279. }
  280. // First quad - each point is bilinearly interpolated at each meter of terrain
  281. private float m_terrainStartHeight0;
  282. public float terrainStartHeight0
  283. {
  284. get { return m_terrainStartHeight0; }
  285. set
  286. {
  287. m_terrainStartHeight0 = value;
  288. configMember.forceSetConfigurationOption("terrain_start_height_0", m_terrainStartHeight0.ToString());
  289. }
  290. }
  291. private float m_terrainStartHeight1;
  292. public float terrainStartHeight1
  293. {
  294. get { return m_terrainStartHeight1; }
  295. set
  296. {
  297. m_terrainStartHeight1 = value;
  298. configMember.forceSetConfigurationOption("terrain_start_height_1", m_terrainStartHeight1.ToString());
  299. }
  300. }
  301. private float m_terrainStartHeight2;
  302. public float terrainStartHeight2
  303. {
  304. get { return m_terrainStartHeight2; }
  305. set
  306. {
  307. m_terrainStartHeight2 = value;
  308. configMember.forceSetConfigurationOption("terrain_start_height_2", m_terrainStartHeight2.ToString());
  309. }
  310. }
  311. private float m_terrainStartHeight3;
  312. public float terrainStartHeight3
  313. {
  314. get { return m_terrainStartHeight3; }
  315. set
  316. {
  317. m_terrainStartHeight3 = value;
  318. configMember.forceSetConfigurationOption("terrain_start_height_3", m_terrainStartHeight3.ToString());
  319. }
  320. }
  321. // Second quad - also bilinearly interpolated.
  322. // Terrain texturing is done that:
  323. // 0..3 (0 = base0, 3 = base3) = (terrain[x,y] - start[x,y]) / range[x,y]
  324. private float m_terrainHeightRange0;
  325. public float terrainHeightRange0
  326. {
  327. get { return m_terrainHeightRange0; }
  328. set
  329. {
  330. m_terrainHeightRange0 = value;
  331. configMember.forceSetConfigurationOption("terrain_height_range_0", m_terrainHeightRange0.ToString());
  332. }
  333. }
  334. private float m_terrainHeightRange1;
  335. public float terrainHeightRange1
  336. {
  337. get { return m_terrainHeightRange1; }
  338. set
  339. {
  340. m_terrainHeightRange1 = value;
  341. configMember.forceSetConfigurationOption("terrain_height_range_1", m_terrainHeightRange1.ToString());
  342. }
  343. }
  344. private float m_terrainHeightRange2;
  345. public float terrainHeightRange2
  346. {
  347. get { return m_terrainHeightRange2; }
  348. set
  349. {
  350. m_terrainHeightRange2 = value;
  351. configMember.forceSetConfigurationOption("terrain_height_range_2", m_terrainHeightRange2.ToString());
  352. }
  353. }
  354. private float m_terrainHeightRange3;
  355. public float terrainHeightRange3
  356. {
  357. get { return m_terrainHeightRange3; }
  358. set
  359. {
  360. m_terrainHeightRange3 = value;
  361. configMember.forceSetConfigurationOption("terrain_height_range_3", m_terrainHeightRange3.ToString());
  362. }
  363. }
  364. // Terrain Default (Must be in F32 Format!)
  365. private string m_terrainFile;
  366. public string terrainFile
  367. {
  368. get { return m_terrainFile; }
  369. set
  370. {
  371. m_terrainFile = value;
  372. configMember.forceSetConfigurationOption("terrain_file", m_terrainFile.ToString());
  373. }
  374. }
  375. private double m_terrainMultiplier;
  376. public double terrainMultiplier
  377. {
  378. get { return m_terrainMultiplier; }
  379. set
  380. {
  381. m_terrainMultiplier = value;
  382. configMember.forceSetConfigurationOption("terrain_multiplier", m_terrainMultiplier.ToString());
  383. }
  384. }
  385. private float m_waterHeight;
  386. public float waterHeight
  387. {
  388. get { return m_waterHeight; }
  389. set
  390. {
  391. m_waterHeight = value;
  392. configMember.forceSetConfigurationOption("water_height", m_waterHeight.ToString());
  393. }
  394. }
  395. private LLUUID m_terrainImageID;
  396. public LLUUID terrainImageID
  397. {
  398. get { return m_terrainImageID; }
  399. set
  400. {
  401. m_terrainImageID = value;
  402. // I don't think there is a reason that this actually
  403. // needs to be written back to the estate settings
  404. // file.
  405. // configMember.forceSetConfigurationOption("terrain_image_id", m_terrainImageID.ToString());
  406. }
  407. }
  408. private LLUUID m_estateManager0;
  409. private LLUUID m_estateManager1;
  410. private LLUUID m_estateManager2;
  411. private LLUUID m_estateManager3;
  412. private LLUUID m_estateManager4;
  413. private LLUUID m_estateManager5;
  414. private LLUUID m_estateManager6;
  415. private LLUUID m_estateManager7;
  416. private LLUUID m_estateManager8;
  417. private LLUUID m_estateManager9;
  418. public LLUUID[] estateManagers
  419. {
  420. get {
  421. // returns a condensed array of LLUUIDs
  422. return GetEstateManagers();
  423. }
  424. set
  425. {
  426. // Sets a Condensed array of LLUUIDS
  427. int i = 0;
  428. for (i = 0; i < value.Length; i++)
  429. {
  430. switch (i)
  431. {
  432. case 0:
  433. m_estateManager0 = value[i];
  434. break;
  435. case 1:
  436. m_estateManager1 = value[i];
  437. break;
  438. case 2:
  439. m_estateManager2 = value[i];
  440. break;
  441. case 3:
  442. m_estateManager3 = value[i];
  443. break;
  444. case 4:
  445. m_estateManager4 = value[i];
  446. break;
  447. case 5:
  448. m_estateManager5 = value[i];
  449. break;
  450. case 6:
  451. m_estateManager6 = value[i];
  452. break;
  453. case 7:
  454. m_estateManager7 = value[i];
  455. break;
  456. case 8:
  457. m_estateManager8 = value[i];
  458. break;
  459. case 9:
  460. m_estateManager9 = value[i];
  461. break;
  462. }
  463. }
  464. // Clear the rest of them.. as they're no longer valid
  465. for (int j = i; j < 10; j++)
  466. {
  467. switch (i)
  468. {
  469. case 0:
  470. m_estateManager0 = LLUUID.Zero;
  471. break;
  472. case 1:
  473. m_estateManager1 = LLUUID.Zero;
  474. break;
  475. case 2:
  476. m_estateManager2 = LLUUID.Zero;
  477. break;
  478. case 3:
  479. m_estateManager3 = LLUUID.Zero;
  480. break;
  481. case 4:
  482. m_estateManager4 = LLUUID.Zero;
  483. break;
  484. case 5:
  485. m_estateManager5 = LLUUID.Zero;
  486. break;
  487. case 6:
  488. m_estateManager6 = LLUUID.Zero;
  489. break;
  490. case 7:
  491. m_estateManager7 = LLUUID.Zero;
  492. break;
  493. case 8:
  494. m_estateManager8 = LLUUID.Zero;
  495. break;
  496. case 9:
  497. m_estateManager9 = LLUUID.Zero;
  498. break;
  499. }
  500. }
  501. for (i = 0; i < 10; i++)
  502. {
  503. // Writes out the Estate managers to the XML file.
  504. configMember.forceSetConfigurationOption("estate_manager_" + i, (GetEstateManagerAtPos(i)).ToString());
  505. }
  506. }
  507. }
  508. #region EstateManager Get Methods to sort out skipped spots in the XML (suser error)
  509. private LLUUID GetEstateManagerAtPos(int pos)
  510. {
  511. // This is a helper for writing them out to the xml file
  512. switch (pos)
  513. {
  514. case 0:
  515. return m_estateManager0;
  516. case 1:
  517. return m_estateManager1;
  518. case 2:
  519. return m_estateManager2;
  520. case 3:
  521. return m_estateManager3;
  522. case 4:
  523. return m_estateManager4;
  524. case 5:
  525. return m_estateManager5;
  526. case 6:
  527. return m_estateManager6;
  528. case 7:
  529. return m_estateManager7;
  530. case 8:
  531. return m_estateManager8;
  532. case 9:
  533. return m_estateManager9;
  534. default:
  535. return LLUUID.Zero;
  536. }
  537. }
  538. private LLUUID[] GetEstateManagers()
  539. {
  540. int numEstateManagers = GetNumberOfEstateManagers();
  541. LLUUID[] rEstateManagers = new LLUUID[numEstateManagers];
  542. int pos = 0;
  543. for (int i = 0; i < numEstateManagers; i++)
  544. {
  545. pos = GetNextEstateManager(pos);
  546. rEstateManagers[i] = GetEstateManagerAtPos(pos); pos++;
  547. }
  548. return rEstateManagers;
  549. }
  550. private int GetNextEstateManager(int startpos)
  551. {
  552. // This is a utility function that skips over estate managers set to LLUUID.Zero
  553. int i = startpos;
  554. for (i=startpos;i<10;i++)
  555. {
  556. if (GetEstateManagerAtPos(i) != LLUUID.Zero) return i;
  557. }
  558. return i;
  559. }
  560. private int GetNumberOfEstateManagers()
  561. {
  562. // This function returns the number of estate managers set
  563. // Regardless of whether there is a skipped spot
  564. int numEstateManagers = 0;
  565. if (m_estateManager0 != LLUUID.Zero) numEstateManagers++;
  566. if (m_estateManager1 != LLUUID.Zero) numEstateManagers++;
  567. if (m_estateManager2 != LLUUID.Zero) numEstateManagers++;
  568. if (m_estateManager3 != LLUUID.Zero) numEstateManagers++;
  569. if (m_estateManager4 != LLUUID.Zero) numEstateManagers++;
  570. if (m_estateManager5 != LLUUID.Zero) numEstateManagers++;
  571. if (m_estateManager6 != LLUUID.Zero) numEstateManagers++;
  572. if (m_estateManager7 != LLUUID.Zero) numEstateManagers++;
  573. if (m_estateManager8 != LLUUID.Zero) numEstateManagers++;
  574. if (m_estateManager9 != LLUUID.Zero) numEstateManagers++;
  575. return numEstateManagers;
  576. }
  577. public void AddEstateManager(LLUUID avatarID)
  578. {
  579. LLUUID[] testateManagers = GetEstateManagers();
  580. LLUUID[] nestateManagers = new LLUUID[testateManagers.Length + 1];
  581. int i = 0;
  582. for (i = 0; i < testateManagers.Length; i++)
  583. {
  584. nestateManagers[i] = testateManagers[i];
  585. }
  586. nestateManagers[i] = avatarID;
  587. //Saves it to the estate settings file
  588. estateManagers = nestateManagers;
  589. }
  590. public void RemoveEstateManager(LLUUID avatarID)
  591. {
  592. int notfoundparam = 11; // starting high so the condense routine (max ten) doesn't run if we don't find it.
  593. LLUUID[] testateManagers = GetEstateManagers(); // temporary estate managers list
  594. int i = 0;
  595. int foundpos = notfoundparam;
  596. // search for estate manager.
  597. for (i = 0; i < testateManagers.Length; i++)
  598. {
  599. if (testateManagers[i] == avatarID)
  600. {
  601. foundpos = i;
  602. break;
  603. }
  604. }
  605. if (foundpos < notfoundparam)
  606. {
  607. LLUUID[] restateManagers = new LLUUID[testateManagers.Length - 1];
  608. // fill new estate managers array up to the found spot
  609. for (int j = 0; j < foundpos; j++)
  610. restateManagers[j] = testateManagers[j];
  611. // skip over the estate manager we're removing and compress
  612. for (int j = foundpos + 1; j < testateManagers.Length; j++)
  613. restateManagers[j - 1] = testateManagers[j];
  614. estateManagers = restateManagers;
  615. }
  616. else
  617. {
  618. m_log.Error("[ESTATESETTINGS]: Unable to locate estate manager : " + avatarID.ToString() + " for removal");
  619. }
  620. }
  621. #endregion
  622. private ConfigurationMember configMember;
  623. public EstateSettings()
  624. {
  625. // Temporary hack to prevent multiple loadings.
  626. if (configMember == null)
  627. {
  628. configMember =
  629. new ConfigurationMember(Path.Combine(Util.configDir(), "estate_settings.xml"), "ESTATE SETTINGS",
  630. loadConfigurationOptions, handleIncomingConfiguration, true);
  631. configMember.performConfigurationRetrieve();
  632. }
  633. }
  634. public void loadConfigurationOptions()
  635. {
  636. configMember.addConfigurationOption("billable_factor", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty,
  637. "0.0", true);
  638. configMember.addConfigurationOption("estate_id", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, String.Empty, "0",
  639. true);
  640. configMember.addConfigurationOption("parent_estate_id", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
  641. String.Empty, "0", true);
  642. configMember.addConfigurationOption("max_agents", ConfigurationOption.ConfigurationTypes.TYPE_BYTE, String.Empty, "40",
  643. true);
  644. configMember.addConfigurationOption("object_bonus_factor", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
  645. String.Empty, "1.0", true);
  646. configMember.addConfigurationOption("redirect_grid_x", ConfigurationOption.ConfigurationTypes.TYPE_INT32, String.Empty,
  647. "0", true);
  648. configMember.addConfigurationOption("redirect_grid_y", ConfigurationOption.ConfigurationTypes.TYPE_INT32, String.Empty,
  649. "0", true);
  650. configMember.addConfigurationOption("region_flags", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, String.Empty,
  651. "0", true);
  652. configMember.addConfigurationOption("sim_access", ConfigurationOption.ConfigurationTypes.TYPE_BYTE, String.Empty, "21",
  653. true);
  654. configMember.addConfigurationOption("sun_hour", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "0",
  655. true);
  656. configMember.addConfigurationOption("terrain_raise_limit", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
  657. String.Empty, "0", true);
  658. configMember.addConfigurationOption("terrain_lower_limit", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
  659. String.Empty, "0", true);
  660. configMember.addConfigurationOption("use_fixed_sun", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, String.Empty,
  661. "false", true);
  662. configMember.addConfigurationOption("price_per_meter", ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
  663. String.Empty, "1", true);
  664. configMember.addConfigurationOption("region_water_height",
  665. ConfigurationOption.ConfigurationTypes.TYPE_UINT16, String.Empty, "20", true);
  666. configMember.addConfigurationOption("region_allow_terraform",
  667. ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, String.Empty, "true", true);
  668. configMember.addConfigurationOption("terrain_base_0", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, String.Empty,
  669. "b8d3965a-ad78-bf43-699b-bff8eca6c975", true);
  670. configMember.addConfigurationOption("terrain_base_1", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, String.Empty,
  671. "abb783e6-3e93-26c0-248a-247666855da3", true);
  672. configMember.addConfigurationOption("terrain_base_2", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, String.Empty,
  673. "179cdabd-398a-9b6b-1391-4dc333ba321f", true);
  674. configMember.addConfigurationOption("terrain_base_3", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, String.Empty,
  675. "beb169c7-11ea-fff2-efe5-0f24dc881df2", true);
  676. configMember.addConfigurationOption("terrain_detail_0", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  677. String.Empty, "00000000-0000-0000-0000-000000000000", true);
  678. configMember.addConfigurationOption("terrain_detail_1", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  679. String.Empty, "00000000-0000-0000-0000-000000000000", true);
  680. configMember.addConfigurationOption("terrain_detail_2", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  681. String.Empty, "00000000-0000-0000-0000-000000000000", true);
  682. configMember.addConfigurationOption("terrain_detail_3", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  683. String.Empty, "00000000-0000-0000-0000-000000000000", true);
  684. configMember.addConfigurationOption("terrain_start_height_0",
  685. ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "10.0", true);
  686. configMember.addConfigurationOption("terrain_start_height_1",
  687. ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "10.0", true);
  688. configMember.addConfigurationOption("terrain_start_height_2",
  689. ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "10.0", true);
  690. configMember.addConfigurationOption("terrain_start_height_3",
  691. ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "10.0", true);
  692. configMember.addConfigurationOption("terrain_height_range_0",
  693. ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "60.0", true);
  694. configMember.addConfigurationOption("terrain_height_range_1",
  695. ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "60.0", true);
  696. configMember.addConfigurationOption("terrain_height_range_2",
  697. ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "60.0", true);
  698. configMember.addConfigurationOption("terrain_height_range_3",
  699. ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "60.0", true);
  700. configMember.addConfigurationOption("terrain_file",
  701. ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, String.Empty,
  702. "default.r32", true);
  703. configMember.addConfigurationOption("terrain_multiplier", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
  704. String.Empty, "60.0", true);
  705. configMember.addConfigurationOption("water_height", ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, String.Empty,
  706. "20.0", true);
  707. configMember.addConfigurationOption("terrain_image_id", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  708. String.Empty, "00000000-0000-0000-0000-000000000000", true);
  709. configMember.addConfigurationOption("estate_manager_0", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  710. String.Empty, "00000000-0000-0000-0000-000000000000", true);
  711. configMember.addConfigurationOption("estate_manager_1", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  712. String.Empty, "00000000-0000-0000-0000-000000000000", true);
  713. configMember.addConfigurationOption("estate_manager_2", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  714. String.Empty, "00000000-0000-0000-0000-000000000000", true);
  715. configMember.addConfigurationOption("estate_manager_3", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  716. String.Empty, "00000000-0000-0000-0000-000000000000", true);
  717. configMember.addConfigurationOption("estate_manager_4", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  718. String.Empty, "00000000-0000-0000-0000-000000000000", true);
  719. configMember.addConfigurationOption("estate_manager_5", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  720. String.Empty, "00000000-0000-0000-0000-000000000000", true);
  721. configMember.addConfigurationOption("estate_manager_6", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  722. String.Empty, "00000000-0000-0000-0000-000000000000", true);
  723. configMember.addConfigurationOption("estate_manager_7", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  724. String.Empty, "00000000-0000-0000-0000-000000000000", true);
  725. configMember.addConfigurationOption("estate_manager_8", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  726. String.Empty, "00000000-0000-0000-0000-000000000000", true);
  727. configMember.addConfigurationOption("estate_manager_9", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
  728. String.Empty, "00000000-0000-0000-0000-000000000000", true);
  729. }
  730. public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
  731. {
  732. switch (configuration_key)
  733. {
  734. case "billable_factor":
  735. m_billableFactor = (float) configuration_result;
  736. break;
  737. case "estate_id":
  738. m_estateID = (uint) configuration_result;
  739. break;
  740. case "parent_estate_id":
  741. m_parentEstateID = (uint) configuration_result;
  742. break;
  743. case "max_agents":
  744. m_maxAgents = (byte) configuration_result;
  745. break;
  746. case "object_bonus_factor":
  747. m_objectBonusFactor = (float) configuration_result;
  748. break;
  749. case "redirect_grid_x":
  750. m_redirectGridX = (int) configuration_result;
  751. break;
  752. case "redirect_grid_y":
  753. m_redirectGridY = (int) configuration_result;
  754. break;
  755. case "region_flags":
  756. m_regionFlags = (Simulator.RegionFlags) ((uint) configuration_result);
  757. break;
  758. case "sim_access":
  759. m_simAccess = (Simulator.SimAccess) ((byte) configuration_result);
  760. break;
  761. case "sun_hour":
  762. m_sunHour = (float) configuration_result;
  763. break;
  764. case "terrain_raise_limit":
  765. m_terrainRaiseLimit = (float) configuration_result;
  766. break;
  767. case "terrain_lower_limit":
  768. m_terrainLowerLimit = (float) configuration_result;
  769. break;
  770. case "use_fixed_sun":
  771. m_useFixedSun = (bool) configuration_result;
  772. break;
  773. case "price_per_meter":
  774. m_pricePerMeter = Convert.ToInt32(configuration_result);
  775. break;
  776. case "region_water_height":
  777. m_regionWaterHeight = (ushort) configuration_result;
  778. break;
  779. case "region_allow_terraform":
  780. m_regionAllowTerraform = (bool) configuration_result;
  781. break;
  782. case "terrain_base_0":
  783. m_terrainBase0 = (LLUUID) configuration_result;
  784. break;
  785. case "terrain_base_1":
  786. m_terrainBase1 = (LLUUID) configuration_result;
  787. break;
  788. case "terrain_base_2":
  789. m_terrainBase2 = (LLUUID) configuration_result;
  790. break;
  791. case "terrain_base_3":
  792. m_terrainBase3 = (LLUUID) configuration_result;
  793. break;
  794. case "terrain_detail_0":
  795. m_terrainDetail0 = (LLUUID) configuration_result;
  796. break;
  797. case "terrain_detail_1":
  798. m_terrainDetail1 = (LLUUID) configuration_result;
  799. break;
  800. case "terrain_detail_2":
  801. m_terrainDetail2 = (LLUUID) configuration_result;
  802. break;
  803. case "terrain_detail_3":
  804. m_terrainDetail3 = (LLUUID) configuration_result;
  805. break;
  806. case "terrain_start_height_0":
  807. m_terrainStartHeight0 = (float) configuration_result;
  808. break;
  809. case "terrain_start_height_1":
  810. m_terrainStartHeight1 = (float) configuration_result;
  811. break;
  812. case "terrain_start_height_2":
  813. m_terrainStartHeight2 = (float) configuration_result;
  814. break;
  815. case "terrain_start_height_3":
  816. m_terrainStartHeight3 = (float) configuration_result;
  817. break;
  818. case "terrain_height_range_0":
  819. m_terrainHeightRange0 = (float) configuration_result;
  820. break;
  821. case "terrain_height_range_1":
  822. m_terrainHeightRange1 = (float) configuration_result;
  823. break;
  824. case "terrain_height_range_2":
  825. m_terrainHeightRange2 = (float) configuration_result;
  826. break;
  827. case "terrain_height_range_3":
  828. m_terrainHeightRange3 = (float) configuration_result;
  829. break;
  830. case "terrain_file":
  831. m_terrainFile = (string) configuration_result;
  832. break;
  833. case "terrain_multiplier":
  834. m_terrainMultiplier = Convert.ToDouble(configuration_result);
  835. break;
  836. case "water_height":
  837. double tmpVal = (double) configuration_result;
  838. m_waterHeight = (float) tmpVal;
  839. break;
  840. case "terrain_image_id":
  841. m_terrainImageID = (LLUUID) configuration_result;
  842. break;
  843. case "estate_manager_0":
  844. m_estateManager0 = (LLUUID)configuration_result;
  845. break;
  846. case "estate_manager_1":
  847. m_estateManager1 = (LLUUID)configuration_result;
  848. break;
  849. case "estate_manager_2":
  850. m_estateManager2 = (LLUUID)configuration_result;
  851. break;
  852. case "estate_manager_3":
  853. m_estateManager3 = (LLUUID)configuration_result;
  854. break;
  855. case "estate_manager_4":
  856. m_estateManager4 = (LLUUID)configuration_result;
  857. break;
  858. case "estate_manager_5":
  859. m_estateManager5 = (LLUUID)configuration_result;
  860. break;
  861. case "estate_manager_6":
  862. m_estateManager6 = (LLUUID)configuration_result;
  863. break;
  864. case "estate_manager_7":
  865. m_estateManager7 = (LLUUID)configuration_result;
  866. break;
  867. case "estate_manager_8":
  868. m_estateManager8 = (LLUUID)configuration_result;
  869. break;
  870. case "estate_manager_9":
  871. m_estateManager9 = (LLUUID)configuration_result;
  872. break;
  873. }
  874. return true;
  875. }
  876. }
  877. }