@@ -16,7 +16,8 @@ def __call__(self, data, replay):
16
16
raise NotImplementedError
17
17
18
18
class InitDataReader_Base (Reader ):
19
- def __call__ (self , data , replay ):
19
+
20
+ def get_player_names (self , data , replay ):
20
21
# The first block of the replay.initData file represents a list of
21
22
# human player names; computers are no recorded. This list appears to
22
23
# always be 16 long, with "" names filling in the balance. Each name
@@ -27,6 +28,10 @@ def __call__(self, data, replay):
27
28
data .skip (5 )
28
29
if name :
29
30
player_names .append (name )
31
+ return player_names
32
+
33
+ def __call__ (self , data , replay ):
34
+ player_names = self .get_player_names (data , replay )
30
35
31
36
# The next block contains information about the structure of the MPQ
32
37
# archive. We don't read this information because we've got mpyq for
@@ -59,6 +64,23 @@ def __call__(self, data, replay):
59
64
sc_account_id = sc_account_id ,
60
65
)
61
66
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
+
62
84
63
85
class AttributesEventsReader_Base (Reader ):
64
86
header_length = 4
0 commit comments