From 1b1f0a2d77fb4d2ac572f16c71a7560860c8c040 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 12 Jun 2012 02:43:33 +0100 Subject: OnConnectionClosed listeners, retrieve data from IClientAPI.SceneAgent rather than scanning all scene for the presence with the right id Stop checking IsLoggingOut on these listeners, if called with a root agent then we always want to perform these actions. This covers cases where the client is closed due to manual kick, simulator shutdown, etc. --- .../SimianGrid/SimianActivityDetector.cs | 28 ++++++---------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'OpenSim/Services/Connectors/SimianGrid') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs index 2267325..95e4bab 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs @@ -79,27 +79,13 @@ namespace OpenSim.Services.Connectors.SimianGrid public void OnConnectionClose(IClientAPI client) { - if (client.IsLoggingOut) - { - object sp = null; - Vector3 position = new Vector3(128, 128, 0); - Vector3 lookat = new Vector3(0, 1, 0); - - if (client.Scene.TryGetScenePresence(client.AgentId, out sp)) - { - if (sp is ScenePresence) - { - if (((ScenePresence)sp).IsChildAgent) - return; - - position = ((ScenePresence)sp).AbsolutePosition; - lookat = ((ScenePresence)sp).Lookat; - } - } + if (client.SceneAgent.IsChildAgent) + return; -// m_log.DebugFormat("[SIMIAN ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); - m_GridUserService.LoggedOut(client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, position, lookat); - } +// m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); + m_GridUserService.LoggedOut( + client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, + client.SceneAgent.AbsolutePosition, client.SceneAgent.Lookat); } void OnEnteringNewParcel(ScenePresence sp, int localLandID, UUID regionID) @@ -111,4 +97,4 @@ namespace OpenSim.Services.Connectors.SimianGrid }); } } -} +} \ No newline at end of file -- cgit v1.1