@@ -16,7 +16,8 @@ def __call__(self, data, replay):
1616 raise NotImplementedError
1717
1818class InitDataReader_Base (Reader ):
19- def __call__ (self , data , replay ):
19+
20+ def get_player_names (self , data , replay ):
2021 # The first block of the replay.initData file represents a list of
2122 # human player names; computers are no recorded. This list appears to
2223 # always be 16 long, with "" names filling in the balance. Each name
@@ -27,6 +28,10 @@ def __call__(self, data, replay):
2728 data .skip (5 )
2829 if name :
2930 player_names .append (name )
31+ return player_names
32+
33+ def __call__ (self , data , replay ):
34+ player_names = self .get_player_names (data , replay )
3035
3136 # The next block contains information about the structure of the MPQ
3237 # archive. We don't read this information because we've got mpyq for
@@ -59,6 +64,23 @@ def __call__(self, data, replay):
5964 sc_account_id = sc_account_id ,
6065 )
6166
67+ class InitDataReader_24764 (InitDataReader_Base ):
68+ def get_player_names (self , data , replay ):
69+ player_names = list ()
70+ for player in range (data .read_byte ()):
71+ name_length = data .read_byte ()
72+ data .byte_align () # Strings seem to be always byte aligned
73+ name = data .read_string (length = name_length )
74+ data .read_bits (1 ) # Not sure why we have this offset, it could be a flag?
75+ clan_length = data .read_byte ()
76+ data .byte_align ()
77+ clan_name = data .read_string (length = clan_length )
78+ unknown = data .read_bits (42 )
79+ data .read_bytes (5 )
80+ player_names .append (name )
81+ return player_names
82+
83+
6284
6385class AttributesEventsReader_Base (Reader ):
6486 header_length = 4
0 commit comments