ILandObject.cs 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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.Collections.Generic;
  28. using OpenMetaverse;
  29. namespace OpenSim.Framework
  30. {
  31. public delegate int overrideParcelMaxPrimCountDelegate(ILandObject obj);
  32. public delegate int overrideSimulatorMaxPrimCountDelegate(ILandObject obj);
  33. public interface ILandObject
  34. {
  35. int GetParcelMaxPrimCount();
  36. int GetSimulatorMaxPrimCount();
  37. int GetPrimsFree();
  38. LandData LandData { get; set; }
  39. bool[,] LandBitmap { get; set; }
  40. UUID RegionUUID { get; }
  41. /// <summary>
  42. /// Prim counts for this land object.
  43. /// </summary>
  44. IPrimCounts PrimCounts { get; set; }
  45. /// <summary>
  46. /// The start point for the land object. This is the western-most point as one scans land working from
  47. /// north to south.
  48. /// </summary>
  49. Vector3 StartPoint { get; }
  50. /// <summary>
  51. /// The end point for the land object. This is the eastern-most point as one scans land working from
  52. /// south to north.
  53. /// </summary>
  54. Vector3 EndPoint { get; }
  55. bool ContainsPoint(int x, int y);
  56. ILandObject Copy();
  57. void SendLandUpdateToAvatarsOverMe();
  58. void SendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client);
  59. void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client);
  60. bool IsEitherBannedOrRestricted(UUID avatar);
  61. bool IsBannedFromLand(UUID avatar);
  62. bool CanBeOnThisLand(UUID avatar, float posHeight);
  63. bool IsRestrictedFromLand(UUID avatar);
  64. bool IsInLandAccessList(UUID avatar);
  65. void SendLandUpdateToClient(IClientAPI remote_client);
  66. void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client);
  67. List<LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag);
  68. void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client);
  69. void UpdateAccessList(uint flags, UUID transactionID, int sequenceID, int sections, List<LandAccessEntry> entries, IClientAPI remote_client);
  70. void UpdateLandBitmapByteArray();
  71. void SetLandBitmapFromByteArray();
  72. bool[,] GetLandBitmap();
  73. void ForceUpdateLandInfo();
  74. void SetLandBitmap(bool[,] bitmap);
  75. /// <summary>
  76. /// Get a land bitmap that would cover an entire region.
  77. /// </summary>
  78. /// <returns>The bitmap created.</returns>
  79. bool[,] BasicFullRegionLandBitmap();
  80. /// <summary>
  81. /// Create a square land bitmap.
  82. /// </summary>
  83. /// <remarks>
  84. /// Land co-ordinates are zero indexed. The inputs are treated as points. So if you want to create a bitmap
  85. /// that covers an entire 256 x 256m region apart from a strip of land on the east, then you would need to
  86. /// specify start_x = 0, start_y = 0, end_x = 252 (or anything up to 255), end_y = 256.
  87. ///
  88. /// At the moment, the smallest parcel of land is 4m x 4m, so if the
  89. /// region is 256 x 256m (the SL size), the bitmap returned will start at (0,0) and end at (63,63).
  90. /// </remarks>
  91. /// <param name="start_x"></param>
  92. /// <param name="start_y"></param>
  93. /// <param name="end_x"></param>
  94. /// <param name="end_y"></param>
  95. /// <returns>The bitmap created.</returns>
  96. bool[,] GetSquareLandBitmap(int start_x, int start_y, int end_x, int end_y);
  97. bool[,] ModifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, bool set_value);
  98. bool[,] MergeLandBitmaps(bool[,] bitmap_base, bool[,] bitmap_add);
  99. void SendForceObjectSelect(int local_id, int request_type, List<UUID> returnIDs, IClientAPI remote_client);
  100. void SendLandObjectOwners(IClientAPI remote_client);
  101. void ReturnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client);
  102. void ResetOverMeRecord();
  103. void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area);
  104. void DeedToGroup(UUID groupID);
  105. void SetParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel);
  106. void SetSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel);
  107. /// <summary>
  108. /// Set the media url for this land parcel
  109. /// </summary>
  110. /// <param name="url"></param>
  111. void SetMediaUrl(string url);
  112. /// <summary>
  113. /// Set the music url for this land parcel
  114. /// </summary>
  115. /// <param name="url"></param>
  116. void SetMusicUrl(string url);
  117. /// <summary>
  118. /// Get the music url for this land parcel
  119. /// </summary>
  120. /// <returns>The music url.</returns>
  121. string GetMusicUrl();
  122. }
  123. }