From 3142982353a121920e571e5b33acffc065b20a2e Mon Sep 17 00:00:00 2001
From: Dan Lake
Date: Wed, 5 Oct 2011 12:58:24 -0700
Subject: Removed redundant scene presence lookups in HGMessageTransferModule
---
.../InstantMessage/HGMessageTransferModule.cs | 25 ++++------------------
1 file changed, 4 insertions(+), 21 deletions(-)
(limited to 'OpenSim/Region/CoreModules')
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
return string.Empty;
}
-
///
- /// Find the scene for an agent
+ /// Find the root client for a ID
///
- private Scene GetClientScene(UUID agentId)
+ public IClientAPI LocateClientObject(UUID agentID)
{
lock (m_Scenes)
{
foreach (Scene scene in m_Scenes)
{
- ScenePresence presence = scene.GetScenePresence(agentId);
+ ScenePresence presence = scene.GetScenePresence(agentID);
if (presence != null && !presence.IsChildAgent)
- return scene;
+ return presence.ControllingClient;
}
}
return null;
}
- ///
- /// Find the client for a ID
- ///
- public IClientAPI LocateClientObject(UUID agentID)
- {
- Scene scene = GetClientScene(agentID);
- if (scene != null)
- {
- ScenePresence presence = scene.GetScenePresence(agentID);
- if (presence != null)
- return presence.ControllingClient;
- }
-
- return null;
- }
-
#region IInstantMessageSimConnector
public bool SendInstantMessage(GridInstantMessage im)
{
--
cgit v1.1