aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorCasperW2009-12-26 18:14:12 +0100
committerCasperW2009-12-26 18:14:12 +0100
commit7371c7662a05d2c1dae1c110905817bb873cf934 (patch)
tree86e5ff0320631f8d400ff5a6ea902dd740fc4040
parentAdd a debugger tag to stop Visual Studio from breaking (diff)
downloadopensim-SC_OLD-7371c7662a05d2c1dae1c110905817bb873cf934.zip
opensim-SC_OLD-7371c7662a05d2c1dae1c110905817bb873cf934.tar.gz
opensim-SC_OLD-7371c7662a05d2c1dae1c110905817bb873cf934.tar.bz2
opensim-SC_OLD-7371c7662a05d2c1dae1c110905817bb873cf934.tar.xz
Fix for landing points. Only one scenario is not fully covered by this change, and that is people who teleport from neighbouring regions, who won't get affected by the landing point.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs47
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs25
3 files changed, 59 insertions, 15 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 265129c..37734f4 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3460,6 +3460,7 @@ namespace OpenSim.Region.Framework.Scenes
3460 } 3460 }
3461 } 3461 }
3462 // Honor parcel landing type and position. 3462 // Honor parcel landing type and position.
3463 /*
3463 ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); 3464 ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
3464 if (land != null) 3465 if (land != null)
3465 { 3466 {
@@ -3468,6 +3469,7 @@ namespace OpenSim.Region.Framework.Scenes
3468 agent.startpos = land.LandData.UserLocation; 3469 agent.startpos = land.LandData.UserLocation;
3469 } 3470 }
3470 } 3471 }
3472 */// This is now handled properly in ScenePresence.MakeRootAgent
3471 } 3473 }
3472 3474
3473 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); 3475 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index e649139..0a02d39 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
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index a3ad7ca..c3bc96a 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -836,9 +836,24 @@ namespace OpenSim.Region.Framework.Scenes
836 { 836 {
837 Border crossedBorder = m_scene.GetCrossedBorder(pos, Cardinals.N); 837 Border crossedBorder = m_scene.GetCrossedBorder(pos, Cardinals.N);
838 pos.Y = crossedBorder.BorderLine.Z - 1; 838 pos.Y = crossedBorder.BorderLine.Z - 1;
839 }
840
841 //If they're TP'ing in or logging in, we haven't had time to add any known child regions yet.
842 //This has the unfortunate consequence that if somebody is TP'ing who is already a child agent,
843 //they'll bypass the landing point. But I can't think of any decent way of fixing this.
844 if (KnownChildRegionHandles.Count == 0)
845 {
846 ILandObject land = m_scene.LandChannel.GetLandObject(pos.X, pos.Y);
847 if (land != null)
848 {
849 //Don't restrict gods, estate managers, or land owners to the TP point. This behaviour mimics agni.
850 if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero && m_godlevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(m_uuid) && land.LandData.OwnerID != m_uuid)
851 {
852 pos = land.LandData.UserLocation;
853 }
854 }
839 } 855 }
840 856
841
842 if (pos.X < 0 || pos.Y < 0 || pos.Z < 0) 857 if (pos.X < 0 || pos.Y < 0 || pos.Z < 0)
843 { 858 {
844 Vector3 emergencyPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128); 859 Vector3 emergencyPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128);
@@ -973,9 +988,10 @@ namespace OpenSim.Region.Framework.Scenes
973 public void Teleport(Vector3 pos) 988 public void Teleport(Vector3 pos)
974 { 989 {
975 bool isFlying = false; 990 bool isFlying = false;
976 if (m_physicsActor != null)
977 isFlying = m_physicsActor.Flying;
978 991
992 if (m_physicsActor != null)
993 isFlying = m_physicsActor.Flying;
994
979 RemoveFromPhysicalScene(); 995 RemoveFromPhysicalScene();
980 Velocity = Vector3.Zero; 996 Velocity = Vector3.Zero;
981 AbsolutePosition = pos; 997 AbsolutePosition = pos;
@@ -986,7 +1002,8 @@ namespace OpenSim.Region.Framework.Scenes
986 SetHeight(m_appearance.AvatarHeight); 1002 SetHeight(m_appearance.AvatarHeight);
987 } 1003 }
988 1004
989 SendTerseUpdateToAllClients(); 1005 SendTerseUpdateToAllClients();
1006
990 } 1007 }
991 1008
992 public void TeleportWithMomentum(Vector3 pos) 1009 public void TeleportWithMomentum(Vector3 pos)