sc2reader icon indicating copy to clipboard operation
sc2reader copied to clipboard

Adding support for the 36442 base build

Open StoicLoofah opened this issue 9 years ago • 3 comments

@GraylinKim I feel like an idiot: I had no idea how the different numbers in the s2protocol file corresponded to the types, and then I realized it was just a dictionary into the types. After that, it was easy to figure out.

For posterity (and anyone else who might want to contribute), I:

  1. took a diff between the last 2 s2protocol builds
  2. for new/different field, I went into sc2reader/readers.py and found where it fit in (probably just below the previous field)
  3. for that field, I took the number type from s2protocol, found another field with the same type, searched that field in readers.py, and copied that type for the new line and added the base_build check as well
  4. None of the fields were marked as optional, but if they were, I would have handled that
  5. for the event changes, I copied the last GameEventsReader and updated its parent. I tweaked it appropriately
  6. I registered the new GameEventsReader in sc2reader/resources.py

and it seemed like that worked.

Let me know if there's anything that I might have missed. I'm popping this into production for lotv.spawningtool.com right now, so I will let you know if I see any other errors.

StoicLoofah avatar Jul 21 '15 16:07 StoicLoofah

I don't have any newer replays myself but you figured it out pretty well. Fix the comment above and I'd be happy to merge.

GraylinKim avatar Jul 26 '15 00:07 GraylinKim

Updated with the condition as you mentioned. If you want to play around with it yourself, here's a replay on this build http://lotv.spawningtool.com/903/download/

StoicLoofah avatar Jul 26 '15 04:07 StoicLoofah

I have been using my own fork in production, and it has been working here. @GraylinKim poking if you want to merge this into your branch?

StoicLoofah avatar Sep 04 '15 15:09 StoicLoofah