acarapetis / shroudstone

Stormgate replay renamer (+ related tools)
GNU General Public License v3.0
7 stars 3 forks source link

parse player names in custom games #12

Closed termac closed 4 weeks ago

termac commented 4 weeks ago

I wanted to parse tournament replay packs and had to make some changes to parse the player nickname in custom games:

Let me know if anything needs improvement to merge.

acarapetis commented 4 weeks ago

Thanks for your contribution!

Looks like tests are failing due to discriminator that were previously null being overwritten with empty strings. I think it makes more sense to keep these as null, so could you please add a condition to check msg.name.discriminator is nonempty before using it? Probably makes sense to do the same with msg.name.nickname.

Would also be good to have some replays that require this new feature added to the test suite. You just need to drop some replay files (just a couple will do) in tests/replays/, run pytest --update-golden and commit the resulting json files.

termac commented 4 weeks ago

Added a check for empty values and some replays to the test suite. I forgot to run the tests before, sorry for that!

acarapetis commented 4 weeks ago

No worries, looks perfect now! I'll bump the version and release it :)