GraylinKim / sc2reader

A python library that extracts data from various Starcraft II resources to power tools and services for the SC2 community. Who doesn't want to hack on the games they play?
http://sc2reader.readthedocs.org
MIT License
411 stars 85 forks source link

Unknown game event type in DHW gameheart classic replay #165

Closed StoicLoofah closed 10 years ago

StoicLoofah commented 10 years ago

http://spawningtool.com/7376/download/

This is one of the games from DreamHack Winter. As far as I can tell, all GH light replays parsed fine, but GH classic replays failed. Here's an error I got

>>> import sc2reader
>>> r = sc2reader.load_replay('/Users/kevin/Downloads/Game1 GHClassic - Akilon Wastes.SC2Replay') 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "sc2reader/factories/sc2factory.py", line 85, in load_replay
    return self.load(Replay, source, options, **new_options)
  File "sc2reader/factories/sc2factory.py", line 137, in load
    return self._load(cls, resource, filename=filename, options=options)
  File "sc2reader/factories/sc2factory.py", line 146, in _load
    obj = cls(resource, filename=filename, factory=self, **options)
  File "sc2reader/resources.py", line 302, in __init__
    self._read_data(data_file, self._get_reader(data_file))
  File "sc2reader/resources.py", line 605, in _read_data
    self.raw_data[data_file] = reader(data, self)
  File "sc2reader/readers.py", line 325, in __call__
    raise ReadError("Event type {0} unknown at position {1}.".format(hex(event_type), hex(event_start)), event_type, event_start, replay, game_events, data)
sc2reader.exceptions.ReadError: Event type 0x72 unknown at position 0xd4aL., Type: 114
GraylinKim commented 10 years ago

Thanks for reporting. I wish more people would report these kinds of problems as they are generally a pretty easy fix.

StoicLoofah commented 10 years ago

Thanks for the quick fix here! That appeared to do it for a majority of the replays.

I have a handful of replays that still aren't working, but I think this one is on me. The GameHeartNormalizer is resulting in only 1 player in some of the games (http://spawningtool.com/7499/download/ for example), so I need to figure out what's going on in the data. I'll submit a pull request when I have it figured out