From 694642a482ffefb9c11ef05d833c508f383d2f0d Mon Sep 17 00:00:00 2001
From: Tedd Hansen
Date: Fri, 1 Feb 2008 23:56:09 +0000
Subject: Moved iniFilePath to a static and put it in
OpenSim.Application.iniFilePath. Refreshing config based on this. Temporarily
disabled feature to refresh config file while running.
---
OpenSim/Region/Application/Application.cs | 2 ++
OpenSim/Region/Application/OpenSimMain.cs | 14 +++++++-------
.../ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs | 11 +++++++++--
prebuild.xml | 3 ++-
4 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
index bf44274..2045b56 100644
--- a/OpenSim/Region/Application/Application.cs
+++ b/OpenSim/Region/Application/Application.cs
@@ -35,6 +35,8 @@ namespace OpenSim
{
public class Application
{
+ public static string iniFilePath = "";
+
//could move our main function into OpenSimMain and kill this class
[STAThread]
public static void Main(string[] args)
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index 70f9fd0..ad5a960 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -125,21 +125,21 @@ namespace OpenSim
AddinManager.Initialize(".");
AddinManager.Registry.Update(null);
- string iniFilePath = startupConfig.GetString("inifile", "OpenSim.ini");
+ Application.iniFilePath = startupConfig.GetString("inifile", "OpenSim.ini");
m_config = new IniConfigSource();
//check for .INI file (either default or name passed in command line)
- if (File.Exists(iniFilePath))
+ if (File.Exists(Application.iniFilePath))
{
- m_config.Merge(new IniConfigSource(iniFilePath));
+ m_config.Merge(new IniConfigSource(Application.iniFilePath));
m_config.Merge(configSource);
}
else
{
- iniFilePath = Path.Combine(Util.configDir(), iniFilePath);
- if (File.Exists(iniFilePath))
+ Application.iniFilePath = Path.Combine(Util.configDir(), Application.iniFilePath);
+ if (File.Exists(Application.iniFilePath))
{
- m_config.Merge(new IniConfigSource(iniFilePath));
+ m_config.Merge(new IniConfigSource(Application.iniFilePath));
m_config.Merge(configSource);
}
else
@@ -149,7 +149,7 @@ namespace OpenSim
m_config.Merge(configSource);
- m_config.Save(iniFilePath);
+ m_config.Save(Application.iniFilePath);
}
}
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs
index c237282..a6d1019 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs
@@ -28,6 +28,7 @@
using System;
+using System.IO;
using Nini.Config;
using OpenSim.Framework.Console;
using OpenSim.Region.Environment.Interfaces;
@@ -128,8 +129,14 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
RefreshConfigFileSeconds = ScriptConfigSource.GetInt("RefreshConfig", 0);
// Reload from disk
- ConfigSource.Reload();
- // Create a new object (probably not necessary?)
+ //ConfigSource.Reload();
+ if (File.Exists(OpenSim.Application.iniFilePath))
+ {
+ //ConfigSource.Merge(new IniConfigSource(OpenSim.Application.iniFilePath));
+ }
+
+
+ // Create a new object (probably not necessary?)
// ScriptConfigSource = ConfigSource.Configs[ScriptEngineName];
if (m_EventQueueManager != null) m_EventQueueManager.ReadConfig();
diff --git a/prebuild.xml b/prebuild.xml
index c4ab41b..22ab82e 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -1161,12 +1161,13 @@
../../../../bin/
- ../../../../bin/ScriptEngines/
+ ../../../../bin/ScriptEngines/
+
--
cgit v1.1