diff options
author | Dr Scofield | 2008-09-18 15:44:05 +0000 |
---|---|---|
committer | Dr Scofield | 2008-09-18 15:44:05 +0000 |
commit | 03f246d6fea009f1812019f5f036987b96b47a2b (patch) | |
tree | f7194082d70c68a4cb64e92036d6613518fbd89c /OpenSim/Region/Application/OpenSimBase.cs | |
parent | add some comments and some try blocks around object storage (diff) | |
download | opensim-SC_OLD-03f246d6fea009f1812019f5f036987b96b47a2b.zip opensim-SC_OLD-03f246d6fea009f1812019f5f036987b96b47a2b.tar.gz opensim-SC_OLD-03f246d6fea009f1812019f5f036987b96b47a2b.tar.bz2 opensim-SC_OLD-03f246d6fea009f1812019f5f036987b96b47a2b.tar.xz |
adds support to delete a region completely and offers that
functionality via the console command "delete-region" and also via
RemoteAdminPlugin.
minor typo fix.
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 4a02264..e5cf07a 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -589,6 +589,37 @@ namespace OpenSim | |||
589 | return clientServer; | 589 | return clientServer; |
590 | } | 590 | } |
591 | 591 | ||
592 | public void RemoveRegion(Scene scene, bool cleanup) | ||
593 | { | ||
594 | // only need to check this if we are not at the | ||
595 | // root level | ||
596 | if ((m_sceneManager.CurrentScene != null) && | ||
597 | (m_sceneManager.CurrentScene.RegionInfo.RegionID == scene.RegionInfo.RegionID)) | ||
598 | { | ||
599 | m_sceneManager.TrySetCurrentScene(".."); | ||
600 | } | ||
601 | |||
602 | scene.DeleteAllSceneObjects(); | ||
603 | m_regionData.Remove(scene.RegionInfo); | ||
604 | m_sceneManager.CloseScene(scene); | ||
605 | |||
606 | if (!cleanup) | ||
607 | return; | ||
608 | |||
609 | if (!String.IsNullOrEmpty(scene.RegionInfo.RegionFile)) | ||
610 | { | ||
611 | File.Delete(scene.RegionInfo.RegionFile); | ||
612 | m_log.InfoFormat("[OPENSIM MAIN] deleting region file \"{0}\"", scene.RegionInfo.RegionFile); | ||
613 | } | ||
614 | } | ||
615 | |||
616 | public void RemoveRegion(string name, bool cleanUp) | ||
617 | { | ||
618 | Scene target; | ||
619 | if (m_sceneManager.TryGetScene(name, out target)) | ||
620 | RemoveRegion(target, cleanUp); | ||
621 | } | ||
622 | |||
592 | protected override StorageManager CreateStorageManager(string connectionstring, string estateconnectionstring) | 623 | protected override StorageManager CreateStorageManager(string connectionstring, string estateconnectionstring) |
593 | { | 624 | { |
594 | return new StorageManager(m_storageDll, connectionstring, estateconnectionstring); | 625 | return new StorageManager(m_storageDll, connectionstring, estateconnectionstring); |