diff options
author | Justin Clark-Casey (justincc) | 2013-09-02 19:15:10 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-09-02 19:15:10 +0100 |
commit | 857f24a5e2b59072ad4d987d5e64318f5249c7e7 (patch) | |
tree | fb2bdcae26a3eb6290ed9a587cf729172bf4f8a2 /OpenSim/Region/Framework/Scenes/ScenePresenceStateMachine.cs | |
parent | Comment out warning about agent updating without valid session ID for now. (diff) | |
download | opensim-SC_OLD-857f24a5e2b59072ad4d987d5e64318f5249c7e7.zip opensim-SC_OLD-857f24a5e2b59072ad4d987d5e64318f5249c7e7.tar.gz opensim-SC_OLD-857f24a5e2b59072ad4d987d5e64318f5249c7e7.tar.bz2 opensim-SC_OLD-857f24a5e2b59072ad4d987d5e64318f5249c7e7.tar.xz |
Fix bug where users teleporting to non-neighbour regions could continue to hear chat from their source region for some time after teleport completion.
This occurs on v2 teleport since the source region now waits 15 secs before closing the old child agent, which could still receive chat.
This commit introduces a ScenePresenceState.PreClose which is set before the wait, so that ChatModule can check for ScenePresenceState.Running.
This was theoretically also an issue on v1 teleport but since the pause before close was only 2 secs there, it was not noticed.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresenceStateMachine.cs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresenceStateMachine.cs b/OpenSim/Region/Framework/Scenes/ScenePresenceStateMachine.cs index dc3a212..cae7fe5 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresenceStateMachine.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresenceStateMachine.cs | |||
@@ -37,7 +37,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
37 | /// This is a state machine. | 37 | /// This is a state machine. |
38 | /// | 38 | /// |
39 | /// [Entry] => Running | 39 | /// [Entry] => Running |
40 | /// Running => Removing | 40 | /// Running => PreRemove, Removing |
41 | /// PreRemove => Running, Removing | ||
41 | /// Removing => Removed | 42 | /// Removing => Removed |
42 | /// | 43 | /// |
43 | /// All other methods should only see the scene presence in running state - this is the normal operational state | 44 | /// All other methods should only see the scene presence in running state - this is the normal operational state |
@@ -46,6 +47,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
46 | public enum ScenePresenceState | 47 | public enum ScenePresenceState |
47 | { | 48 | { |
48 | Running, // Normal operation state. The scene presence is available. | 49 | Running, // Normal operation state. The scene presence is available. |
50 | PreRemove, // The presence is due to be removed but can still be returning to running. | ||
49 | Removing, // The presence is in the process of being removed from the scene via Scene.RemoveClient. | 51 | Removing, // The presence is in the process of being removed from the scene via Scene.RemoveClient. |
50 | Removed, // The presence has been removed from the scene and is effectively dead. | 52 | Removed, // The presence has been removed from the scene and is effectively dead. |
51 | // There is no exit from this state. | 53 | // There is no exit from this state. |
@@ -80,8 +82,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
80 | 82 | ||
81 | lock (this) | 83 | lock (this) |
82 | { | 84 | { |
83 | if (newState == ScenePresenceState.Removing && m_state == ScenePresenceState.Running) | 85 | if (newState == m_state) |
86 | return; | ||
87 | else if (newState == ScenePresenceState.Running && m_state == ScenePresenceState.PreRemove) | ||
84 | transitionOkay = true; | 88 | transitionOkay = true; |
89 | else if (newState == ScenePresenceState.PreRemove && m_state == ScenePresenceState.Running) | ||
90 | transitionOkay = true; | ||
91 | else if (newState == ScenePresenceState.Removing) | ||
92 | { | ||
93 | if (m_state == ScenePresenceState.Running || m_state == ScenePresenceState.PreRemove) | ||
94 | transitionOkay = true; | ||
95 | } | ||
85 | else if (newState == ScenePresenceState.Removed && m_state == ScenePresenceState.Removing) | 96 | else if (newState == ScenePresenceState.Removed && m_state == ScenePresenceState.Removing) |
86 | transitionOkay = true; | 97 | transitionOkay = true; |
87 | } | 98 | } |