EXPERIMENTAL: yet another variation of ES/EAC/TPFinish
Further tweaks on TPs: not sending the callback URL and instead waiting 15sec before closing the agent. This seems to be working fairly well. The viewer seems to have an 8 sec delay between UseCircuitCode and CompleteMovement.
Also added back the position on UpdateAgent, because it's needed for TPing between neighboring regions.
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...
Minor improvements on TP V1 trying to make it exactly as it was before.
More on putting TP V1 as it was
Improve the opening test in CompleteMovement, to account for multiple flags besides ViaLogin.
This commit message intentionally left blank (last commit was idiotic)
Changed the RegionHandshake packet to the Unknown queue, so that it is sent with high priority and hopefully gets to the client before AgentMovementComplete
Minor adjustment on timings of waits.
One more thing to test in order to let CompleteMovement go up the stack.
Moved TriggerOnMakeRootAgent back to the end of MakeRootAgent, to see if that eliminates the temporary placement at infinity upon TPs
Today's wild shot at the infinity problem. Wait on the child agent left behind.
The previous commit did fix the infinity problem! I'm putting the same time on TP_V1 and adding a big red warning on top of those lines.
Deleted all [ZZZ] debug messages.