diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresenceStateMachine.cs')
-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 | } |