barrett777 / Heroes.ReplayParser

A C# library for parsing Heroes of the Storm replay files (.StormReplay)
MIT License
223 stars 95 forks source link

Unparsable Replays (fail on unknown data type in TrackerEventStructure) #109

Closed paviad closed 4 years ago

paviad commented 4 years ago

These replays:

https://drive.google.com/drive/folders/19xOgMhJtKwBq9vRLTziRNCvGkwi-3Onj?usp=sharing

Fail on this line:

https://github.com/barrett777/Heroes.ReplayParser/blob/83638ae78fae439a636d28fb982649065dc0b5c1/Heroes.ReplayParser/MPQFiles/ReplayTrackerEvents.cs#L180

barrett777 commented 4 years ago

Hmm okay I'll look into it Blizzard hasn't made any changes to their replay parser, so I don't think it's new content. I'll see if maybe it's a bug in how I'm parsing

koliva8245 commented 4 years ago

uploader_d0f3ccc6-f453-43e7-9bd2-534b72dbde37_109 - corrupted/desync web_11d7ea9c-48f0-417e-ab9f-688d4d2dce98_9 - ok, has computer players web_11d7ea9c-48f0-417e-ab9f-688d4d2dce98_11 - ok, has computer players web_11d7ea9c-48f0-417e-ab9f-688d4d2dce98_13 - ok, has computer players web_11d7ea9c-48f0-417e-ab9f-688d4d2dce98_10 - ok, has computer players uploader_d0f3ccc6-f453-43e7-9bd2-534b72dbde37_112 - corrupted?, but replay plays fine in-game, (error is on gameloop which is probably why its works)

paviad commented 4 years ago

Thanks for looking into it - so it's either corrupt files or ai players? Out of curiosity why should AI players crash the parsing?

koliva8245 commented 4 years ago

AI games are not supported by the parser.

paviad commented 4 years ago

I think there is something else wrong here, the replay web_11d7ea9c-48f0-417e-ab9f-688d4d2dce98_10 crashes at https://github.com/barrett777/Heroes.ReplayParser/blob/83638ae78fae439a636d28fb982649065dc0b5c1/Heroes.ReplayParser/MPQFiles/ReplayServerBattlelobby.cs#L232

Usually when an AI player is found the parser returns a result of ReplayParseResult.ComputerPlayerFound

barrett777 commented 4 years ago

Yeah, something could be different than normal in that replay, however I haven't spent much effort on AI replays. If this is important to you, you could dig into it and see if you can get the parser to not blow up here.

I'm guessing the line above that probably has a bot name that would be easy to identify: https://github.com/barrett777/Heroes.ReplayParser/blob/83638ae78fae439a636d28fb982649065dc0b5c1/Heroes.ReplayParser/MPQFiles/ReplayServerBattlelobby.cs#L229

You could check if that's a computer name, and if so, don't throw the "Couldn't find BattleTag" exception and just keep parsing. Maybe it will make it further along and be able to return ReplayParseResult.ComputerPlayerFound like normal

paviad commented 4 years ago

Actually, this line is key:

https://github.com/barrett777/Heroes.ReplayParser/blob/83638ae78fae439a636d28fb982649065dc0b5c1/Heroes.ReplayParser/MPQFiles/ReplayServerBattlelobby.cs#L227

It actually indicates if a battle tag exists, but that indication is ignored and a battle tag is read anyway. I'll look into it

koliva8245 commented 4 years ago

For AI games, the extended battle lobby parsing doesn't work yet due to extra bytes. Maybe I actually can get it to work.

paviad commented 4 years ago

You want to reopen this issue until this is resolved (if ever)?

paviad commented 4 years ago

I uploaded 53 more replays to that folder and categorized them by the exception they throw - for your reference.

barrett777 commented 4 years ago

Thanks for providing more info. I'll reopen so this stays visible in case others come across this.

koliva8245 commented 4 years ago

All the replays with exceptions in the ReplayTrackerEvents are corrupted. The EndOfStreamException exceptions are even worse as the mpq archive itself is corrupted.

barrett777 commented 4 years ago

Thanks for fixing this @koliva8245 in version 1.2.12