aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/RegionInfo.cs6
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs30
2 files changed, 34 insertions, 2 deletions
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index eb10fac..504b303 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -259,6 +259,8 @@ namespace OpenSim.Framework
259 259
260 newFile.Save(filename); 260 newFile.Save(filename);
261 261
262 RegionFile = filename;
263
262 return; 264 return;
263 } 265 }
264 266
@@ -273,6 +275,8 @@ namespace OpenSim.Framework
273 if (configName != String.Empty && saveFile) 275 if (configName != String.Empty && saveFile)
274 source.Save(filename); 276 source.Save(filename);
275 277
278 RegionFile = filename;
279
276 return; 280 return;
277 } 281 }
278 282
@@ -285,6 +289,8 @@ namespace OpenSim.Framework
285 289
286 ReadNiniConfig(xmlsource, configName); 290 ReadNiniConfig(xmlsource, configName);
287 291
292 RegionFile = filename;
293
288 return; 294 return;
289 } 295 }
290 catch (Exception) 296 catch (Exception)
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