aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorDiva Canto2013-07-22 11:54:35 -0700
committerDiva Canto2013-07-24 14:27:58 -0700
commit3891a8946bb72c9256d8de4185bf4a72c90be859 (patch)
tree3c4e2ca2468c287e1c0ea711ad6808bef0d82449 /OpenSim/Framework
parentFurther tweaks on TPs: not sending the callback URL and instead waiting 15sec... (diff)
downloadopensim-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 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/ChildAgentDataUpdate.cs11
1 files changed, 6 insertions, 5 deletions
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs
index 9fc048b..1c5f558 100644
--- a/OpenSim/Framework/ChildAgentDataUpdate.cs
+++ b/OpenSim/Framework/ChildAgentDataUpdate.cs
@@ -287,7 +287,7 @@ namespace OpenSim.Framework
287 public Vector3 AtAxis; 287 public Vector3 AtAxis;
288 public Vector3 LeftAxis; 288 public Vector3 LeftAxis;
289 public Vector3 UpAxis; 289 public Vector3 UpAxis;
290 public bool ChangedGrid; 290 public bool SenderWantsToWaitForRoot;
291 291
292 public float Far; 292 public float Far;
293 public float Aspect; 293 public float Aspect;
@@ -356,8 +356,9 @@ namespace OpenSim.Framework
356 args["left_axis"] = OSD.FromString(LeftAxis.ToString()); 356 args["left_axis"] = OSD.FromString(LeftAxis.ToString());
357 args["up_axis"] = OSD.FromString(UpAxis.ToString()); 357 args["up_axis"] = OSD.FromString(UpAxis.ToString());
358 358
359 359 //backwards compatibility
360 args["changed_grid"] = OSD.FromBoolean(ChangedGrid); 360 args["changed_grid"] = OSD.FromBoolean(SenderWantsToWaitForRoot);
361 args["wait_for_root"] = OSD.FromBoolean(SenderWantsToWaitForRoot);
361 args["far"] = OSD.FromReal(Far); 362 args["far"] = OSD.FromReal(Far);
362 args["aspect"] = OSD.FromReal(Aspect); 363 args["aspect"] = OSD.FromReal(Aspect);
363 364
@@ -526,8 +527,8 @@ namespace OpenSim.Framework
526 if (args["up_axis"] != null) 527 if (args["up_axis"] != null)
527 Vector3.TryParse(args["up_axis"].AsString(), out AtAxis); 528 Vector3.TryParse(args["up_axis"].AsString(), out AtAxis);
528 529
529 if (args["changed_grid"] != null) 530 if (args.ContainsKey("wait_for_root") && args["wait_for_root"] != null)
530 ChangedGrid = args["changed_grid"].AsBoolean(); 531 SenderWantsToWaitForRoot = args["wait_for_root"].AsBoolean();
531 532
532 if (args["far"] != null) 533 if (args["far"] != null)
533 Far = (float)(args["far"].AsReal()); 534 Far = (float)(args["far"].AsReal());