DarkflameServer
DarkflameServer copied to clipboard
ENH: Add data validation to user editable strings in .ini's
Is your feature request related to a problem?
More often than not users will input invalid data into the string fields of the sharedconfig.ini
. Most of the time this is due to things like special characters, erroneous spaces, etc. This causes an error to be thrown that is indirectly related to the main issue. Printing out what actually is causing the issue will help speedup troubleshooting, and (hopefully) reduce the number of people that ask for help.
Describe the solution you'd like
Do validation on the user inputted strings from the sharedconfig.ini
. Throw an error code and/or message on error
Example: When reading the client file path from the .ini, check for spaces before and after the string (maybe even in the string as well), as well as special characters that have been known to cause issues. Throw an error stating what caused the check to fail.
All strings should be checked for spaces before and after the string. If this is the case, I think we could maybe just strip the extra spaces and continue.
client_location
and dump_folder
should also be checked for special characters. Maybe even going as far as know whether its a linux or windows build and validating the file?
In regards to the special characters, maybe just throw a warning but continue anyway. This way if it isn't an issue, great, but if it is, then there is a least a paper trail that can lead to the actual issue in the print statements.
Repository breaking implications
None
Describe alternatives you've considered
No response
Additional context
To many people have reported issues with their setup, only to have it pointed out to them that they have an extra space, or their username has a space and/or a special character.