IClientAPI.cs 11 KB

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