opensim-development – Blame information for rev 1

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