IAttachmentsModule.cs 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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 OpenMetaverse;
  29. using OpenMetaverse.Packets;
  30. using OpenSim.Framework;
  31. using OpenSim.Region.Framework.Scenes;
  32. namespace OpenSim.Region.Framework.Interfaces
  33. {
  34. public interface IAttachmentsModule
  35. {
  36. /// <summary>
  37. /// Attach an object to an avatar from the world.
  38. /// </summary>
  39. /// <param name="controllingClient"></param>
  40. /// <param name="localID"></param>
  41. /// <param name="attachPoint"></param>
  42. /// <param name="rot"></param>
  43. /// <param name="silent"></param>
  44. void AttachObject(
  45. IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent);
  46. /// <summary>
  47. /// Attach an object to an avatar.
  48. /// </summary>
  49. /// <param name="controllingClient"></param>
  50. /// <param name="localID"></param>
  51. /// <param name="attachPoint"></param>
  52. /// <param name="rot"></param>
  53. /// <param name="attachPos"></param>
  54. /// <param name="silent"></param>
  55. /// <returns>true if the object was successfully attached, false otherwise</returns>
  56. bool AttachObject(
  57. IClientAPI remoteClient, SceneObjectGroup grp, uint AttachmentPt, bool silent);
  58. /// <summary>
  59. /// Rez an attachment from user inventory and change inventory status to match.
  60. /// </summary>
  61. /// <param name="remoteClient"></param>
  62. /// <param name="itemID"></param>
  63. /// <param name="AttachmentPt"></param>
  64. /// <returns>The scene object that was attached. Null if the scene object could not be found</returns>
  65. UUID RezSingleAttachmentFromInventory(IClientAPI remoteClient, UUID itemID, uint AttachmentPt);
  66. /// <summary>
  67. /// Rez an attachment from user inventory
  68. /// </summary>
  69. /// <param name="remoteClient"></param>
  70. /// <param name="itemID"></param>
  71. /// <param name="AttachmentPt"></param>
  72. /// <param name="updateinventoryStatus">
  73. /// If true, we also update the user's inventory to show that the attachment is set. If false, we do not.
  74. /// False is required so that we don't attempt to update information when a user enters a scene with the
  75. /// attachment already correctly set up in inventory.
  76. /// <returns>The uuid of the scene object that was attached. Null if the scene object could not be found</returns>
  77. UUID RezSingleAttachmentFromInventory(
  78. IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus);
  79. /// <summary>
  80. /// Rez multiple attachments from a user's inventory
  81. /// </summary>
  82. /// <param name="remoteClient"></param>
  83. /// <param name="header"></param>
  84. /// <param name="objects"></param>
  85. void RezMultipleAttachmentsFromInventory(
  86. IClientAPI remoteClient,
  87. RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header,
  88. RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects);
  89. /// <summary>
  90. /// Detach an object from the avatar.
  91. /// </summary>
  92. ///
  93. /// This method is called in response to a client's detach request, so we only update the information in
  94. /// inventory
  95. /// <param name="objectLocalID"></param>
  96. /// <param name="remoteClient"></param>
  97. void DetachObject(uint objectLocalID, IClientAPI remoteClient);
  98. /// <summary>
  99. /// Detach the given item to the ground.
  100. /// </summary>
  101. /// <param name="itemID"></param>
  102. /// <param name="remoteClient"></param>
  103. void DetachSingleAttachmentToGround(UUID itemID, IClientAPI remoteClient);
  104. /// <summary>
  105. /// Update the user inventory to show a detach.
  106. /// </summary>
  107. /// <param name="itemID">/param>
  108. /// <param name="remoteClient"></param>
  109. void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient);
  110. /// <summary>
  111. /// Update the position of an attachment.
  112. /// </summary>
  113. /// <param name="sog"></param>
  114. /// <param name="pos"></param>
  115. void UpdateAttachmentPosition(SceneObjectGroup sog, Vector3 pos);
  116. /// <summary>
  117. /// Update the user inventory with a changed attachment
  118. /// </summary>
  119. /// <param name="remoteClient">
  120. /// A <see cref="IClientAPI"/>
  121. /// </param>
  122. /// <param name="grp">
  123. /// A <see cref="SceneObjectGroup"/>
  124. /// </param>
  125. /// <param name="itemID">
  126. /// A <see cref="UUID"/>
  127. /// </param>
  128. /// <param name="agentID">
  129. /// A <see cref="UUID"/>
  130. /// </param>
  131. void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID);
  132. }
  133. }