aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework/EntityTransfer
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-08-15 13:46:46 +0100
committerJustin Clark-Casey (justincc)2013-08-15 13:46:46 +0100
commit2231fcf5b45be9a2f5b6e1a2665ff7223e275b33 (patch)
tree7d473725fe4240a272eb30099f17fa9bc285eb3c /OpenSim/Region/CoreModules/Framework/EntityTransfer
parentActually implement the bot request object textures switch started in 225cf0d. (diff)
downloadopensim-SC-2231fcf5b45be9a2f5b6e1a2665ff7223e275b33.zip
opensim-SC-2231fcf5b45be9a2f5b6e1a2665ff7223e275b33.tar.gz
opensim-SC-2231fcf5b45be9a2f5b6e1a2665ff7223e275b33.tar.bz2
opensim-SC-2231fcf5b45be9a2f5b6e1a2665ff7223e275b33.tar.xz
Do not use the SP.DoNotCloseAfterTeleport flag for child agent connections.
This approach has problems if a client quits without sending a proper logout but then reconnects before the connection is closed due to inactivity. In this case, the DoNotCloseAfterTeleport was wrongly set. The simplest approach is to close child agents on teleport as quickly as possible so that races are very unlikely to occur Hence, this code now closes child agents as the first action after a sucessful teleport.
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs24
1 files changed, 12 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 87f0264..93a089d 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1055,6 +1055,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1055 1055
1056 m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); 1056 m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp);
1057 1057
1058 // Need to signal neighbours whether child agents may need closing irrespective of whether this
1059 // one needed closing. We also need to close child agents as quickly as possible to avoid complicated
1060 // race conditions with rapid agent releporting (e.g. from A1 to a non-neighbour B, back
1061 // to a neighbour A2 then off to a non-neighbour C). Closing child agents any later requires complex
1062 // distributed checks to avoid problems in rapid reteleporting scenarios and where child agents are
1063 // abandoned without proper close by viewer but then re-used by an incoming connection.
1064 sp.CloseChildAgents(newRegionX, newRegionY);
1065
1058 // May need to logout or other cleanup 1066 // May need to logout or other cleanup
1059 AgentHasMovedAway(sp, logout); 1067 AgentHasMovedAway(sp, logout);
1060 1068
@@ -1064,17 +1072,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1064 // Now let's make it officially a child agent 1072 // Now let's make it officially a child agent
1065 sp.MakeChildAgent(); 1073 sp.MakeChildAgent();
1066 1074
1067 // May still need to signal neighbours whether child agents may need closing irrespective of whether this
1068 // one needed closing. Neighbour regions also contain logic to prevent a close if a subsequent move or
1069 // teleport re-established the child connection.
1070 //
1071 // It may be possible to also close child agents after a pause but one needs to be very careful about
1072 // race conditions between different regions on rapid teleporting (e.g. from A1 to a non-neighbour B, back
1073 // to a neighbour A2 then off to a non-neighbour C. Also, closing child agents early may be more compatible
1074 // with complicated scenarios where there a mixture of V1 and V2 teleports, though this is conjecture. It's
1075 // easier to close immediately and greatly reduce the scope of race conditions if possible.
1076 sp.CloseChildAgents(newRegionX, newRegionY);
1077
1078 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone 1075 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
1079 if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) 1076 if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
1080 { 1077 {
@@ -1096,7 +1093,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1096 } 1093 }
1097 else 1094 else
1098 { 1095 {
1099 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Not closing agent {0}, user is back in {1}", sp.Name, Scene.Name); 1096 m_log.DebugFormat(
1097 "[ENTITY TRANSFER MODULE]: Connection for {0} in {1} has been re-established after teleport. Not closing.",
1098 sp.Name, Scene.Name);
1099
1100 sp.DoNotCloseAfterTeleport = false; 1100 sp.DoNotCloseAfterTeleport = false;
1101 } 1101 }
1102 } 1102 }