Read the raw bytes for a game, extracting from its tar archive if needed.
(game: GameRef)
| 170 | # Enumerate on collisions, or when the parsed numbers are clearly seeds/timestamps |
| 171 | # (e.g. Halite's .hlt names) rather than small sim indices. |
| 172 | if len(set(sims)) != len(sims) or (sims and max(sims) > 4 * len(gs) + 100): |
| 173 | gs.sort(key=lambda g: g.member or (g.path.name if g.path else "")) |
| 174 | for i, g in enumerate(gs): |
| 175 | g.sim = i |
| 176 | games.sort(key=lambda g: (g.round, g.sim)) |
| 177 | return games |
| 178 | |
| 179 | |
| 180 | def read_sim(game: GameRef) -> bytes: |
| 181 | """Read the raw bytes for a game, extracting from its tar archive if needed.""" |
| 182 | if game.archive is not None: |
| 183 | with tarfile.open(game.archive) as tf: |
nothing calls this directly
no outgoing calls
no test coverage detected