diff options
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 57 |
1 files changed, 39 insertions, 18 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 45d512b..218d4e4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1300,6 +1300,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1300 | // This is the method that shuts down the scene. | 1300 | // This is the method that shuts down the scene. |
1301 | public override void Close() | 1301 | public override void Close() |
1302 | { | 1302 | { |
1303 | if (m_shuttingDown) | ||
1304 | { | ||
1305 | m_log.WarnFormat("[SCENE]: Ignoring close request because already closing {0}", Name); | ||
1306 | return; | ||
1307 | } | ||
1308 | |||
1303 | m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName); | 1309 | m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName); |
1304 | 1310 | ||
1305 | StatsReporter.Close(); | 1311 | StatsReporter.Close(); |
@@ -1343,6 +1349,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1343 | 1349 | ||
1344 | m_sceneGraph.Close(); | 1350 | m_sceneGraph.Close(); |
1345 | 1351 | ||
1352 | if (!GridService.DeregisterRegion(RegionInfo.RegionID)) | ||
1353 | m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", Name); | ||
1354 | |||
1355 | base.Close(); | ||
1356 | |||
1357 | // XEngine currently listens to the EventManager.OnShutdown event to trigger script stop and persistence. | ||
1358 | // Therefore. we must dispose of the PhysicsScene after this to prevent a window where script code can | ||
1359 | // attempt to reference a null or disposed physics scene. | ||
1346 | if (PhysicsScene != null) | 1360 | if (PhysicsScene != null) |
1347 | { | 1361 | { |
1348 | PhysicsScene phys = PhysicsScene; | 1362 | PhysicsScene phys = PhysicsScene; |
@@ -1351,12 +1365,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1351 | phys.Dispose(); | 1365 | phys.Dispose(); |
1352 | phys = null; | 1366 | phys = null; |
1353 | } | 1367 | } |
1354 | |||
1355 | if (!GridService.DeregisterRegion(RegionInfo.RegionID)) | ||
1356 | m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", Name); | ||
1357 | |||
1358 | // call the base class Close method. | ||
1359 | base.Close(); | ||
1360 | } | 1368 | } |
1361 | 1369 | ||
1362 | /// <summary> | 1370 | /// <summary> |
@@ -3595,9 +3603,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
3595 | if (closeChildAgents && CapsModule != null) | 3603 | if (closeChildAgents && CapsModule != null) |
3596 | CapsModule.RemoveCaps(agentID); | 3604 | CapsModule.RemoveCaps(agentID); |
3597 | 3605 | ||
3598 | // REFACTORING PROBLEM -- well not really a problem, but just to point out that whatever | 3606 | // // REFACTORING PROBLEM -- well not really a problem, but just to point out that whatever |
3599 | // this method is doing is HORRIBLE!!! | 3607 | // // this method is doing is HORRIBLE!!! |
3600 | avatar.Scene.NeedSceneCacheClear(avatar.UUID); | 3608 | // Commented pending deletion since this method no longer appears to do anything at all |
3609 | // avatar.Scene.NeedSceneCacheClear(avatar.UUID); | ||
3601 | 3610 | ||
3602 | if (closeChildAgents && !isChildAgent) | 3611 | if (closeChildAgents && !isChildAgent) |
3603 | { | 3612 | { |
@@ -4899,13 +4908,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
4899 | /// Get a group via its UUID | 4908 | /// Get a group via its UUID |
4900 | /// </summary> | 4909 | /// </summary> |
4901 | /// <param name="fullID"></param> | 4910 | /// <param name="fullID"></param> |
4902 | /// <returns>null if no group with that name exists</returns> | 4911 | /// <returns>null if no group with that id exists</returns> |
4903 | public SceneObjectGroup GetSceneObjectGroup(UUID fullID) | 4912 | public SceneObjectGroup GetSceneObjectGroup(UUID fullID) |
4904 | { | 4913 | { |
4905 | return m_sceneGraph.GetSceneObjectGroup(fullID); | 4914 | return m_sceneGraph.GetSceneObjectGroup(fullID); |
4906 | } | 4915 | } |
4907 | 4916 | ||
4908 | /// <summary> | 4917 | /// <summary> |
4918 | /// Get a group via its local ID | ||
4919 | /// </summary> | ||
4920 | /// <remarks>This will only return a group if the local ID matches a root part</remarks> | ||
4921 | /// <param name="localID"></param> | ||
4922 | /// <returns>null if no group with that id exists</returns> | ||
4923 | public SceneObjectGroup GetSceneObjectGroup(uint localID) | ||
4924 | { | ||
4925 | return m_sceneGraph.GetSceneObjectGroup(localID); | ||
4926 | } | ||
4927 | |||
4928 | /// <summary> | ||
4909 | /// Get a group by name from the scene (will return the first | 4929 | /// Get a group by name from the scene (will return the first |
4910 | /// found, if there are more than one prim with the same name) | 4930 | /// found, if there are more than one prim with the same name) |
4911 | /// </summary> | 4931 | /// </summary> |
@@ -5065,14 +5085,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
5065 | client.SendRegionHandle(regionID, handle); | 5085 | client.SendRegionHandle(regionID, handle); |
5066 | } | 5086 | } |
5067 | 5087 | ||
5068 | public bool NeedSceneCacheClear(UUID agentID) | 5088 | // Commented pending deletion since this method no longer appears to do anything at all |
5069 | { | 5089 | // public bool NeedSceneCacheClear(UUID agentID) |
5070 | IInventoryTransferModule inv = RequestModuleInterface<IInventoryTransferModule>(); | 5090 | // { |
5071 | if (inv == null) | 5091 | // IInventoryTransferModule inv = RequestModuleInterface<IInventoryTransferModule>(); |
5072 | return true; | 5092 | // if (inv == null) |
5073 | 5093 | // return true; | |
5074 | return inv.NeedSceneCacheClear(agentID, this); | 5094 | // |
5075 | } | 5095 | // return inv.NeedSceneCacheClear(agentID, this); |
5096 | // } | ||
5076 | 5097 | ||
5077 | public void CleanTempObjects() | 5098 | public void CleanTempObjects() |
5078 | { | 5099 | { |