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.
ThreadPoolClientBranch
Tedd Hansen 2008-02-01 23:56:09 +00:00
parent 4715453159
commit 694642a482
4 changed files with 20 additions and 10 deletions

View File

@ -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)

View File

@ -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);
}
}

View File

@ -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();

View File

@ -1167,6 +1167,7 @@
<Reference name="System.Web" localCopy="false"/>
<Reference name="System.Xml" localCopy="false"/>
<Reference name="libsecondlife.dll"/>
<Reference name="OpenSim" />
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Region.Environment" />
<Reference name="OpenSim.Framework.Console"/>