barrett777 / Heroes.ReplayParser

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

Parser Failing when reading replay as bytes with latest Hots patch #114

Closed Zemill closed 3 years ago

Zemill commented 3 years ago

Alright, I figured out the issue with my Lambda parser. I read the replay in as bytes.

So, it throws error "Heroes.ReplayParser.MPQFiles.DetailedParsedException: 'Not Hero'"

https://github.com/barrett777/Heroes.ReplayParser/blob/b9250351138e6f15eabc7a7c1fda26b785c2e7b7/Heroes.ReplayParser/MPQFiles/ReplayServerBattlelobby.cs#L150

So to test the similar approach my Lambda parser uses, I changed the input file section to the following.

byte[] bytes = System.IO.File.ReadAllBytes(replayFile); var (replayParseResult, replay) = DataParser.ParseReplay(bytes, ParseOptions.MediumParsing);

Zemill commented 3 years ago

2021-05-18 15.58.01 Warhead Junction.zip

This is the replay file ive been testing with. QM

Zemill commented 3 years ago

Alright, I did some more testing and it is due to switching parsing options. Default works fine, medium fails

barrett777 commented 3 years ago

Okay so Blizzard changed something in the Battlelobby file, which unfortunately they don't document in their repo

@koliva8245 Has been figuring out how to parse the Battlelobby file in the past :) Are you able to look at this update?

For now, you can disable ParseOptions.ShouldParseDetailedBattleLobby, so something like:

var parseOptions = ParseOptions.MediumParsing;
parseOptions.ShouldParseDetailedBattleLobby = false;
var (replayParseResult, replay) = DataParser.ParseReplay(bytes, parseOptions);

I'm not sure exactly what you lose by disabling this. I think you'll lose knowing what players are in a party together, and maybe a player's account level

Zemill commented 3 years ago

Switching to default fixes my lambda issue, but as you mentioned account level, and party seem to disappear. So not terrible data to lose for now.

barrett777 commented 3 years ago

I think this is fixed now in version 1.2.15 (Thanks Kolivia!)

Zemill commented 3 years ago

I just wanted to verify that this issue is now resolved in the latest version. Thanks