diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs index f991d01..7e55d3c 100644 --- a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs +++ b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs | |||
@@ -133,6 +133,8 @@ namespace OpenSim.Groups | |||
133 | return HandleAddNotice(request); | 133 | return HandleAddNotice(request); |
134 | case "GETNOTICES": | 134 | case "GETNOTICES": |
135 | return HandleGetNotices(request); | 135 | return HandleGetNotices(request); |
136 | case "FINDGROUPS": | ||
137 | return HandleFindGroups(request); | ||
136 | } | 138 | } |
137 | m_log.DebugFormat("[GROUPS HANDLER]: unknown method request: {0}", method); | 139 | m_log.DebugFormat("[GROUPS HANDLER]: unknown method request: {0}", method); |
138 | } | 140 | } |
@@ -170,11 +172,16 @@ namespace OpenSim.Groups | |||
170 | 172 | ||
171 | } | 173 | } |
172 | 174 | ||
173 | grec = m_GroupsService.GetGroupRecord(RequestingAgentID, grec.GroupID); | 175 | if (grec.GroupID != UUID.Zero) |
174 | if (grec == null) | 176 | { |
175 | NullResult(result, "Internal Error"); | 177 | grec = m_GroupsService.GetGroupRecord(RequestingAgentID, grec.GroupID); |
178 | if (grec == null) | ||
179 | NullResult(result, "Internal Error"); | ||
180 | else | ||
181 | result["RESULT"] = GroupsDataUtils.GroupRecord(grec); | ||
182 | } | ||
176 | else | 183 | else |
177 | result["RESULT"] = GroupsDataUtils.GroupRecord(grec); | 184 | NullResult(result, reason); |
178 | } | 185 | } |
179 | 186 | ||
180 | string xmlString = ServerUtils.BuildXmlResponse(result); | 187 | string xmlString = ServerUtils.BuildXmlResponse(result); |
@@ -264,7 +271,6 @@ namespace OpenSim.Groups | |||
264 | UUID groupID = new UUID(request["GroupID"].ToString()); | 271 | UUID groupID = new UUID(request["GroupID"].ToString()); |
265 | string agentID = request["AgentID"].ToString(); | 272 | string agentID = request["AgentID"].ToString(); |
266 | string requestingAgentID = request["RequestingAgentID"].ToString(); | 273 | string requestingAgentID = request["RequestingAgentID"].ToString(); |
267 | string reason = string.Empty; | ||
268 | 274 | ||
269 | m_GroupsService.RemoveAgentFromGroup(requestingAgentID, agentID, groupID); | 275 | m_GroupsService.RemoveAgentFromGroup(requestingAgentID, agentID, groupID); |
270 | } | 276 | } |
@@ -495,7 +501,6 @@ namespace OpenSim.Groups | |||
495 | else | 501 | else |
496 | { | 502 | { |
497 | string op = request["OP"].ToString(); | 503 | string op = request["OP"].ToString(); |
498 | string reason = string.Empty; | ||
499 | 504 | ||
500 | bool success = false; | 505 | bool success = false; |
501 | if (op == "ADD") | 506 | if (op == "ADD") |
@@ -563,7 +568,6 @@ namespace OpenSim.Groups | |||
563 | else | 568 | else |
564 | { | 569 | { |
565 | string op = request["OP"].ToString(); | 570 | string op = request["OP"].ToString(); |
566 | string reason = string.Empty; | ||
567 | 571 | ||
568 | if (op == "GROUP") | 572 | if (op == "GROUP") |
569 | { | 573 | { |
@@ -626,7 +630,6 @@ namespace OpenSim.Groups | |||
626 | else | 630 | else |
627 | { | 631 | { |
628 | string op = request["OP"].ToString(); | 632 | string op = request["OP"].ToString(); |
629 | string reason = string.Empty; | ||
630 | 633 | ||
631 | if (op == "ADD" && request.ContainsKey("GroupID") && request.ContainsKey("RoleID") && request.ContainsKey("AgentID")) | 634 | if (op == "ADD" && request.ContainsKey("GroupID") && request.ContainsKey("RoleID") && request.ContainsKey("AgentID")) |
632 | { | 635 | { |
@@ -739,6 +742,32 @@ namespace OpenSim.Groups | |||
739 | return Util.UTF8NoBomEncoding.GetBytes(xmlString); | 742 | return Util.UTF8NoBomEncoding.GetBytes(xmlString); |
740 | } | 743 | } |
741 | 744 | ||
745 | byte[] HandleFindGroups(Dictionary<string, object> request) | ||
746 | { | ||
747 | Dictionary<string, object> result = new Dictionary<string, object>(); | ||
748 | |||
749 | if (!request.ContainsKey("RequestingAgentID") || !request.ContainsKey("Query")) | ||
750 | NullResult(result, "Bad network data"); | ||
751 | |||
752 | List<DirGroupsReplyData> hits = m_GroupsService.FindGroups(request["RequestingAgentID"].ToString(), request["Query"].ToString()); | ||
753 | |||
754 | if (hits == null || (hits != null && hits.Count == 0)) | ||
755 | NullResult(result, "No hits"); | ||
756 | else | ||
757 | { | ||
758 | Dictionary<string, object> dict = new Dictionary<string, object>(); | ||
759 | int i = 0; | ||
760 | foreach (DirGroupsReplyData n in hits) | ||
761 | dict["n-" + i++] = GroupsDataUtils.DirGroupsReplyData(n); | ||
762 | |||
763 | result["RESULT"] = dict; | ||
764 | } | ||
765 | |||
766 | |||
767 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
768 | return Util.UTF8NoBomEncoding.GetBytes(xmlString); | ||
769 | } | ||
770 | |||
742 | 771 | ||
743 | #region Helpers | 772 | #region Helpers |
744 | 773 | ||