aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorTedd Hansen2008-02-01 23:56:09 +0000
committerTedd Hansen2008-02-01 23:56:09 +0000
commit694642a482ffefb9c11ef05d833c508f383d2f0d (patch)
treeac2dd670d40e53cf83a3069962d3feb9490b54b0 /OpenSim
parentBugfix, maybe it won't crash during startup and crash somewhere else instead? :) (diff)
downloadopensim-SC_OLD-694642a482ffefb9c11ef05d833c508f383d2f0d.zip
opensim-SC_OLD-694642a482ffefb9c11ef05d833c508f383d2f0d.tar.gz
opensim-SC_OLD-694642a482ffefb9c11ef05d833c508f383d2f0d.tar.bz2
opensim-SC_OLD-694642a482ffefb9c11ef05d833c508f383d2f0d.tar.xz
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.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Application/Application.cs2
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs14
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs11
3 files changed, 18 insertions, 9 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
35{ 35{
36 public class Application 36 public class Application
37 { 37 {
38 public static string iniFilePath = "";
39
38 //could move our main function into OpenSimMain and kill this class 40 //could move our main function into OpenSimMain and kill this class
39 [STAThread] 41 [STAThread]
40 public static void Main(string[] args) 42 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
125 AddinManager.Initialize("."); 125 AddinManager.Initialize(".");
126 AddinManager.Registry.Update(null); 126 AddinManager.Registry.Update(null);
127 127
128 string iniFilePath = startupConfig.GetString("inifile", "OpenSim.ini"); 128 Application.iniFilePath = startupConfig.GetString("inifile", "OpenSim.ini");
129 129
130 m_config = new IniConfigSource(); 130 m_config = new IniConfigSource();
131 //check for .INI file (either default or name passed in command line) 131 //check for .INI file (either default or name passed in command line)
132 if (File.Exists(iniFilePath)) 132 if (File.Exists(Application.iniFilePath))
133 { 133 {
134 m_config.Merge(new IniConfigSource(iniFilePath)); 134 m_config.Merge(new IniConfigSource(Application.iniFilePath));
135 m_config.Merge(configSource); 135 m_config.Merge(configSource);
136 } 136 }
137 else 137 else
138 { 138 {
139 iniFilePath = Path.Combine(Util.configDir(), iniFilePath); 139 Application.iniFilePath = Path.Combine(Util.configDir(), Application.iniFilePath);
140 if (File.Exists(iniFilePath)) 140 if (File.Exists(Application.iniFilePath))
141 { 141 {
142 m_config.Merge(new IniConfigSource(iniFilePath)); 142 m_config.Merge(new IniConfigSource(Application.iniFilePath));
143 m_config.Merge(configSource); 143 m_config.Merge(configSource);
144 } 144 }
145 else 145 else
@@ -149,7 +149,7 @@ namespace OpenSim
149 149
150 m_config.Merge(configSource); 150 m_config.Merge(configSource);
151 151
152 m_config.Save(iniFilePath); 152 m_config.Save(Application.iniFilePath);
153 } 153 }
154 } 154 }
155 155
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 @@
28 28
29 29
30using System; 30using System;
31using System.IO;
31using Nini.Config; 32using Nini.Config;
32using OpenSim.Framework.Console; 33using OpenSim.Framework.Console;
33using OpenSim.Region.Environment.Interfaces; 34using OpenSim.Region.Environment.Interfaces;
@@ -128,8 +129,14 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
128 RefreshConfigFileSeconds = ScriptConfigSource.GetInt("RefreshConfig", 0); 129 RefreshConfigFileSeconds = ScriptConfigSource.GetInt("RefreshConfig", 0);
129 130
130 // Reload from disk 131 // Reload from disk
131 ConfigSource.Reload(); 132 //ConfigSource.Reload();
132 // Create a new object (probably not necessary?) 133 if (File.Exists(OpenSim.Application.iniFilePath))
134 {
135 //ConfigSource.Merge(new IniConfigSource(OpenSim.Application.iniFilePath));
136 }
137
138
139 // Create a new object (probably not necessary?)
133// ScriptConfigSource = ConfigSource.Configs[ScriptEngineName]; 140// ScriptConfigSource = ConfigSource.Configs[ScriptEngineName];
134 141
135 if (m_EventQueueManager != null) m_EventQueueManager.ReadConfig(); 142 if (m_EventQueueManager != null) m_EventQueueManager.ReadConfig();