mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 02:36:00 +08:00
do agent crossing async, including QUERYACCESS ( need to check vehicles for
this also ), so it doesn't stop heartbeat
This commit is contained in:
@@ -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!
|
||||
|
||||
Reference in New Issue
Block a user