@@ -422,15 +422,28 @@ def __init__(self, summary_file, filename=None, **options):
422422 for player in [0 , 1 ]:
423423 print "Player" , player , name , self .parts [3 ][0 ][index ][1 ][player ][0 ][0 ]
424424
425- class MatchInfo (Resource ):
426- url_template = 'http://{0}.depot.battle.net:1119/{1}.s2ma'
425+ class MapInfo (Resource ):
426+ url_template = 'http://{0}.depot.battle.net:1119/{1}.s2mi'
427+
428+ #: Name of the Map
429+ map_name = str ()
430+
431+ #: Hash of referenced s2mh file
432+ s2mh_hash = str ()
433+
434+ #: URL of referenced s2mh file
435+ s2mh_url = str ()
436+
427437 def __init__ (self , info_file , filename = None , ** options ):
428- super (MatchInfo , self ).__init__ (info_file , filename ,** options )
438+ super (MapInfo , self ).__init__ (info_file , filename ,** options )
429439 self .data = utils .ReplayBuffer (info_file ).read_data_struct ()
430-
440+ self .map_name = self .data [0 ][7 ]
441+ self .language = self .data [0 ][13 ]
442+ self .s2mh_hash = '' .join ([hex (ord (x ))[2 :] for x in self .data [0 ][1 ][8 :]])
443+ self .s2mh_url = MatchHistory .url_template .format (self .data [0 ][1 ][6 :8 ], self .s2mh_hash )
431444
432445class MatchHistory (Resource ):
433- url_template = 'http://{0}.depot.battle.net:1119/{1}.s2ma '
446+ url_template = 'http://{0}.depot.battle.net:1119/{1}.s2mh '
434447 def __init__ (self , history_file , filename = None , ** options ):
435448 super (MatchHistory , self ).__init__ (history_file , filename ,** options )
436449 self .data = utils .ReplayBuffer (history_file ).read_data_struct ()
0 commit comments