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()
0.7.3-extended
Justin Clark-Casey (justincc) 2012-06-08 00:18:25 +01:00
parent d30d68657e
commit 78c2ef2346
3 changed files with 24 additions and 22 deletions

View File

@ -486,10 +486,10 @@ namespace OpenSim
else
presence.ControllingClient.Kick("\nThe OpenSim manager kicked you out.\n");
// ...and close on our side
presence.Scene.IncomingCloseAgent(presence.UUID);
presence.ControllingClient.Close();
}
}
MainConsole.Instance.Output("");
}

View File

@ -920,7 +920,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);
}
}
@ -3215,6 +3215,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<IEventQueue>();
if (eq != null)
{
eq.DisableSimulator(RegionInfo.RegionHandle, avatar.UUID);
}
else
{
avatar.ControllingClient.SendShutdownConnectionNotice();
}
}
// Only applies to root agents.
if (avatar.ParentID != 0)
{
avatar.StandUp();
@ -3995,19 +4011,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<IEventQueue>();
if (eq != null)
{
eq.DisableSimulator(RegionInfo.RegionHandle, agentID);
}
else
presence.ControllingClient.SendShutdownConnectionNotice();
}
presence.ControllingClient.Close();
return true;
}

View File

@ -84,16 +84,16 @@ namespace OpenSim.Region.Framework.Scenes
if (neighbourService != null)
neighbour = neighbourService.HelloNeighbour(regionhandle, region);
else
m_log.DebugFormat("[SCS]: No neighbour service provided for informing neigbhours of this region");
m_log.DebugFormat("[SCENE COMMUNICATION SERVICE]: No neighbour service provided for informing neigbhours of this region");
if (neighbour != null)
{
m_log.DebugFormat("[INTERGRID]: Successfully informed neighbour {0}-{1} that I'm here", x / Constants.RegionSize, y / Constants.RegionSize);
m_log.DebugFormat("[SCENE COMMUNICATION SERVICE]: Successfully informed neighbour {0}-{1} that I'm here", x / Constants.RegionSize, y / Constants.RegionSize);
m_scene.EventManager.TriggerOnRegionUp(neighbour);
}
else
{
m_log.InfoFormat("[INTERGRID]: Failed to inform neighbour {0}-{1} that I'm here.", x / Constants.RegionSize, y / Constants.RegionSize);
m_log.InfoFormat("[SCENE COMMUNICATION SERVICE]: Failed to inform neighbour {0}-{1} that I'm here.", x / Constants.RegionSize, y / Constants.RegionSize);
}
}
@ -102,7 +102,7 @@ namespace OpenSim.Region.Framework.Scenes
//m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
List<GridRegion> neighbours = m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID);
m_log.DebugFormat("[INTERGRID]: Informing {0} neighbours that this region is up", neighbours.Count);
m_log.DebugFormat("[SCENE COMMUNICATION SERVICE]: Informing {0} neighbours that this region is up", neighbours.Count);
foreach (GridRegion n in neighbours)
{
InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync;
@ -195,8 +195,7 @@ namespace OpenSim.Region.Framework.Scenes
GridRegion destination = m_scene.GridService.GetRegionByPosition(m_regionInfo.ScopeID, (int)x, (int)y);
m_log.DebugFormat(
"[INTERGRID]: Sending close agent {0} to region at {1}-{2}",
agentID, destination.RegionCoordX, destination.RegionCoordY);
"[SCENE COMMUNICATION SERVICE]: Sending close agent ID {0} to {1}", agentID, destination.RegionName);
m_scene.SimulationService.CloseAgent(destination, agentID);
}