aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-06-12 02:43:33 +0100
committerJustin Clark-Casey (justincc)2012-06-12 02:43:33 +0100
commit1b1f0a2d77fb4d2ac572f16c71a7560860c8c040 (patch)
tree2e18738453d51b8a551ba5f9ba7a0cada4cff62c /OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
parentSet IClientAPI.IsActive = false early on client removal due to ack timeout ra... (diff)
downloadopensim-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 '')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs46
1 files changed, 21 insertions, 25 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 }