happyleavesaoc / aoc-mgz

Age of Empires II recorded game parsing and summarization in Python 3.
MIT License
197 stars 42 forks source link

ValueError: 135 is not a valid Action #41

Closed denniske closed 3 years ago

denniske commented 3 years ago

Hi, I am parsing DE matches again and this error occurs quite often:

match_id: 66710120 profile_id: 4732824

ValueError: 135 is not a valid Action

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/pypy-latest-linux64/site-packages/mgz/summary/__init__.py", line 81, in __init__
    self._process_body()
  File "/root/pypy-latest-linux64/site-packages/mgz/summary/__init__.py", line 103, in _process_body
    operation, payload = fast.operation(self._handle)
  File "/root/pypy-latest-linux64/site-packages/mgz/fast.py", line 287, in operation
    return op_type, action(data)
  File "/root/pypy-latest-linux64/site-packages/mgz/fast.py", line 229, in action
    action_type = Action(action_id)
  File "/root/pypy-latest-linux64/lib-python/3/enum.py", line 315, in __call__
    return cls.__new__(cls, value)
  File "/root/pypy-latest-linux64/lib-python/3/enum.py", line 569, in __new__
    raise exc
  File "/root/pypy-latest-linux64/lib-python/3/enum.py", line 553, in __new__
    result = cls._missing_(value)
  File "/root/pypy-latest-linux64/lib-python/3/enum.py", line 582, in _missing_
    raise ValueError("%r is not a valid %s" % (value, cls.__name__))
ValueError: 135 is not a valid Action

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "src/process.py", line 42, in <module>
    summary = mgz.summary.Summary(handle, None)
  File "/root/pypy-latest-linux64/site-packages/mgz/summary/__init__.py", line 84, in __init__
    raise RuntimeError("invalid mgz file: {}".format(e))
happyleavesaoc commented 3 years ago

Thanks, that's a new action, probably from the latest patch. Maybe the coustillier special ability?

happyleavesaoc commented 3 years ago

Fixed in https://github.com/happyleavesaoc/aoc-mgz/commit/1fc17fabc9824cb4008ee236a2ac2de88d5bc118. Not parsed yet, but won't throw an error.