diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Addons/Groups/GroupsModule.cs | 61 |
1 files changed, 26 insertions, 35 deletions
diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs index 69d03a9..826fcbf 100644 --- a/OpenSim/Addons/Groups/GroupsModule.cs +++ b/OpenSim/Addons/Groups/GroupsModule.cs | |||
@@ -141,6 +141,8 @@ namespace OpenSim.Groups | |||
141 | if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); | 141 | if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); |
142 | 142 | ||
143 | scene.EventManager.OnNewClient += OnNewClient; | 143 | scene.EventManager.OnNewClient += OnNewClient; |
144 | scene.EventManager.OnMakeRootAgent += OnMakeRoot; | ||
145 | scene.EventManager.OnMakeChildAgent += OnMakeChild; | ||
144 | scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; | 146 | scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; |
145 | // The InstantMessageModule itself doesn't do this, | 147 | // The InstantMessageModule itself doesn't do this, |
146 | // so lets see if things explode if we don't do it | 148 | // so lets see if things explode if we don't do it |
@@ -194,6 +196,8 @@ namespace OpenSim.Groups | |||
194 | if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); | 196 | if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); |
195 | 197 | ||
196 | scene.EventManager.OnNewClient -= OnNewClient; | 198 | scene.EventManager.OnNewClient -= OnNewClient; |
199 | scene.EventManager.OnMakeRootAgent -= OnMakeRoot; | ||
200 | scene.EventManager.OnMakeChildAgent -= OnMakeChild; | ||
197 | scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; | 201 | scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; |
198 | 202 | ||
199 | lock (m_sceneList) | 203 | lock (m_sceneList) |
@@ -232,16 +236,29 @@ namespace OpenSim.Groups | |||
232 | { | 236 | { |
233 | if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); | 237 | if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); |
234 | 238 | ||
235 | client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest; | ||
236 | client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest; | 239 | client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest; |
237 | client.OnDirFindQuery += OnDirFindQuery; | ||
238 | client.OnRequestAvatarProperties += OnRequestAvatarProperties; | 240 | client.OnRequestAvatarProperties += OnRequestAvatarProperties; |
241 | } | ||
242 | |||
243 | private void OnMakeRoot(ScenePresence sp) | ||
244 | { | ||
245 | if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); | ||
239 | 246 | ||
247 | sp.ControllingClient.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest; | ||
240 | // Used for Notices and Group Invites/Accept/Reject | 248 | // Used for Notices and Group Invites/Accept/Reject |
241 | client.OnInstantMessage += OnInstantMessage; | 249 | sp.ControllingClient.OnInstantMessage += OnInstantMessage; |
242 | 250 | ||
243 | // Send client their groups information. | 251 | // Send client their groups information. |
244 | SendAgentGroupDataUpdate(client, client.AgentId); | 252 | SendAgentGroupDataUpdate(sp.ControllingClient, sp.UUID); |
253 | } | ||
254 | |||
255 | private void OnMakeChild(ScenePresence sp) | ||
256 | { | ||
257 | if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); | ||
258 | |||
259 | sp.ControllingClient.OnUUIDGroupNameRequest -= HandleUUIDGroupNameRequest; | ||
260 | // Used for Notices and Group Invites/Accept/Reject | ||
261 | sp.ControllingClient.OnInstantMessage -= OnInstantMessage; | ||
245 | } | 262 | } |
246 | 263 | ||
247 | private void OnRequestAvatarProperties(IClientAPI remoteClient, UUID avatarID) | 264 | private void OnRequestAvatarProperties(IClientAPI remoteClient, UUID avatarID) |
@@ -287,21 +304,6 @@ namespace OpenSim.Groups | |||
287 | } | 304 | } |
288 | */ | 305 | */ |
289 | 306 | ||
290 | void OnDirFindQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, int queryStart) | ||
291 | { | ||
292 | if (((DirFindFlags)queryFlags & DirFindFlags.Groups) == DirFindFlags.Groups) | ||
293 | { | ||
294 | if (m_debugEnabled) | ||
295 | m_log.DebugFormat( | ||
296 | "[Groups]: {0} called with queryText({1}) queryFlags({2}) queryStart({3})", | ||
297 | System.Reflection.MethodBase.GetCurrentMethod().Name, queryText, (DirFindFlags)queryFlags, queryStart); | ||
298 | |||
299 | // TODO: This currently ignores pretty much all the query flags including Mature and sort order | ||
300 | remoteClient.SendDirGroupsReply(queryID, m_groupData.FindGroups(GetRequestingAgentIDStr(remoteClient), queryText).ToArray()); | ||
301 | } | ||
302 | |||
303 | } | ||
304 | |||
305 | private void OnAgentDataUpdateRequest(IClientAPI remoteClient, UUID dataForAgentID, UUID sessionID) | 307 | private void OnAgentDataUpdateRequest(IClientAPI remoteClient, UUID dataForAgentID, UUID sessionID) |
306 | { | 308 | { |
307 | if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); | 309 | if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); |
@@ -907,23 +909,7 @@ namespace OpenSim.Groups | |||
907 | { | 909 | { |
908 | if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called for notice {1}", System.Reflection.MethodBase.GetCurrentMethod().Name, groupNoticeID); | 910 | if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called for notice {1}", System.Reflection.MethodBase.GetCurrentMethod().Name, groupNoticeID); |
909 | 911 | ||
910 | //GroupRecord groupInfo = m_groupData.GetGroupRecord(GetRequestingAgentID(remoteClient), data.GroupID, null); | ||
911 | |||
912 | GridInstantMessage msg = CreateGroupNoticeIM(remoteClient.AgentId, groupNoticeID, (byte)InstantMessageDialog.GroupNoticeRequested); | 912 | GridInstantMessage msg = CreateGroupNoticeIM(remoteClient.AgentId, groupNoticeID, (byte)InstantMessageDialog.GroupNoticeRequested); |
913 | //GridInstantMessage msg = new GridInstantMessage(); | ||
914 | //msg.imSessionID = UUID.Zero.Guid; | ||
915 | //msg.fromAgentID = data.GroupID.Guid; | ||
916 | //msg.toAgentID = GetRequestingAgentID(remoteClient).Guid; | ||
917 | //msg.timestamp = (uint)Util.UnixTimeSinceEpoch(); | ||
918 | //msg.fromAgentName = "Group Notice : " + groupInfo == null ? "Unknown" : groupInfo.GroupName; | ||
919 | //msg.message = data.noticeData.Subject + "|" + data.Message; | ||
920 | //msg.dialog = (byte)OpenMetaverse.InstantMessageDialog.GroupNoticeRequested; | ||
921 | //msg.fromGroup = true; | ||
922 | //msg.offline = (byte)0; | ||
923 | //msg.ParentEstateID = 0; | ||
924 | //msg.Position = Vector3.Zero; | ||
925 | //msg.RegionID = UUID.Zero.Guid; | ||
926 | //msg.binaryBucket = data.BinaryBucket; | ||
927 | 913 | ||
928 | OutgoingInstantMessage(msg, GetRequestingAgentID(remoteClient)); | 914 | OutgoingInstantMessage(msg, GetRequestingAgentID(remoteClient)); |
929 | } | 915 | } |
@@ -1189,6 +1175,11 @@ namespace OpenSim.Groups | |||
1189 | } | 1175 | } |
1190 | } | 1176 | } |
1191 | 1177 | ||
1178 | public List<DirGroupsReplyData> FindGroups(IClientAPI remoteClient, string query) | ||
1179 | { | ||
1180 | return m_groupData.FindGroups(GetRequestingAgentIDStr(remoteClient), query); | ||
1181 | } | ||
1182 | |||
1192 | #endregion | 1183 | #endregion |
1193 | 1184 | ||
1194 | #region Client/Update Tools | 1185 | #region Client/Update Tools |