aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs49
1 files changed, 8 insertions, 41 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 149d2d3..0eeb22a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1147,8 +1147,8 @@ namespace OpenSim.Region.Framework.Scenes
1147 1147
1148 m_sceneGraph.Close(); 1148 m_sceneGraph.Close();
1149 1149
1150 // De-register with region communications (events cleanup) 1150 if (!GridService.DeregisterRegion(m_regInfo.RegionID))
1151 UnRegisterRegionWithComms(); 1151 m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", m_regInfo.RegionName);
1152 1152
1153 // call the base class Close method. 1153 // call the base class Close method.
1154 base.Close(); 1154 base.Close();
@@ -1173,7 +1173,9 @@ namespace OpenSim.Region.Framework.Scenes
1173 } 1173 }
1174 m_lastUpdate = Util.EnvironmentTickCount(); 1174 m_lastUpdate = Util.EnvironmentTickCount();
1175 1175
1176 HeartbeatThread = Watchdog.StartThread(Heartbeat, "Heartbeat for region " + RegionInfo.RegionName, ThreadPriority.Normal, false); 1176 HeartbeatThread
1177 = Watchdog.StartThread(
1178 Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false);
1177 } 1179 }
1178 1180
1179 /// <summary> 1181 /// <summary>
@@ -1659,8 +1661,6 @@ namespace OpenSim.Region.Framework.Scenes
1659 /// <exception cref="System.Exception">Thrown if registration of the region itself fails.</exception> 1661 /// <exception cref="System.Exception">Thrown if registration of the region itself fails.</exception>
1660 public void RegisterRegionWithGrid() 1662 public void RegisterRegionWithGrid()
1661 { 1663 {
1662 RegisterCommsEvents();
1663
1664 m_sceneGridService.SetScene(this); 1664 m_sceneGridService.SetScene(this);
1665 1665
1666 GridRegion region = new GridRegion(RegionInfo); 1666 GridRegion region = new GridRegion(RegionInfo);
@@ -2661,11 +2661,12 @@ namespace OpenSim.Region.Framework.Scenes
2661 // Send all scene object to the new client 2661 // Send all scene object to the new client
2662 Util.FireAndForget(delegate 2662 Util.FireAndForget(delegate
2663 { 2663 {
2664 Entities.ForEach(delegate(EntityBase e) 2664 EntityBase[] entities = Entities.GetEntities();
2665 foreach(EntityBase e in entities)
2665 { 2666 {
2666 if (e != null && e is SceneObjectGroup) 2667 if (e != null && e is SceneObjectGroup)
2667 ((SceneObjectGroup)e).SendFullUpdateToClient(client); 2668 ((SceneObjectGroup)e).SendFullUpdateToClient(client);
2668 }); 2669 }
2669 }); 2670 });
2670 } 2671 }
2671 2672
@@ -3328,40 +3329,6 @@ namespace OpenSim.Region.Framework.Scenes
3328 #region RegionComms 3329 #region RegionComms
3329 3330
3330 /// <summary> 3331 /// <summary>
3331 /// Register the methods that should be invoked when this scene receives various incoming events
3332 /// </summary>
3333 public void RegisterCommsEvents()
3334 {
3335 m_sceneGridService.OnAvatarCrossingIntoRegion += AgentCrossing;
3336 m_sceneGridService.OnCloseAgentConnection += IncomingCloseAgent;
3337 //m_eventManager.OnRegionUp += OtherRegionUp;
3338 //m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate;
3339 //m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar;
3340 m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid;
3341 m_sceneGridService.OnGetLandData += GetLandData;
3342 }
3343
3344 /// <summary>
3345 /// Deregister this scene from receiving incoming region events
3346 /// </summary>
3347 public void UnRegisterRegionWithComms()
3348 {
3349 m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid;
3350 //m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar;
3351 //m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate;
3352 //m_eventManager.OnRegionUp -= OtherRegionUp;
3353 m_sceneGridService.OnAvatarCrossingIntoRegion -= AgentCrossing;
3354 m_sceneGridService.OnCloseAgentConnection -= IncomingCloseAgent;
3355 m_sceneGridService.OnGetLandData -= GetLandData;
3356
3357 // this does nothing; should be removed
3358 m_sceneGridService.Close();
3359
3360 if (!GridService.DeregisterRegion(m_regInfo.RegionID))
3361 m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", m_regInfo.RegionName);
3362 }
3363
3364 /// <summary>
3365 /// Do the work necessary to initiate a new user connection for a particular scene. 3332 /// Do the work necessary to initiate a new user connection for a particular scene.
3366 /// At the moment, this consists of setting up the caps infrastructure 3333 /// At the moment, this consists of setting up the caps infrastructure
3367 /// The return bool should allow for connections to be refused, but as not all calling paths 3334 /// The return bool should allow for connections to be refused, but as not all calling paths