From 85a327dc59cc2e36e5618bb344551185d800b2e7 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 12 Mar 2013 23:01:27 +0000 Subject: [PATCH] Add DisableInterRegionTeleportCancellation option in [EntityTransfer] section of OpenSim.ini. False by default. This option allows the simulator to specify that the cancel button on inter-region teleports should never appear. This exists because sometimes cancellation will result in a stuck avatar requiring relog. It may be hard to prevent this due to the protocol design (the LL grid has the same issue) In small controlled grids where teleport failure is practically impossible it can be better to disable teleport cancellation entirely. --- .../EntityTransfer/EntityTransferModule.cs | 21 ++++++++++++++++++- bin/OpenSim.ini.example | 7 +++++++ bin/OpenSimDefaults.ini | 5 +++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index fd04722a61..8f217cc372 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -64,6 +64,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; } @@ -114,6 +125,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); @@ -146,9 +160,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() {} @@ -511,6 +527,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 472d6b41d2..8b82752742 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -464,6 +464,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 *} ;; Module to handle offline messaging. The core module requires an external diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index c2fbd17e0a..4384c22b23 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -639,6 +639,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.