diff options
author | Charles Krinke | 2009-04-25 18:58:18 +0000 |
---|---|---|
committer | Charles Krinke | 2009-04-25 18:58:18 +0000 |
commit | c17a12544561de8103e1631c1a23dd225bd39698 (patch) | |
tree | 104af1bbb1dd1724b38731b37cf9b82f8d0b6fab /OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs | |
parent | Fix another typo in the ini example (diff) | |
download | opensim-SC-c17a12544561de8103e1631c1a23dd225bd39698.zip opensim-SC-c17a12544561de8103e1631c1a23dd225bd39698.tar.gz opensim-SC-c17a12544561de8103e1631c1a23dd225bd39698.tar.bz2 opensim-SC-c17a12544561de8103e1631c1a23dd225bd39698.tar.xz |
Thank you kindly, MCortez for a patch that:
The attached patch fixes a few problems that people were
having with the Messaging provided by the XmlRpcGroups
optional module, namely:
* Fixes 2x echo in group messaging
* Fixes problems with cross instance, non-neighbor, messaging
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs index 2a5a319..27cffd6 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs | |||
@@ -146,11 +146,15 @@ 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 | |||
149 | Hashtable respData = XmlRpcCall("groups.createGroup", param); | 152 | Hashtable respData = XmlRpcCall("groups.createGroup", param); |
150 | 153 | ||
151 | if (respData.Contains("error")) | 154 | if (respData.Contains("error")) |
152 | { | 155 | { |
153 | // UUID is not nullable | 156 | // UUID is not nullable |
157 | |||
154 | return UUID.Zero; | 158 | return UUID.Zero; |
155 | } | 159 | } |
156 | 160 | ||
@@ -224,7 +228,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
224 | public GroupRecord GetGroupRecord(UUID GroupID, string GroupName) | 228 | public GroupRecord GetGroupRecord(UUID GroupID, string GroupName) |
225 | { | 229 | { |
226 | Hashtable param = new Hashtable(); | 230 | Hashtable param = new Hashtable(); |
227 | if (GroupID != UUID.Zero) | 231 | if ((GroupID != null) && (GroupID != UUID.Zero)) |
228 | { | 232 | { |
229 | param["GroupID"] = GroupID.ToString(); | 233 | param["GroupID"] = GroupID.ToString(); |
230 | } | 234 | } |
@@ -233,6 +237,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
233 | param["Name"] = GroupName.ToString(); | 237 | param["Name"] = GroupName.ToString(); |
234 | } | 238 | } |
235 | 239 | ||
240 | |||
236 | Hashtable respData = XmlRpcCall("groups.getGroup", param); | 241 | Hashtable respData = XmlRpcCall("groups.getGroup", param); |
237 | 242 | ||
238 | if (respData.Contains("error")) | 243 | if (respData.Contains("error")) |
@@ -249,6 +254,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
249 | Hashtable param = new Hashtable(); | 254 | Hashtable param = new Hashtable(); |
250 | param["GroupID"] = GroupID.ToString(); | 255 | param["GroupID"] = GroupID.ToString(); |
251 | 256 | ||
257 | |||
252 | Hashtable respData = XmlRpcCall("groups.getGroup", param); | 258 | Hashtable respData = XmlRpcCall("groups.getGroup", param); |
253 | 259 | ||
254 | if (respData.Contains("error")) | 260 | if (respData.Contains("error")) |
@@ -264,6 +270,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
264 | MemberGroupProfile.PowersMask = MemberInfo.GroupPowers; | 270 | MemberGroupProfile.PowersMask = MemberInfo.GroupPowers; |
265 | 271 | ||
266 | return MemberGroupProfile; | 272 | return MemberGroupProfile; |
273 | |||
267 | } | 274 | } |
268 | 275 | ||
269 | private GroupProfileData GroupProfileHashtableToGroupProfileData(Hashtable groupProfile) | 276 | private GroupProfileData GroupProfileHashtableToGroupProfileData(Hashtable groupProfile) |
@@ -294,6 +301,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
294 | 301 | ||
295 | private GroupRecord GroupProfileHashtableToGroupRecord(Hashtable groupProfile) | 302 | private GroupRecord GroupProfileHashtableToGroupRecord(Hashtable groupProfile) |
296 | { | 303 | { |
304 | |||
297 | GroupRecord group = new GroupRecord(); | 305 | GroupRecord group = new GroupRecord(); |
298 | group.GroupID = UUID.Parse((string)groupProfile["GroupID"]); | 306 | group.GroupID = UUID.Parse((string)groupProfile["GroupID"]); |
299 | group.GroupName = groupProfile["Name"].ToString(); | 307 | group.GroupName = groupProfile["Name"].ToString(); |
@@ -313,6 +321,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
313 | return group; | 321 | return group; |
314 | } | 322 | } |
315 | 323 | ||
324 | |||
316 | public void SetAgentActiveGroup(UUID AgentID, UUID GroupID) | 325 | public void SetAgentActiveGroup(UUID AgentID, UUID GroupID) |
317 | { | 326 | { |
318 | Hashtable param = new Hashtable(); | 327 | Hashtable param = new Hashtable(); |
@@ -341,6 +350,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
341 | param["ListInProfile"] = ListInProfile ? "1" : "0"; | 350 | param["ListInProfile"] = ListInProfile ? "1" : "0"; |
342 | 351 | ||
343 | XmlRpcCall("groups.setAgentGroupInfo", param); | 352 | XmlRpcCall("groups.setAgentGroupInfo", param); |
353 | |||
344 | } | 354 | } |
345 | 355 | ||
346 | public void AddAgentToGroupInvite(UUID inviteID, UUID groupID, UUID roleID, UUID agentID) | 356 | public void AddAgentToGroupInvite(UUID inviteID, UUID groupID, UUID roleID, UUID agentID) |
@@ -352,6 +362,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
352 | param["GroupID"] = groupID.ToString(); | 362 | param["GroupID"] = groupID.ToString(); |
353 | 363 | ||
354 | XmlRpcCall("groups.addAgentToGroupInvite", param); | 364 | XmlRpcCall("groups.addAgentToGroupInvite", param); |
365 | |||
355 | } | 366 | } |
356 | 367 | ||
357 | public GroupInviteInfo GetAgentToGroupInvite(UUID inviteID) | 368 | public GroupInviteInfo GetAgentToGroupInvite(UUID inviteID) |
@@ -400,6 +411,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
400 | param["GroupID"] = GroupID.ToString(); | 411 | param["GroupID"] = GroupID.ToString(); |
401 | 412 | ||
402 | XmlRpcCall("groups.removeAgentFromGroup", param); | 413 | XmlRpcCall("groups.removeAgentFromGroup", param); |
414 | |||
403 | } | 415 | } |
404 | 416 | ||
405 | public void AddAgentToGroupRole(UUID AgentID, UUID GroupID, UUID RoleID) | 417 | public void AddAgentToGroupRole(UUID AgentID, UUID GroupID, UUID RoleID) |
@@ -422,6 +434,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
422 | XmlRpcCall("groups.removeAgentFromGroupRole", param); | 434 | XmlRpcCall("groups.removeAgentFromGroupRole", param); |
423 | } | 435 | } |
424 | 436 | ||
437 | |||
425 | public List<DirGroupsReplyData> FindGroups(string search) | 438 | public List<DirGroupsReplyData> FindGroups(string search) |
426 | { | 439 | { |
427 | Hashtable param = new Hashtable(); | 440 | Hashtable param = new Hashtable(); |
@@ -482,6 +495,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
482 | return HashTableToGroupMembershipData(respData); | 495 | return HashTableToGroupMembershipData(respData); |
483 | } | 496 | } |
484 | 497 | ||
498 | |||
485 | public List<GroupMembershipData> GetAgentGroupMemberships(UUID AgentID) | 499 | public List<GroupMembershipData> GetAgentGroupMemberships(UUID AgentID) |
486 | { | 500 | { |
487 | Hashtable param = new Hashtable(); | 501 | Hashtable param = new Hashtable(); |
@@ -529,6 +543,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
529 | } | 543 | } |
530 | 544 | ||
531 | return Roles; | 545 | return Roles; |
546 | |||
547 | |||
532 | } | 548 | } |
533 | 549 | ||
534 | public List<GroupRolesData> GetGroupRoles(UUID GroupID) | 550 | public List<GroupRolesData> GetGroupRoles(UUID GroupID) |
@@ -559,6 +575,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
559 | } | 575 | } |
560 | 576 | ||
561 | return Roles; | 577 | return Roles; |
578 | |||
562 | } | 579 | } |
563 | 580 | ||
564 | private static GroupMembershipData HashTableToGroupMembershipData(Hashtable respData) | 581 | private static GroupMembershipData HashTableToGroupMembershipData(Hashtable respData) |
@@ -583,7 +600,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
583 | data.AllowPublish = ((string)respData["AllowPublish"] == "1"); | 600 | data.AllowPublish = ((string)respData["AllowPublish"] == "1"); |
584 | if (respData["Charter"] != null) | 601 | if (respData["Charter"] != null) |
585 | { | 602 | { |
586 | data.Charter = (string)respData["Charter"]; | 603 | data.Charter = (string)respData["Charter"]; |
587 | } | 604 | } |
588 | data.FounderID = new UUID((string)respData["FounderID"]); | 605 | data.FounderID = new UUID((string)respData["FounderID"]); |
589 | data.GroupID = new UUID((string)respData["GroupID"]); | 606 | data.GroupID = new UUID((string)respData["GroupID"]); |
@@ -626,6 +643,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
626 | } | 643 | } |
627 | 644 | ||
628 | return members; | 645 | return members; |
646 | |||
629 | } | 647 | } |
630 | 648 | ||
631 | public List<GroupRoleMembersData> GetGroupRoleMembers(UUID GroupID) | 649 | public List<GroupRoleMembersData> GetGroupRoleMembers(UUID GroupID) |
@@ -642,10 +660,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
642 | foreach (Hashtable membership in respData.Values) | 660 | foreach (Hashtable membership in respData.Values) |
643 | { | 661 | { |
644 | GroupRoleMembersData data = new GroupRoleMembersData(); | 662 | GroupRoleMembersData data = new GroupRoleMembersData(); |
645 | 663 | ||
646 | data.MemberID = new UUID((string)membership["AgentID"]); | 664 | data.MemberID = new UUID((string)membership["AgentID"]); |
647 | data.RoleID = new UUID((string)membership["RoleID"]); | 665 | data.RoleID = new UUID((string)membership["RoleID"]); |
648 | 666 | ||
649 | members.Add(data); | 667 | members.Add(data); |
650 | } | 668 | } |
651 | } | 669 | } |
@@ -685,9 +703,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
685 | param["NoticeID"] = noticeID.ToString(); | 703 | param["NoticeID"] = noticeID.ToString(); |
686 | 704 | ||
687 | Hashtable respData = XmlRpcCall("groups.getGroupNotice", param); | 705 | Hashtable respData = XmlRpcCall("groups.getGroupNotice", param); |
688 | |||
689 | 706 | ||
690 | if (!respData.Contains("error")) | 707 | |
708 | if (respData.Contains("error")) | ||
691 | { | 709 | { |
692 | return null; | 710 | return null; |
693 | } | 711 | } |
@@ -775,7 +793,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
775 | Hashtable error = new Hashtable(); | 793 | Hashtable error = new Hashtable(); |
776 | error.Add("error", "invalid return value"); | 794 | error.Add("error", "invalid return value"); |
777 | return error; | 795 | return error; |
778 | } | 796 | } |
779 | 797 | ||
780 | private void LogRespDataToConsoleError(Hashtable respData) | 798 | private void LogRespDataToConsoleError(Hashtable respData) |
781 | { | 799 | { |
@@ -785,15 +803,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
785 | { | 803 | { |
786 | m_log.ErrorFormat("[GROUPDATA] Key: {0}", key); | 804 | m_log.ErrorFormat("[GROUPDATA] Key: {0}", key); |
787 | 805 | ||
788 | // object o = respData[key]; | ||
789 | |||
790 | string[] lines = respData[key].ToString().Split(new char[] { '\n' }); | 806 | string[] lines = respData[key].ToString().Split(new char[] { '\n' }); |
791 | foreach (string line in lines) | 807 | foreach (string line in lines) |
792 | { | 808 | { |
793 | m_log.ErrorFormat("[GROUPDATA] {0}", line); | 809 | m_log.ErrorFormat("[GROUPDATA] {0}", line); |
794 | } | 810 | } |
811 | |||
795 | } | 812 | } |
796 | } | 813 | } |
814 | |||
797 | } | 815 | } |
798 | 816 | ||
799 | public class GroupNoticeInfo | 817 | public class GroupNoticeInfo |