TwitchPlaysBF2 / GameDataReader

NuGet library providing simple access to game settings. Reading data from games like Battlefield 2 - i.e. to access player data from BF2 specific .con configuration files. Open to extension.
https://www.nuget.org/packages/GameDataReader
MIT License
2 stars 1 forks source link

Improve BF2 parsing with RegEx #2

Closed TwitchPlaysBF2 closed 2 years ago

TwitchPlaysBF2 commented 2 years ago

Look at parsing done in the ParseValue() method of Settings class, inside GameDataReader.Battlefield2.Parsing.

The parsing is done by just replacing all quotes. If a value contains quotes, they would get lost.

This isn't problematic for playernames, since they don't allow quotes anyway (I think). But the prefix and other values could contain quotes. They would get lost.

TwitchPlaysBF2 commented 2 years ago

Better to use value.Trim('\"');

cetteup commented 2 years ago

This can be closed, as refractor values are now already being parsed with regex.