diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 14 |
2 files changed, 17 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index e47c339..cd588e5 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -30,7 +30,6 @@ using System.Collections.Generic; | |||
30 | using System.Net; | 30 | using System.Net; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using System.Threading; | 32 | using System.Threading; |
33 | |||
34 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Capabilities; | 34 | using OpenSim.Framework.Capabilities; |
36 | using OpenSim.Framework.Client; | 35 | using OpenSim.Framework.Client; |
@@ -595,7 +594,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
595 | 594 | ||
596 | if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) | 595 | if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) |
597 | { | 596 | { |
598 | // Thread.Sleep(5000); | 597 | // We need to delay here because Imprudence viewers, unlike v1 or v3, have a short (<200ms, <500ms) delay before |
598 | // they regard the new region as the current region after receiving the AgentMovementComplete | ||
599 | // response. If close is sent before then, it will cause the viewer to quit instead. | ||
600 | // However, if this delay is longer, then a viewer can teleport back to this region and experience | ||
601 | // a failure because the old ScenePresence has not yet been cleaned up. | ||
602 | Thread.Sleep(2000); | ||
603 | |||
599 | sp.Close(); | 604 | sp.Close(); |
600 | sp.Scene.IncomingCloseAgent(sp.UUID); | 605 | sp.Scene.IncomingCloseAgent(sp.UUID); |
601 | } | 606 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e5a9a99..91e6e5a 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1140,9 +1140,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1140 | 1140 | ||
1141 | bool flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); | 1141 | bool flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); |
1142 | MakeRootAgent(AbsolutePosition, flying); | 1142 | MakeRootAgent(AbsolutePosition, flying); |
1143 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); | ||
1144 | |||
1145 | // m_log.DebugFormat("[SCENE PRESENCE] Completed movement"); | ||
1143 | 1146 | ||
1144 | if ((m_callbackURI != null) && !m_callbackURI.Equals("")) | 1147 | if ((m_callbackURI != null) && !m_callbackURI.Equals("")) |
1145 | { | 1148 | { |
1149 | // We cannot sleep here since this would hold up the inbound packet processing thread, as | ||
1150 | // CompleteMovement() is executed synchronously. However, it might be better to delay the release | ||
1151 | // here until we know for sure that the agent is active in this region. Sending AgentMovementComplete | ||
1152 | // is not enough for Imprudence clients - there appears to be a small delay (<200ms, <500ms) until they regard this | ||
1153 | // region as the current region, meaning that a close sent before then will fail the teleport. | ||
1154 | // System.Threading.Thread.Sleep(2000); | ||
1155 | |||
1146 | m_log.DebugFormat( | 1156 | m_log.DebugFormat( |
1147 | "[SCENE PRESENCE]: Releasing {0} {1} with callback to {2}", | 1157 | "[SCENE PRESENCE]: Releasing {0} {1} with callback to {2}", |
1148 | client.Name, client.AgentId, m_callbackURI); | 1158 | client.Name, client.AgentId, m_callbackURI); |
@@ -1151,9 +1161,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1151 | m_callbackURI = null; | 1161 | m_callbackURI = null; |
1152 | } | 1162 | } |
1153 | 1163 | ||
1154 | // m_log.DebugFormat("[SCENE PRESENCE] Completed movement"); | ||
1155 | |||
1156 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); | ||
1157 | ValidateAndSendAppearanceAndAgentData(); | 1164 | ValidateAndSendAppearanceAndAgentData(); |
1158 | 1165 | ||
1159 | // Create child agents in neighbouring regions | 1166 | // Create child agents in neighbouring regions |
@@ -1168,7 +1175,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1168 | friendsModule.SendFriendsOnlineIfNeeded(ControllingClient); | 1175 | friendsModule.SendFriendsOnlineIfNeeded(ControllingClient); |
1169 | } | 1176 | } |
1170 | 1177 | ||
1171 | |||
1172 | // m_log.DebugFormat( | 1178 | // m_log.DebugFormat( |
1173 | // "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms", | 1179 | // "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms", |
1174 | // client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds); | 1180 | // client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds); |