Skip to content

Commit f4eb1fb

Browse files
committed
complain about pid mismatch problems
1 parent 7b5d927 commit f4eb1fb

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

sc2reader/scripts/sc2parse.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,16 @@ def main():
4343
replay = sc2reader.load_replay(path, debug=True, load_level=1)
4444
if not args.one_each or replay.is_ladder:
4545
replay = sc2reader.load_replay(path, debug=True)
46-
print 'No problems with {path}: {build} - {real_type} on {map_name} - Played {start_time}'.format(path=path, **replay.__dict__)
46+
47+
pids = set( [ player.pid for player in replay.players ] )
48+
pids.add(16)
49+
event_pids = set( [ event.pid for event in replay.events ] )
50+
if pids != event_pids:
51+
print 'Pid problem! pids={pids} but event pids={event_pids}'.format(pids=pids, event_pids=event_pids)
52+
print ' with {path}: {build} - {real_type} on {map_name} - Played {start_time}'.format(path=path, **replay.__dict__)
53+
else:
54+
print 'No problems with {path}: {build} - {real_type} on {map_name} - Played {start_time}'.format(path=path, **replay.__dict__)
55+
4756
except sc2reader.exceptions.ReadError as e:
4857
if args.ladder_only and not e.replay.is_ladder: continue
4958

0 commit comments

Comments
 (0)