diff options
author | Justin Clark-Casey (justincc) | 2012-06-12 02:43:33 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-06-12 02:43:33 +0100 |
commit | 1b1f0a2d77fb4d2ac572f16c71a7560860c8c040 (patch) | |
tree | 2e18738453d51b8a551ba5f9ba7a0cada4cff62c /OpenSim/Region | |
parent | Set IClientAPI.IsActive = false early on client removal due to ack timeout ra... (diff) | |
download | opensim-SC_OLD-1b1f0a2d77fb4d2ac572f16c71a7560860c8c040.zip opensim-SC_OLD-1b1f0a2d77fb4d2ac572f16c71a7560860c8c040.tar.gz opensim-SC_OLD-1b1f0a2d77fb4d2ac572f16c71a7560860c8c040.tar.bz2 opensim-SC_OLD-1b1f0a2d77fb4d2ac572f16c71a7560860c8c040.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region')
4 files changed, 29 insertions, 49 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 43a72e2..08863c2 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -325,34 +325,30 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
325 | 325 | ||
326 | void OnConnectionClosed(IClientAPI obj) | 326 | void OnConnectionClosed(IClientAPI obj) |
327 | { | 327 | { |
328 | if (obj.IsLoggingOut) | 328 | if (obj.SceneAgent.IsChildAgent) |
329 | { | 329 | return; |
330 | object sp = null; | ||
331 | if (obj.Scene.TryGetScenePresence(obj.AgentId, out sp)) | ||
332 | { | ||
333 | if (((ScenePresence)sp).IsChildAgent) | ||
334 | return; | ||
335 | } | ||
336 | 330 | ||
337 | // Let's find out if this is a foreign user or a local user | 331 | // Let's find out if this is a foreign user or a local user |
338 | IUserManagement uMan = Scene.RequestModuleInterface<IUserManagement>(); | 332 | IUserManagement uMan = Scene.RequestModuleInterface<IUserManagement>(); |
339 | // UserAccount account = Scene.UserAccountService.GetUserAccount(Scene.RegionInfo.ScopeID, obj.AgentId); | 333 | // UserAccount account = Scene.UserAccountService.GetUserAccount(Scene.RegionInfo.ScopeID, obj.AgentId); |
340 | if (uMan != null && uMan.IsLocalGridUser(obj.AgentId)) | ||
341 | { | ||
342 | // local grid user | ||
343 | return; | ||
344 | } | ||
345 | 334 | ||
346 | AgentCircuitData aCircuit = ((Scene)(obj.Scene)).AuthenticateHandler.GetAgentCircuitData(obj.CircuitCode); | 335 | if (uMan != null && uMan.IsLocalGridUser(obj.AgentId)) |
336 | { | ||
337 | // local grid user | ||
338 | return; | ||
339 | } | ||
347 | 340 | ||
348 | if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) | 341 | AgentCircuitData aCircuit = ((Scene)(obj.Scene)).AuthenticateHandler.GetAgentCircuitData(obj.CircuitCode); |
349 | { | 342 | |
350 | string url = aCircuit.ServiceURLs["HomeURI"].ToString(); | 343 | if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) |
351 | IUserAgentService security = new UserAgentServiceConnector(url); | 344 | { |
352 | security.LogoutAgent(obj.AgentId, obj.SessionId); | 345 | string url = aCircuit.ServiceURLs["HomeURI"].ToString(); |
353 | //m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Sent logout call to UserAgentService @ {0}", url); | 346 | IUserAgentService security = new UserAgentServiceConnector(url); |
354 | } | 347 | security.LogoutAgent(obj.AgentId, obj.SessionId); |
355 | else | 348 | //m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Sent logout call to UserAgentService @ {0}", url); |
349 | } | ||
350 | else | ||
351 | { | ||
356 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: HomeURI not found for agent {0} logout", obj.AgentId); | 352 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: HomeURI not found for agent {0} logout", obj.AgentId); |
357 | } | 353 | } |
358 | } | 354 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs index 4cf62ec..b0edce7 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs | |||
@@ -79,29 +79,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser | |||
79 | 79 | ||
80 | public void OnConnectionClose(IClientAPI client) | 80 | public void OnConnectionClose(IClientAPI client) |
81 | { | 81 | { |
82 | if (client.IsLoggingOut) | 82 | if (client.SceneAgent.IsChildAgent) |
83 | { | 83 | return; |
84 | object sp = null; | ||
85 | Vector3 position = new Vector3(128, 128, 0); | ||
86 | Vector3 lookat = new Vector3(0, 1, 0); | ||
87 | |||
88 | if (client.Scene.TryGetScenePresence(client.AgentId, out sp)) | ||
89 | { | ||
90 | if (sp is ScenePresence) | ||
91 | { | ||
92 | if (((ScenePresence)sp).IsChildAgent) | ||
93 | return; | ||
94 | |||
95 | position = ((ScenePresence)sp).AbsolutePosition; | ||
96 | lookat = ((ScenePresence)sp).Lookat; | ||
97 | } | ||
98 | } | ||
99 | |||
100 | // m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); | ||
101 | m_GridUserService.LoggedOut(client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, position, lookat); | ||
102 | } | ||
103 | 84 | ||
85 | // m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); | ||
86 | m_GridUserService.LoggedOut( | ||
87 | client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, | ||
88 | client.SceneAgent.AbsolutePosition, client.SceneAgent.Lookat); | ||
104 | } | 89 | } |
105 | |||
106 | } | 90 | } |
107 | } | 91 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs index b43745c..172bea1 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs | |||
@@ -79,7 +79,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence | |||
79 | 79 | ||
80 | public void OnConnectionClose(IClientAPI client) | 80 | public void OnConnectionClose(IClientAPI client) |
81 | { | 81 | { |
82 | if (client.IsLoggingOut && !client.SceneAgent.IsChildAgent) | 82 | if (!client.SceneAgent.IsChildAgent) |
83 | { | 83 | { |
84 | // m_log.DebugFormat("[PRESENCE DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); | 84 | // m_log.DebugFormat("[PRESENCE DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); |
85 | m_PresenceService.LogoutAgent(client.SessionId); | 85 | m_PresenceService.LogoutAgent(client.SessionId); |
diff --git a/OpenSim/Region/Framework/Scenes/AsyncInventorySender.cs b/OpenSim/Region/Framework/Scenes/AsyncInventorySender.cs index 9cb5674..d9d2e64 100644 --- a/OpenSim/Region/Framework/Scenes/AsyncInventorySender.cs +++ b/OpenSim/Region/Framework/Scenes/AsyncInventorySender.cs | |||
@@ -137,7 +137,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
137 | } | 137 | } |
138 | } | 138 | } |
139 | 139 | ||
140 | if (fh.Client.IsLoggingOut) | 140 | if (!fh.Client.IsActive) |
141 | continue; | 141 | continue; |
142 | 142 | ||
143 | // m_log.DebugFormat( | 143 | // m_log.DebugFormat( |