diff options
author | Marck | 2010-11-15 19:52:39 +0100 |
---|---|---|
committer | Melanie | 2010-11-16 13:43:27 +0000 |
commit | 50202bab7c76782af782949922a4c6b73868ec54 (patch) | |
tree | 920d0f42d6004eecf53220f0213c63cde99616e7 /OpenSim/Region | |
parent | Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC_OLD-50202bab7c76782af782949922a4c6b73868ec54.zip opensim-SC_OLD-50202bab7c76782af782949922a4c6b73868ec54.tar.gz opensim-SC_OLD-50202bab7c76782af782949922a4c6b73868ec54.tar.bz2 opensim-SC_OLD-50202bab7c76782af782949922a4c6b73868ec54.tar.xz |
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')
3 files changed, 48 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 |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 630821b..c9a24f6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -86,6 +86,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
86 | void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); | 86 | void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); |
87 | void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); | 87 | void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); |
88 | void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); | 88 | void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); |
89 | void osTeleportOwner(string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); | ||
90 | void osTeleportOwner(int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); | ||
91 | void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); | ||
89 | 92 | ||
90 | // Animation commands | 93 | // Animation commands |
91 | void osAvatarPlayAnimation(string avatar, string animation); | 94 | void osAvatarPlayAnimation(string avatar, string animation); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index e289554..370bf1d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -227,6 +227,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
227 | m_OSSL_Functions.osTeleportAgent(agent, position, lookat); | 227 | m_OSSL_Functions.osTeleportAgent(agent, position, lookat); |
228 | } | 228 | } |
229 | 229 | ||
230 | public void osTeleportOwner(string regionName, vector position, vector lookat) | ||
231 | { | ||
232 | m_OSSL_Functions.osTeleportOwner(regionName, position, lookat); | ||
233 | } | ||
234 | |||
235 | public void osTeleportOwner(int regionX, int regionY, vector position, vector lookat) | ||
236 | { | ||
237 | m_OSSL_Functions.osTeleportOwner(regionX, regionY, position, lookat); | ||
238 | } | ||
239 | |||
240 | public void osTeleportOwner(vector position, vector lookat) | ||
241 | { | ||
242 | m_OSSL_Functions.osTeleportOwner(position, lookat); | ||
243 | } | ||
244 | |||
230 | // Avatar info functions | 245 | // Avatar info functions |
231 | public string osGetAgentIP(string agent) | 246 | public string osGetAgentIP(string agent) |
232 | { | 247 | { |