diff options
author | Diva Canto | 2013-07-22 11:54:35 -0700 |
---|---|---|
committer | Diva Canto | 2013-07-24 14:27:58 -0700 |
commit | 3891a8946bb72c9256d8de4185bf4a72c90be859 (patch) | |
tree | 3c4e2ca2468c287e1c0ea711ad6808bef0d82449 /OpenSim/Region/Framework/Scenes/Scene.cs | |
parent | Further tweaks on TPs: not sending the callback URL and instead waiting 15sec... (diff) | |
download | opensim-SC_OLD-3891a8946bb72c9256d8de4185bf4a72c90be859.zip opensim-SC_OLD-3891a8946bb72c9256d8de4185bf4a72c90be859.tar.gz opensim-SC_OLD-3891a8946bb72c9256d8de4185bf4a72c90be859.tar.bz2 opensim-SC_OLD-3891a8946bb72c9256d8de4185bf4a72c90be859.tar.xz |
New Teleport protocol (V2), still compatible with V1 and older. (version of the destination is being checked)
In this new protocol, and as committed before, the viewer is not sent EnableSimulator/EstablishChildCommunication for the destination. Instead, it is sent TeleportFinish directly. TeleportFinish, in turn, makes the viewer send a UserCircuitCode packet followed by CompleteMovementIntoRegion packet. These 2 packets tend to occur one after the other almost immediately to the point that when CMIR arrives the client is not even connected yet and that packet is ignored (there might have been some race conditions here before); then the viewer sends CMIR again within 5-8 secs. But the delay between them may be higher in busier regions, which may lead to race conditions.
This commit improves the process so there are are no race conditions at the destination. CompleteMovement (triggered by the viewer) waits until Update has been sent from the origin. Update, in turn, waits until there is a *root* scene presence -- so making sure CompleteMovement has run MakeRoot. In other words, there are two threadlets at the destination, one from the viewer and one from the origin region, waiting for each other to do the right thing. That makes it safe to close the agent at the origin upon return of the Update call without having to wait for callback, because we are absolutely sure that the viewer knows it is in th new region.
Note also that in the V1 protocol, the destination was getting UseCircuitCode from the viewer twice -- once on EstablishAgentCommunication and then again on TeleportFinish. The second UCC was being ignored, but it shows how we were not following the expected steps...
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index d4ef3d9..da8a1b8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -4221,6 +4221,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
4221 | } | 4221 | } |
4222 | 4222 | ||
4223 | childAgentUpdate.ChildAgentDataUpdate(cAgentData); | 4223 | childAgentUpdate.ChildAgentDataUpdate(cAgentData); |
4224 | |||
4225 | int ntimes = 20; | ||
4226 | if (cAgentData.SenderWantsToWaitForRoot) | ||
4227 | { | ||
4228 | while (childAgentUpdate.IsChildAgent && ntimes-- > 0) | ||
4229 | Thread.Sleep(500); | ||
4230 | |||
4231 | m_log.DebugFormat( | ||
4232 | "[SCENE PRESENCE]: Found presence {0} {1} {2} in {3} after {4} waits", | ||
4233 | childAgentUpdate.Name, childAgentUpdate.UUID, childAgentUpdate.IsChildAgent ? "child" : "root", RegionInfo.RegionName, 20 - ntimes); | ||
4234 | |||
4235 | if (childAgentUpdate.IsChildAgent) | ||
4236 | return false; | ||
4237 | } | ||
4224 | return true; | 4238 | return true; |
4225 | } | 4239 | } |
4226 | return false; | 4240 | return false; |
@@ -4278,10 +4292,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
4278 | m_log.WarnFormat( | 4292 | m_log.WarnFormat( |
4279 | "[SCENE PRESENCE]: Did not find presence with id {0} in {1} before timeout", | 4293 | "[SCENE PRESENCE]: Did not find presence with id {0} in {1} before timeout", |
4280 | agentID, RegionInfo.RegionName); | 4294 | agentID, RegionInfo.RegionName); |
4281 | // else | ||
4282 | // m_log.DebugFormat( | ||
4283 | // "[SCENE PRESENCE]: Found presence {0} {1} {2} in {3} after {4} waits", | ||
4284 | // sp.Name, sp.UUID, sp.IsChildAgent ? "child" : "root", RegionInfo.RegionName, 10 - ntimes); | ||
4285 | 4295 | ||
4286 | return sp; | 4296 | return sp; |
4287 | } | 4297 | } |