diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 52f46f2..a2625c4 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -52,6 +52,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
52 | public class SceneCommunicationService //one instance per region | 52 | public class SceneCommunicationService //one instance per region |
53 | { | 53 | { |
54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
55 | private static string LogHeader = "[SCENE COMMUNICATION SERVICE]"; | ||
55 | 56 | ||
56 | protected RegionInfo m_regionInfo; | 57 | protected RegionInfo m_regionInfo; |
57 | protected Scene m_scene; | 58 | protected Scene m_scene; |
@@ -100,7 +101,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
100 | { | 101 | { |
101 | m_log.WarnFormat( | 102 | m_log.WarnFormat( |
102 | "[SCENE COMMUNICATION SERVICE]: Region {0} failed to inform neighbour at {1}-{2} that it is up.", | 103 | "[SCENE COMMUNICATION SERVICE]: Region {0} failed to inform neighbour at {1}-{2} that it is up.", |
103 | m_scene.Name, x / Constants.RegionSize, y / Constants.RegionSize); | 104 | m_scene.Name, Util.WorldToRegionLoc(x), Util.WorldToRegionLoc(y)); |
104 | } | 105 | } |
105 | } | 106 | } |
106 | 107 | ||
@@ -166,7 +167,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
166 | // we only want to send one update to each simulator; the simulator will | 167 | // we only want to send one update to each simulator; the simulator will |
167 | // hand it off to the regions where a child agent exists, this does assume | 168 | // hand it off to the regions where a child agent exists, this does assume |
168 | // that the region position is cached or performance will degrade | 169 | // that the region position is cached or performance will degrade |
169 | Utils.LongToUInts(regionHandle, out x, out y); | 170 | Util.RegionHandleToWorldLoc(regionHandle, out x, out y); |
170 | GridRegion dest = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); | 171 | GridRegion dest = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); |
171 | if (dest == null) | 172 | if (dest == null) |
172 | continue; | 173 | continue; |
@@ -206,7 +207,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
206 | 207 | ||
207 | //m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID); | 208 | //m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID); |
208 | uint x = 0, y = 0; | 209 | uint x = 0, y = 0; |
209 | Utils.LongToUInts(regionHandle, out x, out y); | 210 | Util.RegionHandleToWorldLoc(regionHandle, out x, out y); |
210 | 211 | ||
211 | GridRegion destination = m_scene.GridService.GetRegionByPosition(m_regionInfo.ScopeID, (int)x, (int)y); | 212 | GridRegion destination = m_scene.GridService.GetRegionByPosition(m_regionInfo.ScopeID, (int)x, (int)y); |
212 | 213 | ||
@@ -226,6 +227,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
226 | { | 227 | { |
227 | foreach (ulong handle in regionslst) | 228 | foreach (ulong handle in regionslst) |
228 | { | 229 | { |
230 | // We must take a copy here since handle acts like a reference when used in an iterator. | ||
231 | // This leads to race conditions if directly passed to SendCloseChildAgent with more than one neighbour region. | ||
229 | ulong handleCopy = handle; | 232 | ulong handleCopy = handle; |
230 | Util.FireAndForget((o) => { SendCloseChildAgent(agentID, handleCopy, auth_code); }); | 233 | Util.FireAndForget((o) => { SendCloseChildAgent(agentID, handleCopy, auth_code); }); |
231 | } | 234 | } |