From ed475f21eee93210f1cdfcb9a9778da91f2b1d38 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sun, 13 Sep 2009 18:28:45 -0400 Subject: * Use the BeginInvoke methodology instead of the FireAndForget methodology to try to mitigate a mono assert. Same functionality done a different way. --- .../Framework/Scenes/SceneCommunicationService.cs | 30 ++++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index b38148b..204c319 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -1412,10 +1412,25 @@ namespace OpenSim.Region.Framework.Scenes 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) + { + + // 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) { - Util.FireAndForget(delegate - { Thread.Sleep(10000); IMessageTransferModule im = initiatingScene.RequestModuleInterface(); if (im != null) @@ -1440,13 +1455,18 @@ 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); - /// + /// /// This Closes child agents on neighboring regions /// Calls an asynchronous method to do so.. so it doesn't lag the sim. /// -- cgit v1.1