diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 29 |
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); |