clockwerk-opensim – Blame information for rev 1

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