aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/General/Configuration/ConfigurationMember.cs
diff options
context:
space:
mode:
authorlbsa712007-09-25 01:20:30 +0000
committerlbsa712007-09-25 01:20:30 +0000
commit2219ccc5b053d5c8885de113488dfb6718903435 (patch)
tree06bde077b98c0e8df228bec23aef8aa9b2eba39d /OpenSim/Framework/General/Configuration/ConfigurationMember.cs
parentMore reorganizing of new SE. Added debug print of application exception. (diff)
downloadopensim-SC_OLD-2219ccc5b053d5c8885de113488dfb6718903435.zip
opensim-SC_OLD-2219ccc5b053d5c8885de113488dfb6718903435.tar.gz
opensim-SC_OLD-2219ccc5b053d5c8885de113488dfb6718903435.tar.bz2
opensim-SC_OLD-2219ccc5b053d5c8885de113488dfb6718903435.tar.xz
* Fixed Culture-variant parsing of config options
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/General/Configuration/ConfigurationMember.cs9
1 files changed, 5 insertions, 4 deletions
diff --git a/OpenSim/Framework/General/Configuration/ConfigurationMember.cs b/OpenSim/Framework/General/Configuration/ConfigurationMember.cs
index c94fd8e..e4c13ba 100644
--- a/OpenSim/Framework/General/Configuration/ConfigurationMember.cs
+++ b/OpenSim/Framework/General/Configuration/ConfigurationMember.cs
@@ -9,6 +9,7 @@ using libsecondlife;
9 9
10using OpenSim.Framework.Console; 10using OpenSim.Framework.Console;
11using OpenSim.Framework.Configuration.Interfaces; 11using OpenSim.Framework.Configuration.Interfaces;
12using System.Globalization;
12 13
13namespace OpenSim.Framework.Configuration 14namespace OpenSim.Framework.Configuration
14{ 15{
@@ -295,7 +296,7 @@ namespace OpenSim.Framework.Configuration
295 break; 296 break;
296 case ConfigurationOption.ConfigurationTypes.TYPE_FLOAT: 297 case ConfigurationOption.ConfigurationTypes.TYPE_FLOAT:
297 float floatResult; 298 float floatResult;
298 if (float.TryParse(console_result, out floatResult)) 299 if (float.TryParse(console_result, NumberStyles.AllowDecimalPoint, Culture.NumberFormatInfo, out floatResult))
299 { 300 {
300 convertSuccess = true; 301 convertSuccess = true;
301 return_result = floatResult; 302 return_result = floatResult;
@@ -304,7 +305,7 @@ namespace OpenSim.Framework.Configuration
304 break; 305 break;
305 case ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE: 306 case ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE:
306 double doubleResult; 307 double doubleResult;
307 if (Double.TryParse(console_result, out doubleResult)) 308 if (Double.TryParse(console_result, NumberStyles.AllowDecimalPoint, Culture.NumberFormatInfo, out doubleResult))
308 { 309 {
309 convertSuccess = true; 310 convertSuccess = true;
310 return_result = doubleResult; 311 return_result = doubleResult;
@@ -332,12 +333,12 @@ namespace OpenSim.Framework.Configuration
332 { 333 {
333 if (configOption.configurationUseDefaultNoPrompt) 334 if (configOption.configurationUseDefaultNoPrompt)
334 { 335 {
335 MainLog.Instance.Error("Default given for '" + configOption.configurationKey + "' is not valid; the configuration result must be " + errorMessage + ". Will skip this option..."); 336 MainLog.Instance.Error("CONFIG", string.Format("[{3}]:[{1}] is not valid default for parameter [{0}].\nThe configuration result must be parsable to {2}.\n", configOption.configurationKey, console_result, errorMessage, configurationFilename));
336 convertSuccess = true; 337 convertSuccess = true;
337 } 338 }
338 else 339 else
339 { 340 {
340 MainLog.Instance.Warn("configuration","Incorrect result given, the configuration option must be " + errorMessage + ". Prompting for same option..."); 341 MainLog.Instance.Warn("CONFIG", string.Format("[{3}]:[{1}] is not a valid value [{0}].\nThe configuration result must be parsable to {2}.\n", configOption.configurationKey, console_result, errorMessage, configurationFilename));
341 ignoreNextFromConfig = true; 342 ignoreNextFromConfig = true;
342 } 343 }
343 } 344 }