aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorAliciaRaven2016-11-22 15:31:45 +0000
committerAliciaRaven2016-11-22 15:31:45 +0000
commit94e48838d5b1f0bf0c5b0e40b7bc9a6f1be156e9 (patch)
tree384a7f929cbc59bf4b45d9daaae976471427219a /OpenSim
parentCoding standards: A local variable may not use the prefix m_ (diff)
downloadopensim-SC_OLD-94e48838d5b1f0bf0c5b0e40b7bc9a6f1be156e9.zip
opensim-SC_OLD-94e48838d5b1f0bf0c5b0e40b7bc9a6f1be156e9.tar.gz
opensim-SC_OLD-94e48838d5b1f0bf0c5b0e40b7bc9a6f1be156e9.tar.bz2
opensim-SC_OLD-94e48838d5b1f0bf0c5b0e40b7bc9a6f1be156e9.tar.xz
Include new Region.ini option for DefaultLandingPoint for teleports with no coords specified.
This is useful when using a Telehub would be to restrictive as it would block landmarks and map teleports. This location is only ever used when no coordinates are provided. If config value not set, the previous default of 128,128 is used.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/RegionInfo.cs58
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs4
3 files changed, 66 insertions, 0 deletions
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index ac77352..b6e9d9f 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -176,6 +176,9 @@ namespace OpenSim.Framework
176 /// </remarks> 176 /// </remarks>
177 public uint RegionSizeZ = Constants.RegionHeight; 177 public uint RegionSizeZ = Constants.RegionHeight;
178 178
179 // If entering avatar has no specific coords, this is where they land
180 public Vector3 DefaultLandingPoint = new Vector3(128, 128, 30);
181
179 private Dictionary<String, String> m_extraSettings = new Dictionary<string, string>(); 182 private Dictionary<String, String> m_extraSettings = new Dictionary<string, string>();
180 183
181 // Apparently, we're applying the same estatesettings regardless of whether it's local or remote. 184 // Apparently, we're applying the same estatesettings regardless of whether it's local or remote.
@@ -712,6 +715,19 @@ namespace OpenSim.Framework
712 m_regionType = config.GetString("RegionType", String.Empty); 715 m_regionType = config.GetString("RegionType", String.Empty);
713 allKeys.Remove("RegionType"); 716 allKeys.Remove("RegionType");
714 717
718 // Get Default Landing Location (Defaults to 128,128)
719 string temp_location = config.GetString("DefaultLanding", "<128, 128, 30>");
720 Vector3 temp_vector;
721
722 if (Vector3.TryParse(temp_location, out temp_vector))
723 DefaultLandingPoint = temp_vector;
724 else
725 m_log.ErrorFormat("[RegionInfo]: Unable to parse DefaultLanding for '{0}'. The value given was '{1}'", RegionName, temp_location);
726
727 allKeys.Remove("DefaultLanding");
728
729 DoDefaultLandingSanityChecks();
730
715 #region Prim and map stuff 731 #region Prim and map stuff
716 732
717 m_nonphysPrimMin = config.GetFloat("NonPhysicalPrimMin", 0); 733 m_nonphysPrimMin = config.GetFloat("NonPhysicalPrimMin", 0);
@@ -764,6 +780,48 @@ namespace OpenSim.Framework
764 } 780 }
765 } 781 }
766 782
783 // Make sure DefaultLanding is within region borders with a buffer zone 5 meters from borders
784 private void DoDefaultLandingSanityChecks()
785 {
786 // Sanity Check Default Landing
787 float buffer_zone = 5f;
788
789 bool ValuesCapped = false;
790
791 // Minimum Positions
792 if (DefaultLandingPoint.X < 0f)
793 {
794 DefaultLandingPoint.X = buffer_zone;
795 ValuesCapped = true;
796 }
797
798 if (DefaultLandingPoint.Y < 0f)
799 {
800 DefaultLandingPoint.Y = buffer_zone;
801 ValuesCapped = true;
802 }
803
804 // Maximum Positions
805 if (DefaultLandingPoint.X > RegionSizeX - buffer_zone)
806 {
807 DefaultLandingPoint.X = RegionSizeX - buffer_zone;
808 ValuesCapped = true;
809 }
810
811 if (DefaultLandingPoint.Y > RegionSizeY - buffer_zone)
812 {
813 DefaultLandingPoint.Y = RegionSizeY - buffer_zone;
814 ValuesCapped = true;
815 }
816
817 // Height
818 if (DefaultLandingPoint.Z < 0f)
819 DefaultLandingPoint.Z = 0f;
820
821 if (ValuesCapped == true)
822 m_log.WarnFormat("[RegionInfo]: The default landing location for {0} has been capped to {1}", RegionName, DefaultLandingPoint);
823 }
824
767 // Make sure user specified region sizes are sane. 825 // Make sure user specified region sizes are sane.
768 // Must be multiples of legacy region size (256). 826 // Must be multiples of legacy region size (256).
769 private void DoRegionSizeSanityChecks() 827 private void DoRegionSizeSanityChecks()
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 1161571..23cfde5 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -455,6 +455,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
455 position = emergencyPos; 455 position = emergencyPos;
456 } 456 }
457 457
458 // Check Default Location (Also See ScenePresence.CompleteMovement)
459 if (position.X == 128f && position.Y == 128f)
460 position = sp.Scene.RegionInfo.DefaultLandingPoint;
461
458 // TODO: Get proper AVG Height 462 // TODO: Get proper AVG Height
459 float localHalfAVHeight = 0.8f; 463 float localHalfAVHeight = 0.8f;
460 if (sp.Appearance != null) 464 if (sp.Appearance != null)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 7efd920..2cf0e9d 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2043,6 +2043,10 @@ namespace OpenSim.Region.Framework.Scenes
2043 look = new Vector3(0.99f, 0.042f, 0); 2043 look = new Vector3(0.99f, 0.042f, 0);
2044 } 2044 }
2045 2045
2046 // Check Default Location (Also See EntityTransferModule.TeleportAgentWithinRegion)
2047 if (AbsolutePosition.X == 128f && AbsolutePosition.Y == 128f)
2048 AbsolutePosition = Scene.RegionInfo.DefaultLandingPoint;
2049
2046 if (!MakeRootAgent(AbsolutePosition, flying, ref look)) 2050 if (!MakeRootAgent(AbsolutePosition, flying, ref look))
2047 { 2051 {
2048 m_log.DebugFormat( 2052 m_log.DebugFormat(