aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Common/Mock
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-05-22 19:18:24 +0100
committerJustin Clark-Casey (justincc)2014-05-22 19:18:24 +0100
commit1b156b7fe84bf132b51ff198d6d730708f5930b7 (patch)
tree94e68fffd365328c8d9be7571d8cbef478c90358 /OpenSim/Tests/Common/Mock
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC-1b156b7fe84bf132b51ff198d6d730708f5930b7.zip
opensim-SC-1b156b7fe84bf132b51ff198d6d730708f5930b7.tar.gz
opensim-SC-1b156b7fe84bf132b51ff198d6d730708f5930b7.tar.bz2
opensim-SC-1b156b7fe84bf132b51ff198d6d730708f5930b7.tar.xz
Add regression test for in-range chat between neighbouring regions from east to west.
Diffstat (limited to 'OpenSim/Tests/Common/Mock')
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs40
1 files changed, 40 insertions, 0 deletions
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)