IClientAPI.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /*
  2. * Copyright (c) Contributors, http://www.openmetaverse.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. */
  28. using System.Collections.Generic;
  29. using System.Net;
  30. using libsecondlife;
  31. using libsecondlife.Packets;
  32. using OpenSim.Framework.Types;
  33. namespace OpenSim.Framework.Interfaces
  34. {
  35. public delegate void ChatFromViewer(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
  36. public delegate void ImprovedInstantMessage(LLUUID fromAgentID, LLUUID toAgentID, uint timestamp, string fromAgentName, string message); // Cut down from full list
  37. public delegate void RezObject(AssetBase primAsset, LLVector3 pos);
  38. public delegate void ModifyTerrain(float height, float seconds, byte size, byte action, float north, float west);
  39. public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam);
  40. public delegate void StartAnim(LLUUID animID, int seq);
  41. public delegate void LinkObjects(uint parent, List<uint> children);
  42. public delegate void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY);
  43. public delegate void TeleportLocationRequest(IClientAPI remoteClient, ulong regionHandle, LLVector3 position, LLVector3 lookAt, uint flags);
  44. public delegate void GenericCall(IClientAPI remoteClient);
  45. public delegate void GenericCall2();
  46. public delegate void GenericCall3(Packet packet); // really don't want to be passing packets in these events, so this is very temporary.
  47. public delegate void GenericCall4(Packet packet, IClientAPI remoteClient);
  48. public delegate void GenericCall5(IClientAPI remoteClient, bool status);
  49. public delegate void GenericCall6(LLUUID uid);
  50. public delegate void GenericCall7(uint localID, string message);
  51. public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock);
  52. public delegate void ObjectSelect(uint localID, IClientAPI remoteClient);
  53. public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient);
  54. public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient);
  55. public delegate void UpdateVector(uint localID, LLVector3 pos, IClientAPI remoteClient);
  56. public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient);
  57. public delegate void UpdatePrimSingleRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient);
  58. public delegate void UpdatePrimGroupRotation(uint localID,LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient);
  59. public delegate void ObjectDuplicate(uint localID, LLVector3 offset, uint dupeFlags);
  60. public delegate void StatusChange(bool status);
  61. public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status);
  62. public delegate void UpdateAgent(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation);
  63. public delegate void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 grapPos, IClientAPI remoteClient);
  64. public delegate void ParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client);
  65. public delegate void ParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client);
  66. public delegate void ParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client);
  67. public delegate void ParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client); // NOTETOSELFremove the packet part
  68. public delegate void EstateOwnerMessageRequest(EstateOwnerMessagePacket packet, IClientAPI remote_client);
  69. public delegate void UUIDNameRequest(LLUUID id, IClientAPI remote_client);
  70. public interface IClientAPI
  71. {
  72. event ImprovedInstantMessage OnInstantMessage;
  73. event ChatFromViewer OnChatFromViewer;
  74. event RezObject OnRezObject;
  75. event ModifyTerrain OnModifyTerrain;
  76. event SetAppearance OnSetAppearance;
  77. event StartAnim OnStartAnim;
  78. event LinkObjects OnLinkObjects;
  79. event RequestMapBlocks OnRequestMapBlocks;
  80. event TeleportLocationRequest OnTeleportLocationRequest;
  81. event GenericCall4 OnDeRezObject;
  82. event GenericCall OnRegionHandShakeReply;
  83. event GenericCall OnRequestWearables;
  84. event GenericCall2 OnCompleteMovementToRegion;
  85. event UpdateAgent OnAgentUpdate;
  86. event GenericCall OnRequestAvatarsData;
  87. event GenericCall4 OnAddPrim;
  88. event ObjectDuplicate OnObjectDuplicate;
  89. event UpdateVector OnGrapObject;
  90. event ObjectSelect OnDeGrapObject;
  91. event MoveObject OnGrapUpdate;
  92. event UpdateShape OnUpdatePrimShape;
  93. event ObjectSelect OnObjectSelect;
  94. event GenericCall7 OnObjectDescription;
  95. event GenericCall7 OnObjectName;
  96. event UpdatePrimFlags OnUpdatePrimFlags;
  97. event UpdatePrimTexture OnUpdatePrimTexture;
  98. event UpdateVector OnUpdatePrimGroupPosition;
  99. event UpdateVector OnUpdatePrimSinglePosition;
  100. event UpdatePrimRotation OnUpdatePrimGroupRotation;
  101. event UpdatePrimSingleRotation OnUpdatePrimSingleRotation;
  102. event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation;
  103. event UpdateVector OnUpdatePrimScale;
  104. event StatusChange OnChildAgentStatus;
  105. event GenericCall2 OnStopMovement;
  106. event NewAvatar OnNewAvatar;
  107. event GenericCall6 OnRemoveAvatar;
  108. event UUIDNameRequest OnNameFromUUIDRequest;
  109. event ParcelPropertiesRequest OnParcelPropertiesRequest;
  110. event ParcelDivideRequest OnParcelDivideRequest;
  111. event ParcelJoinRequest OnParcelJoinRequest;
  112. event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
  113. event EstateOwnerMessageRequest OnEstateOwnerMessage;
  114. LLVector3 StartPos
  115. {
  116. get;
  117. set;
  118. }
  119. LLUUID AgentId
  120. {
  121. get;
  122. }
  123. string FirstName
  124. {
  125. get;
  126. }
  127. string LastName
  128. {
  129. get;
  130. }
  131. void OutPacket(Packet newPack);
  132. void SendWearables(AvatarWearable[] wearables);
  133. void SendStartPingCheck(byte seq);
  134. void SendKillObject(ulong regionHandle, uint avatarLocalID);
  135. void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId);
  136. void SendRegionHandshake(RegionInfo regionInfo);
  137. void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
  138. void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
  139. void SendInstantMessage(string message, LLUUID target);
  140. void SendLayerData(float[] map);
  141. void SendLayerData(int px, int py, float[] map);
  142. void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look);
  143. void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint );
  144. AgentCircuitData RequestClientInfo();
  145. void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, IPEndPoint newRegionExternalEndPoint );
  146. void SendMapBlock(List<MapBlockData> mapBlocks);
  147. void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags);
  148. void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags);
  149. void SendTeleportCancel();
  150. void SendTeleportLocationStart();
  151. void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance);
  152. void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry);
  153. void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity);
  154. void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint);
  155. void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID , uint flags);
  156. void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID, uint flags);
  157. void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, LLUUID textureID, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID);
  158. void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLUUID textureID, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID);
  159. void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation);
  160. }
  161. }