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; 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 * Object-related communications
*/ */

View File

@ -253,6 +253,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return false; 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) public bool CloseAgent(GridRegion destination, UUID id)
{ {

View File

@ -67,6 +67,14 @@ namespace OpenSim.Region.Framework.Interfaces
/// <returns></returns> /// <returns></returns>
bool SendReleaseAgent(ulong regionHandle, UUID id, string uri); 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> /// <summary>
/// Close agent. /// Close agent.
/// </summary> /// </summary>

View File

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

View File

@ -281,7 +281,7 @@ namespace OpenSim.Region.Framework.Scenes
uint x = 0, y = 0; uint x = 0, y = 0;
Utils.LongToUInts(regionHandle, out x, out y); Utils.LongToUInts(regionHandle, out x, out y);
GridRegion destination = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)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) private void SendCloseChildAgentCompleted(IAsyncResult iar)

View File

@ -108,6 +108,11 @@ namespace OpenSim.Server.Handlers.Simulation
DoAgentDelete(request, responsedata, agentID, action, regionID); DoAgentDelete(request, responsedata, agentID, action, regionID);
return responsedata; return responsedata;
} }
else if (method.Equals("DELETECHILD"))
{
DoChildAgentDelete(request, responsedata, agentID, action, regionID);
return responsedata;
}
else else
{ {
m_log.InfoFormat("[AGENT HANDLER]: method {0} not supported in agent message", method); 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) protected void DoAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID)
{ {
m_log.Debug(" >>> DoDelete action:" + action + "; RegionID:" + regionID); m_log.Debug(" >>> DoDelete action:" + action + "; RegionID:" + regionID);

View File

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

View File

@ -70,6 +70,14 @@ namespace OpenSim.Services.Interfaces
/// <returns></returns> /// <returns></returns>
bool ReleaseAgent(UUID originRegion, UUID id, string uri); 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> /// <summary>
/// Close agent. /// Close agent.
/// </summary> /// </summary>