aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs47
1 files changed, 46 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 6bdb8a3..b6ca566 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -60,6 +60,7 @@ namespace OpenSim.Region.Environment.Scenes
60 protected Timer m_restartWaitTimer = new Timer(); 60 protected Timer m_restartWaitTimer = new Timer();
61 61
62 protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>(); 62 protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>();
63 protected List<RegionInfo> m_neighbours = new List<RegionInfo>();
63 64
64 public InnerScene m_innerScene; 65 public InnerScene m_innerScene;
65 66
@@ -266,13 +267,37 @@ namespace OpenSim.Region.Environment.Scenes
266 267
267 public override bool OtherRegionUp(RegionInfo otherRegion) 268 public override bool OtherRegionUp(RegionInfo otherRegion)
268 { 269 {
269 // Another region is up. We have to tell all our ScenePresences about it 270 // Another region is up.
271 // We have to tell all our ScenePresences about it..
272 //and add it to the neighbor list.
270 273
271 274
272 if (RegionInfo.RegionHandle != otherRegion.RegionHandle) 275 if (RegionInfo.RegionHandle != otherRegion.RegionHandle)
273 { 276 {
274 if ((Math.Abs(otherRegion.RegionLocX - RegionInfo.RegionLocX) <= 1) && (Math.Abs(otherRegion.RegionLocY - RegionInfo.RegionLocY) <= 1)) 277 if ((Math.Abs(otherRegion.RegionLocX - RegionInfo.RegionLocX) <= 1) && (Math.Abs(otherRegion.RegionLocY - RegionInfo.RegionLocY) <= 1))
275 { 278 {
279 for (int i = 0; i < m_neighbours.Count; i++)
280 {
281 // The purpose of this loop is to re-update the known neighbors
282 // when another region comes up on top of another one.
283 // The latest region in that location ends up in the
284 // 'known neighbors list'
285 // Additionally, the commFailTF property gets reset to false.
286 if (m_neighbours[i].RegionHandle == otherRegion.RegionHandle)
287 {
288 m_neighbours[i] = otherRegion;
289 }
290 }
291
292 // If the value isn't in the neighbours, add it.
293 // If the RegionInfo isn't exact but is for the same XY World location,
294 // then the above loop will fix that.
295
296 if (!(m_neighbours.Contains(otherRegion)))
297 {
298 m_neighbours.Add(otherRegion);
299 }
300
276 if (!(m_regionRestartNotifyList.Contains(otherRegion))) 301 if (!(m_regionRestartNotifyList.Contains(otherRegion)))
277 { 302 {
278 m_regionRestartNotifyList.Add(otherRegion); 303 m_regionRestartNotifyList.Add(otherRegion);
@@ -1112,6 +1137,7 @@ namespace OpenSim.Region.Environment.Scenes
1112 m_sceneGridService.OnAvatarCrossingIntoRegion += AgentCrossing; 1137 m_sceneGridService.OnAvatarCrossingIntoRegion += AgentCrossing;
1113 m_sceneGridService.OnCloseAgentConnection += CloseConnection; 1138 m_sceneGridService.OnCloseAgentConnection += CloseConnection;
1114 m_sceneGridService.OnRegionUp += OtherRegionUp; 1139 m_sceneGridService.OnRegionUp += OtherRegionUp;
1140 m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate;
1115 1141
1116 m_sceneGridService.KillObject = SendKillObject; 1142 m_sceneGridService.KillObject = SendKillObject;
1117 } 1143 }
@@ -1121,6 +1147,7 @@ namespace OpenSim.Region.Environment.Scenes
1121 /// </summary> 1147 /// </summary>
1122 public void UnRegisterReginWithComms() 1148 public void UnRegisterReginWithComms()
1123 { 1149 {
1150 m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate;
1124 m_sceneGridService.OnRegionUp -= OtherRegionUp; 1151 m_sceneGridService.OnRegionUp -= OtherRegionUp;
1125 m_sceneGridService.OnExpectUser -= NewUserConnection; 1152 m_sceneGridService.OnExpectUser -= NewUserConnection;
1126 m_sceneGridService.OnAvatarCrossingIntoRegion -= AgentCrossing; 1153 m_sceneGridService.OnAvatarCrossingIntoRegion -= AgentCrossing;
@@ -1182,6 +1209,24 @@ namespace OpenSim.Region.Environment.Scenes
1182 } 1209 }
1183 } 1210 }
1184 1211
1212 public virtual bool IncomingChildAgentDataUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData)
1213 {
1214 ScenePresence childAgentUpdate = GetScenePresence(new LLUUID(cAgentData.AgentID));
1215 if (!(childAgentUpdate.Equals(null)))
1216 {
1217 // I can't imagine *yet* why we would get an update if the agent is a root agent..
1218 // however to avoid a race condition crossing borders..
1219 if (childAgentUpdate.IsChildAgent)
1220 {
1221 //Send Data to ScenePresence
1222 childAgentUpdate.ChildAgentDataUpdate(cAgentData);
1223 // Not Implemented:
1224 //TODO: Do we need to pass the message on to one of our neighbors?
1225
1226 }
1227 }
1228 return true;
1229 }
1185 /// <summary> 1230 /// <summary>
1186 /// 1231 ///
1187 /// </summary> 1232 /// </summary>