diff options
Removed redundant scene presence lookups in HGMessageTransferModule
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs index d294692..eb14603 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs | |||
@@ -302,41 +302,24 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
302 | return string.Empty; | 302 | return string.Empty; |
303 | } | 303 | } |
304 | 304 | ||
305 | |||
306 | /// <summary> | 305 | /// <summary> |
307 | /// Find the scene for an agent | 306 | /// Find the root client for a ID |
308 | /// </summary> | 307 | /// </summary> |
309 | private Scene GetClientScene(UUID agentId) | 308 | public IClientAPI LocateClientObject(UUID agentID) |
310 | { | 309 | { |
311 | lock (m_Scenes) | 310 | lock (m_Scenes) |
312 | { | 311 | { |
313 | foreach (Scene scene in m_Scenes) | 312 | foreach (Scene scene in m_Scenes) |
314 | { | 313 | { |
315 | ScenePresence presence = scene.GetScenePresence(agentId); | 314 | ScenePresence presence = scene.GetScenePresence(agentID); |
316 | if (presence != null && !presence.IsChildAgent) | 315 | if (presence != null && !presence.IsChildAgent) |
317 | return scene; | 316 | return presence.ControllingClient; |
318 | } | 317 | } |
319 | } | 318 | } |
320 | 319 | ||
321 | return null; | 320 | return null; |
322 | } | 321 | } |
323 | 322 | ||
324 | /// <summary> | ||
325 | /// Find the client for a ID | ||
326 | /// </summary> | ||
327 | public IClientAPI LocateClientObject(UUID agentID) | ||
328 | { | ||
329 | Scene scene = GetClientScene(agentID); | ||
330 | if (scene != null) | ||
331 | { | ||
332 | ScenePresence presence = scene.GetScenePresence(agentID); | ||
333 | if (presence != null) | ||
334 | return presence.ControllingClient; | ||
335 | } | ||
336 | |||
337 | return null; | ||
338 | } | ||
339 | |||
340 | #region IInstantMessageSimConnector | 323 | #region IInstantMessageSimConnector |
341 | public bool SendInstantMessage(GridInstantMessage im) | 324 | public bool SendInstantMessage(GridInstantMessage im) |
342 | { | 325 | { |