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.
user_profiles
Justin Clark-Casey (justincc) 2013-03-12 23:01:27 +00:00
parent c43d4b5572
commit fb1211ad5e
3 changed files with 32 additions and 1 deletions

View File

@ -66,6 +66,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
/// </summary> /// </summary>
public bool WaitForAgentArrivedAtDestination { get; set; } public bool WaitForAgentArrivedAtDestination { get; set; }
/// <summary>
/// If true then we ask the viewer to disable teleport cancellation and ignore teleport requests.
/// </summary>
/// <remarks>
/// 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.
/// </remarks>
public bool DisableInterRegionTeleportCancellation { get; set; }
protected bool m_Enabled = false; protected bool m_Enabled = false;
public Scene Scene { get; private set; } public Scene Scene { get; private set; }
@ -116,6 +127,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
IConfig transferConfig = source.Configs["EntityTransfer"]; IConfig transferConfig = source.Configs["EntityTransfer"];
if (transferConfig != null) if (transferConfig != null)
{ {
DisableInterRegionTeleportCancellation
= transferConfig.GetBoolean("DisableInterRegionTeleportCancellation", false);
WaitForAgentArrivedAtDestination WaitForAgentArrivedAtDestination
= transferConfig.GetBoolean("wait_for_callback", WaitForAgentArrivedAtDestinationDefault); = transferConfig.GetBoolean("wait_for_callback", WaitForAgentArrivedAtDestinationDefault);
@ -148,9 +162,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
protected virtual void OnNewClient(IClientAPI client) protected virtual void OnNewClient(IClientAPI client)
{ {
client.OnTeleportCancel += OnClientCancelTeleport;
client.OnTeleportHomeRequest += TeleportHome; client.OnTeleportHomeRequest += TeleportHome;
client.OnTeleportLandmarkRequest += RequestTeleportLandmark; client.OnTeleportLandmarkRequest += RequestTeleportLandmark;
if (!DisableInterRegionTeleportCancellation)
client.OnTeleportCancel += OnClientCancelTeleport;
} }
public virtual void Close() {} public virtual void Close() {}
@ -528,6 +544,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (sp.ParentID != (uint)0) if (sp.ParentID != (uint)0)
sp.StandUp(); 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 // 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). // the viewer. However, it might mean that the viewer does not see the black teleport screen (untested).
sp.ControllingClient.SendTeleportStart(teleportFlags); sp.ControllingClient.SendTeleportStart(teleportFlags);

View File

@ -541,6 +541,13 @@
; shout_distance = 100 ; 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] [Messaging]
;# {OfflineMessageModule} {} {Module to use for offline message storage} {OfflineMessageModule "Offline Message Module V2" *} ;# {OfflineMessageModule} {} {Module to use for offline message storage} {OfflineMessageModule "Offline Message Module V2" *}
;; Module to handle offline messaging. The core module requires an external ;; Module to handle offline messaging. The core module requires an external

View File

@ -628,6 +628,11 @@
; Minimum user level required for HyperGrid teleports ; Minimum user level required for HyperGrid teleports
LevelHGTeleport = 0 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] [Messaging]
; Control which region module is used for instant messaging. ; Control which region module is used for instant messaging.