diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 1ff53c9..9e3dafb 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -465,8 +465,34 @@ namespace OpenSim | |||
465 | 465 | ||
466 | if (!String.IsNullOrEmpty(scene.RegionInfo.RegionFile)) | 466 | if (!String.IsNullOrEmpty(scene.RegionInfo.RegionFile)) |
467 | { | 467 | { |
468 | File.Delete(scene.RegionInfo.RegionFile); | 468 | if (scene.RegionInfo.RegionFile.ToLower().EndsWith(".xml")) |
469 | m_log.InfoFormat("[OPENSIM]: deleting region file \"{0}\"", scene.RegionInfo.RegionFile); | 469 | { |
470 | File.Delete(scene.RegionInfo.RegionFile); | ||
471 | m_log.InfoFormat("[OPENSIM]: deleting region file \"{0}\"", scene.RegionInfo.RegionFile); | ||
472 | } | ||
473 | if (scene.RegionInfo.RegionFile.ToLower().EndsWith(".ini")) | ||
474 | { | ||
475 | try | ||
476 | { | ||
477 | IniConfigSource source = new IniConfigSource(scene.RegionInfo.RegionFile); | ||
478 | if (source.Configs[scene.RegionInfo.RegionName] != null) | ||
479 | { | ||
480 | source.Configs.Remove(scene.RegionInfo.RegionName); | ||
481 | |||
482 | if (source.Configs.Count == 0) | ||
483 | { | ||
484 | File.Delete(scene.RegionInfo.RegionFile); | ||
485 | } | ||
486 | else | ||
487 | { | ||
488 | source.Save(scene.RegionInfo.RegionFile); | ||
489 | } | ||
490 | } | ||
491 | } | ||
492 | catch (Exception) | ||
493 | { | ||
494 | } | ||
495 | } | ||
470 | } | 496 | } |
471 | } | 497 | } |
472 | 498 | ||