aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs41
1 files changed, 29 insertions, 12 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index fd17d56..a9791ee 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -216,7 +216,7 @@ namespace OpenSim.Region.Environment.Scenes
216 m_regionHandle = m_regInfo.RegionHandle; 216 m_regionHandle = m_regInfo.RegionHandle;
217 m_regionName = m_regInfo.RegionName; 217 m_regionName = m_regInfo.RegionName;
218 m_datastore = m_regInfo.DataStore; 218 m_datastore = m_regInfo.DataStore;
219 RegisterRegionWithComms(); 219
220 m_physicalPrim = physicalPrim; 220 m_physicalPrim = physicalPrim;
221 m_sendTasksToChild = SendTasksToChild; 221 m_sendTasksToChild = SendTasksToChild;
222 222
@@ -244,6 +244,7 @@ namespace OpenSim.Region.Environment.Scenes
244 244
245 httpListener = httpServer; 245 httpListener = httpServer;
246 m_dumpAssetsToFile = dumpAssetsToFile; 246 m_dumpAssetsToFile = dumpAssetsToFile;
247 RegisterRegionWithComms();
247 } 248 }
248 249
249 #endregion 250 #endregion
@@ -257,21 +258,29 @@ namespace OpenSim.Region.Environment.Scenes
257 m_eventManager.OnPermissionError += SendPermissionAlert; 258 m_eventManager.OnPermissionError += SendPermissionAlert;
258 } 259 }
259 260
260 public override void OtherRegionUp(RegionInfo otherRegion) 261 public override bool OtherRegionUp(RegionInfo otherRegion)
261 { 262 {
262 // Another region is up. We have to tell all our ScenePresences about it 263 // Another region is up. We have to tell all our ScenePresences about it
263 // This fails to get the desired effect and needs further work. 264 // This fails to get the desired effect and needs further work.
264 265 try
265 ForEachScenePresence(delegate(ScenePresence agent)
266 { 266 {
267 if (!(agent.IsChildAgent)) 267
268 { 268 ForEachScenePresence(delegate(ScenePresence agent)
269 InformClientOfNeighbor(agent, otherRegion); 269 {
270 this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo()); 270 if (!(agent.IsChildAgent))
271 271 {
272 this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo());
273 InformClientOfNeighbor(agent, otherRegion);
274 }
272 } 275 }
276
277 );
273 } 278 }
274 ); 279 catch (System.NullReferenceException)
280 {
281 // This means that we're not booted up completely yet.
282 }
283 return true;
275 } 284 }
276 public virtual void Restart(float seconds) 285 public virtual void Restart(float seconds)
277 { 286 {
@@ -1068,9 +1077,13 @@ namespace OpenSim.Region.Environment.Scenes
1068 m_sceneGridService.OnExpectUser += NewUserConnection; 1077 m_sceneGridService.OnExpectUser += NewUserConnection;
1069 m_sceneGridService.OnAvatarCrossingIntoRegion += AgentCrossing; 1078 m_sceneGridService.OnAvatarCrossingIntoRegion += AgentCrossing;
1070 m_sceneGridService.OnCloseAgentConnection += CloseConnection; 1079 m_sceneGridService.OnCloseAgentConnection += CloseConnection;
1080 m_sceneGridService.OnRegionUp += OtherRegionUp;
1081 // Tell Other regions that I'm here.
1082 m_sceneGridService.InformNeighborsThatRegionisUp(RegionInfo);
1071 } 1083 }
1072 public void UnRegisterReginWithComms() 1084 public void UnRegisterReginWithComms()
1073 { 1085 {
1086 m_sceneGridService.OnRegionUp -= OtherRegionUp;
1074 m_sceneGridService.OnExpectUser -= NewUserConnection; 1087 m_sceneGridService.OnExpectUser -= NewUserConnection;
1075 m_sceneGridService.OnAvatarCrossingIntoRegion -= AgentCrossing; 1088 m_sceneGridService.OnAvatarCrossingIntoRegion -= AgentCrossing;
1076 m_sceneGridService.OnCloseAgentConnection -= CloseConnection; 1089 m_sceneGridService.OnCloseAgentConnection -= CloseConnection;
@@ -1578,9 +1591,13 @@ namespace OpenSim.Region.Environment.Scenes
1578 /// <param name="action"></param> 1591 /// <param name="action"></param>
1579 public void ForEachScenePresence(Action<ScenePresence> action) 1592 public void ForEachScenePresence(Action<ScenePresence> action)
1580 { 1593 {
1581 foreach (ScenePresence presence in m_scenePresences.Values) 1594 // We don't want to try to send messages if there are no avatar.
1595 if (!(m_scenePresences.Equals(null)))
1582 { 1596 {
1583 action(presence); 1597 foreach (ScenePresence presence in m_scenePresences.Values)
1598 {
1599 action(presence);
1600 }
1584 } 1601 }
1585 } 1602 }
1586 1603