@@ -124,7 +124,7 @@ def __init__(self, sid, slot_data):
124124
125125 #:
126126 self .hero_mount = slot_data ['mount' ]
127-
127+
128128 #: The unique Battle.net account identifier in the form of
129129 #: <region_id>-S2-<subregion>-<toon_id>
130130 self .toon_handle = slot_data ['toon_handle' ]
@@ -164,10 +164,13 @@ class Player(object):
164164 :param dict detail_data: The detail data associated with this player
165165 :param dict attribute_data: The attribute data associated with this player
166166 """
167- def __init__ (self , pid , detail_data , attribute_data ):
167+ def __init__ (self , pid , slot_data , detail_data , attribute_data ):
168168 #: The player's unique in-game player id
169169 self .pid = int (pid )
170170
171+ #: The player's replay.initData slot data
172+ self .slot_data = slot_data
173+
171174 #: The replay.details data on this player
172175 self .detail_data = detail_data
173176
@@ -197,6 +200,24 @@ def __init__(self, pid, detail_data, attribute_data):
197200 #: One of Protoss, Terran, Zerg
198201 self .play_race = LOCALIZED_RACES .get (detail_data ['race' ], detail_data ['race' ])
199202
203+ #: The co-op commander the player picked
204+ #: Kerrigan, Raynor, etc.
205+ self .commander = slot_data ['commander' ]
206+ if self .commander is not None :
207+ self .commander = self .commander .decode ('utf8' )
208+
209+ #: The level of the co-op commander
210+ #: 1-15 or None
211+ self .commander_level = slot_data ['commander_level' ]
212+
213+ #: The mastery level of the co-op commander
214+ #: >0 or None
215+ self .commander_mastery_level = slot_data ['commander_mastery_talents' ]
216+
217+ #: The mastery talents picked for the co-op commander
218+ #: list of longs of length 6, each between 0 and 30
219+ self .commander_mastery_talents = slot_data ['commander_mastery_talents' ]
220+
200221 #: A reference to a :class:`~sc2reader.utils.Color` object representing the player's color
201222 self .color = utils .Color (** detail_data ['color' ])
202223
@@ -290,7 +311,7 @@ class Computer(Entity, Player):
290311 """
291312 def __init__ (self , sid , slot_data , pid , detail_data , attribute_data ):
292313 Entity .__init__ (self , sid , slot_data )
293- Player .__init__ (self , pid , detail_data , attribute_data )
314+ Player .__init__ (self , pid , slot_data , detail_data , attribute_data )
294315
295316 #: The auto-generated in-game name for this computer player
296317 self .name = detail_data ['name' ]
@@ -316,7 +337,7 @@ class Participant(Entity, User, Player):
316337 def __init__ (self , sid , slot_data , uid , init_data , pid , detail_data , attribute_data ):
317338 Entity .__init__ (self , sid , slot_data )
318339 User .__init__ (self , uid , init_data )
319- Player .__init__ (self , pid , detail_data , attribute_data )
340+ Player .__init__ (self , pid , slot_data , detail_data , attribute_data )
320341
321342 def __str__ (self ):
322343 return "Player {0} - {1} ({2})" .format (self .pid , self .name , self .play_race )
@@ -563,7 +584,7 @@ def __init__(self, contents):
563584 # Leave early so we dont barf. Turns out ggtracker doesnt need
564585 # any of the map data thats loaded below.
565586 return
566-
587+
567588 #: Load screen type: 0 = default, 1 = custom
568589 self .load_screen_type = data .read_uint32 ()
569590
0 commit comments