diff options
Add osTeleportOwner.
This provides the same functionality as osTeleportAgent but without the griefing potential. Region owners need not be concerned about the use of this function because it only allows to do what is already possible with the world map.
The intended use is with HUDs. For example, a list of (hypergrid) destinations could be made available for quick access.
Signed-off-by: Melanie <melanie@t-data.com>
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 8a98be7..0b787d8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -639,6 +639,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
639 | // | 639 | // |
640 | CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); | 640 | CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); |
641 | 641 | ||
642 | TeleportAgent(agent, regionName, position, lookat); | ||
643 | } | ||
644 | |||
645 | private void TeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) | ||
646 | { | ||
642 | m_host.AddScriptLPS(1); | 647 | m_host.AddScriptLPS(1); |
643 | UUID agentId = new UUID(); | 648 | UUID agentId = new UUID(); |
644 | if (UUID.TryParse(agent, out agentId)) | 649 | if (UUID.TryParse(agent, out agentId)) |
@@ -651,7 +656,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
651 | == World.LandChannel.GetLandObject( | 656 | == World.LandChannel.GetLandObject( |
652 | presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) | 657 | presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) |
653 | { | 658 | { |
654 | |||
655 | // Check for hostname , attempt to make a hglink | 659 | // Check for hostname , attempt to make a hglink |
656 | // and convert the regionName to the target region | 660 | // and convert the regionName to the target region |
657 | if (regionName.Contains(".") && regionName.Contains(":")) | 661 | if (regionName.Contains(".") && regionName.Contains(":")) |
@@ -674,13 +678,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
674 | } | 678 | } |
675 | } | 679 | } |
676 | 680 | ||
677 | // Teleport functions | ||
678 | public void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) | 681 | public void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) |
679 | { | 682 | { |
680 | // High because there is no security check. High griefer potential | 683 | // High because there is no security check. High griefer potential |
681 | // | 684 | // |
682 | CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); | 685 | CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); |
683 | 686 | ||
687 | TeleportAgent(agent, regionX, regionY, position, lookat); | ||
688 | } | ||
689 | |||
690 | private void TeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) | ||
691 | { | ||
684 | ulong regionHandle = Util.UIntsToLong(((uint)regionX * (uint)Constants.RegionSize), ((uint)regionY * (uint)Constants.RegionSize)); | 692 | ulong regionHandle = Util.UIntsToLong(((uint)regionX * (uint)Constants.RegionSize), ((uint)regionY * (uint)Constants.RegionSize)); |
685 | 693 | ||
686 | m_host.AddScriptLPS(1); | 694 | m_host.AddScriptLPS(1); |
@@ -709,6 +717,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
709 | osTeleportAgent(agent, World.RegionInfo.RegionName, position, lookat); | 717 | osTeleportAgent(agent, World.RegionInfo.RegionName, position, lookat); |
710 | } | 718 | } |
711 | 719 | ||
720 | public void osTeleportOwner(string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) | ||
721 | { | ||
722 | // Threat level None because this is what can already be done with the World Map in the viewer | ||
723 | CheckThreatLevel(ThreatLevel.None, "osTeleportOwner"); | ||
724 | |||
725 | TeleportAgent(m_host.OwnerID.ToString(), regionName, position, lookat); | ||
726 | } | ||
727 | |||
728 | public void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) | ||
729 | { | ||
730 | osTeleportOwner(World.RegionInfo.RegionName, position, lookat); | ||
731 | } | ||
732 | |||
733 | public void osTeleportOwner(int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) | ||
734 | { | ||
735 | CheckThreatLevel(ThreatLevel.None, "osTeleportOwner"); | ||
736 | |||
737 | TeleportAgent(m_host.OwnerID.ToString(), regionX, regionY, position, lookat); | ||
738 | } | ||
739 | |||
712 | // Functions that get information from the agent itself. | 740 | // Functions that get information from the agent itself. |
713 | // | 741 | // |
714 | // osGetAgentIP - this is used to determine the IP address of | 742 | // osGetAgentIP - this is used to determine the IP address of |