Fix to the scenario where we send an agent to a neighbouring sim (via teleport), then tell our neighbours to close the agents.. thereby disconnecting the user. Added a new CloseChildAgent method in lieu of CloseAgent. This has been a long standing problem - with any luck this will cure it.

avinationmerge
Tom Grimshaw 2010-05-18 03:24:43 -07:00
parent ed1cfb5245
commit 1c040d8c1e
8 changed files with 103 additions and 7 deletions

View File

@ -290,6 +290,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return false;
}
public bool CloseChildAgent(GridRegion destination, UUID id)
{
if (destination == null)
return false;
foreach (Scene s in m_sceneList)
{
if (s.RegionInfo.RegionID == destination.RegionID)
{
//m_log.Debug("[LOCAL COMMS]: Found region to SendCloseAgent");
return s.IncomingCloseChildAgent(id);
}
}
//m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent");
return false;
}
/**
* Object-related communications
*/

View File

@ -253,6 +253,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return false;
}
public bool CloseChildAgent(GridRegion destination, UUID id)
{
if (destination == null)
return false;
// Try local first
if (m_localBackend.CloseChildAgent(destination, id))
return true;
// else do the remote thing
if (!m_localBackend.IsLocalRegion(destination.RegionHandle))
return m_remoteConnector.CloseChildAgent(destination, id);
return false;
}
public bool CloseAgent(GridRegion destination, UUID id)
{

View File

@ -67,6 +67,14 @@ namespace OpenSim.Region.Framework.Interfaces
/// <returns></returns>
bool SendReleaseAgent(ulong regionHandle, UUID id, string uri);
/// <summary>
/// Close chid agent.
/// </summary>
/// <param name="regionHandle"></param>
/// <param name="id"></param>
/// <returns></returns>
bool SendCloseChildAgent(ulong regionHandle, UUID id);
/// <summary>
/// Close agent.
/// </summary>

View File

@ -3914,12 +3914,22 @@ namespace OpenSim.Region.Framework.Scenes
return false;
}
public bool IncomingCloseAgent(UUID agentID)
{
return IncomingCloseAgent(agentID, false);
}
public bool IncomingCloseChildAgent(UUID agentID)
{
return IncomingCloseAgent(agentID, true);
}
/// <summary>
/// Tell a single agent to disconnect from the region.
/// </summary>
/// <param name="regionHandle"></param>
/// <param name="agentID"></param>
public bool IncomingCloseAgent(UUID agentID)
/// <param name="childOnly"></param>
public bool IncomingCloseAgent(UUID agentID, bool childOnly)
{
//m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID);
@ -3931,7 +3941,7 @@ namespace OpenSim.Region.Framework.Scenes
{
m_sceneGraph.removeUserCount(false);
}
else
else if (!childOnly)
{
m_sceneGraph.removeUserCount(true);
}
@ -3947,9 +3957,12 @@ namespace OpenSim.Region.Framework.Scenes
}
else
presence.ControllingClient.SendShutdownConnectionNotice();
}
presence.ControllingClient.Close();
}
else if (!childOnly)
{
presence.ControllingClient.Close();
}
return true;
}

View File

@ -281,7 +281,7 @@ namespace OpenSim.Region.Framework.Scenes
uint x = 0, y = 0;
Utils.LongToUInts(regionHandle, out x, out y);
GridRegion destination = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
m_scene.SimulationService.CloseAgent(destination, agentID);
m_scene.SimulationService.CloseChildAgent(destination, agentID);
}
private void SendCloseChildAgentCompleted(IAsyncResult iar)

View File

@ -108,6 +108,11 @@ namespace OpenSim.Server.Handlers.Simulation
DoAgentDelete(request, responsedata, agentID, action, regionID);
return responsedata;
}
else if (method.Equals("DELETECHILD"))
{
DoChildAgentDelete(request, responsedata, agentID, action, regionID);
return responsedata;
}
else
{
m_log.InfoFormat("[AGENT HANDLER]: method {0} not supported in agent message", method);
@ -320,6 +325,24 @@ namespace OpenSim.Server.Handlers.Simulation
}
}
protected void DoChildAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID)
{
m_log.Debug(" >>> DoChildAgentDelete action:" + action + "; RegionID:" + regionID);
GridRegion destination = new GridRegion();
destination.RegionID = regionID;
if (action.Equals("release"))
ReleaseAgent(regionID, id);
else
m_SimulationService.CloseChildAgent(destination, id);
responsedata["int_response_code"] = HttpStatusCode.OK;
responsedata["str_response_string"] = "OpenSim agent " + id.ToString();
m_log.Debug("[AGENT HANDLER]: Child Agent Released/Deleted.");
}
protected void DoAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID)
{
m_log.Debug(" >>> DoDelete action:" + action + "; RegionID:" + regionID);

View File

@ -442,7 +442,7 @@ namespace OpenSim.Services.Connectors.Simulation
return true;
}
public bool CloseAgent(GridRegion destination, UUID id)
private bool CloseAgent(GridRegion destination, UUID id, bool ChildOnly)
{
string uri = string.Empty;
try
@ -459,6 +459,8 @@ namespace OpenSim.Services.Connectors.Simulation
WebRequest request = WebRequest.Create(uri);
request.Method = "DELETE";
if (ChildOnly)
request.Method += "CHILD";
request.Timeout = 10000;
StreamReader sr = null;
@ -491,6 +493,16 @@ namespace OpenSim.Services.Connectors.Simulation
return true;
}
public bool CloseChildAgent(GridRegion destination, UUID id)
{
return CloseAgent(destination, id, true);
}
public bool CloseAgent(GridRegion destination, UUID id)
{
return CloseAgent(destination, id, false);
}
#endregion Agents
#region Objects

View File

@ -70,6 +70,14 @@ namespace OpenSim.Services.Interfaces
/// <returns></returns>
bool ReleaseAgent(UUID originRegion, UUID id, string uri);
/// <summary>
/// Close child agent.
/// </summary>
/// <param name="regionHandle"></param>
/// <param name="id"></param>
/// <returns></returns>
bool CloseChildAgent(GridRegion destination, UUID id);
/// <summary>
/// Close agent.
/// </summary>