do agent crossing async, including QUERYACCESS ( need to check vehicles for

this also ), so it doesn't stop heartbeat
This commit is contained in:
UbitUmarov
2014-10-21 11:57:47 +01:00
parent afa9b4a002
commit 59413adcee
3 changed files with 56 additions and 10 deletions

View File

@@ -1510,6 +1510,30 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
public bool Cross(ScenePresence agent, bool isFlying)
{
agent.IsInTransit = true;
CrossAsyncDelegate d = CrossAsync;
d.BeginInvoke(agent, isFlying, CrossCompleted, d);
return true;
}
private void CrossCompleted(IAsyncResult iar)
{
CrossAsyncDelegate icon = (CrossAsyncDelegate)iar.AsyncState;
ScenePresence agent = icon.EndInvoke(iar);
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname);
if(!agent.IsChildAgent)
{
// crossing failed
agent.CrossToNewRegionFail();
}
agent.IsInTransit = false;
}
public ScenePresence CrossAsync(ScenePresence agent, bool isFlying)
{
uint x;
uint y;
@@ -1525,16 +1549,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (reason == String.Empty)
agent.ControllingClient.SendAlertMessage("Cannot cross to region");
else
agent.ControllingClient.SendAlertMessage("Cannot cross to region: " + reason);
return false;
agent.ControllingClient.SendAlertMessage("Cannot cross to region: " + reason);
return agent;
}
agent.IsInTransit = true;
// agent.IsInTransit = true;
CrossAgentToNewRegionDelegate d = CrossAgentToNewRegionAsync;
d.BeginInvoke(agent, newpos, neighbourRegion, isFlying, version, CrossAgentToNewRegionCompleted, d);
return true;
CrossAgentToNewRegionAsync(agent, newpos, neighbourRegion, isFlying, version);
agent.IsInTransit = false;
return agent;
}
@@ -1787,8 +1810,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
agent.CloseChildAgents(neighbourx, neighboury);
// the user may change their profile information in other region,
// so the userinfo in UserProfileCache is not reliable any more, delete it
// REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE!