aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs23
1 files changed, 14 insertions, 9 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 688dfe4..402d3a5 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -681,10 +681,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
681 // 681 //
682 CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); 682 CheckThreatLevel(ThreatLevel.High, "osTeleportAgent");
683 683
684 TeleportAgent(agent, regionName, position, lookat); 684 TeleportAgent(agent, regionName, position, lookat, false);
685 } 685 }
686 686
687 private void TeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) 687 private void TeleportAgent(string agent, string regionName,
688 LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool relaxRestrictions)
688 { 689 {
689 m_host.AddScriptLPS(1); 690 m_host.AddScriptLPS(1);
690 UUID agentId = new UUID(); 691 UUID agentId = new UUID();
@@ -694,7 +695,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
694 if (presence != null) 695 if (presence != null)
695 { 696 {
696 // agent must be over owners land to avoid abuse 697 // agent must be over owners land to avoid abuse
697 if (m_host.OwnerID 698 if (relaxRestrictions ||
699 m_host.OwnerID
698 == World.LandChannel.GetLandObject( 700 == World.LandChannel.GetLandObject(
699 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) 701 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
700 { 702 {
@@ -728,10 +730,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
728 // 730 //
729 CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); 731 CheckThreatLevel(ThreatLevel.High, "osTeleportAgent");
730 732
731 TeleportAgent(agent, regionX, regionY, position, lookat); 733 TeleportAgent(agent, regionX, regionY, position, lookat, false);
732 } 734 }
733 735
734 private void TeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) 736 private void TeleportAgent(string agent, int regionX, int regionY,
737 LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool relaxRestrictions)
735 { 738 {
736 ulong regionHandle = Util.UIntsToLong(((uint)regionX * (uint)Constants.RegionSize), ((uint)regionY * (uint)Constants.RegionSize)); 739 ulong regionHandle = Util.UIntsToLong(((uint)regionX * (uint)Constants.RegionSize), ((uint)regionY * (uint)Constants.RegionSize));
737 740
@@ -742,8 +745,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
742 ScenePresence presence = World.GetScenePresence(agentId); 745 ScenePresence presence = World.GetScenePresence(agentId);
743 if (presence != null) 746 if (presence != null)
744 { 747 {
745 // agent must be over owners land to avoid abuse 748 // For osTeleportAgent, agent must be over owners land to avoid abuse
746 if (m_host.OwnerID 749 // For osTeleportOwner, this restriction isn't necessary
750 if (relaxRestrictions ||
751 m_host.OwnerID
747 == World.LandChannel.GetLandObject( 752 == World.LandChannel.GetLandObject(
748 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) 753 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
749 { 754 {
@@ -766,7 +771,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
766 // Threat level None because this is what can already be done with the World Map in the viewer 771 // Threat level None because this is what can already be done with the World Map in the viewer
767 CheckThreatLevel(ThreatLevel.None, "osTeleportOwner"); 772 CheckThreatLevel(ThreatLevel.None, "osTeleportOwner");
768 773
769 TeleportAgent(m_host.OwnerID.ToString(), regionName, position, lookat); 774 TeleportAgent(m_host.OwnerID.ToString(), regionName, position, lookat, true);
770 } 775 }
771 776
772 public void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) 777 public void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
@@ -778,7 +783,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
778 { 783 {
779 CheckThreatLevel(ThreatLevel.None, "osTeleportOwner"); 784 CheckThreatLevel(ThreatLevel.None, "osTeleportOwner");
780 785
781 TeleportAgent(m_host.OwnerID.ToString(), regionX, regionY, position, lookat); 786 TeleportAgent(m_host.OwnerID.ToString(), regionX, regionY, position, lookat, true);
782 } 787 }
783 788
784 // Functions that get information from the agent itself. 789 // Functions that get information from the agent itself.