Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Culture insensitive default config #123

Conversation

neon-glowstick
Copy link
Contributor

Problem

When I try to run BasisNetworkConsole it crashes on startup and complains that a float is in the wrong format.

The problem is that float.Parse is culture sensitive. The default config writes a float as 0.005 with a dot. My default locale reads floats with commas and throws a format exception. It needs the float to be 0,005 to parse.

Fix

Use a locale independent xml reader/writer. When I use the XmlSerializer the float is written as 0.005 and is read without issue.

I also removed the triplicate of defaults. I used the values that got written to file before I started changing things as the default values.

Config on class did not match what ended up in the default config file
When no config is found, a new one will be made with the current locale
@dooly123 dooly123 merged commit fd05ce8 into BasisVR:doolysbranch Jan 30, 2025
7 checks passed
@neon-glowstick neon-glowstick deleted the culture-insensitive-default-config branch January 31, 2025 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants