diff options
author | Justin Clark-Casey (justincc) | 2013-09-02 19:15:10 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-09-02 19:15:10 +0100 |
commit | 857f24a5e2b59072ad4d987d5e64318f5249c7e7 (patch) | |
tree | fb2bdcae26a3eb6290ed9a587cf729172bf4f8a2 /OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |
parent | Comment out warning about agent updating without valid session ID for now. (diff) | |
download | opensim-SC_OLD-857f24a5e2b59072ad4d987d5e64318f5249c7e7.zip opensim-SC_OLD-857f24a5e2b59072ad4d987d5e64318f5249c7e7.tar.gz opensim-SC_OLD-857f24a5e2b59072ad4d987d5e64318f5249c7e7.tar.bz2 opensim-SC_OLD-857f24a5e2b59072ad4d987d5e64318f5249c7e7.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/Avatar/Chat/ChatModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | 15 |
1 files changed, 9 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) |