diff options
Diffstat (limited to 'OpenSim/Tests')
-rw-r--r-- | OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 6 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestClient.cs | 40 |
2 files changed, 45 insertions, 1 deletions
diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 874ff62..342cd06 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs | |||
@@ -574,7 +574,11 @@ namespace OpenSim.Tests.Common | |||
574 | 574 | ||
575 | public static ScenePresence AddChildScenePresence(Scene scene, UUID agentId) | 575 | public static ScenePresence AddChildScenePresence(Scene scene, UUID agentId) |
576 | { | 576 | { |
577 | AgentCircuitData acd = GenerateAgentData(agentId); | 577 | return AddChildScenePresence(scene, GenerateAgentData(agentId)); |
578 | } | ||
579 | |||
580 | public static ScenePresence AddChildScenePresence(Scene scene, AgentCircuitData acd) | ||
581 | { | ||
578 | acd.child = true; | 582 | acd.child = true; |
579 | 583 | ||
580 | // XXX: ViaLogin may not be correct for child agents | 584 | // XXX: ViaLogin may not be correct for child agents |
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index c2b0935..8eeaf99 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -62,14 +62,23 @@ namespace OpenSim.Tests.Common.Mock | |||
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 TestClientOnSendRegionTeleportDelegate OnTestClientSendRegionTeleport; | 64 | public event TestClientOnSendRegionTeleportDelegate OnTestClientSendRegionTeleport; |
65 | |||
65 | public event Action<ISceneEntity, PrimUpdateFlags> OnReceivedEntityUpdate; | 66 | public event Action<ISceneEntity, PrimUpdateFlags> OnReceivedEntityUpdate; |
67 | |||
68 | public event OnReceivedChatMessageDelegate OnReceivedChatMessage; | ||
66 | public event Action<GridInstantMessage> OnReceivedInstantMessage; | 69 | public event Action<GridInstantMessage> OnReceivedInstantMessage; |
70 | |||
67 | public event Action<UUID> OnReceivedSendRebakeAvatarTextures; | 71 | public event Action<UUID> OnReceivedSendRebakeAvatarTextures; |
68 | 72 | ||
69 | public delegate void TestClientOnSendRegionTeleportDelegate( | 73 | public delegate void TestClientOnSendRegionTeleportDelegate( |
70 | ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, | 74 | ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, |
71 | uint locationID, uint flags, string capsURL); | 75 | uint locationID, uint flags, string capsURL); |
72 | 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 | |||
73 | // disable warning: public events, part of the public API | 82 | // disable warning: public events, part of the public API |
74 | #pragma warning disable 67 | 83 | #pragma warning disable 67 |
75 | 84 | ||
@@ -467,6 +476,34 @@ namespace OpenSim.Tests.Common.Mock | |||
467 | } | 476 | } |
468 | 477 | ||
469 | /// <summary> | 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> | ||
470 | /// Attempt a teleport to the given region. | 507 | /// Attempt a teleport to the given region. |
471 | /// </summary> | 508 | /// </summary> |
472 | /// <param name="regionHandle"></param> | 509 | /// <param name="regionHandle"></param> |
@@ -550,6 +587,9 @@ namespace OpenSim.Tests.Common.Mock | |||
550 | string message, byte type, Vector3 fromPos, string fromName, | 587 | string message, byte type, Vector3 fromPos, string fromName, |
551 | UUID fromAgentID, UUID ownerID, byte source, byte audible) | 588 | UUID fromAgentID, UUID ownerID, byte source, byte audible) |
552 | { | 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); | ||
553 | } | 593 | } |
554 | 594 | ||
555 | public void SendInstantMessage(GridInstantMessage im) | 595 | public void SendInstantMessage(GridInstantMessage im) |