diff options
author | Diva Canto | 2013-07-27 19:12:47 -0700 |
---|---|---|
committer | Diva Canto | 2013-07-27 19:12:47 -0700 |
commit | 18eca40af3592d9743cf50267a460968e601859c (patch) | |
tree | 7dbf0879114b52a22da54fc4305df83324632609 /OpenSim/Addons/Groups/GroupsMessagingModule.cs | |
parent | Several major improvements to group (V2) chat. Specifically: handle join/drop... (diff) | |
download | opensim-SC_OLD-18eca40af3592d9743cf50267a460968e601859c.zip opensim-SC_OLD-18eca40af3592d9743cf50267a460968e601859c.tar.gz opensim-SC_OLD-18eca40af3592d9743cf50267a460968e601859c.tar.bz2 opensim-SC_OLD-18eca40af3592d9743cf50267a460968e601859c.tar.xz |
More bug fixes on group chat
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Addons/Groups/GroupsMessagingModule.cs | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/OpenSim/Addons/Groups/GroupsMessagingModule.cs b/OpenSim/Addons/Groups/GroupsMessagingModule.cs index be76ef1..04e2b80 100644 --- a/OpenSim/Addons/Groups/GroupsMessagingModule.cs +++ b/OpenSim/Addons/Groups/GroupsMessagingModule.cs | |||
@@ -132,7 +132,6 @@ namespace OpenSim.Groups | |||
132 | scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; | 132 | scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; |
133 | scene.EventManager.OnClientLogin += OnClientLogin; | 133 | scene.EventManager.OnClientLogin += OnClientLogin; |
134 | } | 134 | } |
135 | |||
136 | public void RegionLoaded(Scene scene) | 135 | public void RegionLoaded(Scene scene) |
137 | { | 136 | { |
138 | if (!m_groupMessagingEnabled) | 137 | if (!m_groupMessagingEnabled) |
@@ -271,7 +270,8 @@ namespace OpenSim.Groups | |||
271 | } | 270 | } |
272 | 271 | ||
273 | // Send to self first of all | 272 | // Send to self first of all |
274 | im.toAgentID = im.fromAgentID; | 273 | im.toAgentID = im.fromAgentID; |
274 | im.fromGroup = true; | ||
275 | ProcessMessageFromGroupSession(im); | 275 | ProcessMessageFromGroupSession(im); |
276 | 276 | ||
277 | List<UUID> regions = new List<UUID>(); | 277 | List<UUID> regions = new List<UUID>(); |
@@ -330,8 +330,7 @@ namespace OpenSim.Groups | |||
330 | } | 330 | } |
331 | } | 331 | } |
332 | 332 | ||
333 | // Temporary for assessing how long it still takes to send messages to large online groups. | 333 | if (m_debugEnabled) |
334 | if (m_messageOnlineAgentsOnly) | ||
335 | m_log.DebugFormat( | 334 | m_log.DebugFormat( |
336 | "[Groups.Messaging]: SendMessageToGroup for group {0} with {1} visible members, {2} online took {3}ms", | 335 | "[Groups.Messaging]: SendMessageToGroup for group {0} with {1} visible members, {2} online took {3}ms", |
337 | groupID, groupMembersCount, groupMembers.Count(), Environment.TickCount - requestStartTick); | 336 | groupID, groupMembersCount, groupMembers.Count(), Environment.TickCount - requestStartTick); |
@@ -349,6 +348,7 @@ namespace OpenSim.Groups | |||
349 | if (m_debugEnabled) m_log.DebugFormat("[Groups.Messaging]: OnInstantMessage registered for {0}", client.Name); | 348 | if (m_debugEnabled) m_log.DebugFormat("[Groups.Messaging]: OnInstantMessage registered for {0}", client.Name); |
350 | 349 | ||
351 | client.OnInstantMessage += OnInstantMessage; | 350 | client.OnInstantMessage += OnInstantMessage; |
351 | ResetAgentGroupChatSessions(client.AgentId.ToString()); | ||
352 | } | 352 | } |
353 | 353 | ||
354 | private void OnGridInstantMessage(GridInstantMessage msg) | 354 | private void OnGridInstantMessage(GridInstantMessage msg) |
@@ -432,16 +432,19 @@ namespace OpenSim.Groups | |||
432 | UUID AgentID = sp.UUID; | 432 | UUID AgentID = sp.UUID; |
433 | msg.toAgentID = AgentID.Guid; | 433 | msg.toAgentID = AgentID.Guid; |
434 | 434 | ||
435 | if (!hasAgentDroppedGroupChatSession(AgentID.ToString(), GroupID) | 435 | if (!hasAgentDroppedGroupChatSession(AgentID.ToString(), GroupID)) |
436 | && !hasAgentBeenInvitedToGroupChatSession(AgentID.ToString(), GroupID)) | ||
437 | { | 436 | { |
438 | AddAgentToSession(AgentID, GroupID, msg); | 437 | if (!hasAgentBeenInvitedToGroupChatSession(AgentID.ToString(), GroupID)) |
439 | } | 438 | AddAgentToSession(AgentID, GroupID, msg); |
440 | 439 | else | |
441 | if (m_debugEnabled) m_log.DebugFormat("[Groups.Messaging]: Passing to ProcessMessageFromGroupSession to deliver to {0} locally", sp.Name); | 440 | { |
441 | if (m_debugEnabled) m_log.DebugFormat("[Groups.Messaging]: Passing to ProcessMessageFromGroupSession to deliver to {0} locally", sp.Name); | ||
442 | 442 | ||
443 | ProcessMessageFromGroupSession(msg); | 443 | ProcessMessageFromGroupSession(msg); |
444 | } | ||
445 | } | ||
444 | }); | 446 | }); |
447 | |||
445 | } | 448 | } |
446 | } | 449 | } |
447 | } | 450 | } |
@@ -664,12 +667,12 @@ namespace OpenSim.Groups | |||
664 | { | 667 | { |
665 | if (!sp.IsChildAgent) | 668 | if (!sp.IsChildAgent) |
666 | { | 669 | { |
667 | if (m_debugEnabled) m_log.WarnFormat("[Groups.Messaging]: Found root agent for client : {0}", sp.ControllingClient.Name); | 670 | if (m_debugEnabled) m_log.DebugFormat("[Groups.Messaging]: Found root agent for client : {0}", sp.ControllingClient.Name); |
668 | return sp.ControllingClient; | 671 | return sp.ControllingClient; |
669 | } | 672 | } |
670 | else | 673 | else |
671 | { | 674 | { |
672 | if (m_debugEnabled) m_log.WarnFormat("[Groups.Messaging]: Found child agent for client : {0}", sp.ControllingClient.Name); | 675 | if (m_debugEnabled) m_log.DebugFormat("[Groups.Messaging]: Found child agent for client : {0}", sp.ControllingClient.Name); |
673 | child = sp.ControllingClient; | 676 | child = sp.ControllingClient; |
674 | } | 677 | } |
675 | } | 678 | } |
@@ -694,9 +697,10 @@ namespace OpenSim.Groups | |||
694 | public void ResetAgentGroupChatSessions(string agentID) | 697 | public void ResetAgentGroupChatSessions(string agentID) |
695 | { | 698 | { |
696 | foreach (List<string> agentList in m_groupsAgentsDroppedFromChatSession.Values) | 699 | foreach (List<string> agentList in m_groupsAgentsDroppedFromChatSession.Values) |
697 | { | ||
698 | agentList.Remove(agentID); | 700 | agentList.Remove(agentID); |
699 | } | 701 | |
702 | foreach (List<string> agentList in m_groupsAgentsInvitedToChatSession.Values) | ||
703 | agentList.Remove(agentID); | ||
700 | } | 704 | } |
701 | 705 | ||
702 | public bool hasAgentBeenInvitedToGroupChatSession(string agentID, UUID groupID) | 706 | public bool hasAgentBeenInvitedToGroupChatSession(string agentID, UUID groupID) |