IAttachmentsModule.cs 6.7 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 System.Xml;
  29. using System.Collections.Generic;
  30. using OpenMetaverse;
  31. using OpenSim.Framework;
  32. using OpenSim.Region.Framework.Scenes;
  33. namespace OpenSim.Region.Framework.Interfaces
  34. {
  35. public interface IAttachmentsModule
  36. {
  37. /// <summary>
  38. /// Copy attachment data from a ScenePresence into the AgentData structure for transmission to another simulator
  39. /// </summary>
  40. /// <param name='sp'></param>
  41. /// <param name='ad'></param>
  42. void CopyAttachments(IScenePresence sp, AgentData ad);
  43. /// <summary>
  44. /// Copy attachment data from an AgentData structure into a ScenePresence.
  45. /// </summary>
  46. /// <param name='ad'></param>
  47. /// <param name='sp'></param>
  48. void CopyAttachments(AgentData ad, IScenePresence sp);
  49. /// <summary>
  50. /// RezAttachments. This should only be called upon login on the first region.
  51. /// Attachment rezzings on crossings and TPs are done in a different way.
  52. /// </summary>
  53. /// <remarks>
  54. /// This is only actually necessary for viewers which do not have a current outfit folder (these viewers make
  55. /// their own attachment calls on login) and agents which have attachments but no viewer (e.g. NPCs).
  56. /// </remarks>
  57. /// <param name="sp"></param>
  58. void RezAttachments(IScenePresence sp);
  59. /// <summary>
  60. /// Derez the attachements for a scene presence that is closing.
  61. /// </summary>
  62. /// <remarks>
  63. /// Attachment changes are saved.
  64. /// </remarks>
  65. /// <param name="sp">The presence closing</param>
  66. /// <param name="saveChanged">Save changed attachments.</param>
  67. /// <param name="saveAllScripted">Save attachments with scripts even if they haven't changed.</para>
  68. void DeRezAttachments(IScenePresence sp);
  69. /// <summary>
  70. /// Delete all the presence's attachments from the scene
  71. /// This is done when a root agent leaves/is demoted to child (for instance, on logout, teleport or region cross).
  72. /// </summary>
  73. /// <param name="sp"></param>
  74. /// <param name="silent"></param>
  75. void DeleteAttachmentsFromScene(IScenePresence sp, bool silent);
  76. /// <summary>
  77. /// Attach an object to an avatar.
  78. /// </summary>
  79. /// <param name="sp"></param>
  80. /// <param name="grp"></param>
  81. /// <param name="AttachmentPt"></param>
  82. /// <param name="silent"></param>
  83. /// <param name="addToInventory">If true then add object to user inventory</param>
  84. /// <param name="append">Append to attachment point rather than replace.</param>
  85. /// <returns>true if the object was successfully attached, false otherwise</returns>
  86. bool AttachObject(IScenePresence sp, SceneObjectGroup grp, uint AttachmentPt, bool silent, bool useAttachmentInfo, bool addToInventory, bool append);
  87. /// <summary>
  88. /// Rez an attachment from user inventory and change inventory status to match.
  89. /// </summary>
  90. /// <param name="sp"></param>
  91. /// <param name="itemID"></param>
  92. /// <param name="AttachmentPt"></param>
  93. /// <returns>The scene object that was attached. Null if the scene object could not be found</returns>
  94. ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt);
  95. // Same as above, but also load script states from a separate doc
  96. ISceneEntity RezSingleAttachmentFromInventory(
  97. IScenePresence presence, UUID itemID, uint AttachmentPt, XmlDocument doc);
  98. /// <summary>
  99. /// Rez multiple attachments from a user's inventory
  100. /// </summary>
  101. /// <param name="sp"></param>
  102. /// <param name="rezlist"></param>
  103. void RezMultipleAttachmentsFromInventory(IScenePresence sp,List<KeyValuePair<UUID, uint>> rezlist);
  104. /// <summary>
  105. /// Detach the given item to the ground.
  106. /// </summary>
  107. /// <param name="sp"></param>
  108. /// <param name="objectLocalID"></param>
  109. void DetachSingleAttachmentToGround(IScenePresence sp, uint objectLocalID);
  110. /// <summary>
  111. /// Detach the given item to the ground at the specified coordinates & rotation
  112. /// </summary>
  113. /// <param name="sp"></param>
  114. /// <param name="objectLocalID"></param>
  115. /// <param name="absolutePos"></param>
  116. /// <param name="absoluteRot"></param>
  117. void DetachSingleAttachmentToGround(IScenePresence sp, uint objectLocalID, Vector3 absolutePos, Quaternion absoluteRot);
  118. /// <summary>
  119. /// Detach the given attachment so that it remains in the user's inventory.
  120. /// </summary>
  121. /// <param name="sp">/param>
  122. /// <param name="grp">The attachment to detach.</param>
  123. void DetachSingleAttachmentToInv(IScenePresence sp, SceneObjectGroup grp);
  124. /// Update the position of an attachment.
  125. /// </summary>
  126. /// <param name="sog"></param>
  127. /// <param name="pos"></param>
  128. void UpdateAttachmentPosition(SceneObjectGroup sog, Vector3 pos);
  129. }
  130. }