aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-09-07 23:55:41 +0100
committerJustin Clark-Casey (justincc)2011-09-07 23:55:41 +0100
commit08bd16285d3b9e2be8f76db17ac7cd7a861ae817 (patch)
tree5521929f9457392089d1bfdc1c24e556c27c59c2 /OpenSim/Region/ScriptEngine/Shared
parentWhen a region is added to the HG Inventory Broker, also pass this through to ... (diff)
downloadopensim-SC_OLD-08bd16285d3b9e2be8f76db17ac7cd7a861ae817.zip
opensim-SC_OLD-08bd16285d3b9e2be8f76db17ac7cd7a861ae817.tar.gz
opensim-SC_OLD-08bd16285d3b9e2be8f76db17ac7cd7a861ae817.tar.bz2
opensim-SC_OLD-08bd16285d3b9e2be8f76db17ac7cd7a861ae817.tar.xz
When invoking any of the OSSL teleport functions, do it on a separate thread rather than the script thread.
This is to prevent the aborting of attachment script threads on teleport from aborting the one actually doing the teleport. This allows OSSL teleport functions to work when invoked on scripts in attachments (and huds, I assume)
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs19
1 files changed, 13 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 3ddd79b..e1c837e 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -703,9 +703,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
703 == World.LandChannel.GetLandObject( 703 == World.LandChannel.GetLandObject(
704 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) 704 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
705 { 705 {
706 World.RequestTeleportLocation(presence.ControllingClient, regionName, 706 // We will launch the teleport on a new thread so that when the script threads are terminated
707 new Vector3((float)position.x, (float)position.y, (float)position.z), 707 // before teleport in ScriptInstance.GetXMLState(), we don't end up aborting the one doing the teleporting.
708 new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation); 708 Util.FireAndForget(
709 o => World.RequestTeleportLocation(presence.ControllingClient, regionName,
710 new Vector3((float)position.x, (float)position.y, (float)position.z),
711 new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation));
709 712
710 ScriptSleep(5000); 713 ScriptSleep(5000);
711 } 714 }
@@ -741,9 +744,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
741 == World.LandChannel.GetLandObject( 744 == World.LandChannel.GetLandObject(
742 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) 745 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
743 { 746 {
744 World.RequestTeleportLocation(presence.ControllingClient, regionHandle, 747 // We will launch the teleport on a new thread so that when the script threads are terminated
745 new Vector3((float)position.x, (float)position.y, (float)position.z), 748 // before teleport in ScriptInstance.GetXMLState(), we don't end up aborting the one doing the teleporting.
746 new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation); 749 Util.FireAndForget(
750 o => World.RequestTeleportLocation(presence.ControllingClient, regionHandle,
751 new Vector3((float)position.x, (float)position.y, (float)position.z),
752 new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation));
753
747 ScriptSleep(5000); 754 ScriptSleep(5000);
748 } 755 }
749 } 756 }