diff options
author | Diva Canto | 2016-06-23 11:44:59 -0700 |
---|---|---|
committer | Diva Canto | 2016-06-23 11:44:59 -0700 |
commit | b522f0916aa96a941da95d456acaa8d2ea0bb496 (patch) | |
tree | c27e21707e324e7cfc2648240e60b1b5a686262d /OpenSim | |
parent | Replace the http server dll with the right pair dll + xml (diff) | |
download | opensim-SC_OLD-b522f0916aa96a941da95d456acaa8d2ea0bb496.zip opensim-SC_OLD-b522f0916aa96a941da95d456acaa8d2ea0bb496.tar.gz opensim-SC_OLD-b522f0916aa96a941da95d456acaa8d2ea0bb496.tar.bz2 opensim-SC_OLD-b522f0916aa96a941da95d456acaa8d2ea0bb496.tar.xz |
Mantis #7934 and related: landing points and telehubs for gods. Added a new configuration variable LandingPointBehavior that can switch between what we're used to in OpenSim and the behavior in SL.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 88 |
1 files changed, 82 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 62ba314..4775b1f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -462,6 +462,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
462 | /// </value> | 462 | /// </value> |
463 | private IScriptModule[] m_scriptEngines; | 463 | private IScriptModule[] m_scriptEngines; |
464 | 464 | ||
465 | private enum LandingPointBehavior | ||
466 | { | ||
467 | OS = 1, | ||
468 | SL = 2 | ||
469 | } | ||
470 | |||
471 | private LandingPointBehavior m_LandingPointBehavior = LandingPointBehavior.OS; | ||
472 | |||
465 | #region Properties | 473 | #region Properties |
466 | 474 | ||
467 | /// <summary> | 475 | /// <summary> |
@@ -1051,6 +1059,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
1051 | Appearance = appearance; | 1059 | Appearance = appearance; |
1052 | 1060 | ||
1053 | m_stateMachine = new ScenePresenceStateMachine(this); | 1061 | m_stateMachine = new ScenePresenceStateMachine(this); |
1062 | |||
1063 | IConfig sconfig = m_scene.Config.Configs["EntityTransfer"]; | ||
1064 | if (sconfig != null) | ||
1065 | { | ||
1066 | string lpb = sconfig.GetString("LandingPointBehavior", "LandingPointBehavior_OS"); | ||
1067 | if (lpb == "LandingPointBehavior_SL") | ||
1068 | m_LandingPointBehavior = LandingPointBehavior.SL; | ||
1069 | } | ||
1070 | |||
1054 | } | 1071 | } |
1055 | 1072 | ||
1056 | private void RegionHeartbeatEnd(Scene scene) | 1073 | private void RegionHeartbeatEnd(Scene scene) |
@@ -1208,10 +1225,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1208 | if (ParentID == 0) | 1225 | if (ParentID == 0) |
1209 | { | 1226 | { |
1210 | bool positionChanged = false; | 1227 | bool positionChanged = false; |
1211 | if(!CheckAndAdjustLandingPoint(ref pos, ref lookat, ref positionChanged )) | 1228 | bool success = true; |
1212 | { | 1229 | if (m_LandingPointBehavior == LandingPointBehavior.OS) |
1213 | m_log.DebugFormat("[SCENE PRESENCE MakeRootAgent]: houston we have a problem.. {0}({1} got here banned",Name, UUID); | 1230 | success = CheckAndAdjustLandingPoint_OS(ref pos, ref lookat, ref positionChanged); |
1214 | } | 1231 | else |
1232 | success = CheckAndAdjustLandingPoint_SL(ref pos, ref lookat, ref positionChanged); | ||
1233 | |||
1234 | if (!success) | ||
1235 | m_log.DebugFormat("[SCENE PRESENCE MakeRootAgent]: houston we have a problem.. {0} ({1} got banned)", Name, UUID); | ||
1215 | 1236 | ||
1216 | if (pos.X < 0f || pos.Y < 0f | 1237 | if (pos.X < 0f || pos.Y < 0f |
1217 | || pos.X >= m_scene.RegionInfo.RegionSizeX | 1238 | || pos.X >= m_scene.RegionInfo.RegionSizeX |
@@ -5788,8 +5809,63 @@ namespace OpenSim.Region.Framework.Scenes | |||
5788 | const TeleportFlags adicionalLandPointFlags = TeleportFlags.ViaLandmark | | 5809 | const TeleportFlags adicionalLandPointFlags = TeleportFlags.ViaLandmark | |
5789 | TeleportFlags.ViaLocation | TeleportFlags.ViaHGLogin; | 5810 | TeleportFlags.ViaLocation | TeleportFlags.ViaHGLogin; |
5790 | 5811 | ||
5791 | // Modify landing point based on telehubs or parcel restrictions. | 5812 | // Modify landing point based on possible banning, telehubs or parcel restrictions. |
5792 | private bool CheckAndAdjustLandingPoint(ref Vector3 pos, ref Vector3 lookat, ref bool positionChanged) | 5813 | // This is the behavior in OpenSim for a very long time, different from SL |
5814 | private bool CheckAndAdjustLandingPoint_OS(ref Vector3 pos, ref Vector3 lookat, ref bool positionChanged) | ||
5815 | { | ||
5816 | string reason; | ||
5817 | |||
5818 | // Honor bans | ||
5819 | if (!m_scene.TestLandRestrictions(UUID, out reason, ref pos.X, ref pos.Y)) | ||
5820 | return false; | ||
5821 | |||
5822 | SceneObjectGroup telehub = null; | ||
5823 | if (m_scene.RegionInfo.RegionSettings.TelehubObject != UUID.Zero && (telehub = m_scene.GetSceneObjectGroup(m_scene.RegionInfo.RegionSettings.TelehubObject)) != null) | ||
5824 | { | ||
5825 | if (!m_scene.RegionInfo.EstateSettings.AllowDirectTeleport) | ||
5826 | { | ||
5827 | CheckAndAdjustTelehub(telehub, ref pos, ref positionChanged); | ||
5828 | return true; | ||
5829 | } | ||
5830 | } | ||
5831 | |||
5832 | ILandObject land = m_scene.LandChannel.GetLandObject(pos.X, pos.Y); | ||
5833 | if (land != null) | ||
5834 | { | ||
5835 | if (Scene.DebugTeleporting) | ||
5836 | TeleportFlagsDebug(); | ||
5837 | |||
5838 | // If we come in via login, landmark or map, we want to | ||
5839 | // honor landing points. If we come in via Lure, we want | ||
5840 | // to ignore them. | ||
5841 | if ((m_teleportFlags & (TeleportFlags.ViaLogin | TeleportFlags.ViaRegionID)) == | ||
5842 | (TeleportFlags.ViaLogin | TeleportFlags.ViaRegionID) || | ||
5843 | (m_teleportFlags & adicionalLandPointFlags) != 0) | ||
5844 | { | ||
5845 | // Don't restrict gods, estate managers, or land owners to | ||
5846 | // the TP point. This behaviour mimics agni. | ||
5847 | if (land.LandData.LandingType == (byte)LandingType.LandingPoint && | ||
5848 | land.LandData.UserLocation != Vector3.Zero && | ||
5849 | GodLevel < 200 && | ||
5850 | ((land.LandData.OwnerID != m_uuid && | ||
5851 | !m_scene.Permissions.IsGod(m_uuid) && | ||
5852 | !m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_uuid)) || | ||
5853 | (m_teleportFlags & TeleportFlags.ViaLocation) != 0 || | ||
5854 | (m_teleportFlags & Constants.TeleportFlags.ViaHGLogin) != 0)) | ||
5855 | { | ||
5856 | pos = land.LandData.UserLocation; | ||
5857 | } | ||
5858 | } | ||
5859 | |||
5860 | land.SendLandUpdateToClient(ControllingClient); | ||
5861 | } | ||
5862 | |||
5863 | return true; | ||
5864 | } | ||
5865 | |||
5866 | // Modify landing point based on telehubs or parcel restrictions. | ||
5867 | // This is a behavior coming from AVN, somewhat mimicking SL | ||
5868 | private bool CheckAndAdjustLandingPoint_SL(ref Vector3 pos, ref Vector3 lookat, ref bool positionChanged) | ||
5793 | { | 5869 | { |
5794 | string reason; | 5870 | string reason; |
5795 | 5871 | ||