aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
authorCharles Krinke2009-02-01 17:41:33 +0000
committerCharles Krinke2009-02-01 17:41:33 +0000
commit50536c66a0f2e72d68df25c84a2286337dd9b357 (patch)
treeb08d791649187c671a0e76e27f251d5f98e54390 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation
parent* Adding a few fields to the Land data responder that the client is complaini... (diff)
downloadopensim-SC_OLD-50536c66a0f2e72d68df25c84a2286337dd9b357.zip
opensim-SC_OLD-50536c66a0f2e72d68df25c84a2286337dd9b357.tar.gz
opensim-SC_OLD-50536c66a0f2e72d68df25c84a2286337dd9b357.tar.bz2
opensim-SC_OLD-50536c66a0f2e72d68df25c84a2286337dd9b357.tar.xz
Thank you kindly, TLaukkan (Tommil) for a patch that:
Added osTeleportAgent with region coordinates to support hyper grid scripted teleports.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 9e76ee2..3e7ffab 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -513,6 +513,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
513 } 513 }
514 } 514 }
515 515
516 // Teleport functions
517 public void osTeleportAgent(string agent, uint regionX, uint regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
518 {
519 // High because there is no security check. High griefer potential
520 //
521 CheckThreatLevel(ThreatLevel.High, "osTeleportAgent");
522
523 ulong regionHandle = Util.UIntsToLong((regionX * (uint)Constants.RegionSize), (regionY * (uint)Constants.RegionSize));
524
525 m_host.AddScriptLPS(1);
526 UUID agentId = new UUID();
527 if (UUID.TryParse(agent, out agentId))
528 {
529 ScenePresence presence = World.GetScenePresence(agentId);
530 if (presence != null)
531 {
532 // agent must be over owners land to avoid abuse
533 if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y))
534 {
535 presence.ControllingClient.SendTeleportLocationStart();
536 World.RequestTeleportLocation(presence.ControllingClient, regionHandle,
537 new Vector3((float)position.x, (float)position.y, (float)position.z),
538 new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation);
539 ScriptSleep(5000);
540 }
541 }
542 }
543 }
544
516 public void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) 545 public void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
517 { 546 {
518 osTeleportAgent(agent, World.RegionInfo.RegionName, position, lookat); 547 osTeleportAgent(agent, World.RegionInfo.RegionName, position, lookat);