HearthSim / python-hsreplay

Python library for creating and parsing HSReplay XML files
https://hearthsim.info/hsreplay/
MIT License
50 stars 14 forks source link

Player.initial_deck is sometimes missing cards #35

Closed beheh closed 8 years ago

beheh commented 8 years ago

Downstream issue: HearthSim/HSReplay.net#43

This log file is missing cards in the initial_deck of player "Red1010". The replay itself contains a lot more cards (a seen in the replay).

I'm testing with the following script:

import sys
from datetime import datetime
from hsreplay.dumper import parse_log

file = open(sys.argv[1], "r")
parser = parse_log(file, processor="GameState", date=datetime.now())
file.close()
game_tree = parser.games[0]

for player in game_tree.game.players:
    print("Found player %s" % player.name)
    for card in player.initial_deck:
        print("...with card %s" % card)

...and am only getting the following cards for the second player:

Found player Red1010
...with card Card(id=60, card_id='EX1_391')
...with card Card(id=61, card_id=None)
...with card Card(id=62, card_id=None)
...with card Card(id=63, card_id=None)
...with card Card(id=64, card_id=None)
...with card Card(id=65, card_id=None)
...with card Card(id=66, card_id=None)
...with card Card(id=67, card_id='OG_283')

Not sure if this should be here on in python-hearthstone. Just copy over if necessary.

beheh commented 8 years ago

Moving to HearthSim/python-hearthstone#6.