aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools/Configger
diff options
context:
space:
mode:
authorDiva Canto2014-05-07 16:59:11 -0700
committerDiva Canto2014-05-07 16:59:11 -0700
commit3db9b847bfc9d1b2619e3467ba4bc34d9d4e5edc (patch)
tree60cef24b4e9614bced90ee12e458f06ff457f8a4 /OpenSim/Tools/Configger
parentMakes it possible to support grids in which all the simulators share all cent... (diff)
downloadopensim-SC_OLD-3db9b847bfc9d1b2619e3467ba4bc34d9d4e5edc.zip
opensim-SC_OLD-3db9b847bfc9d1b2619e3467ba4bc34d9d4e5edc.tar.gz
opensim-SC_OLD-3db9b847bfc9d1b2619e3467ba4bc34d9d4e5edc.tar.bz2
opensim-SC_OLD-3db9b847bfc9d1b2619e3467ba4bc34d9d4e5edc.tar.xz
Allow Tools.Configger to take -inifile as argument
Diffstat (limited to 'OpenSim/Tools/Configger')
-rw-r--r--OpenSim/Tools/Configger/ConfigurationLoader.cs12
-rw-r--r--OpenSim/Tools/Configger/Main.cs5
2 files changed, 9 insertions, 8 deletions
diff --git a/OpenSim/Tools/Configger/ConfigurationLoader.cs b/OpenSim/Tools/Configger/ConfigurationLoader.cs
index 0b6ee9c..4820e0b 100644
--- a/OpenSim/Tools/Configger/ConfigurationLoader.cs
+++ b/OpenSim/Tools/Configger/ConfigurationLoader.cs
@@ -64,14 +64,14 @@ namespace OpenSim.Tools.Configger
64 /// <param name="configSettings"></param> 64 /// <param name="configSettings"></param>
65 /// <param name="networkInfo"></param> 65 /// <param name="networkInfo"></param>
66 /// <returns>A configuration that gets passed to modules</returns> 66 /// <returns>A configuration that gets passed to modules</returns>
67 public IConfigSource LoadConfigSettings() 67 public IConfigSource LoadConfigSettings(IConfig startupConfig)
68 { 68 {
69 bool iniFileExists = false; 69 bool iniFileExists = false;
70 70
71 List<string> sources = new List<string>(); 71 List<string> sources = new List<string>();
72 72
73 string iniFileName = "OpenSim.ini"; 73 string iniFileName = startupConfig.GetString("inifile", Path.Combine(".", "OpenSim.ini"));
74 string iniFilePath = Path.Combine(".", iniFileName); 74 Console.WriteLine("---> " + iniFileName + " <---");
75 75
76 if (IsUri(iniFileName)) 76 if (IsUri(iniFileName))
77 { 77 {
@@ -80,10 +80,10 @@ namespace OpenSim.Tools.Configger
80 } 80 }
81 else 81 else
82 { 82 {
83 if (File.Exists(iniFilePath)) 83 if (File.Exists(iniFileName))
84 { 84 {
85 if (!sources.Contains(iniFilePath)) 85 if (!sources.Contains(iniFileName))
86 sources.Add(iniFilePath); 86 sources.Add(iniFileName);
87 } 87 }
88 } 88 }
89 89
diff --git a/OpenSim/Tools/Configger/Main.cs b/OpenSim/Tools/Configger/Main.cs
index 61a12e3..d7d918b 100644
--- a/OpenSim/Tools/Configger/Main.cs
+++ b/OpenSim/Tools/Configger/Main.cs
@@ -35,15 +35,16 @@ namespace OpenSim.Tools.Configger
35 public static int Main(string[] args) 35 public static int Main(string[] args)
36 { 36 {
37 ArgvConfigSource argvConfig = new ArgvConfigSource(args); 37 ArgvConfigSource argvConfig = new ArgvConfigSource(args);
38
38 argvConfig.AddSwitch("Startup", "format", "f"); 39 argvConfig.AddSwitch("Startup", "format", "f");
40 argvConfig.AddSwitch("Startup", "inifile");
39 41
40 IConfig startupConfig = argvConfig.Configs["Startup"]; 42 IConfig startupConfig = argvConfig.Configs["Startup"];
41 43
42 string format = startupConfig.GetString("format", "ini"); 44 string format = startupConfig.GetString("format", "ini");
43 45
44 ConfigurationLoader loader = new ConfigurationLoader(); 46 ConfigurationLoader loader = new ConfigurationLoader();
45 47 IConfigSource s = loader.LoadConfigSettings(startupConfig);
46 IConfigSource s = loader.LoadConfigSettings();
47 48
48 if (format == "mysql") 49 if (format == "mysql")
49 { 50 {