1

Closed

SignedInGamer DoAuthentication locale issue

description

Hi,
 
The "double.Parse" in DoAuthentication (SignedInGame.cs) does not work if the device is using a "comma seperated value" locale (e.g. French). It throws an Exception because of the "unknown char dot".
 
One possible fix is the following:
 
double result = 0.0;

if (!double.TryParse(osVersion, out result))
{
    osVersion = osVersion.Replace(".", ",");
}
 
if (double.Parse(osVersion) > 4.1)
{
...
 
Thank you.
Closed Jun 29, 2012 at 12:42 PM by slygamer
Fixed in the develop3d branch in commithttps://github.com/mono/MonoGame/commit/cfccac26c661f0922d08162109ea6dc9349647c5

comments

jfperusse wrote Apr 7, 2012 at 2:25 AM

It might be better to always do a replace to "CurrentCulture.NumberFormat.NumberDecimalSeparator".

slygamer wrote May 2, 2012 at 7:27 AM

I think it would be better to use CultureInfo.InvariantCulture when parsing the version number.