diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | 15 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 7 |
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 |