aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorDiva Canto2013-02-21 17:26:19 -0800
committerDiva Canto2013-02-21 17:26:19 -0800
commite515cdddec435e97e9ed4722de08ee410e94a7e6 (patch)
tree0b090dc495ef464e037d4f134f059bce35504d2f /OpenSim/Framework
parentBulletSim: add OutOfBounds logic and some position sanity checking (diff)
downloadopensim-SC_OLD-e515cdddec435e97e9ed4722de08ee410e94a7e6.zip
opensim-SC_OLD-e515cdddec435e97e9ed4722de08ee410e94a7e6.tar.gz
opensim-SC_OLD-e515cdddec435e97e9ed4722de08ee410e94a7e6.tar.bz2
opensim-SC_OLD-e515cdddec435e97e9ed4722de08ee410e94a7e6.tar.xz
Simplification of HG configs: HomeURI and GatekeeperURI now are defined as default under [Startup]. They can then be overwritten in the other sections (but probably shouldn't). I kept the existing code for backwards compatibility, so this should not cause any breaks from people's current configurations. But people should move to have these 2 vars under [Startup] -- see OpenSim.ini.example and Robust.HG.ini.example. And yes, both names now end with "URI" for consistency.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Util.cs22
1 files changed, 21 insertions, 1 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index d9148fb..1700d3e 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -863,7 +863,7 @@ namespace OpenSim.Framework
863 return FileName; 863 return FileName;
864 } 864 }
865 865
866 // Nini (config) related Methods 866 #region Nini (config) related Methods
867 public static IConfigSource ConvertDataRowToXMLConfig(DataRow row, string fileName) 867 public static IConfigSource ConvertDataRowToXMLConfig(DataRow row, string fileName)
868 { 868 {
869 if (!File.Exists(fileName)) 869 if (!File.Exists(fileName))
@@ -886,6 +886,26 @@ namespace OpenSim.Framework
886 } 886 }
887 } 887 }
888 888
889 public static string GetConfigVarWithDefaultSection(IConfigSource config, string varname, string section)
890 {
891 // First, check the Startup section, the default section
892 IConfig cnf = config.Configs["Startup"];
893 if (cnf == null)
894 return string.Empty;
895 string val = cnf.GetString(varname, string.Empty);
896
897 // Then check for an overwrite of the default in the given section
898 if (!string.IsNullOrEmpty(section))
899 {
900 cnf = config.Configs[section];
901 if (cnf != null)
902 val = cnf.GetString(varname, val);
903 }
904
905 return val;
906 }
907 #endregion
908
889 public static float Clip(float x, float min, float max) 909 public static float Clip(float x, float min, float max)
890 { 910 {
891 return Math.Min(Math.Max(x, min), max); 911 return Math.Min(Math.Max(x, min), max);