LandData.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  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 OpenMetaverse;
  30. namespace OpenSim.Framework
  31. {
  32. public class LandData
  33. {
  34. private Vector3 _AABBMax = new Vector3();
  35. private Vector3 _AABBMin = new Vector3();
  36. private int _area = 0;
  37. private uint _auctionID = 0; //Unemplemented. If set to 0, not being auctioned
  38. private UUID _authBuyerID = UUID.Zero; //Unemplemented. Authorized Buyer's UUID
  39. private Parcel.ParcelCategory _category = new Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category
  40. private int _claimDate = 0;
  41. private int _claimPrice = 0; //Unemplemented
  42. private UUID _globalID = UUID.Zero;
  43. private UUID _groupID = UUID.Zero;
  44. private int _groupPrims = 0;
  45. private bool _isGroupOwned = false;
  46. private byte[] _bitmap = new byte[512];
  47. private string _description = String.Empty;
  48. private uint _flags = (uint) Parcel.ParcelFlags.AllowFly | (uint) Parcel.ParcelFlags.AllowLandmark |
  49. (uint) Parcel.ParcelFlags.AllowAPrimitiveEntry |
  50. (uint) Parcel.ParcelFlags.AllowDeedToGroup | (uint) Parcel.ParcelFlags.AllowTerraform |
  51. (uint) Parcel.ParcelFlags.CreateObjects | (uint) Parcel.ParcelFlags.AllowOtherScripts |
  52. (uint) Parcel.ParcelFlags.SoundLocal;
  53. private byte _landingType = 0;
  54. private string _name = "Your Parcel";
  55. private Parcel.ParcelStatus _status = Parcel.ParcelStatus.Leased;
  56. private int _localID = 0;
  57. private byte _mediaAutoScale = 0;
  58. private UUID _mediaID = UUID.Zero;
  59. private string _mediaURL = String.Empty;
  60. private string _musicURL = String.Empty;
  61. private int _otherPrims = 0;
  62. private UUID _ownerID = UUID.Zero;
  63. private int _ownerPrims = 0;
  64. private List<ParcelManager.ParcelAccessEntry> _parcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
  65. private float _passHours = 0;
  66. private int _passPrice = 0;
  67. private int _salePrice = 0; //Unemeplemented. Parcels price.
  68. private int _selectedPrims = 0;
  69. private int _simwideArea = 0;
  70. private int _simwidePrims = 0;
  71. private UUID _snapshotID = UUID.Zero;
  72. private Vector3 _userLocation = new Vector3();
  73. private Vector3 _userLookAt = new Vector3();
  74. private int _dwell = 0;
  75. private int _otherCleanTime = 0;
  76. public Vector3 AABBMax {
  77. get {
  78. return _AABBMax;
  79. }
  80. set {
  81. _AABBMax = value;
  82. }
  83. }
  84. public Vector3 AABBMin {
  85. get {
  86. return _AABBMin;
  87. }
  88. set {
  89. _AABBMin = value;
  90. }
  91. }
  92. public int Area {
  93. get {
  94. return _area;
  95. }
  96. set {
  97. _area = value;
  98. }
  99. }
  100. public uint AuctionID {
  101. get {
  102. return _auctionID;
  103. }
  104. set {
  105. _auctionID = value;
  106. }
  107. }
  108. public UUID AuthBuyerID {
  109. get {
  110. return _authBuyerID;
  111. }
  112. set {
  113. _authBuyerID = value;
  114. }
  115. }
  116. public OpenMetaverse.Parcel.ParcelCategory Category {
  117. get {
  118. return _category;
  119. }
  120. set {
  121. _category = value;
  122. }
  123. }
  124. public int ClaimDate {
  125. get {
  126. return _claimDate;
  127. }
  128. set {
  129. _claimDate = value;
  130. }
  131. }
  132. public int ClaimPrice {
  133. get {
  134. return _claimPrice;
  135. }
  136. set {
  137. _claimPrice = value;
  138. }
  139. }
  140. public UUID GlobalID {
  141. get {
  142. return _globalID;
  143. }
  144. set {
  145. _globalID = value;
  146. }
  147. }
  148. public UUID GroupID {
  149. get {
  150. return _groupID;
  151. }
  152. set {
  153. _groupID = value;
  154. }
  155. }
  156. public int GroupPrims {
  157. get {
  158. return _groupPrims;
  159. }
  160. set {
  161. _groupPrims = value;
  162. }
  163. }
  164. public bool IsGroupOwned {
  165. get {
  166. return _isGroupOwned;
  167. }
  168. set {
  169. _isGroupOwned = value;
  170. }
  171. }
  172. public byte[] Bitmap {
  173. get {
  174. return _bitmap;
  175. }
  176. set {
  177. _bitmap = value;
  178. }
  179. }
  180. public string Description {
  181. get {
  182. return _description;
  183. }
  184. set {
  185. _description = value;
  186. }
  187. }
  188. public uint Flags {
  189. get {
  190. return _flags;
  191. }
  192. set {
  193. _flags = value;
  194. }
  195. }
  196. public byte LandingType {
  197. get {
  198. return _landingType;
  199. }
  200. set {
  201. _landingType = value;
  202. }
  203. }
  204. public string Name {
  205. get {
  206. return _name;
  207. }
  208. set {
  209. _name = value;
  210. }
  211. }
  212. public OpenMetaverse.Parcel.ParcelStatus Status {
  213. get {
  214. return _status;
  215. }
  216. set {
  217. _status = value;
  218. }
  219. }
  220. public int LocalID {
  221. get {
  222. return _localID;
  223. }
  224. set {
  225. _localID = value;
  226. }
  227. }
  228. public byte MediaAutoScale {
  229. get {
  230. return _mediaAutoScale;
  231. }
  232. set {
  233. _mediaAutoScale = value;
  234. }
  235. }
  236. public UUID MediaID {
  237. get {
  238. return _mediaID;
  239. }
  240. set {
  241. _mediaID = value;
  242. }
  243. }
  244. public string MediaURL {
  245. get {
  246. return _mediaURL;
  247. }
  248. set {
  249. _mediaURL = value;
  250. }
  251. }
  252. public string MusicURL {
  253. get {
  254. return _musicURL;
  255. }
  256. set {
  257. _musicURL = value;
  258. }
  259. }
  260. public int OtherPrims {
  261. get {
  262. return _otherPrims;
  263. }
  264. set {
  265. _otherPrims = value;
  266. }
  267. }
  268. public UUID OwnerID {
  269. get {
  270. return _ownerID;
  271. }
  272. set {
  273. _ownerID = value;
  274. }
  275. }
  276. public int OwnerPrims {
  277. get {
  278. return _ownerPrims;
  279. }
  280. set {
  281. _ownerPrims = value;
  282. }
  283. }
  284. public List<OpenMetaverse.ParcelManager.ParcelAccessEntry> ParcelAccessList {
  285. get {
  286. return _parcelAccessList;
  287. }
  288. set {
  289. _parcelAccessList = value;
  290. }
  291. }
  292. public float PassHours {
  293. get {
  294. return _passHours;
  295. }
  296. set {
  297. _passHours = value;
  298. }
  299. }
  300. public int PassPrice {
  301. get {
  302. return _passPrice;
  303. }
  304. set {
  305. _passPrice = value;
  306. }
  307. }
  308. public int SalePrice {
  309. get {
  310. return _salePrice;
  311. }
  312. set {
  313. _salePrice = value;
  314. }
  315. }
  316. public int SelectedPrims {
  317. get {
  318. return _selectedPrims;
  319. }
  320. set {
  321. _selectedPrims = value;
  322. }
  323. }
  324. public int SimwideArea {
  325. get {
  326. return _simwideArea;
  327. }
  328. set {
  329. _simwideArea = value;
  330. }
  331. }
  332. public int SimwidePrims {
  333. get {
  334. return _simwidePrims;
  335. }
  336. set {
  337. _simwidePrims = value;
  338. }
  339. }
  340. public UUID SnapshotID {
  341. get {
  342. return _snapshotID;
  343. }
  344. set {
  345. _snapshotID = value;
  346. }
  347. }
  348. public Vector3 UserLocation {
  349. get {
  350. return _userLocation;
  351. }
  352. set {
  353. _userLocation = value;
  354. }
  355. }
  356. public Vector3 UserLookAt {
  357. get {
  358. return _userLookAt;
  359. }
  360. set {
  361. _userLookAt = value;
  362. }
  363. }
  364. public int Dwell {
  365. get {
  366. return _dwell;
  367. }
  368. set {
  369. _dwell = value;
  370. }
  371. }
  372. public int OtherCleanTime {
  373. get {
  374. return _otherCleanTime;
  375. }
  376. set {
  377. _otherCleanTime = value;
  378. }
  379. }
  380. public LandData()
  381. {
  382. _globalID = UUID.Random();
  383. }
  384. public LandData Copy()
  385. {
  386. LandData landData = new LandData();
  387. landData._AABBMax = _AABBMax;
  388. landData._AABBMin = _AABBMin;
  389. landData._area = _area;
  390. landData._auctionID = _auctionID;
  391. landData._authBuyerID = _authBuyerID;
  392. landData._category = _category;
  393. landData._claimDate = _claimDate;
  394. landData._claimPrice = _claimPrice;
  395. landData._globalID = _globalID;
  396. landData._groupID = _groupID;
  397. landData._groupPrims = _groupPrims;
  398. landData._otherPrims = _otherPrims;
  399. landData._ownerPrims = _ownerPrims;
  400. landData._selectedPrims = _selectedPrims;
  401. landData._isGroupOwned = _isGroupOwned;
  402. landData._localID = _localID;
  403. landData._landingType = _landingType;
  404. landData._mediaAutoScale = _mediaAutoScale;
  405. landData._mediaID = _mediaID;
  406. landData._mediaURL = _mediaURL;
  407. landData._musicURL = _musicURL;
  408. landData._ownerID = _ownerID;
  409. landData._bitmap = (byte[]) _bitmap.Clone();
  410. landData._description = _description;
  411. landData._flags = _flags;
  412. landData._name = _name;
  413. landData._status = _status;
  414. landData._passHours = _passHours;
  415. landData._passPrice = _passPrice;
  416. landData._salePrice = _salePrice;
  417. landData._snapshotID = _snapshotID;
  418. landData._userLocation = _userLocation;
  419. landData._userLookAt = _userLookAt;
  420. landData._otherCleanTime = _otherCleanTime;
  421. landData._dwell = _dwell;
  422. landData._parcelAccessList.Clear();
  423. foreach (ParcelManager.ParcelAccessEntry entry in _parcelAccessList)
  424. {
  425. ParcelManager.ParcelAccessEntry newEntry = new ParcelManager.ParcelAccessEntry();
  426. newEntry.AgentID = entry.AgentID;
  427. newEntry.Flags = entry.Flags;
  428. newEntry.Time = entry.Time;
  429. landData._parcelAccessList.Add(newEntry);
  430. }
  431. return landData;
  432. }
  433. }
  434. }