diff options
author | Justin Clark-Casey | 2014-05-27 23:29:54 +0100 |
---|---|---|
committer | Justin Clark-Casey | 2014-05-27 23:29:54 +0100 |
commit | 3f703ae1cb02cbcb0efaff061d495bacca941de0 (patch) | |
tree | 3221068b4bc4119023b3dfa621c19e126c2eb3f3 /OpenSim/Tests/Common | |
parent | Merge branch 'master' into 0.8-post-fixes (diff) | |
parent | minor: Comment out 2 error level debugging message in authentication code (diff) | |
download | opensim-SC_OLD-3f703ae1cb02cbcb0efaff061d495bacca941de0.zip opensim-SC_OLD-3f703ae1cb02cbcb0efaff061d495bacca941de0.tar.gz opensim-SC_OLD-3f703ae1cb02cbcb0efaff061d495bacca941de0.tar.bz2 opensim-SC_OLD-3f703ae1cb02cbcb0efaff061d495bacca941de0.tar.xz |
Merge branch 'master' into 0.8-post-fixes
Diffstat (limited to 'OpenSim/Tests/Common')
-rw-r--r-- | OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 6 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs | 24 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestClient.cs | 40 |
3 files changed, 68 insertions, 2 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/MockGroupsServicesConnector.cs b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs index b3f8c36..5a257e9 100644 --- a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs +++ b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs | |||
@@ -324,7 +324,29 @@ namespace OpenSim.Tests.Common.Mock | |||
324 | 324 | ||
325 | public List<GroupNoticeData> GetGroupNotices(UUID requestingAgentID, UUID groupID) | 325 | public List<GroupNoticeData> GetGroupNotices(UUID requestingAgentID, UUID groupID) |
326 | { | 326 | { |
327 | return null; | 327 | XGroup group = GetXGroup(groupID, null); |
328 | |||
329 | if (group == null) | ||
330 | return null; | ||
331 | |||
332 | List<GroupNoticeData> notices = new List<GroupNoticeData>(); | ||
333 | |||
334 | foreach (XGroupNotice notice in group.notices.Values) | ||
335 | { | ||
336 | GroupNoticeData gnd = new GroupNoticeData() | ||
337 | { | ||
338 | NoticeID = notice.noticeID, | ||
339 | Timestamp = notice.timestamp, | ||
340 | FromName = notice.fromName, | ||
341 | Subject = notice.subject, | ||
342 | HasAttachment = notice.hasAttachment, | ||
343 | AssetType = (byte)notice.assetType | ||
344 | }; | ||
345 | |||
346 | notices.Add(gnd); | ||
347 | } | ||
348 | |||
349 | return notices; | ||
328 | } | 350 | } |
329 | 351 | ||
330 | public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID) | 352 | public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID) |
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) |