make EnableChildAgent async from caller
parent
4a20760929
commit
722b3a6523
|
@ -1892,11 +1892,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
agent.Id0 = currentAgentCircuit.Id0;
|
agent.Id0 = currentAgentCircuit.Id0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Thread.Sleep(200); // the original delay that was at InformClientOfNeighbourAsync start
|
||||||
|
|
||||||
IPEndPoint external = region.ExternalEndPoint;
|
IPEndPoint external = region.ExternalEndPoint;
|
||||||
if (external != null)
|
if (external != null)
|
||||||
{
|
{
|
||||||
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
|
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
|
||||||
d.BeginInvoke(sp, agent, region, external, true,true,
|
d.BeginInvoke(sp, agent, region, external, true,
|
||||||
InformClientOfNeighbourCompleted,
|
InformClientOfNeighbourCompleted,
|
||||||
d);
|
d);
|
||||||
}
|
}
|
||||||
|
@ -1906,7 +1908,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
#region Enable Child Agents
|
#region Enable Child Agents
|
||||||
|
|
||||||
private delegate void InformClientOfNeighbourDelegate(
|
private delegate void InformClientOfNeighbourDelegate(
|
||||||
ScenePresence avatar, AgentCircuitData a, GridRegion reg, IPEndPoint endPoint, bool newAgent, bool doInitialDelay);
|
ScenePresence avatar, AgentCircuitData a, GridRegion reg, IPEndPoint endPoint, bool newAgent);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This informs all neighbouring regions about agent "avatar".
|
/// This informs all neighbouring regions about agent "avatar".
|
||||||
|
@ -2020,9 +2022,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
//avatar.Scene.DumpChildrenSeeds(avatar.UUID);
|
//avatar.Scene.DumpChildrenSeeds(avatar.UUID);
|
||||||
//avatar.DumpKnownRegions();
|
//avatar.DumpKnownRegions();
|
||||||
|
|
||||||
bool newAgent = false;
|
Util.FireAndForget(delegate
|
||||||
|
{
|
||||||
|
Thread.Sleep(200); // the original delay that was at InformClientOfNeighbourAsync start
|
||||||
int count = 0;
|
int count = 0;
|
||||||
bool delay = true;
|
bool newAgent = false;
|
||||||
|
|
||||||
foreach (GridRegion neighbour in neighbours)
|
foreach (GridRegion neighbour in neighbours)
|
||||||
{
|
{
|
||||||
//m_log.WarnFormat("--> Going to send child agent to {0}", neighbour.RegionName);
|
//m_log.WarnFormat("--> Going to send child agent to {0}", neighbour.RegionName);
|
||||||
|
@ -2037,16 +2042,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Let's put this back at sync, so that it doesn't clog
|
InformClientOfNeighbourAsync(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent);
|
||||||
// the network, especially for regions in the same physical server.
|
|
||||||
// We're really not in a hurry here.
|
|
||||||
InformClientOfNeighbourAsync(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent, delay);
|
|
||||||
delay = false; // ugly i know.. but there aren't that many neighbours
|
|
||||||
|
|
||||||
//InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
|
|
||||||
//d.BeginInvoke(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent,
|
|
||||||
// InformClientOfNeighbourCompleted,
|
|
||||||
// d);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (ArgumentOutOfRangeException)
|
catch (ArgumentOutOfRangeException)
|
||||||
|
@ -2073,11 +2069,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
// XXX: Well, decided to swallow the exception instead for now. Let us see how that goes.
|
// XXX: Well, decided to swallow the exception instead for now. Let us see how that goes.
|
||||||
// throw e;
|
// throw e;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector3 CalculateOffset(ScenePresence sp, GridRegion neighbour)
|
Vector3 CalculateOffset(ScenePresence sp, GridRegion neighbour)
|
||||||
|
@ -2109,13 +2105,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
/// <param name="regionHandle"></param>
|
/// <param name="regionHandle"></param>
|
||||||
/// <param name="endPoint"></param>
|
/// <param name="endPoint"></param>
|
||||||
private void InformClientOfNeighbourAsync(ScenePresence sp, AgentCircuitData a, GridRegion reg,
|
private void InformClientOfNeighbourAsync(ScenePresence sp, AgentCircuitData a, GridRegion reg,
|
||||||
IPEndPoint endPoint, bool newAgent,bool doinitialdelay)
|
IPEndPoint endPoint, bool newAgent)
|
||||||
{
|
{
|
||||||
// Let's wait just a little to give time to originating regions to catch up with closing child agents
|
|
||||||
// after a cross here
|
|
||||||
if(doinitialdelay)
|
|
||||||
Thread.Sleep(500);
|
|
||||||
|
|
||||||
Scene scene = sp.Scene;
|
Scene scene = sp.Scene;
|
||||||
|
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
|
|
Loading…
Reference in New Issue