aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Addons/Groups/GroupsMessagingModule.cs34
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs100
2 files changed, 108 insertions, 26 deletions
diff --git a/OpenSim/Addons/Groups/GroupsMessagingModule.cs b/OpenSim/Addons/Groups/GroupsMessagingModule.cs
index bbb5e05..bd8db32 100644
--- a/OpenSim/Addons/Groups/GroupsMessagingModule.cs
+++ b/OpenSim/Addons/Groups/GroupsMessagingModule.cs
@@ -56,8 +56,8 @@ namespace OpenSim.Groups
56 private IGroupsServicesConnector m_groupData = null; 56 private IGroupsServicesConnector m_groupData = null;
57 57
58 // Config Options 58 // Config Options
59 private bool m_groupMessagingEnabled = false; 59 private bool m_groupMessagingEnabled;
60 private bool m_debugEnabled = true; 60 private bool m_debugEnabled;
61 61
62 /// <summary> 62 /// <summary>
63 /// If enabled, module only tries to send group IMs to online users by querying cached presence information. 63 /// If enabled, module only tries to send group IMs to online users by querying cached presence information.
@@ -120,7 +120,7 @@ namespace OpenSim.Groups
120 return; 120 return;
121 } 121 }
122 122
123 m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true); 123 m_debugEnabled = groupsConfig.GetBoolean("MessagingDebugEnabled", m_debugEnabled);
124 124
125 m_log.InfoFormat( 125 m_log.InfoFormat(
126 "[Groups.Messaging]: GroupsMessagingModule enabled with MessageOnlineOnly = {0}, DebugEnabled = {1}", 126 "[Groups.Messaging]: GroupsMessagingModule enabled with MessageOnlineOnly = {0}, DebugEnabled = {1}",
@@ -140,6 +140,14 @@ namespace OpenSim.Groups
140 scene.EventManager.OnMakeChildAgent += OnMakeChildAgent; 140 scene.EventManager.OnMakeChildAgent += OnMakeChildAgent;
141 scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; 141 scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
142 scene.EventManager.OnClientLogin += OnClientLogin; 142 scene.EventManager.OnClientLogin += OnClientLogin;
143
144 scene.AddCommand(
145 "Debug",
146 this,
147 "debug groups messaging verbose",
148 "debug groups messaging verbose <true|false>",
149 "This setting turns on very verbose groups messaging debugging",
150 HandleDebugGroupsMessagingVerbose);
143 } 151 }
144 152
145 public void RegionLoaded(Scene scene) 153 public void RegionLoaded(Scene scene)
@@ -227,6 +235,26 @@ namespace OpenSim.Groups
227 235
228 #endregion 236 #endregion
229 237
238 private void HandleDebugGroupsMessagingVerbose(object modules, string[] args)
239 {
240 if (args.Length < 5)
241 {
242 MainConsole.Instance.Output("Usage: debug groups messaging verbose <true|false>");
243 return;
244 }
245
246 bool verbose = false;
247 if (!bool.TryParse(args[4], out verbose))
248 {
249 MainConsole.Instance.Output("Usage: debug groups messaging verbose <true|false>");
250 return;
251 }
252
253 m_debugEnabled = verbose;
254
255 MainConsole.Instance.OutputFormat("{0} verbose logging set to {1}", Name, m_debugEnabled);
256 }
257
230 /// <summary> 258 /// <summary>
231 /// Not really needed, but does confirm that the group exists. 259 /// Not really needed, but does confirm that the group exists.
232 /// </summary> 260 /// </summary>
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
index 3724a2c..09bbec2 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
@@ -55,8 +55,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
55 private IGroupsServicesConnector m_groupData = null; 55 private IGroupsServicesConnector m_groupData = null;
56 56
57 // Config Options 57 // Config Options
58 private bool m_groupMessagingEnabled = false; 58 private bool m_groupMessagingEnabled;
59 private bool m_debugEnabled = true; 59 private bool m_debugEnabled;
60 60
61 /// <summary> 61 /// <summary>
62 /// If enabled, module only tries to send group IMs to online users by querying cached presence information. 62 /// If enabled, module only tries to send group IMs to online users by querying cached presence information.
@@ -113,7 +113,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
113 if (m_messageOnlineAgentsOnly) 113 if (m_messageOnlineAgentsOnly)
114 m_usersOnlineCache = new ExpiringCache<UUID, PresenceInfo[]>(); 114 m_usersOnlineCache = new ExpiringCache<UUID, PresenceInfo[]>();
115 115
116 m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true); 116 m_debugEnabled = groupsConfig.GetBoolean("MessagingDebugEnabled", m_debugEnabled);
117 } 117 }
118 118
119 m_log.InfoFormat( 119 m_log.InfoFormat(
@@ -127,6 +127,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
127 return; 127 return;
128 128
129 scene.RegisterModuleInterface<IGroupsMessagingModule>(this); 129 scene.RegisterModuleInterface<IGroupsMessagingModule>(this);
130
131 scene.AddCommand(
132 "Debug",
133 this,
134 "debug groups messaging verbose",
135 "debug groups messaging verbose <true|false>",
136 "This setting turns on very verbose groups messaging debugging",
137 HandleDebugGroupsMessagingVerbose);
130 } 138 }
131 139
132 public void RegionLoaded(Scene scene) 140 public void RegionLoaded(Scene scene)
@@ -218,6 +226,26 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
218 226
219 #endregion 227 #endregion
220 228
229 private void HandleDebugGroupsMessagingVerbose(object modules, string[] args)
230 {
231 if (args.Length < 5)
232 {
233 MainConsole.Instance.Output("Usage: debug groups messaging verbose <true|false>");
234 return;
235 }
236
237 bool verbose = false;
238 if (!bool.TryParse(args[4], out verbose))
239 {
240 MainConsole.Instance.Output("Usage: debug groups messaging verbose <true|false>");
241 return;
242 }
243
244 m_debugEnabled = verbose;
245
246 MainConsole.Instance.OutputFormat("{0} verbose logging set to {1}", Name, m_debugEnabled);
247 }
248
221 /// <summary> 249 /// <summary>
222 /// Not really needed, but does confirm that the group exists. 250 /// Not really needed, but does confirm that the group exists.
223 /// </summary> 251 /// </summary>
@@ -336,27 +364,45 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
336 IClientAPI client = GetActiveClient(member.AgentID); 364 IClientAPI client = GetActiveClient(member.AgentID);
337 if (client == null) 365 if (client == null)
338 { 366 {
367 int startTick = Environment.TickCount;
368
339 // If they're not local, forward across the grid 369 // If they're not local, forward across the grid
340 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Delivering to {0} via Grid", member.AgentID);
341 m_msgTransferModule.SendInstantMessage(msg, delegate(bool success) { }); 370 m_msgTransferModule.SendInstantMessage(msg, delegate(bool success) { });
371
372 if (m_debugEnabled)
373 m_log.DebugFormat(
374 "[GROUPS-MESSAGING]: Delivering to {0} via grid took {1} ms",
375 member.AgentID, Environment.TickCount - startTick);
342 } 376 }
343 else 377 else
344 { 378 {
345 // Deliver locally, directly 379 int startTick = Environment.TickCount;
346 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Passing to ProcessMessageFromGroupSession to deliver to {0} locally", client.Name); 380
347 ProcessMessageFromGroupSession(msg, client); 381 ProcessMessageFromGroupSession(msg, client);
382
383 // Deliver locally, directly
384 if (m_debugEnabled)
385 m_log.DebugFormat(
386 "[GROUPS-MESSAGING]: Delivering to {0} locally took {1} ms",
387 member.AgentID, Environment.TickCount - startTick);
348 } 388 }
349 } 389 }
350 else 390 else
351 { 391 {
392 int startTick = Environment.TickCount;
393
352 m_msgTransferModule.HandleUndeliverableMessage(msg, delegate(bool success) { }); 394 m_msgTransferModule.HandleUndeliverableMessage(msg, delegate(bool success) { });
395
396 if (m_debugEnabled)
397 m_log.DebugFormat(
398 "[GROUPS-MESSAGING]: Handling undeliverable message for {0} took {1} ms",
399 member.AgentID, Environment.TickCount - startTick);
353 } 400 }
354 } 401 }
355 402
356 // Temporary for assessing how long it still takes to send messages to large online groups. 403 if (m_debugEnabled)
357 if (m_messageOnlineAgentsOnly)
358 m_log.DebugFormat( 404 m_log.DebugFormat(
359 "[GROUPS-MESSAGING]: SendMessageToGroup for group {0} with {1} members, {2} candidates for delivery took {3}ms", 405 "[GROUPS-MESSAGING]: Total SendMessageToGroup for group {0} with {1} members, {2} candidates for delivery took {3} ms",
360 groupID, groupMembersCount, attemptDeliveryUuidSet.Count(), Environment.TickCount - requestStartTick); 406 groupID, groupMembersCount, attemptDeliveryUuidSet.Count(), Environment.TickCount - requestStartTick);
361 } 407 }
362 408
@@ -591,15 +637,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
591 // Don't log any normal IMs (privacy!) 637 // Don't log any normal IMs (privacy!)
592 if (m_debugEnabled && im.dialog != (byte)InstantMessageDialog.MessageFromAgent) 638 if (m_debugEnabled && im.dialog != (byte)InstantMessageDialog.MessageFromAgent)
593 { 639 {
594 m_log.WarnFormat("[GROUPS-MESSAGING]: IM: fromGroup({0})", im.fromGroup ? "True" : "False"); 640 m_log.DebugFormat("[GROUPS-MESSAGING]: IM: fromGroup({0})", im.fromGroup ? "True" : "False");
595 m_log.WarnFormat("[GROUPS-MESSAGING]: IM: Dialog({0})", (InstantMessageDialog)im.dialog); 641 m_log.DebugFormat("[GROUPS-MESSAGING]: IM: Dialog({0})", (InstantMessageDialog)im.dialog);
596 m_log.WarnFormat("[GROUPS-MESSAGING]: IM: fromAgentID({0})", im.fromAgentID); 642 m_log.DebugFormat("[GROUPS-MESSAGING]: IM: fromAgentID({0})", im.fromAgentID);
597 m_log.WarnFormat("[GROUPS-MESSAGING]: IM: fromAgentName({0})", im.fromAgentName); 643 m_log.DebugFormat("[GROUPS-MESSAGING]: IM: fromAgentName({0})", im.fromAgentName);
598 m_log.WarnFormat("[GROUPS-MESSAGING]: IM: imSessionID({0})", im.imSessionID); 644 m_log.DebugFormat("[GROUPS-MESSAGING]: IM: imSessionID({0})", im.imSessionID);
599 m_log.WarnFormat("[GROUPS-MESSAGING]: IM: message({0})", im.message); 645 m_log.DebugFormat("[GROUPS-MESSAGING]: IM: message({0})", im.message);
600 m_log.WarnFormat("[GROUPS-MESSAGING]: IM: offline({0})", im.offline); 646 m_log.DebugFormat("[GROUPS-MESSAGING]: IM: offline({0})", im.offline);
601 m_log.WarnFormat("[GROUPS-MESSAGING]: IM: toAgentID({0})", im.toAgentID); 647 m_log.DebugFormat("[GROUPS-MESSAGING]: IM: toAgentID({0})", im.toAgentID);
602 m_log.WarnFormat("[GROUPS-MESSAGING]: IM: binaryBucket({0})", OpenMetaverse.Utils.BytesToHexString(im.binaryBucket, "BinaryBucket")); 648 m_log.DebugFormat("[GROUPS-MESSAGING]: IM: binaryBucket({0})", OpenMetaverse.Utils.BytesToHexString(im.binaryBucket, "BinaryBucket"));
603 } 649 }
604 } 650 }
605 651
@@ -610,7 +656,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
610 /// </summary> 656 /// </summary>
611 private IClientAPI GetActiveClient(UUID agentID) 657 private IClientAPI GetActiveClient(UUID agentID)
612 { 658 {
613 if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Looking for local client {0}", agentID); 659 if (m_debugEnabled)
660 m_log.DebugFormat("[GROUPS-MESSAGING]: Looking for local client {0}", agentID);
614 661
615 IClientAPI child = null; 662 IClientAPI child = null;
616 663
@@ -622,12 +669,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
622 { 669 {
623 if (!sp.IsChildAgent) 670 if (!sp.IsChildAgent)
624 { 671 {
625 if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Found root agent for client : {0}", sp.ControllingClient.Name); 672 if (m_debugEnabled)
673 m_log.DebugFormat("[GROUPS-MESSAGING]: Found root agent for client : {0}", sp.ControllingClient.Name);
674
626 return sp.ControllingClient; 675 return sp.ControllingClient;
627 } 676 }
628 else 677 else
629 { 678 {
630 if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Found child agent for client : {0}", sp.ControllingClient.Name); 679 if (m_debugEnabled)
680 m_log.DebugFormat("[GROUPS-MESSAGING]: Found child agent for client : {0}", sp.ControllingClient.Name);
681
631 child = sp.ControllingClient; 682 child = sp.ControllingClient;
632 } 683 }
633 } 684 }
@@ -636,12 +687,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
636 // If we didn't find a root, then just return whichever child we found, or null if none 687 // If we didn't find a root, then just return whichever child we found, or null if none
637 if (child == null) 688 if (child == null)
638 { 689 {
639 if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Could not find local client for agent : {0}", agentID); 690 if (m_debugEnabled)
691 m_log.DebugFormat("[GROUPS-MESSAGING]: Could not find local client for agent : {0}", agentID);
640 } 692 }
641 else 693 else
642 { 694 {
643 if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Returning child agent for client : {0}", child.Name); 695 if (m_debugEnabled)
696 m_log.DebugFormat("[GROUPS-MESSAGING]: Returning child agent for client : {0}", child.Name);
644 } 697 }
698
645 return child; 699 return child;
646 } 700 }
647 701