aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
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
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 '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs29
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs5
3 files changed, 35 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);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index a8d98dc..79b30c7 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -66,6 +66,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
66 66
67 // Teleport commands 67 // Teleport commands
68 void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); 68 void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
69 void osTeleportAgent(string agent, uint regionX, uint regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
69 void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); 70 void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
70 71
71 // Animation commands 72 // Animation commands
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 01b2d86..3817a07 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -131,6 +131,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
131 m_OSSL_Functions.osTeleportAgent(agent, regionName, position, lookat); 131 m_OSSL_Functions.osTeleportAgent(agent, regionName, position, lookat);
132 } 132 }
133 133
134 public void osTeleportAgent(string agent, long regionX, long regionY, vector position, vector lookat)
135 {
136 m_OSSL_Functions.osTeleportAgent(agent, (uint) regionX, (uint) regionY, position, lookat);
137 }
138
134 public void osTeleportAgent(string agent, vector position, vector lookat) 139 public void osTeleportAgent(string agent, vector position, vector lookat)
135 { 140 {
136 m_OSSL_Functions.osTeleportAgent(agent, position, lookat); 141 m_OSSL_Functions.osTeleportAgent(agent, position, lookat);