aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs
diff options
context:
space:
mode:
authorJeff Ames2009-04-27 05:22:44 +0000
committerJeff Ames2009-04-27 05:22:44 +0000
commit8dbcfc70bf87d503edd4239bd974339a130de153 (patch)
tree9adfe4db9d5658952cf181b919cbe45db170139b /OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs
parentUpdate svn properties. (diff)
downloadopensim-SC_OLD-8dbcfc70bf87d503edd4239bd974339a130de153.zip
opensim-SC_OLD-8dbcfc70bf87d503edd4239bd974339a130de153.tar.gz
opensim-SC_OLD-8dbcfc70bf87d503edd4239bd974339a130de153.tar.bz2
opensim-SC_OLD-8dbcfc70bf87d503edd4239bd974339a130de153.tar.xz
Add copyright headers. Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs61
1 files changed, 21 insertions, 40 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs
index eb9f804..a2d506c 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs
@@ -143,13 +143,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
143 143
144 if (m_msgTransferModule == null) 144 if (m_msgTransferModule == null)
145 { 145 {
146 m_msgTransferModule = scene.RequestModuleInterface<IMessageTransferModule>(); 146 m_msgTransferModule = scene.RequestModuleInterface<IMessageTransferModule>();
147 147
148 // No message transfer module, no notices, group invites, rejects, ejects, etc 148 // No message transfer module, no notices, group invites, rejects, ejects, etc
149 if (m_msgTransferModule == null) 149 if (m_msgTransferModule == null)
150 { 150 {
151 m_groupsEnabled = false; 151 m_groupsEnabled = false;
152 m_log.Error("[GROUPS]: Could not get MessageTransferModule"); 152 m_log.Error("[GROUPS]: Could not get MessageTransferModule");
153 Close(); 153 Close();
154 return; 154 return;
155 } 155 }
@@ -157,7 +157,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
157 157
158 lock (m_sceneList) 158 lock (m_sceneList)
159 { 159 {
160 m_sceneList.Add(scene); 160 m_sceneList.Add(scene);
161 } 161 }
162 162
163 scene.EventManager.OnNewClient += OnNewClient; 163 scene.EventManager.OnNewClient += OnNewClient;
@@ -178,7 +178,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
178 178
179 lock (m_sceneList) 179 lock (m_sceneList)
180 { 180 {
181 m_sceneList.Remove(scene); 181 m_sceneList.Remove(scene);
182 } 182 }
183 } 183 }
184 184
@@ -313,16 +313,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
313 GroupName = "Unknown"; 313 GroupName = "Unknown";
314 } 314 }
315 315
316
317 remote_client.SendGroupNameReply(GroupID, GroupName); 316 remote_client.SendGroupNameReply(GroupID, GroupName);
318 } 317 }
319 318
320
321 private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im) 319 private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im)
322 { 320 {
323 if (m_debugEnabled) m_log.DebugFormat("[GROUPS] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 321 if (m_debugEnabled) m_log.DebugFormat("[GROUPS] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
324 322
325
326 // Group invitations 323 // Group invitations
327 if ((im.dialog == (byte)InstantMessageDialog.GroupInvitationAccept) || (im.dialog == (byte)InstantMessageDialog.GroupInvitationDecline)) 324 if ((im.dialog == (byte)InstantMessageDialog.GroupInvitationAccept) || (im.dialog == (byte)InstantMessageDialog.GroupInvitationDecline))
328 { 325 {
@@ -334,7 +331,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
334 UUID fromAgentID = new UUID(im.fromAgentID); 331 UUID fromAgentID = new UUID(im.fromAgentID);
335 if ((inviteInfo != null) && (fromAgentID == inviteInfo.AgentID)) 332 if ((inviteInfo != null) && (fromAgentID == inviteInfo.AgentID))
336 { 333 {
337
338 // Accept 334 // Accept
339 if (im.dialog == (byte)InstantMessageDialog.GroupInvitationAccept) 335 if (im.dialog == (byte)InstantMessageDialog.GroupInvitationAccept)
340 { 336 {
@@ -373,10 +369,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
373 { 369 {
374 if (m_debugEnabled) m_log.DebugFormat("[GROUPS] Received a reject invite notice."); 370 if (m_debugEnabled) m_log.DebugFormat("[GROUPS] Received a reject invite notice.");
375 m_groupData.RemoveAgentToGroupInvite(inviteID); 371 m_groupData.RemoveAgentToGroupInvite(inviteID);
376
377 } 372 }
378
379
380 } 373 }
381 } 374 }
382 375
@@ -411,14 +404,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
411 binBucket = binBucket.Remove(0, 14).Trim(); 404 binBucket = binBucket.Remove(0, 14).Trim();
412 if (m_debugEnabled) 405 if (m_debugEnabled)
413 { 406 {
414 m_log.WarnFormat("I don't understand a group notice binary bucket of: {0}", binBucket); 407 m_log.WarnFormat("I don't understand a group notice binary bucket of: {0}", binBucket);
415 408
416 OSDMap binBucketOSD = (OSDMap)OSDParser.DeserializeLLSDXml(binBucket); 409 OSDMap binBucketOSD = (OSDMap)OSDParser.DeserializeLLSDXml(binBucket);
417 410
418 foreach (string key in binBucketOSD.Keys) 411 foreach (string key in binBucketOSD.Keys)
419 { 412 {
420 m_log.WarnFormat("{0}: {1}", key, binBucketOSD[key].ToString()); 413 m_log.WarnFormat("{0}: {1}", key, binBucketOSD[key].ToString());
421 } 414 }
422 } 415 }
423 416
424 // treat as if no attachment 417 // treat as if no attachment
@@ -429,7 +422,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
429 bucket[18] = 0; //dunno 422 bucket[18] = 0; //dunno
430 } 423 }
431 424
432
433 m_groupData.AddGroupNotice(GroupID, NoticeID, im.fromAgentName, Subject, Message, bucket); 425 m_groupData.AddGroupNotice(GroupID, NoticeID, im.fromAgentName, Subject, Message, bucket);
434 if (OnNewGroupNotice != null) 426 if (OnNewGroupNotice != null)
435 { 427 {
@@ -446,12 +438,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
446 438
447 msg.toAgentID = member.AgentID.Guid; 439 msg.toAgentID = member.AgentID.Guid;
448 OutgoingInstantMessage(msg, member.AgentID); 440 OutgoingInstantMessage(msg, member.AgentID);
449
450 } 441 }
451 } 442 }
452
453
454
455 } 443 }
456 } 444 }
457 445
@@ -477,11 +465,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
477 UUID groupID = new UUID(im.fromAgentID); 465 UUID groupID = new UUID(im.fromAgentID);
478 ejectee.SendAgentDropGroup(groupID); 466 ejectee.SendAgentDropGroup(groupID);
479 } 467 }
480
481 } 468 }
482
483
484
485 } 469 }
486 470
487 private void OnGridInstantMessage(GridInstantMessage msg) 471 private void OnGridInstantMessage(GridInstantMessage msg)
@@ -491,7 +475,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
491 // Trigger the above event handler 475 // Trigger the above event handler
492 OnInstantMessage(null, msg); 476 OnInstantMessage(null, msg);
493 477
494
495 // If a message from a group arrives here, it may need to be forwarded to a local client 478 // If a message from a group arrives here, it may need to be forwarded to a local client
496 if (msg.fromGroup == true) 479 if (msg.fromGroup == true)
497 { 480 {
@@ -501,17 +484,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
501 case (byte)InstantMessageDialog.GroupNotice: 484 case (byte)InstantMessageDialog.GroupNotice:
502 UUID toAgentID = new UUID(msg.toAgentID); 485 UUID toAgentID = new UUID(msg.toAgentID);
503 IClientAPI localClient = GetActiveClient(toAgentID); 486 IClientAPI localClient = GetActiveClient(toAgentID);
504 if( localClient != null ) 487 if (localClient != null)
505 { 488 {
506 localClient.SendInstantMessage(msg); 489 localClient.SendInstantMessage(msg);
507 } 490 }
508 break; 491 break;
509 } 492 }
510 } 493 }
511
512 } 494 }
513 495
514
515 #endregion 496 #endregion
516 497
517 #region IGroupsModule Members 498 #region IGroupsModule Members
@@ -570,8 +551,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
570 List<GroupMembersData> data = m_groupData.GetGroupMembers(groupID); 551 List<GroupMembersData> data = m_groupData.GetGroupMembers(groupID);
571 if (m_debugEnabled) 552 if (m_debugEnabled)
572 { 553 {
573 foreach (GroupMembersData member in data) 554 foreach (GroupMembersData member in data)
574 { 555 {
575 m_log.DebugFormat("[GROUPS] {0} {1}", member.AgentID, member.Title); 556 m_log.DebugFormat("[GROUPS] {0} {1}", member.AgentID, member.Title);
576 } 557 }
577 } 558 }
@@ -588,8 +569,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
588 569
589 if (m_debugEnabled) 570 if (m_debugEnabled)
590 { 571 {
591 foreach (GroupRolesData member in data) 572 foreach (GroupRolesData member in data)
592 { 573 {
593 m_log.DebugFormat("[GROUPS] {0} {1}", member.Title, member.Members); 574 m_log.DebugFormat("[GROUPS] {0} {1}", member.Title, member.Members);
594 } 575 }
595 } 576 }
@@ -606,8 +587,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
606 587
607 if (m_debugEnabled) 588 if (m_debugEnabled)
608 { 589 {
609 foreach (GroupRoleMembersData member in data) 590 foreach (GroupRoleMembersData member in data)
610 { 591 {
611 m_log.DebugFormat("[GROUPS] Av: {0} Role: {1}", member.MemberID, member.RoleID); 592 m_log.DebugFormat("[GROUPS] Av: {0} Role: {1}", member.MemberID, member.RoleID);
612 } 593 }
613 } 594 }