diff options
author | onefang | 2019-09-11 16:36:50 +1000 |
---|---|---|
committer | onefang | 2019-09-11 16:36:50 +1000 |
commit | 50cd1ffd32f69228e566f2b0b89f86ea0d9fe489 (patch) | |
tree | 52f2ab0c04f1a5d7d6ac5dc872981b4b156447e7 /OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs | |
parent | Renamed branch to SledjChisl. (diff) | |
parent | Bump to release flavour, build 0. (diff) | |
download | opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.zip opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.gz opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.bz2 opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.xz |
Merge branch 'SledjChisl'
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs index a3109e0..0a24555 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs | |||
@@ -101,7 +101,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
101 | /// <returns>true if the agent was not already in transit, false if it was</returns> | 101 | /// <returns>true if the agent was not already in transit, false if it was</returns> |
102 | internal bool SetInTransit(UUID id) | 102 | internal bool SetInTransit(UUID id) |
103 | { | 103 | { |
104 | m_log.DebugFormat("{0} SetInTransit. agent={1}, newState=Preparing", LogHeader, id); | 104 | // m_log.DebugFormat("{0} SetInTransit. agent={1}, newState=Preparing", LogHeader, id); |
105 | lock (m_agentsInTransit) | 105 | lock (m_agentsInTransit) |
106 | { | 106 | { |
107 | if (!m_agentsInTransit.ContainsKey(id)) | 107 | if (!m_agentsInTransit.ContainsKey(id)) |
@@ -123,7 +123,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
123 | /// <exception cref='Exception'>Illegal transitions will throw an Exception</exception> | 123 | /// <exception cref='Exception'>Illegal transitions will throw an Exception</exception> |
124 | internal bool UpdateInTransit(UUID id, AgentTransferState newState) | 124 | internal bool UpdateInTransit(UUID id, AgentTransferState newState) |
125 | { | 125 | { |
126 | m_log.DebugFormat("{0} UpdateInTransit. agent={1}, newState={2}", LogHeader, id, newState); | 126 | // m_log.DebugFormat("{0} UpdateInTransit. agent={1}, newState={2}", LogHeader, id, newState); |
127 | 127 | ||
128 | bool transitionOkay = false; | 128 | bool transitionOkay = false; |
129 | 129 | ||
@@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
169 | } | 169 | } |
170 | else | 170 | else |
171 | { | 171 | { |
172 | if (newState == AgentTransferState.Cancelling | 172 | if (newState == AgentTransferState.Cancelling |
173 | && (oldState == AgentTransferState.Preparing || oldState == AgentTransferState.Transferring)) | 173 | && (oldState == AgentTransferState.Preparing || oldState == AgentTransferState.Transferring)) |
174 | { | 174 | { |
175 | transitionOkay = true; | 175 | transitionOkay = true; |
@@ -181,7 +181,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
181 | } | 181 | } |
182 | 182 | ||
183 | if (!transitionOkay) | 183 | if (!transitionOkay) |
184 | failureMessage | 184 | failureMessage |
185 | = string.Format( | 185 | = string.Format( |
186 | "Agent with ID {0} is not allowed to move from old transit state {1} to new state {2} in {3}", | 186 | "Agent with ID {0} is not allowed to move from old transit state {1} to new state {2} in {3}", |
187 | id, oldState, newState, m_mod.Scene.RegionInfo.RegionName); | 187 | id, oldState, newState, m_mod.Scene.RegionInfo.RegionName); |
@@ -192,7 +192,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
192 | m_agentsInTransit[id] = newState; | 192 | m_agentsInTransit[id] = newState; |
193 | 193 | ||
194 | // m_log.DebugFormat( | 194 | // m_log.DebugFormat( |
195 | // "[ENTITY TRANSFER STATE MACHINE]: Changed agent with id {0} from state {1} to {2} in {3}", | 195 | // "[ENTITY TRANSFER STATE MACHINE]: Changed agent with id {0} from state {1} to {2} in {3}", |
196 | // id, oldState, newState, m_mod.Scene.Name); | 196 | // id, oldState, newState, m_mod.Scene.Name); |
197 | } | 197 | } |
198 | else if (failIfNotOkay) | 198 | else if (failIfNotOkay) |
@@ -204,11 +204,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
204 | // { | 204 | // { |
205 | // if (oldState != null) | 205 | // if (oldState != null) |
206 | // m_log.DebugFormat( | 206 | // m_log.DebugFormat( |
207 | // "[ENTITY TRANSFER STATE MACHINE]: Ignored change of agent with id {0} from state {1} to {2} in {3}", | 207 | // "[ENTITY TRANSFER STATE MACHINE]: Ignored change of agent with id {0} from state {1} to {2} in {3}", |
208 | // id, oldState, newState, m_mod.Scene.Name); | 208 | // id, oldState, newState, m_mod.Scene.Name); |
209 | // else | 209 | // else |
210 | // m_log.DebugFormat( | 210 | // m_log.DebugFormat( |
211 | // "[ENTITY TRANSFER STATE MACHINE]: Ignored change of agent with id {0} to state {1} in {2} since agent not in transit", | 211 | // "[ENTITY TRANSFER STATE MACHINE]: Ignored change of agent with id {0} to state {1} in {2} since agent not in transit", |
212 | // id, newState, m_mod.Scene.Name); | 212 | // id, newState, m_mod.Scene.Name); |
213 | // } | 213 | // } |
214 | } | 214 | } |
@@ -247,32 +247,32 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
247 | { | 247 | { |
248 | AgentTransferState state = m_agentsInTransit[id]; | 248 | AgentTransferState state = m_agentsInTransit[id]; |
249 | 249 | ||
250 | if (state == AgentTransferState.Transferring || state == AgentTransferState.ReceivedAtDestination) | 250 | // if (state == AgentTransferState.Transferring || state == AgentTransferState.ReceivedAtDestination) |
251 | { | 251 | // { |
252 | // FIXME: For now, we allow exit from any state since a thrown exception in teleport is now guranteed | 252 | // FIXME: For now, we allow exit from any state since a thrown exception in teleport is now guranteed |
253 | // to be handled properly - ResetFromTransit() could be invoked at any step along the process | 253 | // to be handled properly - ResetFromTransit() could be invoked at any step along the process |
254 | m_log.WarnFormat( | 254 | // m_log.WarnFormat( |
255 | "[ENTITY TRANSFER STATE MACHINE]: Agent with ID {0} should not exit directly from state {1}, should go to {2} state first in {3}", | 255 | // "[ENTITY TRANSFER STATE MACHINE]: Agent with ID {0} should not exit directly from state {1}, should go to {2} state first in {3}", |
256 | id, state, AgentTransferState.CleaningUp, m_mod.Scene.RegionInfo.RegionName); | 256 | // id, state, AgentTransferState.CleaningUp, m_mod.Scene.RegionInfo.RegionName); |
257 | 257 | ||
258 | // throw new Exception( | 258 | // throw new Exception( |
259 | // "Agent with ID {0} cannot exit directly from state {1}, it must go to {2} state first", | 259 | // "Agent with ID {0} cannot exit directly from state {1}, it must go to {2} state first", |
260 | // state, AgentTransferState.CleaningUp); | 260 | // state, AgentTransferState.CleaningUp); |
261 | } | 261 | // } |
262 | 262 | ||
263 | m_agentsInTransit.Remove(id); | 263 | m_agentsInTransit.Remove(id); |
264 | 264 | ||
265 | m_log.DebugFormat( | 265 | // m_log.DebugFormat( |
266 | "[ENTITY TRANSFER STATE MACHINE]: Agent {0} cleared from transit in {1}", | 266 | // "[ENTITY TRANSFER STATE MACHINE]: Agent {0} cleared from transit in {1}", |
267 | id, m_mod.Scene.RegionInfo.RegionName); | 267 | // id, m_mod.Scene.RegionInfo.RegionName); |
268 | 268 | ||
269 | return true; | 269 | return true; |
270 | } | 270 | } |
271 | } | 271 | } |
272 | 272 | ||
273 | m_log.WarnFormat( | 273 | // m_log.WarnFormat( |
274 | "[ENTITY TRANSFER STATE MACHINE]: Agent {0} requested to clear from transit in {1} but was already cleared", | 274 | // "[ENTITY TRANSFER STATE MACHINE]: Agent {0} requested to clear from transit in {1} but was already cleared", |
275 | id, m_mod.Scene.RegionInfo.RegionName); | 275 | // id, m_mod.Scene.RegionInfo.RegionName); |
276 | 276 | ||
277 | return false; | 277 | return false; |
278 | } | 278 | } |
@@ -281,7 +281,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
281 | { | 281 | { |
282 | if (!m_mod.WaitForAgentArrivedAtDestination) | 282 | if (!m_mod.WaitForAgentArrivedAtDestination) |
283 | return true; | 283 | return true; |
284 | 284 | ||
285 | lock (m_agentsInTransit) | 285 | lock (m_agentsInTransit) |
286 | { | 286 | { |
287 | AgentTransferState? currentState = GetAgentTransferState(id); | 287 | AgentTransferState? currentState = GetAgentTransferState(id); |
@@ -299,7 +299,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
299 | id, m_mod.Scene.RegionInfo.RegionName, currentState)); | 299 | id, m_mod.Scene.RegionInfo.RegionName, currentState)); |
300 | } | 300 | } |
301 | 301 | ||
302 | int count = 200; | 302 | int count = 400; |
303 | 303 | ||
304 | // There should be no race condition here since no other code should be removing the agent transfer or | 304 | // There should be no race condition here since no other code should be removing the agent transfer or |
305 | // changing the state to another other than Transferring => ReceivedAtDestination. | 305 | // changing the state to another other than Transferring => ReceivedAtDestination. |
@@ -354,4 +354,4 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
354 | } | 354 | } |
355 | } | 355 | } |
356 | } | 356 | } |
357 | } \ No newline at end of file | 357 | } |