IClientAPI.cs 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697
  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.Collections.Generic;
  29. using System.Net;
  30. using libsecondlife;
  31. using libsecondlife.Packets;
  32. namespace OpenSim.Framework
  33. {
  34. // Base Args Interface
  35. public interface IEventArgs
  36. {
  37. IScene Scene { get; set; }
  38. IClientAPI Sender { get; set; }
  39. }
  40. public delegate void ViewerEffectEventHandler(IClientAPI sender, ViewerEffectPacket.EffectBlock[] effectBlock);
  41. public delegate void ChatFromViewer(Object sender, ChatFromViewerArgs e);
  42. public enum ChatTypeEnum
  43. {
  44. Whisper = 0,
  45. Say = 1,
  46. Shout = 2,
  47. // 3 is an obsolete version of Say
  48. StartTyping = 4,
  49. StopTyping = 5,
  50. Broadcast = 0xFF
  51. }
  52. public enum ThrottleOutPacketType : int
  53. {
  54. Resend = 0,
  55. Land = 1,
  56. Wind = 2,
  57. Cloud = 3,
  58. Task = 4,
  59. Texture = 5,
  60. Asset = 6,
  61. Unknown = 7, // Also doubles as 'do not throttle'
  62. Back = 8
  63. }
  64. /// <summary>
  65. /// ChatFromViewer Arguments
  66. /// </summary>
  67. public class ChatFromViewerArgs : EventArgs, IEventArgs
  68. {
  69. protected string m_message;
  70. protected ChatTypeEnum m_type;
  71. protected int m_channel;
  72. protected LLVector3 m_position;
  73. protected string m_from;
  74. protected IClientAPI m_sender;
  75. protected IScene m_scene;
  76. /// <summary>
  77. /// The message sent by the user
  78. /// </summary>
  79. public string Message
  80. {
  81. get { return m_message; }
  82. set { m_message = value; }
  83. }
  84. /// <summary>
  85. /// The type of message, eg say, shout, broadcast.
  86. /// </summary>
  87. public ChatTypeEnum Type
  88. {
  89. get { return m_type; }
  90. set { m_type = value; }
  91. }
  92. /// <summary>
  93. /// Which channel was this message sent on? Different channels may have different listeners. Public chat is on channel zero.
  94. /// </summary>
  95. public int Channel
  96. {
  97. get { return m_channel; }
  98. set { m_channel = value; }
  99. }
  100. /// <summary>
  101. /// The position of the sender at the time of the message broadcast.
  102. /// </summary>
  103. public LLVector3 Position
  104. {
  105. get { return m_position; }
  106. set { m_position = value; }
  107. }
  108. /// <summary>
  109. /// The name of the sender (needed for scripts)
  110. /// </summary>
  111. public string From
  112. {
  113. get { return m_from; }
  114. set { m_from = value; }
  115. }
  116. /// <summary>
  117. /// The client responsible for sending the message, or null.
  118. /// </summary>
  119. public IClientAPI Sender
  120. {
  121. get { return m_sender; }
  122. set { m_sender = value; }
  123. }
  124. /// <summary>
  125. ///
  126. /// </summary>
  127. public IScene Scene
  128. {
  129. get { return m_scene; }
  130. set { m_scene = value; }
  131. }
  132. public ChatFromViewerArgs()
  133. {
  134. m_position = new LLVector3();
  135. }
  136. }
  137. public class TextureRequestArgs : EventArgs
  138. {
  139. protected LLUUID m_requestedAssetID;
  140. private sbyte m_discardLevel;
  141. private uint m_packetNumber;
  142. private float m_priority;
  143. public float Priority
  144. {
  145. get { return m_priority; }
  146. set { m_priority = value; }
  147. }
  148. /// <summary>
  149. ///
  150. /// </summary>
  151. public uint PacketNumber
  152. {
  153. get { return m_packetNumber; }
  154. set { m_packetNumber = value; }
  155. }
  156. /// <summary>
  157. ///
  158. /// </summary>
  159. public sbyte DiscardLevel
  160. {
  161. get { return m_discardLevel; }
  162. set { m_discardLevel = value; }
  163. }
  164. /// <summary>
  165. ///
  166. /// </summary>
  167. public LLUUID RequestedAssetID
  168. {
  169. get { return m_requestedAssetID; }
  170. set { m_requestedAssetID = value; }
  171. }
  172. }
  173. public class AvatarWearingArgs : EventArgs
  174. {
  175. private List<Wearable> m_nowWearing = new List<Wearable>();
  176. /// <summary>
  177. ///
  178. /// </summary>
  179. public List<Wearable> NowWearing
  180. {
  181. get { return m_nowWearing; }
  182. set { m_nowWearing = value; }
  183. }
  184. public class Wearable
  185. {
  186. public LLUUID ItemID = new LLUUID("00000000-0000-0000-0000-000000000000");
  187. public byte Type = 0;
  188. public Wearable(LLUUID itemId, byte type)
  189. {
  190. ItemID = itemId;
  191. Type = type;
  192. }
  193. }
  194. }
  195. public delegate void TextureRequest(Object sender, TextureRequestArgs e);
  196. public delegate void AvatarNowWearing(Object sender, AvatarWearingArgs e);
  197. public delegate void ImprovedInstantMessage(IClientAPI remoteclient,
  198. LLUUID fromAgentID, LLUUID fromAgentSession, LLUUID toAgentID, LLUUID imSessionID, uint timestamp,
  199. string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, uint ParentEstateID,
  200. LLVector3 Position, LLUUID RegionID, byte[] binaryBucket); // This shouldn't be cut down...
  201. // especially if we're ever going to implement groups, presence, estate message dialogs...
  202. public delegate void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 RayEnd, LLVector3 RayStart,
  203. LLUUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
  204. uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags,
  205. bool RezSelected, bool RemoveItem, LLUUID fromTaskID );
  206. public delegate void RezSingleAttachmentFromInv(IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt,
  207. uint ItemFlags, uint NextOwnerMask);
  208. public delegate void ObjectAttach(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot);
  209. public delegate void ModifyTerrain(
  210. float height, float seconds, byte size, byte action, float north, float west, float south, float east,
  211. IClientAPI remoteClient);
  212. public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam);
  213. public delegate void StartAnim(IClientAPI remoteClient, LLUUID animID, int seq);
  214. public delegate void StopAnim(IClientAPI remoteClient, LLUUID animID);
  215. public delegate void LinkObjects(uint parent, List<uint> children);
  216. public delegate void DelinkObjects(List<uint> primIds);
  217. public delegate void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY);
  218. public delegate void RequestMapName(IClientAPI remoteClient, string mapName);
  219. public delegate void TeleportLocationRequest(
  220. IClientAPI remoteClient, ulong regionHandle, LLVector3 position, LLVector3 lookAt, uint flags);
  221. public delegate void DisconnectUser();
  222. public delegate void RequestAvatarProperties(IClientAPI remoteClient, LLUUID avatarID);
  223. public delegate void UpdateAvatarProperties(IClientAPI remoteClient, UserProfileData ProfileData);
  224. public delegate void SetAlwaysRun(IClientAPI remoteClient, bool SetAlwaysRun);
  225. public delegate void GenericCall2();
  226. // really don't want to be passing packets in these events, so this is very temporary.
  227. public delegate void GenericCall4(Packet packet, IClientAPI remoteClient);
  228. public delegate void GenericCall5(IClientAPI remoteClient, bool status);
  229. public delegate void GenericCall7(IClientAPI remoteClient, uint localID, string message);
  230. public delegate void UpdateShape(LLUUID agentID, uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock);
  231. public delegate void ObjectExtraParams(LLUUID agentID, uint localID, ushort type, bool inUse, byte[] data);
  232. public delegate void ObjectSelect(uint localID, IClientAPI remoteClient);
  233. public delegate void RequestObjectPropertiesFamily(
  234. IClientAPI remoteClient, LLUUID AgentID, uint RequestFlags, LLUUID TaskID);
  235. public delegate void ObjectDeselect(uint localID, IClientAPI remoteClient);
  236. public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient);
  237. public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient);
  238. public delegate void UpdateVector(uint localID, LLVector3 pos, IClientAPI remoteClient);
  239. public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient);
  240. public delegate void UpdatePrimSingleRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient);
  241. public delegate void UpdatePrimGroupRotation(uint localID, LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient);
  242. public delegate void ObjectDuplicate(uint localID, LLVector3 offset, uint dupeFlags, LLUUID AgentID, LLUUID GroupID);
  243. public delegate void ObjectDuplicateOnRay(uint localID, uint dupeFlags, LLUUID AgentID, LLUUID GroupID,
  244. LLUUID RayTargetObj, LLVector3 RayEnd, LLVector3 RayStart,
  245. bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates);
  246. public delegate void StatusChange(bool status);
  247. public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status);
  248. public delegate void UpdateAgent(IClientAPI remoteClient, AgentUpdatePacket agentData);
  249. public delegate void AgentRequestSit(IClientAPI remoteClient, LLUUID agentID, LLUUID targetID, LLVector3 offset);
  250. public delegate void AgentSit(IClientAPI remoteClient, LLUUID agentID);
  251. public delegate void AvatarPickerRequest(IClientAPI remoteClient, LLUUID agentdata, LLUUID queryID, string UserQuery
  252. );
  253. public delegate void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 grapPos, IClientAPI remoteClient);
  254. public delegate void ParcelAccessListRequest(
  255. LLUUID agentID, LLUUID sessionID, uint flags, int sequenceID, int landLocalID, IClientAPI remote_client);
  256. public delegate void ParcelAccessListUpdateRequest(
  257. LLUUID agentID, LLUUID sessionID, uint flags, int landLocalID, List<ParcelManager.ParcelAccessEntry> entries,
  258. IClientAPI remote_client);
  259. public delegate void ParcelPropertiesRequest(
  260. int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client);
  261. public delegate void ParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client);
  262. public delegate void ParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client);
  263. public delegate void ParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client);
  264. public delegate void ParcelSelectObjects(int land_local_id, int request_type, IClientAPI remote_client);
  265. public delegate void ParcelObjectOwnerRequest(int local_id, IClientAPI remote_client);
  266. public delegate void EstateOwnerMessageRequest(EstateOwnerMessagePacket packet, IClientAPI remote_client);
  267. public delegate void RegionInfoRequest(IClientAPI remote_client, LLUUID sessionID);
  268. public delegate void EstateCovenantRequest(IClientAPI remote_client, LLUUID sessionID);
  269. public delegate void UUIDNameRequest(LLUUID id, IClientAPI remote_client);
  270. public delegate void AddNewPrim(LLUUID ownerID, LLVector3 RayEnd, LLQuaternion rot, PrimitiveBaseShape shape, byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID, byte RayEndIsIntersection);
  271. public delegate void RequestGodlikePowers(LLUUID AgentID, LLUUID SessionID, LLUUID token, bool GodLike, IClientAPI remote_client);
  272. public delegate void GodKickUser(
  273. LLUUID GodAgentID, LLUUID GodSessionID, LLUUID AgentID, uint kickflags, byte[] reason);
  274. public delegate void CreateInventoryFolder(
  275. IClientAPI remoteClient, LLUUID folderID, ushort folderType, string folderName, LLUUID parentID);
  276. public delegate void UpdateInventoryFolder(
  277. IClientAPI remoteClient, LLUUID folderID, ushort type, string name, LLUUID parentID);
  278. public delegate void MoveInventoryFolder(
  279. IClientAPI remoteClient, LLUUID folderID, LLUUID parentID);
  280. public delegate void CreateNewInventoryItem(
  281. IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID, uint callbackID, string description, string name,
  282. sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask);
  283. public delegate void FetchInventoryDescendents(
  284. IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder);
  285. public delegate void PurgeInventoryDescendents(
  286. IClientAPI remoteClient, LLUUID folderID);
  287. public delegate void FetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID);
  288. public delegate void RequestTaskInventory(IClientAPI remoteClient, uint localID);
  289. public delegate void UpdateInventoryItem(
  290. IClientAPI remoteClient, LLUUID transactionID, LLUUID itemID, string name, string description,
  291. uint nextOwnerMask);
  292. public delegate void CopyInventoryItem(
  293. IClientAPI remoteClient, uint callbackID, LLUUID oldAgentID, LLUUID oldItemID, LLUUID newFolderID,
  294. string newName);
  295. public delegate void MoveInventoryItem(
  296. IClientAPI remoteClient, LLUUID folderID, LLUUID itemID, int length, string newName);
  297. public delegate void RemoveInventoryItem(
  298. IClientAPI remoteClient, LLUUID itemID);
  299. public delegate void RemoveInventoryFolder(
  300. IClientAPI remoteClient, LLUUID folderID);
  301. public delegate void RequestAsset(IClientAPI remoteClient, TransferRequestPacket transferRequest);
  302. public delegate void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID);
  303. public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID);
  304. public delegate void RemoveTaskInventory(IClientAPI remoteClient, LLUUID itemID, uint localID);
  305. public delegate void UDPAssetUploadRequest(
  306. IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data, bool storeLocal,
  307. bool tempFile);
  308. public delegate void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data);
  309. public delegate void RequestXfer(IClientAPI remoteClient, ulong xferID, string fileName);
  310. public delegate void ConfirmXfer(IClientAPI remoteClient, ulong xferID, uint packetID);
  311. public delegate void FriendActionDelegate(IClientAPI remoteClient,LLUUID agentID,LLUUID transactionID,List<LLUUID> callingCardFolders);
  312. public delegate void FriendshipTermination(IClientAPI remoteClient,LLUUID agentID, LLUUID ExID);
  313. public delegate void PacketStats(int inPackets, int outPackets, int unAckedBytes);
  314. public delegate void MoneyTransferRequest(LLUUID sourceID, LLUUID destID, int amount, int transactionType, string description);
  315. // We keep all this information for fraud purposes in the future.
  316. public delegate void MoneyBalanceRequest(IClientAPI remoteClient, LLUUID agentID, LLUUID sessionID, LLUUID TransactionID);
  317. public delegate void ObjectPermissions(IClientAPI controller, LLUUID agentID, LLUUID sessionID, byte field, uint localId, uint mask, byte set);
  318. public interface IClientAPI
  319. {
  320. event ImprovedInstantMessage OnInstantMessage;
  321. event ChatFromViewer OnChatFromViewer;
  322. event TextureRequest OnRequestTexture;
  323. event RezObject OnRezObject;
  324. event ModifyTerrain OnModifyTerrain;
  325. event SetAppearance OnSetAppearance;
  326. event AvatarNowWearing OnAvatarNowWearing;
  327. event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv;
  328. event ObjectAttach OnObjectAttach;
  329. event StartAnim OnStartAnim;
  330. event StopAnim OnStopAnim;
  331. event LinkObjects OnLinkObjects;
  332. event DelinkObjects OnDelinkObjects;
  333. event RequestMapBlocks OnRequestMapBlocks;
  334. event RequestMapName OnMapNameRequest;
  335. event TeleportLocationRequest OnTeleportLocationRequest;
  336. event DisconnectUser OnDisconnectUser;
  337. event RequestAvatarProperties OnRequestAvatarProperties;
  338. event SetAlwaysRun OnSetAlwaysRun;
  339. event GenericCall4 OnDeRezObject;
  340. event Action<IClientAPI> OnRegionHandShakeReply;
  341. event GenericCall2 OnRequestWearables;
  342. event GenericCall2 OnCompleteMovementToRegion;
  343. event UpdateAgent OnAgentUpdate;
  344. event AgentRequestSit OnAgentRequestSit;
  345. event AgentSit OnAgentSit;
  346. event AvatarPickerRequest OnAvatarPickerRequest;
  347. event Action<IClientAPI> OnRequestAvatarsData;
  348. event AddNewPrim OnAddPrim;
  349. event FetchInventory OnAgentDataUpdateRequest;
  350. event FetchInventory OnUserInfoRequest;
  351. event TeleportLocationRequest OnSetStartLocationRequest;
  352. event RequestGodlikePowers OnRequestGodlikePowers;
  353. event GodKickUser OnGodKickUser;
  354. event ObjectDuplicate OnObjectDuplicate;
  355. event ObjectDuplicateOnRay OnObjectDuplicateOnRay;
  356. event UpdateVector OnGrabObject;
  357. event ObjectSelect OnDeGrabObject;
  358. event MoveObject OnGrabUpdate;
  359. event UpdateShape OnUpdatePrimShape;
  360. event ObjectExtraParams OnUpdateExtraParams;
  361. event ObjectSelect OnObjectSelect;
  362. event ObjectDeselect OnObjectDeselect;
  363. event GenericCall7 OnObjectDescription;
  364. event GenericCall7 OnObjectName;
  365. event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily;
  366. event UpdatePrimFlags OnUpdatePrimFlags;
  367. event UpdatePrimTexture OnUpdatePrimTexture;
  368. event UpdateVector OnUpdatePrimGroupPosition;
  369. event UpdateVector OnUpdatePrimSinglePosition;
  370. event UpdatePrimRotation OnUpdatePrimGroupRotation;
  371. event UpdatePrimSingleRotation OnUpdatePrimSingleRotation;
  372. event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation;
  373. event UpdateVector OnUpdatePrimScale;
  374. event StatusChange OnChildAgentStatus;
  375. event GenericCall2 OnStopMovement;
  376. event Action<LLUUID> OnRemoveAvatar;
  377. event ObjectPermissions OnObjectPermissions;
  378. event CreateNewInventoryItem OnCreateNewInventoryItem;
  379. event CreateInventoryFolder OnCreateNewInventoryFolder;
  380. event UpdateInventoryFolder OnUpdateInventoryFolder;
  381. event MoveInventoryFolder OnMoveInventoryFolder;
  382. event FetchInventoryDescendents OnFetchInventoryDescendents;
  383. event PurgeInventoryDescendents OnPurgeInventoryDescendents;
  384. event FetchInventory OnFetchInventory;
  385. event RequestTaskInventory OnRequestTaskInventory;
  386. event UpdateInventoryItem OnUpdateInventoryItem;
  387. event CopyInventoryItem OnCopyInventoryItem;
  388. event MoveInventoryItem OnMoveInventoryItem;
  389. event RemoveInventoryFolder OnRemoveInventoryFolder;
  390. event RemoveInventoryItem OnRemoveInventoryItem;
  391. event UDPAssetUploadRequest OnAssetUploadRequest;
  392. event XferReceive OnXferReceive;
  393. event RequestXfer OnRequestXfer;
  394. event ConfirmXfer OnConfirmXfer;
  395. event RezScript OnRezScript;
  396. event UpdateTaskInventory OnUpdateTaskInventory;
  397. event RemoveTaskInventory OnRemoveTaskItem;
  398. event RequestAsset OnRequestAsset;
  399. event UUIDNameRequest OnNameFromUUIDRequest;
  400. event ParcelAccessListRequest OnParcelAccessListRequest;
  401. event ParcelAccessListUpdateRequest OnParcelAccessListUpdateRequest;
  402. event ParcelPropertiesRequest OnParcelPropertiesRequest;
  403. event ParcelDivideRequest OnParcelDivideRequest;
  404. event ParcelJoinRequest OnParcelJoinRequest;
  405. event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
  406. event ParcelSelectObjects OnParcelSelectObjects;
  407. event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest;
  408. event EstateOwnerMessageRequest OnEstateOwnerMessage;
  409. event RegionInfoRequest OnRegionInfoRequest;
  410. event EstateCovenantRequest OnEstateCovenantRequest;
  411. event FriendActionDelegate OnApproveFriendRequest;
  412. event FriendActionDelegate OnDenyFriendRequest;
  413. event FriendshipTermination OnTerminateFriendship;
  414. event PacketStats OnPacketStats;
  415. // Financial packets
  416. event MoneyTransferRequest OnMoneyTransferRequest;
  417. event MoneyBalanceRequest OnMoneyBalanceRequest;
  418. event UpdateAvatarProperties OnUpdateAvatarProperties;
  419. LLVector3 StartPos { get; set; }
  420. LLUUID AgentId { get; }
  421. LLUUID SessionId { get; }
  422. LLUUID SecureSessionId { get; }
  423. string FirstName { get; }
  424. string LastName { get; }
  425. /// <summary>
  426. /// Returns the full name of the agent/avatar represented by this client
  427. /// </summary>
  428. /// <param name="newPack"></param>
  429. /// <param name="packType"></param>
  430. string Name { get; }
  431. uint CircuitCode { get; }
  432. void OutPacket(Packet newPack, ThrottleOutPacketType packType);
  433. void SendWearables(AvatarWearable[] wearables, int serial);
  434. void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry);
  435. void SendStartPingCheck(byte seq);
  436. void SendKillObject(ulong regionHandle, uint localID);
  437. void SendAnimations(LLUUID[] animID, int[] seqs, LLUUID sourceAgentId);
  438. void SendRegionHandshake(RegionInfo regionInfo);
  439. void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
  440. void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
  441. void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent,
  442. LLUUID imSessionID, string fromName, byte dialog, uint timeStamp);
  443. void SendLayerData(float[] map);
  444. void SendLayerData(int px, int py, float[] map);
  445. void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look);
  446. void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint);
  447. AgentCircuitData RequestClientInfo();
  448. void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, IPEndPoint newRegionExternalEndPoint,
  449. string capsURL);
  450. void SendMapBlock(List<MapBlockData> mapBlocks);
  451. void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags);
  452. void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID,
  453. uint flags, string capsURL);
  454. void SendTeleportFailed(string reason);
  455. void SendTeleportLocationStart();
  456. void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance);
  457. void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID,
  458. LLVector3 Pos, byte[] textureEntry, uint parentID);
  459. void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
  460. LLVector3 velocity, LLQuaternion rotation);
  461. void SendCoarseLocationUpdate(List<LLVector3> CoarseLocations);
  462. void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint);
  463. void SetChildAgentThrottle(byte[] throttle);
  464. void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape,
  465. LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, byte[] color,
  466. uint parentID, byte[] particleSystem, LLQuaternion rotation, byte clickAction, byte[] textureanimation);
  467. void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape,
  468. LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, byte[] color,
  469. uint parentID, byte[] particleSystem, LLQuaternion rotation, byte clickAction);
  470. void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
  471. LLQuaternion rotation, byte state);
  472. void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
  473. LLQuaternion rotation, LLVector3 velocity, LLVector3 rotationalvelocity);
  474. void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items,
  475. List<InventoryFolderBase> folders, bool fetchFolders,
  476. bool fetchItems);
  477. void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item);
  478. /// <summary>
  479. /// Tell the client that we have created the item it requested.
  480. /// </summary>
  481. /// <param name="Item"></param>
  482. void SendInventoryItemCreateUpdate(InventoryItemBase Item);
  483. void SendRemoveInventoryItem(LLUUID itemID);
  484. void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName);
  485. void SendXferPacket(ulong xferID, uint packet, byte[] data);
  486. void SendAvatarPickerReply(AvatarPickerReplyPacket Pack);
  487. void SendAgentDataUpdate(LLUUID agentid, LLUUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle);
  488. void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID);
  489. void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain, byte flags);
  490. void SendTriggeredSound(LLUUID soundID, LLUUID ownerID, LLUUID objectID, LLUUID parentID, ulong handle, LLVector3 position, float gain);
  491. void SendAttachedSoundGainChange(LLUUID objectID, float gain);
  492. void SendNameReply(LLUUID profileId, string firstname, string lastname);
  493. void SendAlertMessage(string message);
  494. void SendAgentAlertMessage(string message, bool modal);
  495. void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message, string url);
  496. void SendDialog(string objectname, LLUUID objectID, LLUUID ownerID, string msg, LLUUID textureID, int ch, string[] buttonlabels);
  497. bool AddMoney(int debit);
  498. void SendSunPos(LLVector3 sunPos, LLVector3 sunVel);
  499. void SendViewerTime(int phase);
  500. void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, string flAbout,
  501. uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, LLUUID partnerID);
  502. byte[] GetThrottlesPacked(float multiplier);
  503. void SetDebug(int newDebug);
  504. void InPacket(Packet NewPack);
  505. void Close(bool ShutdownCircuit);
  506. void Kick(string message);
  507. void Stop();
  508. event ViewerEffectEventHandler OnViewerEffect;
  509. event Action<IClientAPI> OnLogout;
  510. event Action<IClientAPI> OnConnectionClosed;
  511. void SendBlueBoxMessage(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message);
  512. void SendLogoutPacket();
  513. ClientInfo GetClientInfo();
  514. void SetClientInfo(ClientInfo info);
  515. void Terminate();
  516. }
  517. [Serializable]
  518. public class ClientInfo
  519. {
  520. public byte[] usecircuit;
  521. public EndPoint userEP;
  522. public EndPoint proxyEP;
  523. public sAgentCircuitData agentcircuit;
  524. public Dictionary<uint, uint> pendingAcks;
  525. public Dictionary<uint, byte[]> needAck;
  526. public List<byte[]> out_packets;
  527. public uint sequence;
  528. }
  529. }