LandData.cs 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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 libsecondlife;
  30. namespace OpenSim.Framework
  31. {
  32. public class LandData
  33. {
  34. public LLVector3 AABBMax = new LLVector3();
  35. public LLVector3 AABBMin = new LLVector3();
  36. public int area = 0;
  37. public uint auctionID = 0; //Unemplemented. If set to 0, not being auctioned
  38. public LLUUID authBuyerID = LLUUID.Zero; //Unemplemented. Authorized Buyer's UUID
  39. public Parcel.ParcelCategory category = new Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category
  40. public int claimDate = 0; //Unemplemented
  41. public int claimPrice = 0; //Unemplemented
  42. public LLUUID globalID = LLUUID.Zero;
  43. public LLUUID groupID = LLUUID.Zero; //Unemplemented
  44. public int groupPrims = 0;
  45. public bool isGroupOwned = false;
  46. public byte[] landBitmapByteArray = new byte[512];
  47. public string landDesc = String.Empty;
  48. public uint landFlags = (uint) Parcel.ParcelFlags.AllowFly | (uint) Parcel.ParcelFlags.AllowLandmark |
  49. (uint) Parcel.ParcelFlags.AllowAllObjectEntry |
  50. (uint) Parcel.ParcelFlags.AllowDeedToGroup | (uint) Parcel.ParcelFlags.AllowTerraform |
  51. (uint) Parcel.ParcelFlags.CreateObjects | (uint) Parcel.ParcelFlags.AllowOtherScripts |
  52. (uint) Parcel.ParcelFlags.SoundLocal;
  53. public byte landingType = 0;
  54. public string landName = "Your Parcel";
  55. public Parcel.ParcelStatus landStatus = Parcel.ParcelStatus.Leased;
  56. public int localID = 0;
  57. public byte mediaAutoScale = 0;
  58. public LLUUID mediaID = LLUUID.Zero;
  59. public string mediaURL = String.Empty;
  60. public string musicURL = String.Empty;
  61. public int otherPrims = 0;
  62. public LLUUID ownerID = LLUUID.Zero;
  63. public int ownerPrims = 0;
  64. public List<ParcelManager.ParcelAccessEntry> parcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
  65. public float passHours = 0;
  66. public int passPrice = 0;
  67. public int salePrice = 0; //Unemeplemented. Parcels price.
  68. public int selectedPrims = 0;
  69. public int simwideArea = 0;
  70. public int simwidePrims = 0;
  71. public LLUUID snapshotID = LLUUID.Zero;
  72. public LLVector3 userLocation = new LLVector3();
  73. public LLVector3 userLookAt = new LLVector3();
  74. public LandData()
  75. {
  76. globalID = LLUUID.Random();
  77. }
  78. public LandData Copy()
  79. {
  80. LandData landData = new LandData();
  81. landData.AABBMax = AABBMax;
  82. landData.AABBMin = AABBMin;
  83. landData.area = area;
  84. landData.auctionID = auctionID;
  85. landData.authBuyerID = authBuyerID;
  86. landData.category = category;
  87. landData.claimDate = claimDate;
  88. landData.claimPrice = claimPrice;
  89. landData.globalID = globalID;
  90. landData.groupID = groupID;
  91. landData.groupPrims = groupPrims;
  92. landData.otherPrims = otherPrims;
  93. landData.ownerPrims = ownerPrims;
  94. landData.selectedPrims = selectedPrims;
  95. landData.isGroupOwned = isGroupOwned;
  96. landData.localID = localID;
  97. landData.landingType = landingType;
  98. landData.mediaAutoScale = mediaAutoScale;
  99. landData.mediaID = mediaID;
  100. landData.mediaURL = mediaURL;
  101. landData.musicURL = musicURL;
  102. landData.ownerID = ownerID;
  103. landData.landBitmapByteArray = (byte[]) landBitmapByteArray.Clone();
  104. landData.landDesc = landDesc;
  105. landData.landFlags = landFlags;
  106. landData.landName = landName;
  107. landData.landStatus = landStatus;
  108. landData.passHours = passHours;
  109. landData.passPrice = passPrice;
  110. landData.salePrice = salePrice;
  111. landData.snapshotID = snapshotID;
  112. landData.userLocation = userLocation;
  113. landData.userLookAt = userLookAt;
  114. landData.parcelAccessList.Clear();
  115. foreach (ParcelManager.ParcelAccessEntry entry in parcelAccessList)
  116. {
  117. ParcelManager.ParcelAccessEntry newEntry = new ParcelManager.ParcelAccessEntry();
  118. newEntry.AgentID = entry.AgentID;
  119. newEntry.Flags = entry.Flags;
  120. newEntry.Time = entry.Time;
  121. landData.parcelAccessList.Add(newEntry);
  122. }
  123. return landData;
  124. }
  125. }
  126. }