1
0

RegionSettings.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  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 OpenSimulator 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 OpenMetaverse;
  30. namespace OpenSim.Framework
  31. {
  32. public class RegionSettings
  33. {
  34. public delegate void SaveDelegate(RegionSettings rs);
  35. public event SaveDelegate OnSave;
  36. /// <value>
  37. /// These appear to be terrain textures that are shipped with the client.
  38. /// </value>
  39. public static readonly UUID DEFAULT_TERRAIN_TEXTURE_1 = new UUID("b8d3965a-ad78-bf43-699b-bff8eca6c975");
  40. public static readonly UUID DEFAULT_TERRAIN_TEXTURE_2 = new UUID("abb783e6-3e93-26c0-248a-247666855da3");
  41. public static readonly UUID DEFAULT_TERRAIN_TEXTURE_3 = new UUID("179cdabd-398a-9b6b-1391-4dc333ba321f");
  42. public static readonly UUID DEFAULT_TERRAIN_TEXTURE_4 = new UUID("beb169c7-11ea-fff2-efe5-0f24dc881df2");
  43. public void Save()
  44. {
  45. if (OnSave != null)
  46. OnSave(this);
  47. }
  48. private UUID m_RegionUUID = UUID.Zero;
  49. public UUID RegionUUID
  50. {
  51. get { return m_RegionUUID; }
  52. set { m_RegionUUID = value; }
  53. }
  54. private bool m_BlockTerraform = false;
  55. public bool BlockTerraform
  56. {
  57. get { return m_BlockTerraform; }
  58. set { m_BlockTerraform = value; }
  59. }
  60. private bool m_BlockFly = false;
  61. public bool BlockFly
  62. {
  63. get { return m_BlockFly; }
  64. set { m_BlockFly = value; }
  65. }
  66. private bool m_AllowDamage = false;
  67. public bool AllowDamage
  68. {
  69. get { return m_AllowDamage; }
  70. set { m_AllowDamage = value; }
  71. }
  72. private bool m_RestrictPushing = false;
  73. public bool RestrictPushing
  74. {
  75. get { return m_RestrictPushing; }
  76. set { m_RestrictPushing = value; }
  77. }
  78. private bool m_AllowLandResell = true;
  79. public bool AllowLandResell
  80. {
  81. get { return m_AllowLandResell; }
  82. set { m_AllowLandResell = value; }
  83. }
  84. private bool m_AllowLandJoinDivide = true;
  85. public bool AllowLandJoinDivide
  86. {
  87. get { return m_AllowLandJoinDivide; }
  88. set { m_AllowLandJoinDivide = value; }
  89. }
  90. private bool m_BlockShowInSearch = false;
  91. public bool BlockShowInSearch
  92. {
  93. get { return m_BlockShowInSearch; }
  94. set { m_BlockShowInSearch = value; }
  95. }
  96. private int m_AgentLimit = 40;
  97. public int AgentLimit
  98. {
  99. get { return m_AgentLimit; }
  100. set { m_AgentLimit = value; }
  101. }
  102. private double m_ObjectBonus = 1.0;
  103. public double ObjectBonus
  104. {
  105. get { return m_ObjectBonus; }
  106. set { m_ObjectBonus = value; }
  107. }
  108. private int m_Maturity = 1;
  109. public int Maturity
  110. {
  111. get { return m_Maturity; }
  112. set { m_Maturity = value; }
  113. }
  114. private bool m_DisableScripts = false;
  115. public bool DisableScripts
  116. {
  117. get { return m_DisableScripts; }
  118. set { m_DisableScripts = value; }
  119. }
  120. private bool m_DisableCollisions = false;
  121. public bool DisableCollisions
  122. {
  123. get { return m_DisableCollisions; }
  124. set { m_DisableCollisions = value; }
  125. }
  126. private bool m_DisablePhysics = false;
  127. public bool DisablePhysics
  128. {
  129. get { return m_DisablePhysics; }
  130. set { m_DisablePhysics = value; }
  131. }
  132. private UUID m_TerrainTexture1 = UUID.Zero;
  133. public UUID TerrainTexture1
  134. {
  135. get { return m_TerrainTexture1; }
  136. set
  137. {
  138. if (value == UUID.Zero)
  139. m_TerrainTexture1 = DEFAULT_TERRAIN_TEXTURE_1;
  140. else
  141. m_TerrainTexture1 = value;
  142. }
  143. }
  144. private UUID m_TerrainTexture2 = UUID.Zero;
  145. public UUID TerrainTexture2
  146. {
  147. get { return m_TerrainTexture2; }
  148. set
  149. {
  150. if (value == UUID.Zero)
  151. m_TerrainTexture2 = DEFAULT_TERRAIN_TEXTURE_2;
  152. else
  153. m_TerrainTexture2 = value;
  154. }
  155. }
  156. private UUID m_TerrainTexture3 = UUID.Zero;
  157. public UUID TerrainTexture3
  158. {
  159. get { return m_TerrainTexture3; }
  160. set
  161. {
  162. if (value == UUID.Zero)
  163. m_TerrainTexture3 = DEFAULT_TERRAIN_TEXTURE_3;
  164. else
  165. m_TerrainTexture3 = value;
  166. }
  167. }
  168. private UUID m_TerrainTexture4 = UUID.Zero;
  169. public UUID TerrainTexture4
  170. {
  171. get { return m_TerrainTexture4; }
  172. set
  173. {
  174. if (value == UUID.Zero)
  175. m_TerrainTexture4 = DEFAULT_TERRAIN_TEXTURE_4;
  176. else
  177. m_TerrainTexture4 = value;
  178. }
  179. }
  180. private double m_Elevation1NW = 10;
  181. public double Elevation1NW
  182. {
  183. get { return m_Elevation1NW; }
  184. set { m_Elevation1NW = value; }
  185. }
  186. private double m_Elevation2NW = 60;
  187. public double Elevation2NW
  188. {
  189. get { return m_Elevation2NW; }
  190. set { m_Elevation2NW = value; }
  191. }
  192. private double m_Elevation1NE = 10;
  193. public double Elevation1NE
  194. {
  195. get { return m_Elevation1NE; }
  196. set { m_Elevation1NE = value; }
  197. }
  198. private double m_Elevation2NE = 60;
  199. public double Elevation2NE
  200. {
  201. get { return m_Elevation2NE; }
  202. set { m_Elevation2NE = value; }
  203. }
  204. private double m_Elevation1SE = 10;
  205. public double Elevation1SE
  206. {
  207. get { return m_Elevation1SE; }
  208. set { m_Elevation1SE = value; }
  209. }
  210. private double m_Elevation2SE = 60;
  211. public double Elevation2SE
  212. {
  213. get { return m_Elevation2SE; }
  214. set { m_Elevation2SE = value; }
  215. }
  216. private double m_Elevation1SW = 10;
  217. public double Elevation1SW
  218. {
  219. get { return m_Elevation1SW; }
  220. set { m_Elevation1SW = value; }
  221. }
  222. private double m_Elevation2SW = 60;
  223. public double Elevation2SW
  224. {
  225. get { return m_Elevation2SW; }
  226. set { m_Elevation2SW = value; }
  227. }
  228. private double m_WaterHeight = 20;
  229. public double WaterHeight
  230. {
  231. get { return m_WaterHeight; }
  232. set { m_WaterHeight = value; }
  233. }
  234. private double m_TerrainRaiseLimit = 100;
  235. public double TerrainRaiseLimit
  236. {
  237. get { return m_TerrainRaiseLimit; }
  238. set { m_TerrainRaiseLimit = value; }
  239. }
  240. private double m_TerrainLowerLimit = -100;
  241. public double TerrainLowerLimit
  242. {
  243. get { return m_TerrainLowerLimit; }
  244. set { m_TerrainLowerLimit = value; }
  245. }
  246. private bool m_UseEstateSun = true;
  247. public bool UseEstateSun
  248. {
  249. get { return m_UseEstateSun; }
  250. set { m_UseEstateSun = value; }
  251. }
  252. private bool m_Sandbox = false;
  253. public bool Sandbox
  254. {
  255. get { return m_Sandbox; }
  256. set { m_Sandbox = value; }
  257. }
  258. private Vector3 m_SunVector;
  259. public Vector3 SunVector
  260. {
  261. get { return m_SunVector; }
  262. set { m_SunVector = value; }
  263. }
  264. private UUID m_TerrainImageID;
  265. public UUID TerrainImageID
  266. {
  267. get { return m_TerrainImageID; }
  268. set { m_TerrainImageID = value; }
  269. }
  270. private bool m_FixedSun = false;
  271. public bool FixedSun
  272. {
  273. get { return m_FixedSun; }
  274. set { m_FixedSun = value; }
  275. }
  276. private double m_SunPosition = 0.0;
  277. public double SunPosition
  278. {
  279. get { return m_SunPosition; }
  280. set { m_SunPosition = value; }
  281. }
  282. private UUID m_Covenant = UUID.Zero;
  283. public UUID Covenant
  284. {
  285. get { return m_Covenant; }
  286. set { m_Covenant = value; }
  287. }
  288. private int m_LoadedCreationDateTime;
  289. public int LoadedCreationDateTime
  290. {
  291. get { return m_LoadedCreationDateTime; }
  292. set { m_LoadedCreationDateTime = value; }
  293. }
  294. public String LoadedCreationDate
  295. {
  296. get
  297. {
  298. TimeSpan ts = new TimeSpan(0, 0, LoadedCreationDateTime);
  299. DateTime stamp = new DateTime(1970, 1, 1) + ts;
  300. return stamp.ToLongDateString();
  301. }
  302. }
  303. public String LoadedCreationTime
  304. {
  305. get
  306. {
  307. TimeSpan ts = new TimeSpan(0, 0, LoadedCreationDateTime);
  308. DateTime stamp = new DateTime(1970, 1, 1) + ts;
  309. return stamp.ToLongTimeString();
  310. }
  311. }
  312. private String m_LoadedCreationID;
  313. public String LoadedCreationID
  314. {
  315. get { return m_LoadedCreationID; }
  316. set { m_LoadedCreationID = value; }
  317. }
  318. }
  319. }