diff options
Diffstat (limited to 'OpenSim/Tests/Common/Mock/TestClient.cs')
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestClient.cs | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index dce2fd7..179a91f 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -47,9 +47,9 @@ namespace OpenSim.Tests.Common.Mock | |||
47 | EventWaitHandle wh = new EventWaitHandle (false, EventResetMode.AutoReset, "Crossing"); | 47 | EventWaitHandle wh = new EventWaitHandle (false, EventResetMode.AutoReset, "Crossing"); |
48 | 48 | ||
49 | private Scene m_scene; | 49 | private Scene m_scene; |
50 | private SceneManager m_sceneManager; | ||
51 | 50 | ||
52 | // Properties so that we can get at received data for test purposes | 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; } | 53 | public List<UUID> ReceivedOfflineNotifications { get; private set; } |
54 | public List<UUID> ReceivedOnlineNotifications { get; private set; } | 54 | public List<UUID> ReceivedOnlineNotifications { get; private set; } |
55 | public List<UUID> ReceivedFriendshipTerminations { get; private set; } | 55 | public List<UUID> ReceivedFriendshipTerminations { get; private set; } |
@@ -61,6 +61,7 @@ namespace OpenSim.Tests.Common.Mock | |||
61 | // Test client specific events - for use by tests to implement some IClientAPI behaviour. | 61 | // Test client specific events - for use by tests to implement some IClientAPI behaviour. |
62 | public event Action<RegionInfo, Vector3, Vector3> OnReceivedMoveAgentIntoRegion; | 62 | public event Action<RegionInfo, Vector3, Vector3> OnReceivedMoveAgentIntoRegion; |
63 | public event Action<ulong, IPEndPoint> OnTestClientInformClientOfNeighbour; | 63 | public event Action<ulong, IPEndPoint> OnTestClientInformClientOfNeighbour; |
64 | public event Action<GridInstantMessage> OnReceivedInstantMessage; | ||
64 | 65 | ||
65 | // disable warning: public events, part of the public API | 66 | // disable warning: public events, part of the public API |
66 | #pragma warning disable 67 | 67 | #pragma warning disable 67 |
@@ -197,6 +198,7 @@ namespace OpenSim.Tests.Common.Mock | |||
197 | public event EstateCovenantRequest OnEstateCovenantRequest; | 198 | public event EstateCovenantRequest OnEstateCovenantRequest; |
198 | public event EstateChangeInfo OnEstateChangeInfo; | 199 | public event EstateChangeInfo OnEstateChangeInfo; |
199 | public event EstateManageTelehub OnEstateManageTelehub; | 200 | public event EstateManageTelehub OnEstateManageTelehub; |
201 | public event CachedTextureRequest OnCachedTextureRequest; | ||
200 | 202 | ||
201 | public event ObjectDuplicateOnRay OnObjectDuplicateOnRay; | 203 | public event ObjectDuplicateOnRay OnObjectDuplicateOnRay; |
202 | 204 | ||
@@ -435,33 +437,21 @@ namespace OpenSim.Tests.Common.Mock | |||
435 | /// <summary> | 437 | /// <summary> |
436 | /// Constructor | 438 | /// Constructor |
437 | /// </summary> | 439 | /// </summary> |
438 | /// <remarks> | ||
439 | /// Can be used for a test where there is only one region or where there are multiple regions that are not | ||
440 | /// neighbours and where no teleporting takes place. In other situations, the constructor that takes in a | ||
441 | /// scene manager should be used. | ||
442 | /// </remarks> | ||
443 | /// <param name="agentData"></param> | ||
444 | /// <param name="scene"></param> | ||
445 | public TestClient(AgentCircuitData agentData, Scene scene) : this(agentData, scene, null) {} | ||
446 | |||
447 | /// <summary> | ||
448 | /// Constructor | ||
449 | /// </summary> | ||
450 | /// <param name="agentData"></param> | 440 | /// <param name="agentData"></param> |
451 | /// <param name="scene"></param> | 441 | /// <param name="scene"></param> |
452 | /// <param name="sceneManager"></param> | 442 | /// <param name="sceneManager"></param> |
453 | public TestClient(AgentCircuitData agentData, Scene scene, SceneManager sceneManager) | 443 | public TestClient(AgentCircuitData agentData, Scene scene) |
454 | { | 444 | { |
455 | m_agentId = agentData.AgentID; | 445 | m_agentId = agentData.AgentID; |
456 | m_firstName = agentData.firstname; | 446 | m_firstName = agentData.firstname; |
457 | m_lastName = agentData.lastname; | 447 | m_lastName = agentData.lastname; |
458 | m_circuitCode = agentData.circuitcode; | 448 | m_circuitCode = agentData.circuitcode; |
459 | m_scene = scene; | 449 | m_scene = scene; |
460 | m_sceneManager = sceneManager; | ||
461 | SessionId = agentData.SessionID; | 450 | SessionId = agentData.SessionID; |
462 | SecureSessionId = agentData.SecureSessionID; | 451 | SecureSessionId = agentData.SecureSessionID; |
463 | CapsSeedUrl = agentData.CapsPath; | 452 | CapsSeedUrl = agentData.CapsPath; |
464 | 453 | ||
454 | ReceivedKills = new List<uint>(); | ||
465 | ReceivedOfflineNotifications = new List<UUID>(); | 455 | ReceivedOfflineNotifications = new List<UUID>(); |
466 | ReceivedOnlineNotifications = new List<UUID>(); | 456 | ReceivedOnlineNotifications = new List<UUID>(); |
467 | ReceivedFriendshipTerminations = new List<UUID>(); | 457 | ReceivedFriendshipTerminations = new List<UUID>(); |
@@ -487,6 +477,18 @@ namespace OpenSim.Tests.Common.Mock | |||
487 | OnCompleteMovementToRegion(this, true); | 477 | OnCompleteMovementToRegion(this, true); |
488 | } | 478 | } |
489 | 479 | ||
480 | /// <summary> | ||
481 | /// Emulate sending an IM from the viewer to the simulator. | ||
482 | /// </summary> | ||
483 | /// <param name='im'></param> | ||
484 | public void HandleImprovedInstantMessage(GridInstantMessage im) | ||
485 | { | ||
486 | ImprovedInstantMessage handlerInstantMessage = OnInstantMessage; | ||
487 | |||
488 | if (handlerInstantMessage != null) | ||
489 | handlerInstantMessage(this, im); | ||
490 | } | ||
491 | |||
490 | public virtual void ActivateGesture(UUID assetId, UUID gestureId) | 492 | public virtual void ActivateGesture(UUID assetId, UUID gestureId) |
491 | { | 493 | { |
492 | } | 494 | } |
@@ -499,6 +501,11 @@ namespace OpenSim.Tests.Common.Mock | |||
499 | { | 501 | { |
500 | } | 502 | } |
501 | 503 | ||
504 | public void SendCachedTextureResponse(ISceneEntity avatar, int serial, List<CachedTextureResponseArg> cachedTextures) | ||
505 | { | ||
506 | |||
507 | } | ||
508 | |||
502 | public virtual void Kick(string message) | 509 | public virtual void Kick(string message) |
503 | { | 510 | { |
504 | } | 511 | } |
@@ -513,11 +520,11 @@ namespace OpenSim.Tests.Common.Mock | |||
513 | 520 | ||
514 | public virtual void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) | 521 | public virtual void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) |
515 | { | 522 | { |
516 | |||
517 | } | 523 | } |
518 | 524 | ||
519 | public virtual void SendKillObject(ulong regionHandle, List<uint> localID) | 525 | public virtual void SendKillObject(List<uint> localID) |
520 | { | 526 | { |
527 | ReceivedKills.AddRange(localID); | ||
521 | } | 528 | } |
522 | 529 | ||
523 | public virtual void SetChildAgentThrottle(byte[] throttle) | 530 | public virtual void SetChildAgentThrottle(byte[] throttle) |
@@ -526,15 +533,13 @@ namespace OpenSim.Tests.Common.Mock | |||
526 | 533 | ||
527 | public void SetAgentThrottleSilent(int throttle, int setting) | 534 | public void SetAgentThrottleSilent(int throttle, int setting) |
528 | { | 535 | { |
529 | |||
530 | |||
531 | } | 536 | } |
537 | |||
532 | public byte[] GetThrottlesPacked(float multiplier) | 538 | public byte[] GetThrottlesPacked(float multiplier) |
533 | { | 539 | { |
534 | return new byte[0]; | 540 | return new byte[0]; |
535 | } | 541 | } |
536 | 542 | ||
537 | |||
538 | public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs) | 543 | public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs) |
539 | { | 544 | { |
540 | } | 545 | } |
@@ -547,7 +552,8 @@ namespace OpenSim.Tests.Common.Mock | |||
547 | 552 | ||
548 | public void SendInstantMessage(GridInstantMessage im) | 553 | public void SendInstantMessage(GridInstantMessage im) |
549 | { | 554 | { |
550 | 555 | if (OnReceivedInstantMessage != null) | |
556 | OnReceivedInstantMessage(im); | ||
551 | } | 557 | } |
552 | 558 | ||
553 | public void SendGenericMessage(string method, UUID invoice, List<string> message) | 559 | public void SendGenericMessage(string method, UUID invoice, List<string> message) |