diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups')
3 files changed, 24 insertions, 23 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 68e6497..61c51e0 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | |||
@@ -328,17 +328,19 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
328 | } | 328 | } |
329 | */ | 329 | */ |
330 | 330 | ||
331 | |||
332 | void OnDirFindQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, int queryStart) | 331 | void OnDirFindQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, int queryStart) |
333 | { | 332 | { |
334 | if (((DirFindFlags)queryFlags & DirFindFlags.Groups) == DirFindFlags.Groups) | 333 | if (((DirFindFlags)queryFlags & DirFindFlags.Groups) == DirFindFlags.Groups) |
335 | { | 334 | { |
336 | if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called with queryText({1}) queryFlags({2}) queryStart({3})", System.Reflection.MethodBase.GetCurrentMethod().Name, queryText, (DirFindFlags)queryFlags, queryStart); | 335 | if (m_debugEnabled) |
336 | m_log.DebugFormat( | ||
337 | "[GROUPS]: {0} called with queryText({1}) queryFlags({2}) queryStart({3})", | ||
338 | System.Reflection.MethodBase.GetCurrentMethod().Name, queryText, (DirFindFlags)queryFlags, queryStart); | ||
337 | 339 | ||
338 | // TODO: This currently ignores pretty much all the query flags including Mature and sort order | 340 | // TODO: This currently ignores pretty much all the query flags including Mature and sort order |
339 | remoteClient.SendDirGroupsReply(queryID, m_groupData.FindGroups(GetClientGroupRequestID(remoteClient), queryText).ToArray()); | 341 | remoteClient.SendDirGroupsReply( |
340 | } | 342 | queryID, m_groupData.FindGroups(GetClientGroupRequestID(remoteClient), queryText).ToArray()); |
341 | 343 | } | |
342 | } | 344 | } |
343 | 345 | ||
344 | private void OnAgentDataUpdateRequest(IClientAPI remoteClient, UUID dataForAgentID, UUID sessionID) | 346 | private void OnAgentDataUpdateRequest(IClientAPI remoteClient, UUID dataForAgentID, UUID sessionID) |
@@ -363,7 +365,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
363 | SendScenePresenceUpdate(dataForAgentID, activeGroupTitle); | 365 | SendScenePresenceUpdate(dataForAgentID, activeGroupTitle); |
364 | } | 366 | } |
365 | 367 | ||
366 | private void HandleUUIDGroupNameRequest(UUID GroupID,IClientAPI remoteClient) | 368 | private void HandleUUIDGroupNameRequest(UUID GroupID, IClientAPI remoteClient) |
367 | { | 369 | { |
368 | if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); | 370 | if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); |
369 | 371 | ||
@@ -593,6 +595,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
593 | return m_groupData.GetGroupRecord(null, GroupID, null); | 595 | return m_groupData.GetGroupRecord(null, GroupID, null); |
594 | } | 596 | } |
595 | 597 | ||
598 | public GroupRecord GetGroupRecord(string name) | ||
599 | { | ||
600 | return m_groupData.GetGroupRecord(null, UUID.Zero, name); | ||
601 | } | ||
602 | |||
596 | public void ActivateGroup(IClientAPI remoteClient, UUID groupID) | 603 | public void ActivateGroup(IClientAPI remoteClient, UUID groupID) |
597 | { | 604 | { |
598 | if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); | 605 | if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); |
@@ -652,7 +659,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
652 | List<GroupRolesData> data = m_groupData.GetGroupRoles(GetClientGroupRequestID(remoteClient), groupID); | 659 | List<GroupRolesData> data = m_groupData.GetGroupRoles(GetClientGroupRequestID(remoteClient), groupID); |
653 | 660 | ||
654 | return data; | 661 | return data; |
655 | |||
656 | } | 662 | } |
657 | 663 | ||
658 | public List<GroupRoleMembersData> GroupRoleMembersRequest(IClientAPI remoteClient, UUID groupID) | 664 | public List<GroupRoleMembersData> GroupRoleMembersRequest(IClientAPI remoteClient, UUID groupID) |
@@ -662,8 +668,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
662 | List<GroupRoleMembersData> data = m_groupData.GetGroupRoleMembers(GetClientGroupRequestID(remoteClient), groupID); | 668 | List<GroupRoleMembersData> data = m_groupData.GetGroupRoleMembers(GetClientGroupRequestID(remoteClient), groupID); |
663 | 669 | ||
664 | return data; | 670 | return data; |
665 | |||
666 | |||
667 | } | 671 | } |
668 | 672 | ||
669 | public GroupProfileData GroupProfileRequest(IClientAPI remoteClient, UUID groupID) | 673 | public GroupProfileData GroupProfileRequest(IClientAPI remoteClient, UUID groupID) |
@@ -712,7 +716,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
712 | 716 | ||
713 | public GroupMembershipData GetMembershipData(UUID groupID, UUID agentID) | 717 | public GroupMembershipData GetMembershipData(UUID groupID, UUID agentID) |
714 | { | 718 | { |
715 | if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); | 719 | if (m_debugEnabled) |
720 | m_log.DebugFormat( | ||
721 | "[GROUPS]: {0} called with groupID={1}, agentID={2}", | ||
722 | System.Reflection.MethodBase.GetCurrentMethod().Name, groupID, agentID); | ||
716 | 723 | ||
717 | return m_groupData.GetAgentGroupMembership(null, agentID, groupID); | 724 | return m_groupData.GetAgentGroupMembership(null, agentID, groupID); |
718 | } | 725 | } |
@@ -746,7 +753,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
746 | return UUID.Zero; | 753 | return UUID.Zero; |
747 | } | 754 | } |
748 | // is there is a money module present ? | 755 | // is there is a money module present ? |
749 | IMoneyModule money=remoteClient.Scene.RequestModuleInterface<IMoneyModule>(); | 756 | IMoneyModule money = remoteClient.Scene.RequestModuleInterface<IMoneyModule>(); |
750 | if (money != null) | 757 | if (money != null) |
751 | { | 758 | { |
752 | // do the transaction, that is if the agent has got sufficient funds | 759 | // do the transaction, that is if the agent has got sufficient funds |
@@ -1166,8 +1173,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
1166 | else | 1173 | else |
1167 | { | 1174 | { |
1168 | string domain = string.Empty; //m_sceneList[0].CommsManager.NetworkServersInfo.UserURL; | 1175 | string domain = string.Empty; //m_sceneList[0].CommsManager.NetworkServersInfo.UserURL; |
1169 | if (account.ServiceURLs["HomeURI"] != null) | 1176 | object homeUriObj; |
1170 | domain = account.ServiceURLs["HomeURI"].ToString(); | 1177 | if (account.ServiceURLs.TryGetValue("HomeURI", out homeUriObj) && homeUriObj != null) |
1178 | domain = homeUriObj.ToString(); | ||
1171 | // They're a local user, use this: | 1179 | // They're a local user, use this: |
1172 | info.RequestID.UserServiceURL = domain; | 1180 | info.RequestID.UserServiceURL = domain; |
1173 | } | 1181 | } |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs index 9e0fa2d..621ab28 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs | |||
@@ -55,7 +55,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
55 | GroupInviteInfo GetAgentToGroupInvite(GroupRequestID requestID, UUID inviteID); | 55 | GroupInviteInfo GetAgentToGroupInvite(GroupRequestID requestID, UUID inviteID); |
56 | void RemoveAgentToGroupInvite(GroupRequestID requestID, UUID inviteID); | 56 | void RemoveAgentToGroupInvite(GroupRequestID requestID, UUID inviteID); |
57 | 57 | ||
58 | |||
59 | void AddAgentToGroupRole(GroupRequestID requestID, UUID AgentID, UUID GroupID, UUID RoleID); | 58 | void AddAgentToGroupRole(GroupRequestID requestID, UUID AgentID, UUID GroupID, UUID RoleID); |
60 | void RemoveAgentFromGroupRole(GroupRequestID requestID, UUID AgentID, UUID GroupID, UUID RoleID); | 59 | void RemoveAgentFromGroupRole(GroupRequestID requestID, UUID AgentID, UUID GroupID, UUID RoleID); |
61 | List<GroupRolesData> GetAgentGroupRoles(GroupRequestID requestID, UUID AgentID, UUID GroupID); | 60 | List<GroupRolesData> GetAgentGroupRoles(GroupRequestID requestID, UUID AgentID, UUID GroupID); |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs index 964d0bb..24ae4f7 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs | |||
@@ -47,9 +47,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
47 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 47 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
48 | public class XmlRpcGroupsServicesConnectorModule : ISharedRegionModule, IGroupsServicesConnector | 48 | public class XmlRpcGroupsServicesConnectorModule : ISharedRegionModule, IGroupsServicesConnector |
49 | { | 49 | { |
50 | private static readonly ILog m_log = | 50 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
51 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
52 | |||
53 | 51 | ||
54 | public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome | | 52 | public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome | |
55 | GroupPowers.Accountable | | 53 | GroupPowers.Accountable | |
@@ -354,11 +352,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
354 | MemberGroupProfile.PowersMask = MemberInfo.GroupPowers; | 352 | MemberGroupProfile.PowersMask = MemberInfo.GroupPowers; |
355 | 353 | ||
356 | return MemberGroupProfile; | 354 | return MemberGroupProfile; |
357 | |||
358 | } | 355 | } |
359 | 356 | ||
360 | |||
361 | |||
362 | public void SetAgentActiveGroup(GroupRequestID requestID, UUID AgentID, UUID GroupID) | 357 | public void SetAgentActiveGroup(GroupRequestID requestID, UUID AgentID, UUID GroupID) |
363 | { | 358 | { |
364 | Hashtable param = new Hashtable(); | 359 | Hashtable param = new Hashtable(); |
@@ -470,7 +465,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
470 | XmlRpcCall(requestID, "groups.removeAgentFromGroupRole", param); | 465 | XmlRpcCall(requestID, "groups.removeAgentFromGroupRole", param); |
471 | } | 466 | } |
472 | 467 | ||
473 | |||
474 | public List<DirGroupsReplyData> FindGroups(GroupRequestID requestID, string search) | 468 | public List<DirGroupsReplyData> FindGroups(GroupRequestID requestID, string search) |
475 | { | 469 | { |
476 | Hashtable param = new Hashtable(); | 470 | Hashtable param = new Hashtable(); |
@@ -531,7 +525,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
531 | return HashTableToGroupMembershipData(respData); | 525 | return HashTableToGroupMembershipData(respData); |
532 | } | 526 | } |
533 | 527 | ||
534 | |||
535 | public List<GroupMembershipData> GetAgentGroupMemberships(GroupRequestID requestID, UUID AgentID) | 528 | public List<GroupMembershipData> GetAgentGroupMemberships(GroupRequestID requestID, UUID AgentID) |
536 | { | 529 | { |
537 | Hashtable param = new Hashtable(); | 530 | Hashtable param = new Hashtable(); |
@@ -778,7 +771,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
778 | 771 | ||
779 | private GroupRecord GroupProfileHashtableToGroupRecord(Hashtable groupProfile) | 772 | private GroupRecord GroupProfileHashtableToGroupRecord(Hashtable groupProfile) |
780 | { | 773 | { |
781 | |||
782 | GroupRecord group = new GroupRecord(); | 774 | GroupRecord group = new GroupRecord(); |
783 | group.GroupID = UUID.Parse((string)groupProfile["GroupID"]); | 775 | group.GroupID = UUID.Parse((string)groupProfile["GroupID"]); |
784 | group.GroupName = groupProfile["Name"].ToString(); | 776 | group.GroupName = groupProfile["Name"].ToString(); |
@@ -797,6 +789,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
797 | 789 | ||
798 | return group; | 790 | return group; |
799 | } | 791 | } |
792 | |||
800 | private static GroupMembershipData HashTableToGroupMembershipData(Hashtable respData) | 793 | private static GroupMembershipData HashTableToGroupMembershipData(Hashtable respData) |
801 | { | 794 | { |
802 | GroupMembershipData data = new GroupMembershipData(); | 795 | GroupMembershipData data = new GroupMembershipData(); |
@@ -829,6 +822,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
829 | data.MembershipFee = int.Parse((string)respData["MembershipFee"]); | 822 | data.MembershipFee = int.Parse((string)respData["MembershipFee"]); |
830 | data.OpenEnrollment = ((string)respData["OpenEnrollment"] == "1"); | 823 | data.OpenEnrollment = ((string)respData["OpenEnrollment"] == "1"); |
831 | data.ShowInList = ((string)respData["ShowInList"] == "1"); | 824 | data.ShowInList = ((string)respData["ShowInList"] == "1"); |
825 | |||
832 | return data; | 826 | return data; |
833 | } | 827 | } |
834 | 828 | ||