diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 34f09240a8..9b1b69aaa4 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -66,6 +66,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer /// public bool WaitForAgentArrivedAtDestination { get; set; } + /// + /// If true then we ask the viewer to disable teleport cancellation and ignore teleport requests. + /// + /// + /// This is useful in situations where teleport is very likely to always succeed and we want to avoid a + /// situation where avatars can be come 'stuck' due to a failed teleport cancellation. Unfortunately, the + /// nature of the teleport protocol makes it extremely difficult (maybe impossible) to make teleport + /// cancellation consistently suceed. + /// + public bool DisableInterRegionTeleportCancellation { get; set; } + protected bool m_Enabled = false; public Scene Scene { get; private set; } @@ -116,6 +127,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer IConfig transferConfig = source.Configs["EntityTransfer"]; if (transferConfig != null) { + DisableInterRegionTeleportCancellation + = transferConfig.GetBoolean("DisableInterRegionTeleportCancellation", false); + WaitForAgentArrivedAtDestination = transferConfig.GetBoolean("wait_for_callback", WaitForAgentArrivedAtDestinationDefault); @@ -148,9 +162,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer protected virtual void OnNewClient(IClientAPI client) { - client.OnTeleportCancel += OnClientCancelTeleport; client.OnTeleportHomeRequest += TeleportHome; client.OnTeleportLandmarkRequest += RequestTeleportLandmark; + + if (!DisableInterRegionTeleportCancellation) + client.OnTeleportCancel += OnClientCancelTeleport; } public virtual void Close() {} @@ -528,6 +544,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (sp.ParentID != (uint)0) sp.StandUp(); + if (DisableInterRegionTeleportCancellation) + teleportFlags |= (uint)TeleportFlags.DisableCancel; + // At least on LL 3.3.4, this is not strictly necessary - a teleport will succeed without sending this to // the viewer. However, it might mean that the viewer does not see the black teleport screen (untested). sp.ControllingClient.SendTeleportStart(teleportFlags); diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index e078e86807..ce2e6008cf 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -541,6 +541,13 @@ ; shout_distance = 100 +[EntityTransfer] + ;# {DisableInterRegionTeleportCancellation} {} {Determine whether the cancel button is shown at all during teleports.} {false true} false + ;; This option exists because cancelling at certain points can result in an unuseable session (frozen avatar, etc.) + ;; Disabling cancellation can be okay in small closed grids where all teleports are highly likely to suceed. + ;DisableInterRegionTeleportCancellation = false + + [Messaging] ;# {OfflineMessageModule} {} {Module to use for offline message storage} {OfflineMessageModule "Offline Message Module V2" *} ;; Module to handle offline messaging. The core module requires an external diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 417150af69..1d2c0cff86 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -628,6 +628,11 @@ ; Minimum user level required for HyperGrid teleports LevelHGTeleport = 0 + ; Determine whether the cancel button is shown at all during teleports. + ; This option exists because cancelling at certain points can result in an unuseable session (frozen avatar, etc.) + ; Disabling cancellation can be okay in small closed grids where all teleports are highly likely to suceed. + DisableInterRegionTeleportCancellation = false + [Messaging] ; Control which region module is used for instant messaging.