diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index a2625c4..df7a72a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -85,15 +85,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
85 | if (neighbourService != null) | 85 | if (neighbourService != null) |
86 | neighbour = neighbourService.HelloNeighbour(regionhandle, region); | 86 | neighbour = neighbourService.HelloNeighbour(regionhandle, region); |
87 | else | 87 | else |
88 | m_log.DebugFormat( | 88 | m_log.DebugFormat( "{0} neighbour service provided for region {0} to inform neigbhours of status", LogHeader, m_scene.Name); |
89 | "[SCENE COMMUNICATION SERVICE]: No neighbour service provided for region {0} to inform neigbhours of status", | ||
90 | m_scene.Name); | ||
91 | 89 | ||
92 | if (neighbour != null) | 90 | if (neighbour != null) |
93 | { | 91 | { |
94 | m_log.DebugFormat( | 92 | m_log.DebugFormat( "{0} Region {1} successfully informed neighbour {2} at {3}-{4} that it is up", |
95 | "[SCENE COMMUNICATION SERVICE]: Region {0} successfully informed neighbour {1} at {2}-{3} that it is up", | 93 | LogHeader, m_scene.Name, neighbour.RegionName, Util.WorldToRegionLoc(x), Util.WorldToRegionLoc(y)); |
96 | m_scene.Name, neighbour.RegionName, x / Constants.RegionSize, y / Constants.RegionSize); | ||
97 | 94 | ||
98 | m_scene.EventManager.TriggerOnRegionUp(neighbour); | 95 | m_scene.EventManager.TriggerOnRegionUp(neighbour); |
99 | } | 96 | } |
@@ -112,12 +109,35 @@ namespace OpenSim.Region.Framework.Scenes | |||
112 | List<GridRegion> neighbours | 109 | List<GridRegion> neighbours |
113 | = m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID); | 110 | = m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID); |
114 | 111 | ||
115 | m_log.DebugFormat( | 112 | List<GridRegion> onlineNeighbours = new List<GridRegion>(); |
116 | "[SCENE COMMUNICATION SERVICE]: Informing {0} neighbours that region {1} is up", | ||
117 | neighbours.Count, m_scene.Name); | ||
118 | 113 | ||
119 | foreach (GridRegion n in neighbours) | 114 | foreach (GridRegion n in neighbours) |
120 | { | 115 | { |
116 | OpenSim.Framework.RegionFlags? regionFlags = n.RegionFlags; | ||
117 | |||
118 | // m_log.DebugFormat( | ||
119 | // "{0}: Region flags for {1} as seen by {2} are {3}", | ||
120 | // LogHeader, n.RegionName, m_scene.Name, regionFlags != null ? regionFlags.ToString() : "not present"); | ||
121 | |||
122 | // Robust services before 2015-01-14 do not return the regionFlags information. In this case, we could | ||
123 | // make a separate RegionFlags call but this would involve a network call for each neighbour. | ||
124 | if (regionFlags != null) | ||
125 | { | ||
126 | if ((regionFlags & OpenSim.Framework.RegionFlags.RegionOnline) != 0) | ||
127 | onlineNeighbours.Add(n); | ||
128 | } | ||
129 | else | ||
130 | { | ||
131 | onlineNeighbours.Add(n); | ||
132 | } | ||
133 | } | ||
134 | |||
135 | m_log.DebugFormat( | ||
136 | "{0} Informing {1} neighbours that region {2} is up", | ||
137 | LogHeader, onlineNeighbours.Count, m_scene.Name); | ||
138 | |||
139 | foreach (GridRegion n in onlineNeighbours) | ||
140 | { | ||
121 | InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync; | 141 | InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync; |
122 | d.BeginInvoke(neighbourService, region, n.RegionHandle, | 142 | d.BeginInvoke(neighbourService, region, n.RegionHandle, |
123 | InformNeighborsThatRegionisUpCompleted, | 143 | InformNeighborsThatRegionisUpCompleted, |
@@ -155,6 +175,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
155 | 175 | ||
156 | public void SendChildAgentDataUpdate(AgentPosition cAgentData, ScenePresence presence) | 176 | public void SendChildAgentDataUpdate(AgentPosition cAgentData, ScenePresence presence) |
157 | { | 177 | { |
178 | // m_log.DebugFormat( | ||
179 | // "[SCENE COMMUNICATION SERVICE]: Sending child agent position updates for {0} in {1}", | ||
180 | // presence.Name, m_scene.Name); | ||
181 | |||
158 | // This assumes that we know what our neighbors are. | 182 | // This assumes that we know what our neighbors are. |
159 | try | 183 | try |
160 | { | 184 | { |
@@ -230,7 +254,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
230 | // We must take a copy here since handle acts like a reference when used in an iterator. | 254 | // 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. | 255 | // This leads to race conditions if directly passed to SendCloseChildAgent with more than one neighbour region. |
232 | ulong handleCopy = handle; | 256 | ulong handleCopy = handle; |
233 | Util.FireAndForget((o) => { SendCloseChildAgent(agentID, handleCopy, auth_code); }); | 257 | Util.FireAndForget( |
258 | o => SendCloseChildAgent(agentID, handleCopy, auth_code), | ||
259 | null, | ||
260 | "SceneCommunicationService.SendCloseChildAgentConnections"); | ||
234 | } | 261 | } |
235 | } | 262 | } |
236 | 263 | ||