aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authormingchen2007-10-28 03:41:34 +0000
committermingchen2007-10-28 03:41:34 +0000
commitd56da1c8311fdb27728580239399f429826d09a8 (patch)
tree5c16f81c58ee393475ad840691d8ce5a5c7fbb47
parent* Added 'Jim' and 'Goblin' shapes; not available in inventory yet though (diff)
downloadopensim-SC_OLD-d56da1c8311fdb27728580239399f429826d09a8.zip
opensim-SC_OLD-d56da1c8311fdb27728580239399f429826d09a8.tar.gz
opensim-SC_OLD-d56da1c8311fdb27728580239399f429826d09a8.tar.bz2
opensim-SC_OLD-d56da1c8311fdb27728580239399f429826d09a8.tar.xz
*Replaced -useexecutepath with an updated -inifile extension. You can now specify either a filename (will use the default config path, or you can specify a full path.
-rw-r--r--OpenSim/Framework/General/Util.cs22
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs30
2 files changed, 15 insertions, 37 deletions
diff --git a/OpenSim/Framework/General/Util.cs b/OpenSim/Framework/General/Util.cs
index 0c9a290..dac2545 100644
--- a/OpenSim/Framework/General/Util.cs
+++ b/OpenSim/Framework/General/Util.cs
@@ -44,7 +44,6 @@ namespace OpenSim.Framework.Utilities
44 private static object XferLock = new object(); 44 private static object XferLock = new object();
45 private static Dictionary<LLUUID, string> capsURLS = new Dictionary<LLUUID, string>(); 45 private static Dictionary<LLUUID, string> capsURLS = new Dictionary<LLUUID, string>();
46 46
47 private static bool m_useExecutePath;
48 47
49 public static ulong UIntsToLong(uint X, uint Y) 48 public static ulong UIntsToLong(uint X, uint Y)
50 { 49 {
@@ -298,21 +297,12 @@ namespace OpenSim.Framework.Utilities
298 // directory locations 297 // directory locations
299 // 298 //
300 299
301 public static void changeUseExecutePathSetting(bool setting)
302 {
303 m_useExecutePath = setting;
304 }
305
306 public static string homeDir() 300 public static string homeDir()
307 { 301 {
308 string temp; 302 string temp;
309// string personal=(Environment.GetFolderPath(Environment.SpecialFolder.Personal)); 303// string personal=(Environment.GetFolderPath(Environment.SpecialFolder.Personal));
310// temp = Path.Combine(personal,".OpenSim"); 304// temp = Path.Combine(personal,".OpenSim");
311 temp="."; 305 temp=".";
312 if (m_useExecutePath)
313 {
314 temp = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
315 }
316 return temp; 306 return temp;
317 } 307 }
318 308
@@ -320,10 +310,6 @@ namespace OpenSim.Framework.Utilities
320 { 310 {
321 string temp; 311 string temp;
322 temp = "."; 312 temp = ".";
323 if (m_useExecutePath)
324 {
325 temp = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
326 }
327 return temp; 313 return temp;
328 } 314 }
329 315
@@ -331,10 +317,6 @@ namespace OpenSim.Framework.Utilities
331 { 317 {
332 string temp; 318 string temp;
333 temp = "."; 319 temp = ".";
334 if (m_useExecutePath)
335 {
336 temp = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
337 }
338 return temp; 320 return temp;
339 } 321 }
340 322
@@ -342,10 +324,6 @@ namespace OpenSim.Framework.Utilities
342 { 324 {
343 string temp; 325 string temp;
344 temp = "."; 326 temp = ".";
345 if (m_useExecutePath)
346 {
347 temp = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
348 }
349 return temp; 327 return temp;
350 } 328 }
351 329
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index 75c7eb5..bb26cae 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -95,20 +95,10 @@ namespace OpenSim
95 { 95 {
96 IConfig startupConfig = configSource.Configs["Startup"]; 96 IConfig startupConfig = configSource.Configs["Startup"];
97 97
98 string iniFile = startupConfig.GetString("inifile", "OpenSim.ini"); 98 string iniFilePath = startupConfig.GetString("inifile", "OpenSim.ini");
99 string useExecutePathString = startupConfig.GetString("useexecutepath", "false").ToLower();
100
101 bool useExecutePath = false;
102 if (useExecutePathString == "true" || useExecutePathString == "" || useExecutePathString == "1" || useExecutePathString == "yes")
103 {
104 useExecutePath = true;
105 }
106
107 Util.changeUseExecutePathSetting(useExecutePath);
108 99
109 m_config = new IniConfigSource(); 100 m_config = new IniConfigSource();
110 //check for .INI file (either default or name passed in command line) 101 //check for .INI file (either default or name passed in command line)
111 string iniFilePath = Path.Combine(Util.configDir(), iniFile);
112 if (File.Exists(iniFilePath)) 102 if (File.Exists(iniFilePath))
113 { 103 {
114 m_config.Merge(new IniConfigSource(iniFilePath)); 104 m_config.Merge(new IniConfigSource(iniFilePath));
@@ -116,12 +106,22 @@ namespace OpenSim
116 } 106 }
117 else 107 else
118 { 108 {
119 // no default config files, so set default values, and save it 109 iniFilePath = Path.Combine(Util.configDir(), iniFilePath);
120 SetDefaultConfig(); 110 if (File.Exists(iniFilePath))
111 {
112 m_config.Merge(new IniConfigSource(iniFilePath));
113 m_config.Merge(configSource);
114 }
115 else
116 {
121 117
122 m_config.Merge(configSource); 118 // no default config files, so set default values, and save it
119 SetDefaultConfig();
123 120
124 m_config.Save(iniFilePath); 121 m_config.Merge(configSource);
122
123 m_config.Save(iniFilePath);
124 }
125 } 125 }
126 126
127 ReadConfigSettings(); 127 ReadConfigSettings();