aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Addons/Groups/Service/GroupsService.cs11
-rwxr-xr-xOpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs8
-rw-r--r--OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs29
3 files changed, 39 insertions, 9 deletions
diff --git a/OpenSim/Addons/Groups/Service/GroupsService.cs b/OpenSim/Addons/Groups/Service/GroupsService.cs
index 0792a47..b5f8ff5 100644
--- a/OpenSim/Addons/Groups/Service/GroupsService.cs
+++ b/OpenSim/Addons/Groups/Service/GroupsService.cs
@@ -230,15 +230,22 @@ namespace OpenSim.Groups
230 if (d.Data.ContainsKey("Location") && d.Data["Location"] != string.Empty) 230 if (d.Data.ContainsKey("Location") && d.Data["Location"] != string.Empty)
231 continue; 231 continue;
232 232
233 int nmembers = m_Database.MemberCount(d.GroupID);
234 if(nmembers == 0)
235 continue;
236
233 DirGroupsReplyData g = new DirGroupsReplyData(); 237 DirGroupsReplyData g = new DirGroupsReplyData();
234 g.groupID = d.GroupID;
235 238
236 if (d.Data.ContainsKey("Name")) 239 if (d.Data.ContainsKey("Name"))
237 g.groupName = d.Data["Name"]; 240 g.groupName = d.Data["Name"];
238 else 241 else
242 {
239 m_log.DebugFormat("[Groups]: Key Name not found"); 243 m_log.DebugFormat("[Groups]: Key Name not found");
244 continue;
245 }
240 246
241 g.members = m_Database.MemberCount(d.GroupID); 247 g.groupID = d.GroupID;
248 g.members = nmembers;
242 249
243 groups.Add(g); 250 groups.Add(g);
244 } 251 }
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 7c2a887..80ca67b 100755
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -3850,19 +3850,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3850 packet.QueryData = new DirGroupsReplyPacket.QueryDataBlock(); 3850 packet.QueryData = new DirGroupsReplyPacket.QueryDataBlock();
3851 packet.QueryData.QueryID = queryID; 3851 packet.QueryData.QueryID = queryID;
3852 3852
3853 packet.QueryReplies = new DirGroupsReplyPacket.QueryRepliesBlock[ 3853 packet.QueryReplies = new DirGroupsReplyPacket.QueryRepliesBlock[data.Length];
3854 data.Length];
3855 3854
3856 int i = 0; 3855 int i = 0;
3857 foreach (DirGroupsReplyData d in data) 3856 foreach (DirGroupsReplyData d in data)
3858 { 3857 {
3859 packet.QueryReplies[i] = new DirGroupsReplyPacket.QueryRepliesBlock(); 3858 packet.QueryReplies[i] = new DirGroupsReplyPacket.QueryRepliesBlock();
3860 packet.QueryReplies[i].GroupID = d.groupID; 3859 packet.QueryReplies[i].GroupID = d.groupID;
3861 packet.QueryReplies[i].GroupName = 3860 packet.QueryReplies[i].GroupName = Util.StringToBytes(d.groupName, 35);
3862 Utils.StringToBytes(d.groupName);
3863 packet.QueryReplies[i].Members = d.members; 3861 packet.QueryReplies[i].Members = d.members;
3864 packet.QueryReplies[i].SearchOrder = d.searchOrder; 3862 packet.QueryReplies[i].SearchOrder = d.searchOrder;
3865 i++; 3863 ++i;
3866 } 3864 }
3867 3865
3868 OutPacket(packet, ThrottleOutPacketType.Task); 3866 OutPacket(packet, ThrottleOutPacketType.Task);
diff --git a/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs b/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs
index c04d856..1026eae 100644
--- a/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs
@@ -186,10 +186,35 @@ namespace OpenSim.Region.CoreModules.Framework.Search
186 if (string.IsNullOrEmpty(queryText)) 186 if (string.IsNullOrEmpty(queryText))
187 remoteClient.SendDirGroupsReply(queryID, new DirGroupsReplyData[0]); 187 remoteClient.SendDirGroupsReply(queryID, new DirGroupsReplyData[0]);
188 188
189 List<DirGroupsReplyData> answer = m_GroupsService.FindGroups(remoteClient, queryText);
190 if(answer.Count == 0)
191 {
192 remoteClient.SendDirGroupsReply(queryID, new DirGroupsReplyData[0]);
193 return;
194 }
195
196 // filter out groups with no members
197 DirGroupsReplyData[] result = new DirGroupsReplyData[answer.Count];
198 int count = 0;
199 foreach(DirGroupsReplyData dgrd in answer)
200 {
201 if(dgrd.members > 0)
202 result[count++] = dgrd;
203 }
204 answer = null;
205
206 // viewers don't sent sorting, so results they show are a nice mess
207 if ((queryStart > 0) && (queryStart < count))
208 {
209 int len = count - queryStart;
210 DirGroupsReplyData[] tmp = new DirGroupsReplyData[len];
211 Array.Copy(result, queryStart, tmp, 0, len);
212 result = tmp;
213 }
214
189 // TODO: This currently ignores pretty much all the query flags including Mature and sort order 215 // TODO: This currently ignores pretty much all the query flags including Mature and sort order
190 remoteClient.SendDirGroupsReply(queryID, m_GroupsService.FindGroups(remoteClient, queryText).ToArray()); 216 remoteClient.SendDirGroupsReply(queryID, result);
191 } 217 }
192
193 } 218 }
194 219
195 #endregion Event Handlers 220 #endregion Event Handlers