aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-04-29 18:52:10 +0000
committerJustin Clarke Casey2009-04-29 18:52:10 +0000
commit1bf0bc8bb3c3d78f2616397b7a4f048ae5ea1ac3 (patch)
tree163b606708688dfcd147cf47494e976cd125e968 /OpenSim/Region/OptionalModules
parent* Apply http://opensimulator.org/mantis/view.php?id=3557 (diff)
downloadopensim-SC_OLD-1bf0bc8bb3c3d78f2616397b7a4f048ae5ea1ac3.zip
opensim-SC_OLD-1bf0bc8bb3c3d78f2616397b7a4f048ae5ea1ac3.tar.gz
opensim-SC_OLD-1bf0bc8bb3c3d78f2616397b7a4f048ae5ea1ac3.tar.bz2
opensim-SC_OLD-1bf0bc8bb3c3d78f2616397b7a4f048ae5ea1ac3.tar.xz
* Apply further groups xmlrpc to stop an exception in the exception handler
* Thanks mcortez
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs47
1 files changed, 17 insertions, 30 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs
index e913543..25ce093 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs
@@ -146,9 +146,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
146 | GroupPowers.VoteOnProposal; 146 | GroupPowers.VoteOnProposal;
147 param["OwnersPowers"] = ((ulong)OwnerPowers).ToString(); 147 param["OwnersPowers"] = ((ulong)OwnerPowers).ToString();
148 148
149
150
151
152 Hashtable respData = XmlRpcCall("groups.createGroup", param); 149 Hashtable respData = XmlRpcCall("groups.createGroup", param);
153 150
154 if (respData.Contains("error")) 151 if (respData.Contains("error"))
@@ -237,7 +234,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
237 param["Name"] = GroupName.ToString(); 234 param["Name"] = GroupName.ToString();
238 } 235 }
239 236
240
241 Hashtable respData = XmlRpcCall("groups.getGroup", param); 237 Hashtable respData = XmlRpcCall("groups.getGroup", param);
242 238
243 if (respData.Contains("error")) 239 if (respData.Contains("error"))
@@ -246,7 +242,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
246 } 242 }
247 243
248 return GroupProfileHashtableToGroupRecord(respData); 244 return GroupProfileHashtableToGroupRecord(respData);
249
250 } 245 }
251 246
252 public GroupProfileData GetMemberGroupProfile(UUID GroupID, UUID AgentID) 247 public GroupProfileData GetMemberGroupProfile(UUID GroupID, UUID AgentID)
@@ -254,7 +249,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
254 Hashtable param = new Hashtable(); 249 Hashtable param = new Hashtable();
255 param["GroupID"] = GroupID.ToString(); 250 param["GroupID"] = GroupID.ToString();
256 251
257
258 Hashtable respData = XmlRpcCall("groups.getGroup", param); 252 Hashtable respData = XmlRpcCall("groups.getGroup", param);
259 253
260 if (respData.Contains("error")) 254 if (respData.Contains("error"))
@@ -270,7 +264,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
270 MemberGroupProfile.PowersMask = MemberInfo.GroupPowers; 264 MemberGroupProfile.PowersMask = MemberInfo.GroupPowers;
271 265
272 return MemberGroupProfile; 266 return MemberGroupProfile;
273
274 } 267 }
275 268
276 private GroupProfileData GroupProfileHashtableToGroupProfileData(Hashtable groupProfile) 269 private GroupProfileData GroupProfileHashtableToGroupProfileData(Hashtable groupProfile)
@@ -350,7 +343,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
350 param["ListInProfile"] = ListInProfile ? "1" : "0"; 343 param["ListInProfile"] = ListInProfile ? "1" : "0";
351 344
352 XmlRpcCall("groups.setAgentGroupInfo", param); 345 XmlRpcCall("groups.setAgentGroupInfo", param);
353
354 } 346 }
355 347
356 public void AddAgentToGroupInvite(UUID inviteID, UUID groupID, UUID roleID, UUID agentID) 348 public void AddAgentToGroupInvite(UUID inviteID, UUID groupID, UUID roleID, UUID agentID)
@@ -362,7 +354,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
362 param["GroupID"] = groupID.ToString(); 354 param["GroupID"] = groupID.ToString();
363 355
364 XmlRpcCall("groups.addAgentToGroupInvite", param); 356 XmlRpcCall("groups.addAgentToGroupInvite", param);
365
366 } 357 }
367 358
368 public GroupInviteInfo GetAgentToGroupInvite(UUID inviteID) 359 public GroupInviteInfo GetAgentToGroupInvite(UUID inviteID)
@@ -434,7 +425,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
434 XmlRpcCall("groups.removeAgentFromGroupRole", param); 425 XmlRpcCall("groups.removeAgentFromGroupRole", param);
435 } 426 }
436 427
437
438 public List<DirGroupsReplyData> FindGroups(string search) 428 public List<DirGroupsReplyData> FindGroups(string search)
439 { 429 {
440 Hashtable param = new Hashtable(); 430 Hashtable param = new Hashtable();
@@ -495,7 +485,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
495 return HashTableToGroupMembershipData(respData); 485 return HashTableToGroupMembershipData(respData);
496 } 486 }
497 487
498
499 public List<GroupMembershipData> GetAgentGroupMemberships(UUID AgentID) 488 public List<GroupMembershipData> GetAgentGroupMemberships(UUID AgentID)
500 { 489 {
501 Hashtable param = new Hashtable(); 490 Hashtable param = new Hashtable();
@@ -543,8 +532,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
543 } 532 }
544 533
545 return Roles; 534 return Roles;
546
547
548 } 535 }
549 536
550 public List<GroupRolesData> GetGroupRoles(UUID GroupID) 537 public List<GroupRolesData> GetGroupRoles(UUID GroupID)
@@ -575,7 +562,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
575 } 562 }
576 563
577 return Roles; 564 return Roles;
578
579 } 565 }
580 566
581 private static GroupMembershipData HashTableToGroupMembershipData(Hashtable respData) 567 private static GroupMembershipData HashTableToGroupMembershipData(Hashtable respData)
@@ -643,7 +629,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
643 } 629 }
644 630
645 return members; 631 return members;
646
647 } 632 }
648 633
649 public List<GroupRoleMembersData> GetGroupRoleMembers(UUID GroupID) 634 public List<GroupRoleMembersData> GetGroupRoleMembers(UUID GroupID)
@@ -667,6 +652,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
667 members.Add(data); 652 members.Add(data);
668 } 653 }
669 } 654 }
655
670 return members; 656 return members;
671 } 657 }
672 658
@@ -694,9 +680,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
694 values.Add(data); 680 values.Add(data);
695 } 681 }
696 } 682 }
683
697 return values; 684 return values;
698
699 } 685 }
686
700 public GroupNoticeInfo GetGroupNotice(UUID noticeID) 687 public GroupNoticeInfo GetGroupNotice(UUID noticeID)
701 { 688 {
702 Hashtable param = new Hashtable(); 689 Hashtable param = new Hashtable();
@@ -704,7 +691,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
704 691
705 Hashtable respData = XmlRpcCall("groups.getGroupNotice", param); 692 Hashtable respData = XmlRpcCall("groups.getGroupNotice", param);
706 693
707
708 if (respData.Contains("error")) 694 if (respData.Contains("error"))
709 { 695 {
710 return null; 696 return null;
@@ -728,6 +714,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
728 714
729 return data; 715 return data;
730 } 716 }
717
731 public void AddGroupNotice(UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket) 718 public void AddGroupNotice(UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket)
732 { 719 {
733 string binBucket = OpenMetaverse.Utils.BytesToHexString(binaryBucket, ""); 720 string binBucket = OpenMetaverse.Utils.BytesToHexString(binaryBucket, "");
@@ -768,14 +755,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
768 } 755 }
769 catch (Exception e) 756 catch (Exception e)
770 { 757 {
771 m_log.Error("[GROUPS] An error has occured while attempting to access the XmlRpcGroups server"); 758 m_log.ErrorFormat("[GROUPS]: An error has occured while attempting to access the XmlRpcGroups server method: {0}", function);
772 m_log.ErrorFormat("[GROUPS] {0} ", e.ToString()); 759 m_log.ErrorFormat("[GROUPS]: {0} ", e.ToString());
773 760
774 foreach (KeyValuePair<object, object> kvp in param) 761 foreach (KeyValuePair<object, object> kvp in param)
775 { 762 {
776 m_log.WarnFormat("[GROUPS] {0} :: {1}", kvp.Key.ToString(), kvp.Value.ToString()); 763 m_log.WarnFormat("[GROUPS]: {0} :: {1}", kvp.Key.ToString(), kvp.Value.ToString());
777 } 764 }
778 Hashtable respData = (Hashtable)resp.Value; 765
766
767 Hashtable respData = new Hashtable();
779 respData.Add("error", e.ToString()); 768 respData.Add("error", e.ToString());
780 return respData; 769 return respData;
781 } 770 }
@@ -791,21 +780,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
791 return respData; 780 return respData;
792 } 781 }
793 782
794 m_log.ErrorFormat("[XmlRpcGroupData] The XmlRpc server returned a {1} instead of a hashtable for {0}", function, resp.Value.GetType().ToString()); 783 m_log.ErrorFormat("[GROUPS]: The XmlRpc server returned a {1} instead of a hashtable for {0}", function, resp.Value.GetType().ToString());
795 784
796 if (resp.Value is ArrayList) 785 if (resp.Value is ArrayList)
797 { 786 {
798 ArrayList al = (ArrayList)resp.Value; 787 ArrayList al = (ArrayList)resp.Value;
799 m_log.ErrorFormat("[XmlRpcGroupData] Contains {0} elements", al.Count); 788 m_log.ErrorFormat("[GROUPS]: Contains {0} elements", al.Count);
800 789
801 foreach (object o in al) 790 foreach (object o in al)
802 { 791 {
803 m_log.ErrorFormat("[XmlRpcGroupData] {0} :: {1}", o.GetType().ToString(), o.ToString()); 792 m_log.ErrorFormat("[GROUPS]: {0} :: {1}", o.GetType().ToString(), o.ToString());
804 } 793 }
805 } 794 }
806 else 795 else
807 { 796 {
808 m_log.ErrorFormat("[XmlRpcGroupData] Function returned: {0}", resp.Value.ToString()); 797 m_log.ErrorFormat("[GROUPS]: Function returned: {0}", resp.Value.ToString());
809 } 798 }
810 799
811 Hashtable error = new Hashtable(); 800 Hashtable error = new Hashtable();
@@ -815,21 +804,19 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
815 804
816 private void LogRespDataToConsoleError(Hashtable respData) 805 private void LogRespDataToConsoleError(Hashtable respData)
817 { 806 {
818 m_log.Error("[GROUPDATA] Error:"); 807 m_log.Error("[GROUPS]: Error:");
819 808
820 foreach (string key in respData.Keys) 809 foreach (string key in respData.Keys)
821 { 810 {
822 m_log.ErrorFormat("[GROUPDATA] Key: {0}", key); 811 m_log.ErrorFormat("[GROUPS]: Key: {0}", key);
823 812
824 string[] lines = respData[key].ToString().Split(new char[] { '\n' }); 813 string[] lines = respData[key].ToString().Split(new char[] { '\n' });
825 foreach (string line in lines) 814 foreach (string line in lines)
826 { 815 {
827 m_log.ErrorFormat("[GROUPDATA] {0}", line); 816 m_log.ErrorFormat("[GROUPS]: {0}", line);
828 } 817 }
829
830 } 818 }
831 } 819 }
832
833 } 820 }
834 821
835 public class GroupNoticeInfo 822 public class GroupNoticeInfo