aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-09-02 19:15:10 +0100
committerJustin Clark-Casey (justincc)2013-09-02 19:21:53 +0100
commit62b12783dfa6ed5f6b4921da302f356b4eac18f8 (patch)
tree1972b663cc8fbdc6372568a4ddf76ca702a2c0b9 /OpenSim/Region/CoreModules
parentComment out warning about agent updating without valid session ID for now. (diff)
downloadopensim-SC_OLD-62b12783dfa6ed5f6b4921da302f356b4eac18f8.zip
opensim-SC_OLD-62b12783dfa6ed5f6b4921da302f356b4eac18f8.tar.gz
opensim-SC_OLD-62b12783dfa6ed5f6b4921da302f356b4eac18f8.tar.bz2
opensim-SC_OLD-62b12783dfa6ed5f6b4921da302f356b4eac18f8.tar.xz
Fix bug where users teleporting to non-neighbour regions could continue to hear chat from their source region for some time after teleport completion.
This occurs on v2 teleport since the source region now waits 15 secs before closing the old child agent, which could still receive chat. This commit introduces a ScenePresenceState.PreClose which is set before the wait, so that ChatModule can check for ScenePresenceState.Running. This was theoretically also an issue on v1 teleport but since the pause before close was only 2 secs there, it was not noticed.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs15
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs7
2 files changed, 16 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
index 58f747b..5229c08 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
@@ -326,15 +326,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
326 UUID fromAgentID, UUID ownerID, string fromName, ChatTypeEnum type, 326 UUID fromAgentID, UUID ownerID, string fromName, ChatTypeEnum type,
327 string message, ChatSourceType src, bool ignoreDistance) 327 string message, ChatSourceType src, bool ignoreDistance)
328 { 328 {
329 Vector3 fromRegionPos = fromPos + regionPos; 329 if (presence.LifecycleState != ScenePresenceState.Running)
330 Vector3 toRegionPos = presence.AbsolutePosition + 330 return false;
331 new Vector3(presence.Scene.RegionInfo.RegionLocX * Constants.RegionSize,
332 presence.Scene.RegionInfo.RegionLocY * Constants.RegionSize, 0);
333
334 int dis = (int)Util.GetDistanceTo(toRegionPos, fromRegionPos);
335 331
336 if (!ignoreDistance) 332 if (!ignoreDistance)
337 { 333 {
334 Vector3 fromRegionPos = fromPos + regionPos;
335 Vector3 toRegionPos = presence.AbsolutePosition +
336 new Vector3(presence.Scene.RegionInfo.RegionLocX * Constants.RegionSize,
337 presence.Scene.RegionInfo.RegionLocY * Constants.RegionSize, 0);
338
339 int dis = (int)Util.GetDistanceTo(toRegionPos, fromRegionPos);
340
338 if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance || 341 if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance ||
339 type == ChatTypeEnum.Say && dis > m_saydistance || 342 type == ChatTypeEnum.Say && dis > m_saydistance ||
340 type == ChatTypeEnum.Shout && dis > m_shoutdistance) 343 type == ChatTypeEnum.Shout && dis > m_shoutdistance)
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 17ebc83..316f882 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -920,6 +920,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
920 920
921 if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) 921 if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
922 { 922 {
923 if (!sp.Scene.IncomingPreCloseAgent(sp))
924 return;
925
923 // We need to delay here because Imprudence viewers, unlike v1 or v3, have a short (<200ms, <500ms) delay before 926 // We need to delay here because Imprudence viewers, unlike v1 or v3, have a short (<200ms, <500ms) delay before
924 // they regard the new region as the current region after receiving the AgentMovementComplete 927 // they regard the new region as the current region after receiving the AgentMovementComplete
925 // response. If close is sent before then, it will cause the viewer to quit instead. 928 // response. If close is sent before then, it will cause the viewer to quit instead.
@@ -1082,6 +1085,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1082 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone 1085 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
1083 if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) 1086 if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
1084 { 1087 {
1088 if (!sp.Scene.IncomingPreCloseAgent(sp))
1089 return;
1090
1085 // RED ALERT!!!! 1091 // RED ALERT!!!!
1086 // PLEASE DO NOT DECREASE THIS WAIT TIME UNDER ANY CIRCUMSTANCES. 1092 // PLEASE DO NOT DECREASE THIS WAIT TIME UNDER ANY CIRCUMSTANCES.
1087 // THE VIEWERS SEEM TO NEED SOME TIME AFTER RECEIVING MoveAgentIntoRegion 1093 // THE VIEWERS SEEM TO NEED SOME TIME AFTER RECEIVING MoveAgentIntoRegion
@@ -1095,6 +1101,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1095 // then this will be handled in IncomingCloseAgent under lock conditions 1101 // then this will be handled in IncomingCloseAgent under lock conditions
1096 m_log.DebugFormat( 1102 m_log.DebugFormat(
1097 "[ENTITY TRANSFER MODULE]: Closing agent {0} in {1} after teleport", sp.Name, Scene.Name); 1103 "[ENTITY TRANSFER MODULE]: Closing agent {0} in {1} after teleport", sp.Name, Scene.Name);
1104
1098 sp.Scene.IncomingCloseAgent(sp.UUID, false); 1105 sp.Scene.IncomingCloseAgent(sp.UUID, false);
1099 } 1106 }
1100 else 1107 else