aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
diff options
context:
space:
mode:
authorMelanie Thielker2017-01-05 19:07:37 +0000
committerMelanie Thielker2017-01-05 19:07:37 +0000
commitb16abc8166c29585cb76cc55c3bdd76e5833cb4f (patch)
tree6a34f465a74b7a3a6dc00a3d7aa8dcc25ac3e3a5 /OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
parentMake it possible to disable the bakes module in the way it is described in co... (diff)
downloadopensim-SC-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.zip
opensim-SC-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.gz
opensim-SC-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.bz2
opensim-SC-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.xz
Massive tab and trailing space cleanup
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs60
1 files changed, 30 insertions, 30 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
index 0aaf95c..8791235 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
@@ -125,7 +125,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
125 { 125 {
126 if (!m_groupMessagingEnabled) 126 if (!m_groupMessagingEnabled)
127 return; 127 return;
128 128
129 scene.RegisterModuleInterface<IGroupsMessagingModule>(this); 129 scene.RegisterModuleInterface<IGroupsMessagingModule>(this);
130 130
131 scene.AddCommand( 131 scene.AddCommand(
@@ -136,7 +136,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
136 "This setting turns on very verbose groups messaging debugging", 136 "This setting turns on very verbose groups messaging debugging",
137 HandleDebugGroupsMessagingVerbose); 137 HandleDebugGroupsMessagingVerbose);
138 } 138 }
139 139
140 public void RegionLoaded(Scene scene) 140 public void RegionLoaded(Scene scene)
141 { 141 {
142 if (!m_groupMessagingEnabled) 142 if (!m_groupMessagingEnabled)
@@ -205,7 +205,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
205 m_msgTransferModule = null; 205 m_msgTransferModule = null;
206 } 206 }
207 207
208 public Type ReplaceableInterface 208 public Type ReplaceableInterface
209 { 209 {
210 get { return null; } 210 get { return null; }
211 } 211 }
@@ -253,7 +253,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
253 { 253 {
254 if (m_debugEnabled) 254 if (m_debugEnabled)
255 m_log.DebugFormat("[GROUPS-MESSAGING]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 255 m_log.DebugFormat("[GROUPS-MESSAGING]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
256 256
257 GroupRecord groupInfo = m_groupData.GetGroupRecord(agentID, groupID, null); 257 GroupRecord groupInfo = m_groupData.GetGroupRecord(agentID, groupID, null);
258 258
259 if (groupInfo != null) 259 if (groupInfo != null)
@@ -270,7 +270,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
270 { 270 {
271 SendMessageToGroup(im, groupID, new UUID(im.fromAgentID), null); 271 SendMessageToGroup(im, groupID, new UUID(im.fromAgentID), null);
272 } 272 }
273 273
274 public void SendMessageToGroup( 274 public void SendMessageToGroup(
275 GridInstantMessage im, UUID groupID, UUID sendingAgentForGroupCalls, Func<GroupMembersData, bool> sendCondition) 275 GridInstantMessage im, UUID groupID, UUID sendingAgentForGroupCalls, Func<GroupMembersData, bool> sendCondition)
276 { 276 {
@@ -294,19 +294,19 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
294 m_usersOnlineCache.Add(groupID, onlineAgents, m_usersOnlineCacheExpirySeconds); 294 m_usersOnlineCache.Add(groupID, onlineAgents, m_usersOnlineCacheExpirySeconds);
295 } 295 }
296 296
297 attemptDeliveryUuidSet 297 attemptDeliveryUuidSet
298 = new HashSet<string>(Array.ConvertAll<PresenceInfo, string>(onlineAgents, pi => pi.UserID)); 298 = new HashSet<string>(Array.ConvertAll<PresenceInfo, string>(onlineAgents, pi => pi.UserID));
299 } 299 }
300 else 300 else
301 { 301 {
302 attemptDeliveryUuidSet 302 attemptDeliveryUuidSet
303 = new HashSet<string>(groupMembers.ConvertAll<string>(gmd => gmd.AgentID.ToString())); 303 = new HashSet<string>(groupMembers.ConvertAll<string>(gmd => gmd.AgentID.ToString()));
304 304
305 if (m_debugEnabled) 305 if (m_debugEnabled)
306 m_log.DebugFormat( 306 m_log.DebugFormat(
307 "[GROUPS-MESSAGING]: SendMessageToGroup called for group {0} with {1} visible members", 307 "[GROUPS-MESSAGING]: SendMessageToGroup called for group {0} with {1} visible members",
308 groupID, groupMembers.Count); 308 groupID, groupMembers.Count);
309 } 309 }
310 310
311 foreach (GroupMembersData member in groupMembers) 311 foreach (GroupMembersData member in groupMembers)
312 { 312 {
@@ -314,9 +314,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
314 { 314 {
315 if (!sendCondition(member)) 315 if (!sendCondition(member))
316 { 316 {
317 if (m_debugEnabled) 317 if (m_debugEnabled)
318 m_log.DebugFormat( 318 m_log.DebugFormat(
319 "[GROUPS-MESSAGING]: Not sending to {0} as they do not fulfill send condition", 319 "[GROUPS-MESSAGING]: Not sending to {0} as they do not fulfill send condition",
320 member.AgentID); 320 member.AgentID);
321 321
322 continue; 322 continue;
@@ -325,7 +325,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
325 else if (m_groupData.hasAgentDroppedGroupChatSession(member.AgentID, groupID)) 325 else if (m_groupData.hasAgentDroppedGroupChatSession(member.AgentID, groupID))
326 { 326 {
327 // Don't deliver messages to people who have dropped this session 327 // Don't deliver messages to people who have dropped this session
328 if (m_debugEnabled) 328 if (m_debugEnabled)
329 m_log.DebugFormat( 329 m_log.DebugFormat(
330 "[GROUPS-MESSAGING]: {0} has dropped session, not delivering to them", member.AgentID); 330 "[GROUPS-MESSAGING]: {0} has dropped session, not delivering to them", member.AgentID);
331 331
@@ -360,9 +360,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
360 // If they're not local, forward across the grid 360 // If they're not local, forward across the grid
361 m_msgTransferModule.SendInstantMessage(msg, delegate(bool success) { }); 361 m_msgTransferModule.SendInstantMessage(msg, delegate(bool success) { });
362 362
363 if (m_debugEnabled) 363 if (m_debugEnabled)
364 m_log.DebugFormat( 364 m_log.DebugFormat(
365 "[GROUPS-MESSAGING]: Delivering to {0} via grid took {1} ms", 365 "[GROUPS-MESSAGING]: Delivering to {0} via grid took {1} ms",
366 member.AgentID, Environment.TickCount - startTick); 366 member.AgentID, Environment.TickCount - startTick);
367 } 367 }
368 else 368 else
@@ -372,9 +372,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
372 ProcessMessageFromGroupSession(msg, client); 372 ProcessMessageFromGroupSession(msg, client);
373 373
374 // Deliver locally, directly 374 // Deliver locally, directly
375 if (m_debugEnabled) 375 if (m_debugEnabled)
376 m_log.DebugFormat( 376 m_log.DebugFormat(
377 "[GROUPS-MESSAGING]: Delivering to {0} locally took {1} ms", 377 "[GROUPS-MESSAGING]: Delivering to {0} locally took {1} ms",
378 member.AgentID, Environment.TickCount - startTick); 378 member.AgentID, Environment.TickCount - startTick);
379 } 379 }
380 } 380 }
@@ -385,9 +385,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
385 385
386 m_msgTransferModule.HandleUndeliverableMessage(msg, delegate(bool success) { }); 386 m_msgTransferModule.HandleUndeliverableMessage(msg, delegate(bool success) { });
387 387
388 if (m_debugEnabled) 388 if (m_debugEnabled)
389 m_log.DebugFormat( 389 m_log.DebugFormat(
390 "[GROUPS-MESSAGING]: Handling undeliverable message for {0} took {1} ms", 390 "[GROUPS-MESSAGING]: Handling undeliverable message for {0} took {1} ms",
391 member.AgentID, Environment.TickCount - startTick); 391 member.AgentID, Environment.TickCount - startTick);
392 } 392 }
393 } 393 }
@@ -397,7 +397,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
397 "[GROUPS-MESSAGING]: Total SendMessageToGroup for group {0} with {1} members, {2} candidates for delivery took {3} ms", 397 "[GROUPS-MESSAGING]: Total SendMessageToGroup for group {0} with {1} members, {2} candidates for delivery took {3} ms",
398 groupID, groupMembersCount, attemptDeliveryUuidSet.Count(), Environment.TickCount - requestStartTick); 398 groupID, groupMembersCount, attemptDeliveryUuidSet.Count(), Environment.TickCount - requestStartTick);
399 } 399 }
400 400
401 #region SimGridEventHandlers 401 #region SimGridEventHandlers
402 402
403 void OnClientLogin(IClientAPI client) 403 void OnClientLogin(IClientAPI client)
@@ -417,7 +417,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
417 // The instant message module will only deliver messages of dialog types: 417 // The instant message module will only deliver messages of dialog types:
418 // MessageFromAgent, StartTyping, StopTyping, MessageFromObject 418 // MessageFromAgent, StartTyping, StopTyping, MessageFromObject
419 // 419 //
420 // Any other message type will not be delivered to a client by the 420 // Any other message type will not be delivered to a client by the
421 // Instant Message Module 421 // Instant Message Module
422 422
423 if (m_debugEnabled) 423 if (m_debugEnabled)
@@ -428,7 +428,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
428 } 428 }
429 429
430 // Incoming message from a group 430 // Incoming message from a group
431 if ((msg.fromGroup == true) && 431 if ((msg.fromGroup == true) &&
432 ((msg.dialog == (byte)InstantMessageDialog.SessionSend) 432 ((msg.dialog == (byte)InstantMessageDialog.SessionSend)
433 || (msg.dialog == (byte)InstantMessageDialog.SessionAdd) 433 || (msg.dialog == (byte)InstantMessageDialog.SessionAdd)
434 || (msg.dialog == (byte)InstantMessageDialog.SessionDrop))) 434 || (msg.dialog == (byte)InstantMessageDialog.SessionDrop)))
@@ -450,7 +450,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
450 450
451 private void ProcessMessageFromGroupSession(GridInstantMessage msg, IClientAPI client) 451 private void ProcessMessageFromGroupSession(GridInstantMessage msg, IClientAPI client)
452 { 452 {
453 if (m_debugEnabled) 453 if (m_debugEnabled)
454 m_log.DebugFormat( 454 m_log.DebugFormat(
455 "[GROUPS-MESSAGING]: Session message from {0} going to agent {1}, sessionID {2}, type {3}", 455 "[GROUPS-MESSAGING]: Session message from {0} going to agent {1}, sessionID {2}, type {3}",
456 msg.fromAgentName, msg.toAgentID, msg.imSessionID, (InstantMessageDialog)msg.dialog); 456 msg.fromAgentName, msg.toAgentID, msg.imSessionID, (InstantMessageDialog)msg.dialog);
@@ -522,7 +522,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
522 } 522 }
523 } 523 }
524 } 524 }
525 else 525 else
526 { 526 {
527 client.SendInstantMessage(msg); 527 client.SendInstantMessage(msg);
528 } 528 }
@@ -570,7 +570,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
570 if (m_debugEnabled) m_log.InfoFormat("[GROUPS-MESSAGING]: imSessionID({0}) toAgentID({1})", im.imSessionID, im.toAgentID); 570 if (m_debugEnabled) m_log.InfoFormat("[GROUPS-MESSAGING]: imSessionID({0}) toAgentID({1})", im.imSessionID, im.toAgentID);
571 571
572 GroupRecord groupInfo = m_groupData.GetGroupRecord(UUID.Zero, GroupID, null); 572 GroupRecord groupInfo = m_groupData.GetGroupRecord(UUID.Zero, GroupID, null);
573 573
574 if (groupInfo != null) 574 if (groupInfo != null)
575 { 575 {
576 m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID); 576 m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID);
@@ -586,7 +586,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
586 // Send a message from locally connected client to a group 586 // Send a message from locally connected client to a group
587 if ((im.dialog == (byte)InstantMessageDialog.SessionSend)) 587 if ((im.dialog == (byte)InstantMessageDialog.SessionSend))
588 { 588 {
589 if (m_debugEnabled) 589 if (m_debugEnabled)
590 m_log.DebugFormat("[GROUPS-MESSAGING]: Send message to session for group {0} with session ID {1}", GroupID, im.imSessionID.ToString()); 590 m_log.DebugFormat("[GROUPS-MESSAGING]: Send message to session for group {0} with session ID {1}", GroupID, im.imSessionID.ToString());
591 591
592 //If this agent is sending a message, then they want to be in the session 592 //If this agent is sending a message, then they want to be in the session
@@ -597,7 +597,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
597 597
598 if ((im.dialog == (byte)InstantMessageDialog.SessionDrop)) 598 if ((im.dialog == (byte)InstantMessageDialog.SessionDrop))
599 { 599 {
600 if (m_debugEnabled) 600 if (m_debugEnabled)
601 m_log.DebugFormat("[GROUPS-MESSAGING]: Send message to session for group {0} with session ID {1}", GroupID, im.imSessionID.ToString()); 601 m_log.DebugFormat("[GROUPS-MESSAGING]: Send message to session for group {0} with session ID {1}", GroupID, im.imSessionID.ToString());
602 602
603 m_groupData.AgentDroppedFromGroupChatSession(AgentID, GroupID); 603 m_groupData.AgentDroppedFromGroupChatSession(AgentID, GroupID);
@@ -659,7 +659,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
659 /// </summary> 659 /// </summary>
660 private IClientAPI GetActiveClient(UUID agentID) 660 private IClientAPI GetActiveClient(UUID agentID)
661 { 661 {
662 if (m_debugEnabled) 662 if (m_debugEnabled)
663 m_log.DebugFormat("[GROUPS-MESSAGING]: Looking for local client {0}", agentID); 663 m_log.DebugFormat("[GROUPS-MESSAGING]: Looking for local client {0}", agentID);
664 664
665 IClientAPI child = null; 665 IClientAPI child = null;
@@ -672,14 +672,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
672 { 672 {
673 if (!sp.IsChildAgent) 673 if (!sp.IsChildAgent)
674 { 674 {
675 if (m_debugEnabled) 675 if (m_debugEnabled)
676 m_log.DebugFormat("[GROUPS-MESSAGING]: Found root agent for client : {0}", sp.ControllingClient.Name); 676 m_log.DebugFormat("[GROUPS-MESSAGING]: Found root agent for client : {0}", sp.ControllingClient.Name);
677 677
678 return sp.ControllingClient; 678 return sp.ControllingClient;
679 } 679 }
680 else 680 else
681 { 681 {
682 if (m_debugEnabled) 682 if (m_debugEnabled)
683 m_log.DebugFormat("[GROUPS-MESSAGING]: Found child agent for client : {0}", sp.ControllingClient.Name); 683 m_log.DebugFormat("[GROUPS-MESSAGING]: Found child agent for client : {0}", sp.ControllingClient.Name);
684 684
685 child = sp.ControllingClient; 685 child = sp.ControllingClient;
@@ -690,12 +690,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
690 // If we didn't find a root, then just return whichever child we found, or null if none 690 // If we didn't find a root, then just return whichever child we found, or null if none
691 if (child == null) 691 if (child == null)
692 { 692 {
693 if (m_debugEnabled) 693 if (m_debugEnabled)
694 m_log.DebugFormat("[GROUPS-MESSAGING]: Could not find local client for agent : {0}", agentID); 694 m_log.DebugFormat("[GROUPS-MESSAGING]: Could not find local client for agent : {0}", agentID);
695 } 695 }
696 else 696 else
697 { 697 {
698 if (m_debugEnabled) 698 if (m_debugEnabled)
699 m_log.DebugFormat("[GROUPS-MESSAGING]: Returning child agent for client : {0}", child.Name); 699 m_log.DebugFormat("[GROUPS-MESSAGING]: Returning child agent for client : {0}", child.Name);
700 } 700 }
701 701