* Use the BeginInvoke methodology instead of the FireAndForget methodology to try to mitigate a mono assert. Same functionality done a different way.

remotes/origin/0.6.7-post-fixes
Teravus Ovares (Dan Olivares) 2009-09-13 18:28:45 -04:00
parent 3562d75c17
commit ed475f21ee
1 changed files with 25 additions and 5 deletions

View File

@ -1412,9 +1412,24 @@ namespace OpenSim.Region.Framework.Scenes
d.BeginInvoke(agent, newpos, neighbourx, neighboury, isFlying, CrossAgentToNewRegionCompleted, d); d.BeginInvoke(agent, newpos, neighbourx, neighboury, isFlying, CrossAgentToNewRegionCompleted, d);
} }
public void InformClientToInitateTeleportToLocation(ScenePresence agent, uint regionX, uint regionY, Vector3 position, Scene initiatingScene) public delegate void InformClientToInitateTeleportToLocationDelegate(ScenePresence agent, uint regionX, uint regionY,
Vector3 position,
Scene initiatingScene);
public void InformClientToInitateTeleportToLocation(ScenePresence agent, uint regionX, uint regionY, Vector3 position,
Scene initiatingScene)
{ {
Util.FireAndForget(delegate
// This assumes that we know what our neighbors are.
InformClientToInitateTeleportToLocationDelegate d = InformClientToInitiateTeleportToLocationAsync;
d.BeginInvoke(agent,regionX,regionY,position,initiatingScene,
InformClientToInitiateTeleportToLocationCompleted,
d);
}
public void InformClientToInitiateTeleportToLocationAsync(ScenePresence agent, uint regionX, uint regionY, Vector3 position,
Scene initiatingScene)
{ {
Thread.Sleep(10000); Thread.Sleep(10000);
IMessageTransferModule im = initiatingScene.RequestModuleInterface<IMessageTransferModule>(); IMessageTransferModule im = initiatingScene.RequestModuleInterface<IMessageTransferModule>();
@ -1440,8 +1455,13 @@ namespace OpenSim.Region.Framework.Scenes
}); });
} }
}
}); private void InformClientToInitiateTeleportToLocationCompleted(IAsyncResult iar)
{
InformClientToInitateTeleportToLocationDelegate icon =
(InformClientToInitateTeleportToLocationDelegate) iar.AsyncState;
icon.EndInvoke(iar);
} }
public delegate ScenePresence CrossAgentToNewRegionDelegate(ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, bool isFlying); public delegate ScenePresence CrossAgentToNewRegionDelegate(ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, bool isFlying);