From b56673c920603022fce9cb479b714f6fbd0f1311 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 8 Jun 2012 00:18:25 +0100 Subject: Fix bug with "kick user" reducing agent counts by 2 instead of 1. This is done by making the kick user command call IClientAPI.Close() rather than routing through Scene.IncomingCloseAgent(), which also called IClientAPI.Close() DisableSimulator for child agents is moved from IncomingCloseAgent() to RemoveClient(), this is not a functional change since IncomingCloseAgent() always ends up calling RemoveClient() --- OpenSim/Region/Framework/Scenes/Scene.cs | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 939c8fa..17503b1 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -940,7 +940,7 @@ namespace OpenSim.Region.Framework.Scenes else { m_log.InfoFormat( - "[INTERGRID]: Got notice about far away Region: {0} at ({1}, {2})", + "[SCENE]: Got notice about far away Region: {0} at ({1}, {2})", otherRegion.RegionName, otherRegion.RegionLocX, otherRegion.RegionLocY); } } @@ -3235,6 +3235,22 @@ namespace OpenSim.Region.Framework.Scenes { isChildAgent = avatar.IsChildAgent; + // Don't do this to root agents, it's not nice for the viewer + if (closeChildAgents && isChildAgent) + { + // Tell a single agent to disconnect from the region. + IEventQueue eq = RequestModuleInterface(); + if (eq != null) + { + eq.DisableSimulator(RegionInfo.RegionHandle, avatar.UUID); + } + else + { + avatar.ControllingClient.SendShutdownConnectionNotice(); + } + } + + // Only applies to root agents. if (avatar.ParentID != 0) { avatar.StandUp(); @@ -4033,19 +4049,6 @@ namespace OpenSim.Region.Framework.Scenes m_sceneGraph.removeUserCount(true); } - // Don't do this to root agents on logout, it's not nice for the viewer - if (presence.IsChildAgent) - { - // Tell a single agent to disconnect from the region. - IEventQueue eq = RequestModuleInterface(); - if (eq != null) - { - eq.DisableSimulator(RegionInfo.RegionHandle, agentID); - } - else - presence.ControllingClient.SendShutdownConnectionNotice(); - } - presence.ControllingClient.Close(); return true; } -- cgit v1.1