aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs47
1 files changed, 36 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index f49d072..8c808ab 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -706,17 +706,42 @@ namespace OpenSim.Region.Framework.Scenes
706 { 706 {
707 m_log.DebugFormat( 707 m_log.DebugFormat(
708 "[SCENE COMMUNICATION SERVICE]: RequestTeleportToLocation {0} within {1}", 708 "[SCENE COMMUNICATION SERVICE]: RequestTeleportToLocation {0} within {1}",
709 position, m_regionInfo.RegionName); 709 position, m_regionInfo.RegionName);
710 710
711 // Teleport within the same region 711 // Teleport within the same region
712 if (IsOutsideRegion(avatar.Scene, position) || position.Z < 0) 712 if (IsOutsideRegion(avatar.Scene, position) || position.Z < 0)
713 { 713 {
714 Vector3 emergencyPos = new Vector3(128, 128, 128); 714 Vector3 emergencyPos = new Vector3(128, 128, 128);
715 715
716 m_log.WarnFormat( 716 m_log.WarnFormat(
717 "[SCENE COMMUNICATION SERVICE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", 717 "[SCENE COMMUNICATION SERVICE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}",
718 position, avatar.Name, avatar.UUID, emergencyPos); 718 position, avatar.Name, avatar.UUID, emergencyPos);
719 position = emergencyPos; 719 position = emergencyPos;
720 }
721
722 Vector3 currentPos = avatar.AbsolutePosition;
723 ILandObject srcLand = m_scene.LandChannel.GetLandObject(currentPos.X, currentPos.Y);
724 ILandObject destLand = m_scene.LandChannel.GetLandObject(position.X, position.Y);
725 if (srcLand != null && destLand != null && (teleportFlags & (uint)TeleportFlags.ViaLure) == 0 && (teleportFlags & (uint)TeleportFlags.ViaGodlikeLure) == 0)
726 {
727 if (srcLand.LandData.LocalID == destLand.LandData.LocalID)
728 {
729 //TPing within the same parcel. If the landing point is restricted, block the TP.
730 //Don't restrict gods, estate managers, or land owners to the TP point. This behaviour mimics agni.
731 if (destLand.LandData.LandingType == (byte)1 && destLand.LandData.UserLocation != Vector3.Zero && avatar.GodLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar.UUID) && destLand.LandData.OwnerID != avatar.UUID)
732 {
733 avatar.ControllingClient.SendAgentAlertMessage("Can't TP to the destination; landing point set.", false);
734 position = currentPos;
735 }
736 }
737 else
738 {
739 //Tping to a different parcel. Respect the landing point on the destination parcel.
740 if (destLand.LandData.LandingType == (byte)1 && destLand.LandData.UserLocation != Vector3.Zero && avatar.GodLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar.UUID) && destLand.LandData.OwnerID != avatar.UUID)
741 {
742 position = destLand.LandData.UserLocation;
743 }
744 }
720 } 745 }
721 746
722 // TODO: Get proper AVG Height 747 // TODO: Get proper AVG Height