Skip to content

Total struct size too long, when trying to analyse Brookside Battleground map game #124

@Pawel1894

Description

@Pawel1894

Hey!

I cannot parse games played on map Brookside Battleground. Any idea how that can be fixed? I bumped version of mgz to 1.8.31, but did not helped.

Error:

 File "/lib/python3.11/site-packages/mgz/fast/header.py", line 709, in parse
    players, mod, device = parse_players(header, num_players, version, save)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/mgz/fast/header.py", line 648, in parse_players
    mod = parse_mod(header, num_players, version)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/mgz/fast/header.py", line 104, in parse_mod
    values = unpack(f'<{resources}f', header)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/mgz/util.py", line 321, in unpack
    output = struct.unpack(fmt, data.read(struct.calcsize(fmt)))
                                          ^^^^^^^^^^^^^^^^^^^^
struct.error: total struct size too long

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/lib/python311.zip/_pyodide/_base.py", line 571, in eval_code_async
    await CodeRunner(
  File "/lib/python311.zip/_pyodide/_base.py", line 394, in run_async
    coroutine = eval(self.code, globals, locals)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<exec>", line 7, in <module>
  File "/lib/python3.11/site-packages/mgz/model/__init__.py", line 105, in parse_match
    data = parse(handle)
           ^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/mgz/fast/header.py", line 713, in parse
    raise RuntimeError(f"could not parse: {e}")
RuntimeError: could not parse: total struct size too long

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions