TestClient.cs 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242
  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 OpenSimulator 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 System.Reflection;
  31. using System.Threading;
  32. using log4net;
  33. using OpenMetaverse;
  34. using OpenMetaverse.Packets;
  35. using OpenSim.Framework;
  36. using OpenSim.Region.Framework.Interfaces;
  37. using OpenSim.Region.Framework.Scenes;
  38. using OpenSim.Framework.Client;
  39. namespace OpenSim.Tests.Common.Mock
  40. {
  41. public class TestClient : IClientAPI, IClientCore
  42. {
  43. private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
  44. // Mock testing variables
  45. public List<ImageDataPacket> sentdatapkt = new List<ImageDataPacket>();
  46. public List<ImagePacketPacket> sentpktpkt = new List<ImagePacketPacket>();
  47. EventWaitHandle wh = new EventWaitHandle (false, EventResetMode.AutoReset, "Crossing");
  48. // TODO: This is a really nasty (and temporary) means of telling the test client which scene to invoke setup
  49. // methods on when a teleport is requested
  50. public Scene TeleportTargetScene;
  51. private TestClient TeleportSceneClient;
  52. private Scene m_scene;
  53. // Properties so that we can get at received data for test purposes
  54. public List<UUID> ReceivedOfflineNotifications { get; private set; }
  55. public List<UUID> ReceivedOnlineNotifications { get; private set; }
  56. public List<UUID> ReceivedFriendshipTerminations { get; private set; }
  57. // disable warning: public events, part of the public API
  58. #pragma warning disable 67
  59. public event Action<IClientAPI> OnLogout;
  60. public event ObjectPermissions OnObjectPermissions;
  61. public event MoneyTransferRequest OnMoneyTransferRequest;
  62. public event ParcelBuy OnParcelBuy;
  63. public event Action<IClientAPI> OnConnectionClosed;
  64. public event ImprovedInstantMessage OnInstantMessage;
  65. public event ChatMessage OnChatFromClient;
  66. public event TextureRequest OnRequestTexture;
  67. public event RezObject OnRezObject;
  68. public event ModifyTerrain OnModifyTerrain;
  69. public event BakeTerrain OnBakeTerrain;
  70. public event SetAppearance OnSetAppearance;
  71. public event AvatarNowWearing OnAvatarNowWearing;
  72. public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv;
  73. public event RezMultipleAttachmentsFromInv OnRezMultipleAttachmentsFromInv;
  74. public event UUIDNameRequest OnDetachAttachmentIntoInv;
  75. public event ObjectAttach OnObjectAttach;
  76. public event ObjectDeselect OnObjectDetach;
  77. public event ObjectDrop OnObjectDrop;
  78. public event StartAnim OnStartAnim;
  79. public event StopAnim OnStopAnim;
  80. public event LinkObjects OnLinkObjects;
  81. public event DelinkObjects OnDelinkObjects;
  82. public event RequestMapBlocks OnRequestMapBlocks;
  83. public event RequestMapName OnMapNameRequest;
  84. public event TeleportLocationRequest OnTeleportLocationRequest;
  85. public event TeleportLandmarkRequest OnTeleportLandmarkRequest;
  86. public event TeleportCancel OnTeleportCancel;
  87. public event DisconnectUser OnDisconnectUser;
  88. public event RequestAvatarProperties OnRequestAvatarProperties;
  89. public event SetAlwaysRun OnSetAlwaysRun;
  90. public event DeRezObject OnDeRezObject;
  91. public event Action<IClientAPI> OnRegionHandShakeReply;
  92. public event GenericCall1 OnRequestWearables;
  93. public event Action<IClientAPI, bool> OnCompleteMovementToRegion;
  94. public event UpdateAgent OnPreAgentUpdate;
  95. public event UpdateAgent OnAgentUpdate;
  96. public event AgentRequestSit OnAgentRequestSit;
  97. public event AgentSit OnAgentSit;
  98. public event AvatarPickerRequest OnAvatarPickerRequest;
  99. public event Action<IClientAPI> OnRequestAvatarsData;
  100. public event AddNewPrim OnAddPrim;
  101. public event RequestGodlikePowers OnRequestGodlikePowers;
  102. public event GodKickUser OnGodKickUser;
  103. public event ObjectDuplicate OnObjectDuplicate;
  104. public event GrabObject OnGrabObject;
  105. public event DeGrabObject OnDeGrabObject;
  106. public event MoveObject OnGrabUpdate;
  107. public event SpinStart OnSpinStart;
  108. public event SpinObject OnSpinUpdate;
  109. public event SpinStop OnSpinStop;
  110. public event ViewerEffectEventHandler OnViewerEffect;
  111. public event FetchInventory OnAgentDataUpdateRequest;
  112. public event TeleportLocationRequest OnSetStartLocationRequest;
  113. public event UpdateShape OnUpdatePrimShape;
  114. public event ObjectExtraParams OnUpdateExtraParams;
  115. public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily;
  116. public event ObjectSelect OnObjectSelect;
  117. public event ObjectRequest OnObjectRequest;
  118. public event GenericCall7 OnObjectDescription;
  119. public event GenericCall7 OnObjectName;
  120. public event GenericCall7 OnObjectClickAction;
  121. public event GenericCall7 OnObjectMaterial;
  122. public event UpdatePrimFlags OnUpdatePrimFlags;
  123. public event UpdatePrimTexture OnUpdatePrimTexture;
  124. public event UpdateVector OnUpdatePrimGroupPosition;
  125. public event UpdateVector OnUpdatePrimSinglePosition;
  126. public event UpdatePrimRotation OnUpdatePrimGroupRotation;
  127. public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation;
  128. public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition;
  129. public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation;
  130. public event UpdateVector OnUpdatePrimScale;
  131. public event UpdateVector OnUpdatePrimGroupScale;
  132. public event StatusChange OnChildAgentStatus;
  133. public event GenericCall2 OnStopMovement;
  134. public event Action<UUID> OnRemoveAvatar;
  135. public event CreateNewInventoryItem OnCreateNewInventoryItem;
  136. public event LinkInventoryItem OnLinkInventoryItem;
  137. public event CreateInventoryFolder OnCreateNewInventoryFolder;
  138. public event UpdateInventoryFolder OnUpdateInventoryFolder;
  139. public event MoveInventoryFolder OnMoveInventoryFolder;
  140. public event RemoveInventoryFolder OnRemoveInventoryFolder;
  141. public event RemoveInventoryItem OnRemoveInventoryItem;
  142. public event FetchInventoryDescendents OnFetchInventoryDescendents;
  143. public event PurgeInventoryDescendents OnPurgeInventoryDescendents;
  144. public event FetchInventory OnFetchInventory;
  145. public event RequestTaskInventory OnRequestTaskInventory;
  146. public event UpdateInventoryItem OnUpdateInventoryItem;
  147. public event CopyInventoryItem OnCopyInventoryItem;
  148. public event MoveInventoryItem OnMoveInventoryItem;
  149. public event UDPAssetUploadRequest OnAssetUploadRequest;
  150. public event RequestTerrain OnRequestTerrain;
  151. public event RequestTerrain OnUploadTerrain;
  152. public event XferReceive OnXferReceive;
  153. public event RequestXfer OnRequestXfer;
  154. public event ConfirmXfer OnConfirmXfer;
  155. public event AbortXfer OnAbortXfer;
  156. public event RezScript OnRezScript;
  157. public event UpdateTaskInventory OnUpdateTaskInventory;
  158. public event MoveTaskInventory OnMoveTaskItem;
  159. public event RemoveTaskInventory OnRemoveTaskItem;
  160. public event RequestAsset OnRequestAsset;
  161. public event GenericMessage OnGenericMessage;
  162. public event UUIDNameRequest OnNameFromUUIDRequest;
  163. public event UUIDNameRequest OnUUIDGroupNameRequest;
  164. public event ParcelPropertiesRequest OnParcelPropertiesRequest;
  165. public event ParcelDivideRequest OnParcelDivideRequest;
  166. public event ParcelJoinRequest OnParcelJoinRequest;
  167. public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
  168. public event ParcelAbandonRequest OnParcelAbandonRequest;
  169. public event ParcelGodForceOwner OnParcelGodForceOwner;
  170. public event ParcelReclaim OnParcelReclaim;
  171. public event ParcelReturnObjectsRequest OnParcelReturnObjectsRequest;
  172. public event ParcelAccessListRequest OnParcelAccessListRequest;
  173. public event ParcelAccessListUpdateRequest OnParcelAccessListUpdateRequest;
  174. public event ParcelSelectObjects OnParcelSelectObjects;
  175. public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest;
  176. public event ParcelDeedToGroup OnParcelDeedToGroup;
  177. public event ObjectDeselect OnObjectDeselect;
  178. public event RegionInfoRequest OnRegionInfoRequest;
  179. public event EstateCovenantRequest OnEstateCovenantRequest;
  180. public event EstateChangeInfo OnEstateChangeInfo;
  181. public event ObjectDuplicateOnRay OnObjectDuplicateOnRay;
  182. public event FriendActionDelegate OnApproveFriendRequest;
  183. public event FriendActionDelegate OnDenyFriendRequest;
  184. public event FriendshipTermination OnTerminateFriendship;
  185. public event GrantUserFriendRights OnGrantUserRights;
  186. public event EconomyDataRequest OnEconomyDataRequest;
  187. public event MoneyBalanceRequest OnMoneyBalanceRequest;
  188. public event UpdateAvatarProperties OnUpdateAvatarProperties;
  189. public event ObjectIncludeInSearch OnObjectIncludeInSearch;
  190. public event UUIDNameRequest OnTeleportHomeRequest;
  191. public event ScriptAnswer OnScriptAnswer;
  192. public event RequestPayPrice OnRequestPayPrice;
  193. public event ObjectSaleInfo OnObjectSaleInfo;
  194. public event ObjectBuy OnObjectBuy;
  195. public event BuyObjectInventory OnBuyObjectInventory;
  196. public event AgentSit OnUndo;
  197. public event AgentSit OnRedo;
  198. public event LandUndo OnLandUndo;
  199. public event ForceReleaseControls OnForceReleaseControls;
  200. public event GodLandStatRequest OnLandStatRequest;
  201. public event RequestObjectPropertiesFamily OnObjectGroupRequest;
  202. public event DetailedEstateDataRequest OnDetailedEstateDataRequest;
  203. public event SetEstateFlagsRequest OnSetEstateFlagsRequest;
  204. public event SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture;
  205. public event SetEstateTerrainDetailTexture OnSetEstateTerrainDetailTexture;
  206. public event SetEstateTerrainTextureHeights OnSetEstateTerrainTextureHeights;
  207. public event CommitEstateTerrainTextureRequest OnCommitEstateTerrainTextureRequest;
  208. public event SetRegionTerrainSettings OnSetRegionTerrainSettings;
  209. public event EstateRestartSimRequest OnEstateRestartSimRequest;
  210. public event EstateChangeCovenantRequest OnEstateChangeCovenantRequest;
  211. public event UpdateEstateAccessDeltaRequest OnUpdateEstateAccessDeltaRequest;
  212. public event SimulatorBlueBoxMessageRequest OnSimulatorBlueBoxMessageRequest;
  213. public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest;
  214. public event EstateDebugRegionRequest OnEstateDebugRegionRequest;
  215. public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
  216. public event EstateTeleportAllUsersHomeRequest OnEstateTeleportAllUsersHomeRequest;
  217. public event ScriptReset OnScriptReset;
  218. public event GetScriptRunning OnGetScriptRunning;
  219. public event SetScriptRunning OnSetScriptRunning;
  220. public event Action<Vector3, bool, bool> OnAutoPilotGo;
  221. public event TerrainUnacked OnUnackedTerrain;
  222. public event RegionHandleRequest OnRegionHandleRequest;
  223. public event ParcelInfoRequest OnParcelInfoRequest;
  224. public event ActivateGesture OnActivateGesture;
  225. public event DeactivateGesture OnDeactivateGesture;
  226. public event ObjectOwner OnObjectOwner;
  227. public event DirPlacesQuery OnDirPlacesQuery;
  228. public event DirFindQuery OnDirFindQuery;
  229. public event DirLandQuery OnDirLandQuery;
  230. public event DirPopularQuery OnDirPopularQuery;
  231. public event DirClassifiedQuery OnDirClassifiedQuery;
  232. public event EventInfoRequest OnEventInfoRequest;
  233. public event ParcelSetOtherCleanTime OnParcelSetOtherCleanTime;
  234. public event MapItemRequest OnMapItemRequest;
  235. public event OfferCallingCard OnOfferCallingCard;
  236. public event AcceptCallingCard OnAcceptCallingCard;
  237. public event DeclineCallingCard OnDeclineCallingCard;
  238. public event SoundTrigger OnSoundTrigger;
  239. public event StartLure OnStartLure;
  240. public event TeleportLureRequest OnTeleportLureRequest;
  241. public event NetworkStats OnNetworkStatsUpdate;
  242. public event ClassifiedInfoRequest OnClassifiedInfoRequest;
  243. public event ClassifiedInfoUpdate OnClassifiedInfoUpdate;
  244. public event ClassifiedDelete OnClassifiedDelete;
  245. public event ClassifiedDelete OnClassifiedGodDelete;
  246. public event EventNotificationAddRequest OnEventNotificationAddRequest;
  247. public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest;
  248. public event EventGodDelete OnEventGodDelete;
  249. public event ParcelDwellRequest OnParcelDwellRequest;
  250. public event UserInfoRequest OnUserInfoRequest;
  251. public event UpdateUserInfo OnUpdateUserInfo;
  252. public event RetrieveInstantMessages OnRetrieveInstantMessages;
  253. public event PickDelete OnPickDelete;
  254. public event PickGodDelete OnPickGodDelete;
  255. public event PickInfoUpdate OnPickInfoUpdate;
  256. public event AvatarNotesUpdate OnAvatarNotesUpdate;
  257. public event MuteListRequest OnMuteListRequest;
  258. public event AvatarInterestUpdate OnAvatarInterestUpdate;
  259. public event PlacesQuery OnPlacesQuery;
  260. public event FindAgentUpdate OnFindAgent;
  261. public event TrackAgentUpdate OnTrackAgent;
  262. public event NewUserReport OnUserReport;
  263. public event SaveStateHandler OnSaveState;
  264. public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
  265. public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
  266. public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
  267. public event FreezeUserUpdate OnParcelFreezeUser;
  268. public event EjectUserUpdate OnParcelEjectUser;
  269. public event ParcelBuyPass OnParcelBuyPass;
  270. public event ParcelGodMark OnParcelGodMark;
  271. public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
  272. public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
  273. public event SimWideDeletesDelegate OnSimWideDeletes;
  274. public event SendPostcard OnSendPostcard;
  275. public event MuteListEntryUpdate OnUpdateMuteListEntry;
  276. public event MuteListEntryRemove OnRemoveMuteListEntry;
  277. public event GodlikeMessage onGodlikeMessage;
  278. public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
  279. #pragma warning restore 67
  280. /// <value>
  281. /// This agent's UUID
  282. /// </value>
  283. private UUID m_agentId;
  284. public ISceneAgent SceneAgent { get { throw new NotImplementedException(); } }
  285. /// <value>
  286. /// The last caps seed url that this client was given.
  287. /// </value>
  288. public string CapsSeedUrl;
  289. private Vector3 startPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 2);
  290. public virtual Vector3 StartPos
  291. {
  292. get { return startPos; }
  293. set { }
  294. }
  295. public virtual UUID AgentId
  296. {
  297. get { return m_agentId; }
  298. }
  299. public UUID SessionId
  300. {
  301. get { return UUID.Zero; }
  302. }
  303. public UUID SecureSessionId
  304. {
  305. get { return UUID.Zero; }
  306. }
  307. public virtual string FirstName
  308. {
  309. get { return m_firstName; }
  310. }
  311. private string m_firstName;
  312. public virtual string LastName
  313. {
  314. get { return m_lastName; }
  315. }
  316. private string m_lastName;
  317. public virtual String Name
  318. {
  319. get { return FirstName + " " + LastName; }
  320. }
  321. public bool IsActive
  322. {
  323. get { return true; }
  324. set { }
  325. }
  326. public bool IsLoggingOut
  327. {
  328. get { return false; }
  329. set { }
  330. }
  331. public UUID ActiveGroupId
  332. {
  333. get { return UUID.Zero; }
  334. }
  335. public string ActiveGroupName
  336. {
  337. get { return String.Empty; }
  338. }
  339. public ulong ActiveGroupPowers
  340. {
  341. get { return 0; }
  342. }
  343. public bool IsGroupMember(UUID groupID)
  344. {
  345. return false;
  346. }
  347. public ulong GetGroupPowers(UUID groupID)
  348. {
  349. return 0;
  350. }
  351. public virtual int NextAnimationSequenceNumber
  352. {
  353. get { return 1; }
  354. }
  355. public IScene Scene
  356. {
  357. get { return m_scene; }
  358. }
  359. public bool SendLogoutPacketWhenClosing
  360. {
  361. set { }
  362. }
  363. private uint m_circuitCode;
  364. public uint CircuitCode
  365. {
  366. get { return m_circuitCode; }
  367. set { m_circuitCode = value; }
  368. }
  369. public IPEndPoint RemoteEndPoint
  370. {
  371. get { return new IPEndPoint(IPAddress.Loopback, (ushort)m_circuitCode); }
  372. }
  373. /// <summary>
  374. /// Constructor
  375. /// </summary>
  376. /// <param name="agentData"></param>
  377. /// <param name="scene"></param>
  378. public TestClient(AgentCircuitData agentData, Scene scene)
  379. {
  380. m_agentId = agentData.AgentID;
  381. m_firstName = agentData.firstname;
  382. m_lastName = agentData.lastname;
  383. m_circuitCode = agentData.circuitcode;
  384. m_scene = scene;
  385. CapsSeedUrl = agentData.CapsPath;
  386. ReceivedOfflineNotifications = new List<UUID>();
  387. ReceivedOnlineNotifications = new List<UUID>();
  388. ReceivedFriendshipTerminations = new List<UUID>();
  389. }
  390. /// <summary>
  391. /// Attempt a teleport to the given region.
  392. /// </summary>
  393. /// <param name="regionHandle"></param>
  394. /// <param name="position"></param>
  395. /// <param name="lookAt"></param>
  396. public void Teleport(ulong regionHandle, Vector3 position, Vector3 lookAt)
  397. {
  398. OnTeleportLocationRequest(this, regionHandle, position, lookAt, 16);
  399. }
  400. public void CompleteMovement()
  401. {
  402. OnCompleteMovementToRegion(this, true);
  403. }
  404. public virtual void ActivateGesture(UUID assetId, UUID gestureId)
  405. {
  406. }
  407. public virtual void SendWearables(AvatarWearable[] wearables, int serial)
  408. {
  409. }
  410. public virtual void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry)
  411. {
  412. }
  413. public virtual void Kick(string message)
  414. {
  415. }
  416. public virtual void SendStartPingCheck(byte seq)
  417. {
  418. }
  419. public virtual void SendAvatarPickerReply(AvatarPickerReplyAgentDataArgs AgentData, List<AvatarPickerReplyDataArgs> Data)
  420. {
  421. }
  422. public virtual void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle)
  423. {
  424. }
  425. public virtual void SendKillObject(ulong regionHandle, List<uint> localID)
  426. {
  427. }
  428. public virtual void SetChildAgentThrottle(byte[] throttle)
  429. {
  430. }
  431. public byte[] GetThrottlesPacked(float multiplier)
  432. {
  433. return new byte[0];
  434. }
  435. public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs)
  436. {
  437. }
  438. public virtual void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName,
  439. UUID fromAgentID, byte source, byte audible)
  440. {
  441. }
  442. public virtual void SendChatMessage(byte[] message, byte type, Vector3 fromPos, string fromName,
  443. UUID fromAgentID, byte source, byte audible)
  444. {
  445. }
  446. public void SendInstantMessage(GridInstantMessage im)
  447. {
  448. }
  449. public void SendGenericMessage(string method, List<string> message)
  450. {
  451. }
  452. public void SendGenericMessage(string method, List<byte[]> message)
  453. {
  454. }
  455. public virtual void SendLayerData(float[] map)
  456. {
  457. }
  458. public virtual void SendLayerData(int px, int py, float[] map)
  459. {
  460. }
  461. public virtual void SendLayerData(int px, int py, float[] map, bool track)
  462. {
  463. }
  464. public virtual void SendWindData(Vector2[] windSpeeds) { }
  465. public virtual void SendCloudData(float[] cloudCover) { }
  466. public virtual void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look)
  467. {
  468. }
  469. public virtual AgentCircuitData RequestClientInfo()
  470. {
  471. AgentCircuitData agentData = new AgentCircuitData();
  472. agentData.AgentID = AgentId;
  473. agentData.SessionID = UUID.Zero;
  474. agentData.SecureSessionID = UUID.Zero;
  475. agentData.circuitcode = m_circuitCode;
  476. agentData.child = false;
  477. agentData.firstname = m_firstName;
  478. agentData.lastname = m_lastName;
  479. ICapabilitiesModule capsModule = m_scene.RequestModuleInterface<ICapabilitiesModule>();
  480. if (capsModule != null)
  481. {
  482. agentData.CapsPath = capsModule.GetCapsPath(m_agentId);
  483. agentData.ChildrenCapSeeds = new Dictionary<ulong, string>(capsModule.GetChildrenSeeds(m_agentId));
  484. }
  485. return agentData;
  486. }
  487. public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint)
  488. {
  489. m_log.DebugFormat("[TEST CLIENT]: Processing inform client of neighbour");
  490. // In response to this message, we are going to make a teleport to the scene we've previous been told
  491. // about by test code (this needs to be improved).
  492. AgentCircuitData newAgent = RequestClientInfo();
  493. // Stage 2: add the new client as a child agent to the scene
  494. TeleportSceneClient = new TestClient(newAgent, TeleportTargetScene);
  495. TeleportTargetScene.AddNewClient(TeleportSceneClient, PresenceType.User);
  496. }
  497. public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint,
  498. uint locationID, uint flags, string capsURL)
  499. {
  500. m_log.DebugFormat("[TEST CLIENT]: Received SendRegionTeleport");
  501. CapsSeedUrl = capsURL;
  502. TeleportSceneClient.CompleteMovement();
  503. //TeleportTargetScene.AgentCrossing(newAgent.AgentID, new Vector3(90, 90, 90), false);
  504. }
  505. public virtual void SendTeleportFailed(string reason)
  506. {
  507. m_log.DebugFormat("[TEST CLIENT]: Teleport failed with reason {0}", reason);
  508. }
  509. public virtual void CrossRegion(ulong newRegionHandle, Vector3 pos, Vector3 lookAt,
  510. IPEndPoint newRegionExternalEndPoint, string capsURL)
  511. {
  512. // This is supposed to send a packet to the client telling it's ready to start region crossing.
  513. // Instead I will just signal I'm ready, mimicking the communication behavior.
  514. // It's ugly, but avoids needless communication setup. This is used in ScenePresenceTests.cs.
  515. // Arthur V.
  516. wh.Set();
  517. }
  518. public virtual void SendMapBlock(List<MapBlockData> mapBlocks, uint flag)
  519. {
  520. }
  521. public virtual void SendLocalTeleport(Vector3 position, Vector3 lookAt, uint flags)
  522. {
  523. }
  524. public virtual void SendTeleportStart(uint flags)
  525. {
  526. }
  527. public void SendTeleportProgress(uint flags, string message)
  528. {
  529. }
  530. public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance)
  531. {
  532. }
  533. public virtual void SendPayPrice(UUID objectID, int[] payPrice)
  534. {
  535. }
  536. public virtual void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations)
  537. {
  538. }
  539. public virtual void SendDialog(string objectname, UUID objectID, UUID ownerID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels)
  540. {
  541. }
  542. public void SendAvatarDataImmediate(ISceneEntity avatar)
  543. {
  544. }
  545. public void SendEntityUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags)
  546. {
  547. }
  548. public void ReprioritizeUpdates()
  549. {
  550. }
  551. public void FlushPrimUpdates()
  552. {
  553. }
  554. public virtual void SendInventoryFolderDetails(UUID ownerID, UUID folderID,
  555. List<InventoryItemBase> items,
  556. List<InventoryFolderBase> folders,
  557. int version,
  558. bool fetchFolders,
  559. bool fetchItems)
  560. {
  561. }
  562. public virtual void SendInventoryItemDetails(UUID ownerID, InventoryItemBase item)
  563. {
  564. }
  565. public virtual void SendInventoryItemCreateUpdate(InventoryItemBase Item, uint callbackID)
  566. {
  567. }
  568. public virtual void SendRemoveInventoryItem(UUID itemID)
  569. {
  570. }
  571. public virtual void SendBulkUpdateInventory(InventoryNodeBase node)
  572. {
  573. }
  574. public UUID GetDefaultAnimation(string name)
  575. {
  576. return UUID.Zero;
  577. }
  578. public void SendTakeControls(int controls, bool passToAgent, bool TakeControls)
  579. {
  580. }
  581. public virtual void SendTaskInventory(UUID taskID, short serial, byte[] fileName)
  582. {
  583. }
  584. public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data)
  585. {
  586. }
  587. public virtual void SendAbortXferPacket(ulong xferID)
  588. {
  589. }
  590. public virtual void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit,
  591. int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor,
  592. int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay,
  593. int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent)
  594. {
  595. }
  596. public virtual void SendNameReply(UUID profileId, string firstname, string lastname)
  597. {
  598. }
  599. public virtual void SendPreLoadSound(UUID objectID, UUID ownerID, UUID soundID)
  600. {
  601. }
  602. public virtual void SendPlayAttachedSound(UUID soundID, UUID objectID, UUID ownerID, float gain,
  603. byte flags)
  604. {
  605. }
  606. public void SendTriggeredSound(UUID soundID, UUID ownerID, UUID objectID, UUID parentID, ulong handle, Vector3 position, float gain)
  607. {
  608. }
  609. public void SendAttachedSoundGainChange(UUID objectID, float gain)
  610. {
  611. }
  612. public void SendAlertMessage(string message)
  613. {
  614. }
  615. public void SendAgentAlertMessage(string message, bool modal)
  616. {
  617. }
  618. public void SendSystemAlertMessage(string message)
  619. {
  620. }
  621. public void SendLoadURL(string objectname, UUID objectID, UUID ownerID, bool groupOwned, string message,
  622. string url)
  623. {
  624. }
  625. public virtual void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args)
  626. {
  627. if (OnRegionHandShakeReply != null)
  628. {
  629. OnRegionHandShakeReply(this);
  630. }
  631. if (OnCompleteMovementToRegion != null)
  632. {
  633. OnCompleteMovementToRegion(this, true);
  634. }
  635. }
  636. public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID)
  637. {
  638. }
  639. public void SendConfirmXfer(ulong xferID, uint PacketID)
  640. {
  641. }
  642. public void SendXferRequest(ulong XferID, short AssetType, UUID vFileID, byte FilePath, byte[] FileName)
  643. {
  644. }
  645. public void SendInitiateDownload(string simFileName, string clientFileName)
  646. {
  647. }
  648. public void SendImageFirstPart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec)
  649. {
  650. ImageDataPacket im = new ImageDataPacket();
  651. im.Header.Reliable = false;
  652. im.ImageID.Packets = numParts;
  653. im.ImageID.ID = ImageUUID;
  654. if (ImageSize > 0)
  655. im.ImageID.Size = ImageSize;
  656. im.ImageData.Data = ImageData;
  657. im.ImageID.Codec = imageCodec;
  658. im.Header.Zerocoded = true;
  659. sentdatapkt.Add(im);
  660. }
  661. public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData)
  662. {
  663. ImagePacketPacket im = new ImagePacketPacket();
  664. im.Header.Reliable = false;
  665. im.ImageID.Packet = partNumber;
  666. im.ImageID.ID = imageUuid;
  667. im.ImageData.Data = imageData;
  668. sentpktpkt.Add(im);
  669. }
  670. public void SendImageNotFound(UUID imageid)
  671. {
  672. }
  673. public void SendShutdownConnectionNotice()
  674. {
  675. }
  676. public void SendSimStats(SimStats stats)
  677. {
  678. }
  679. public void SendObjectPropertiesFamilyData(ISceneEntity Entity, uint RequestFlags)
  680. {
  681. }
  682. public void SendObjectPropertiesReply(ISceneEntity entity)
  683. {
  684. }
  685. public void SendAgentOffline(UUID[] agentIDs)
  686. {
  687. ReceivedOfflineNotifications.AddRange(agentIDs);
  688. }
  689. public void SendAgentOnline(UUID[] agentIDs)
  690. {
  691. ReceivedOnlineNotifications.AddRange(agentIDs);
  692. }
  693. public void SendSitResponse(UUID TargetID, Vector3 OffsetPos, Quaternion SitOrientation, bool autopilot,
  694. Vector3 CameraAtOffset, Vector3 CameraEyeOffset, bool ForceMouseLook)
  695. {
  696. }
  697. public void SendAdminResponse(UUID Token, uint AdminLevel)
  698. {
  699. }
  700. public void SendGroupMembership(GroupMembershipData[] GroupMembership)
  701. {
  702. }
  703. public bool AddMoney(int debit)
  704. {
  705. return false;
  706. }
  707. public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong time, uint dlen, uint ylen, float phase)
  708. {
  709. }
  710. public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks)
  711. {
  712. }
  713. public void SendViewerTime(int phase)
  714. {
  715. }
  716. public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember,
  717. string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL,
  718. UUID partnerID)
  719. {
  720. }
  721. public int DebugPacketLevel { get; set; }
  722. public void InPacket(object NewPack)
  723. {
  724. }
  725. public void ProcessInPacket(Packet NewPack)
  726. {
  727. }
  728. public void Close()
  729. {
  730. m_scene.RemoveClient(AgentId, true);
  731. }
  732. public void Start()
  733. {
  734. throw new NotImplementedException();
  735. }
  736. public void Stop()
  737. {
  738. }
  739. public void SendBlueBoxMessage(UUID FromAvatarID, String FromAvatarName, String Message)
  740. {
  741. }
  742. public void SendLogoutPacket()
  743. {
  744. }
  745. public void Terminate()
  746. {
  747. }
  748. public EndPoint GetClientEP()
  749. {
  750. return null;
  751. }
  752. public ClientInfo GetClientInfo()
  753. {
  754. return null;
  755. }
  756. public void SetClientInfo(ClientInfo info)
  757. {
  758. }
  759. public void SendScriptQuestion(UUID objectID, string taskName, string ownerName, UUID itemID, int question)
  760. {
  761. }
  762. public void SendHealth(float health)
  763. {
  764. }
  765. public void SendEstateList(UUID invoice, int code, UUID[] Data, uint estateID)
  766. {
  767. }
  768. public void SendBannedUserList(UUID invoice, EstateBan[] banlist, uint estateID)
  769. {
  770. }
  771. public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args)
  772. {
  773. }
  774. public void SendEstateCovenantInformation(UUID covenant)
  775. {
  776. }
  777. public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner)
  778. {
  779. }
  780. public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, ILandObject lo, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
  781. {
  782. }
  783. public void SendLandAccessListData(List<UUID> avatars, uint accessFlag, int localLandID)
  784. {
  785. }
  786. public void SendForceClientSelectObjects(List<uint> objectIDs)
  787. {
  788. }
  789. public void SendCameraConstraint(Vector4 ConstraintPlane)
  790. {
  791. }
  792. public void SendLandObjectOwners(LandData land, List<UUID> groups, Dictionary<UUID, int> ownersAndCount)
  793. {
  794. }
  795. public void SendLandParcelOverlay(byte[] data, int sequence_id)
  796. {
  797. }
  798. public void SendParcelMediaCommand(uint flags, ParcelMediaCommandEnum command, float time)
  799. {
  800. }
  801. public void SendParcelMediaUpdate(string mediaUrl, UUID mediaTextureID, byte autoScale, string mediaType,
  802. string mediaDesc, int mediaWidth, int mediaHeight, byte mediaLoop)
  803. {
  804. }
  805. public void SendGroupNameReply(UUID groupLLUID, string GroupName)
  806. {
  807. }
  808. public void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia)
  809. {
  810. }
  811. public void SendScriptRunningReply(UUID objectID, UUID itemID, bool running)
  812. {
  813. }
  814. public void SendAsset(AssetRequestToClient req)
  815. {
  816. }
  817. public void SendTexture(AssetBase TextureAsset)
  818. {
  819. }
  820. public void SendSetFollowCamProperties (UUID objectID, SortedDictionary<int, float> parameters)
  821. {
  822. }
  823. public void SendClearFollowCamProperties (UUID objectID)
  824. {
  825. }
  826. public void SendRegionHandle (UUID regoinID, ulong handle)
  827. {
  828. }
  829. public void SendParcelInfo (RegionInfo info, LandData land, UUID parcelID, uint x, uint y)
  830. {
  831. }
  832. public void SetClientOption(string option, string value)
  833. {
  834. }
  835. public string GetClientOption(string option)
  836. {
  837. return string.Empty;
  838. }
  839. public void SendScriptTeleportRequest(string objName, string simName, Vector3 pos, Vector3 lookAt)
  840. {
  841. }
  842. public void SendDirPlacesReply(UUID queryID, DirPlacesReplyData[] data)
  843. {
  844. }
  845. public void SendDirPeopleReply(UUID queryID, DirPeopleReplyData[] data)
  846. {
  847. }
  848. public void SendDirEventsReply(UUID queryID, DirEventsReplyData[] data)
  849. {
  850. }
  851. public void SendDirGroupsReply(UUID queryID, DirGroupsReplyData[] data)
  852. {
  853. }
  854. public void SendDirClassifiedReply(UUID queryID, DirClassifiedReplyData[] data)
  855. {
  856. }
  857. public void SendDirLandReply(UUID queryID, DirLandReplyData[] data)
  858. {
  859. }
  860. public void SendDirPopularReply(UUID queryID, DirPopularReplyData[] data)
  861. {
  862. }
  863. public void SendMapItemReply(mapItemReply[] replies, uint mapitemtype, uint flags)
  864. {
  865. }
  866. public void KillEndDone()
  867. {
  868. }
  869. public void SendEventInfoReply (EventData info)
  870. {
  871. }
  872. public void SendOfferCallingCard (UUID destID, UUID transactionID)
  873. {
  874. }
  875. public void SendAcceptCallingCard (UUID transactionID)
  876. {
  877. }
  878. public void SendDeclineCallingCard (UUID transactionID)
  879. {
  880. }
  881. public void SendAvatarGroupsReply(UUID avatarID, GroupMembershipData[] data)
  882. {
  883. }
  884. public void SendJoinGroupReply(UUID groupID, bool success)
  885. {
  886. }
  887. public void SendEjectGroupMemberReply(UUID agentID, UUID groupID, bool succss)
  888. {
  889. }
  890. public void SendLeaveGroupReply(UUID groupID, bool success)
  891. {
  892. }
  893. public void SendTerminateFriend(UUID exFriendID)
  894. {
  895. ReceivedFriendshipTerminations.Add(exFriendID);
  896. }
  897. public bool AddGenericPacketHandler(string MethodName, GenericMessage handler)
  898. {
  899. //throw new NotImplementedException();
  900. return false;
  901. }
  902. public void SendAvatarClassifiedReply(UUID targetID, UUID[] classifiedID, string[] name)
  903. {
  904. }
  905. public void SendClassifiedInfoReply(UUID classifiedID, UUID creatorID, uint creationDate, uint expirationDate, uint category, string name, string description, UUID parcelID, uint parentEstate, UUID snapshotID, string simName, Vector3 globalPos, string parcelName, byte classifiedFlags, int price)
  906. {
  907. }
  908. public void SendAgentDropGroup(UUID groupID)
  909. {
  910. }
  911. public void SendAvatarNotesReply(UUID targetID, string text)
  912. {
  913. }
  914. public void SendAvatarPicksReply(UUID targetID, Dictionary<UUID, string> picks)
  915. {
  916. }
  917. public void SendAvatarClassifiedReply(UUID targetID, Dictionary<UUID, string> classifieds)
  918. {
  919. }
  920. public void SendParcelDwellReply(int localID, UUID parcelID, float dwell)
  921. {
  922. }
  923. public void SendUserInfoReply(bool imViaEmail, bool visible, string email)
  924. {
  925. }
  926. public void SendCreateGroupReply(UUID groupID, bool success, string message)
  927. {
  928. }
  929. public void RefreshGroupMembership()
  930. {
  931. }
  932. public void SendUseCachedMuteList()
  933. {
  934. }
  935. public void SendMuteListUpdate(string filename)
  936. {
  937. }
  938. public void SendPickInfoReply(UUID pickID,UUID creatorID, bool topPick, UUID parcelID, string name, string desc, UUID snapshotID, string user, string originalName, string simName, Vector3 posGlobal, int sortOrder, bool enabled)
  939. {
  940. }
  941. public bool TryGet<T>(out T iface)
  942. {
  943. iface = default(T);
  944. return false;
  945. }
  946. public T Get<T>()
  947. {
  948. return default(T);
  949. }
  950. public void Disconnect(string reason)
  951. {
  952. }
  953. public void Disconnect()
  954. {
  955. }
  956. public void SendRebakeAvatarTextures(UUID textureID)
  957. {
  958. }
  959. public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages)
  960. {
  961. }
  962. public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt)
  963. {
  964. }
  965. public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier)
  966. {
  967. }
  968. public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt)
  969. {
  970. }
  971. public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes)
  972. {
  973. }
  974. public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals)
  975. {
  976. }
  977. public void SendChangeUserRights(UUID agentID, UUID friendID, int rights)
  978. {
  979. }
  980. public void SendTextBoxRequest(string message, int chatChannel, string objectname, UUID ownerID, string ownerFirstName, string ownerLastName, UUID objectId)
  981. {
  982. }
  983. public void StopFlying(ISceneEntity presence)
  984. {
  985. }
  986. public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data)
  987. {
  988. }
  989. }
  990. }