diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestClient.cs | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index dce2fd7..df8cf27 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 |
@@ -106,6 +107,7 @@ namespace OpenSim.Tests.Common.Mock | |||
106 | public event Action<IClientAPI, bool> OnCompleteMovementToRegion; | 107 | public event Action<IClientAPI, bool> OnCompleteMovementToRegion; |
107 | public event UpdateAgent OnPreAgentUpdate; | 108 | public event UpdateAgent OnPreAgentUpdate; |
108 | public event UpdateAgent OnAgentUpdate; | 109 | public event UpdateAgent OnAgentUpdate; |
110 | public event UpdateAgent OnAgentCameraUpdate; | ||
109 | public event AgentRequestSit OnAgentRequestSit; | 111 | public event AgentRequestSit OnAgentRequestSit; |
110 | public event AgentSit OnAgentSit; | 112 | public event AgentSit OnAgentSit; |
111 | public event AvatarPickerRequest OnAvatarPickerRequest; | 113 | public event AvatarPickerRequest OnAvatarPickerRequest; |
@@ -197,6 +199,7 @@ namespace OpenSim.Tests.Common.Mock | |||
197 | public event EstateCovenantRequest OnEstateCovenantRequest; | 199 | public event EstateCovenantRequest OnEstateCovenantRequest; |
198 | public event EstateChangeInfo OnEstateChangeInfo; | 200 | public event EstateChangeInfo OnEstateChangeInfo; |
199 | public event EstateManageTelehub OnEstateManageTelehub; | 201 | public event EstateManageTelehub OnEstateManageTelehub; |
202 | public event CachedTextureRequest OnCachedTextureRequest; | ||
200 | 203 | ||
201 | public event ObjectDuplicateOnRay OnObjectDuplicateOnRay; | 204 | public event ObjectDuplicateOnRay OnObjectDuplicateOnRay; |
202 | 205 | ||
@@ -435,33 +438,21 @@ namespace OpenSim.Tests.Common.Mock | |||
435 | /// <summary> | 438 | /// <summary> |
436 | /// Constructor | 439 | /// Constructor |
437 | /// </summary> | 440 | /// </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> | 441 | /// <param name="agentData"></param> |
451 | /// <param name="scene"></param> | 442 | /// <param name="scene"></param> |
452 | /// <param name="sceneManager"></param> | 443 | /// <param name="sceneManager"></param> |
453 | public TestClient(AgentCircuitData agentData, Scene scene, SceneManager sceneManager) | 444 | public TestClient(AgentCircuitData agentData, Scene scene) |
454 | { | 445 | { |
455 | m_agentId = agentData.AgentID; | 446 | m_agentId = agentData.AgentID; |
456 | m_firstName = agentData.firstname; | 447 | m_firstName = agentData.firstname; |
457 | m_lastName = agentData.lastname; | 448 | m_lastName = agentData.lastname; |
458 | m_circuitCode = agentData.circuitcode; | 449 | m_circuitCode = agentData.circuitcode; |
459 | m_scene = scene; | 450 | m_scene = scene; |
460 | m_sceneManager = sceneManager; | ||
461 | SessionId = agentData.SessionID; | 451 | SessionId = agentData.SessionID; |
462 | SecureSessionId = agentData.SecureSessionID; | 452 | SecureSessionId = agentData.SecureSessionID; |
463 | CapsSeedUrl = agentData.CapsPath; | 453 | CapsSeedUrl = agentData.CapsPath; |
464 | 454 | ||
455 | ReceivedKills = new List<uint>(); | ||
465 | ReceivedOfflineNotifications = new List<UUID>(); | 456 | ReceivedOfflineNotifications = new List<UUID>(); |
466 | ReceivedOnlineNotifications = new List<UUID>(); | 457 | ReceivedOnlineNotifications = new List<UUID>(); |
467 | ReceivedFriendshipTerminations = new List<UUID>(); | 458 | ReceivedFriendshipTerminations = new List<UUID>(); |
@@ -487,6 +478,18 @@ namespace OpenSim.Tests.Common.Mock | |||
487 | OnCompleteMovementToRegion(this, true); | 478 | OnCompleteMovementToRegion(this, true); |
488 | } | 479 | } |
489 | 480 | ||
481 | /// <summary> | ||
482 | /// Emulate sending an IM from the viewer to the simulator. | ||
483 | /// </summary> | ||
484 | /// <param name='im'></param> | ||
485 | public void HandleImprovedInstantMessage(GridInstantMessage im) | ||
486 | { | ||
487 | ImprovedInstantMessage handlerInstantMessage = OnInstantMessage; | ||
488 | |||
489 | if (handlerInstantMessage != null) | ||
490 | handlerInstantMessage(this, im); | ||
491 | } | ||
492 | |||
490 | public virtual void ActivateGesture(UUID assetId, UUID gestureId) | 493 | public virtual void ActivateGesture(UUID assetId, UUID gestureId) |
491 | { | 494 | { |
492 | } | 495 | } |
@@ -499,6 +502,11 @@ namespace OpenSim.Tests.Common.Mock | |||
499 | { | 502 | { |
500 | } | 503 | } |
501 | 504 | ||
505 | public void SendCachedTextureResponse(ISceneEntity avatar, int serial, List<CachedTextureResponseArg> cachedTextures) | ||
506 | { | ||
507 | |||
508 | } | ||
509 | |||
502 | public virtual void Kick(string message) | 510 | public virtual void Kick(string message) |
503 | { | 511 | { |
504 | } | 512 | } |
@@ -513,11 +521,11 @@ namespace OpenSim.Tests.Common.Mock | |||
513 | 521 | ||
514 | public virtual void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) | 522 | public virtual void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) |
515 | { | 523 | { |
516 | |||
517 | } | 524 | } |
518 | 525 | ||
519 | public virtual void SendKillObject(ulong regionHandle, List<uint> localID) | 526 | public virtual void SendKillObject(List<uint> localID) |
520 | { | 527 | { |
528 | ReceivedKills.AddRange(localID); | ||
521 | } | 529 | } |
522 | 530 | ||
523 | public virtual void SetChildAgentThrottle(byte[] throttle) | 531 | public virtual void SetChildAgentThrottle(byte[] throttle) |
@@ -526,15 +534,13 @@ namespace OpenSim.Tests.Common.Mock | |||
526 | 534 | ||
527 | public void SetAgentThrottleSilent(int throttle, int setting) | 535 | public void SetAgentThrottleSilent(int throttle, int setting) |
528 | { | 536 | { |
529 | |||
530 | |||
531 | } | 537 | } |
538 | |||
532 | public byte[] GetThrottlesPacked(float multiplier) | 539 | public byte[] GetThrottlesPacked(float multiplier) |
533 | { | 540 | { |
534 | return new byte[0]; | 541 | return new byte[0]; |
535 | } | 542 | } |
536 | 543 | ||
537 | |||
538 | public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs) | 544 | public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs) |
539 | { | 545 | { |
540 | } | 546 | } |
@@ -547,7 +553,8 @@ namespace OpenSim.Tests.Common.Mock | |||
547 | 553 | ||
548 | public void SendInstantMessage(GridInstantMessage im) | 554 | public void SendInstantMessage(GridInstantMessage im) |
549 | { | 555 | { |
550 | 556 | if (OnReceivedInstantMessage != null) | |
557 | OnReceivedInstantMessage(im); | ||
551 | } | 558 | } |
552 | 559 | ||
553 | public void SendGenericMessage(string method, UUID invoice, List<string> message) | 560 | public void SendGenericMessage(string method, UUID invoice, List<string> message) |
@@ -585,7 +592,7 @@ namespace OpenSim.Tests.Common.Mock | |||
585 | { | 592 | { |
586 | AgentCircuitData agentData = new AgentCircuitData(); | 593 | AgentCircuitData agentData = new AgentCircuitData(); |
587 | agentData.AgentID = AgentId; | 594 | agentData.AgentID = AgentId; |
588 | agentData.SessionID = UUID.Zero; | 595 | agentData.SessionID = SessionId; |
589 | agentData.SecureSessionID = UUID.Zero; | 596 | agentData.SecureSessionID = UUID.Zero; |
590 | agentData.circuitcode = m_circuitCode; | 597 | agentData.circuitcode = m_circuitCode; |
591 | agentData.child = false; | 598 | agentData.child = false; |
@@ -1260,7 +1267,7 @@ namespace OpenSim.Tests.Common.Mock | |||
1260 | { | 1267 | { |
1261 | } | 1268 | } |
1262 | 1269 | ||
1263 | public void StopFlying(ISceneEntity presence) | 1270 | public void SendAgentTerseUpdate(ISceneEntity presence) |
1264 | { | 1271 | { |
1265 | } | 1272 | } |
1266 | 1273 | ||