aiarena-web icon indicating copy to clipboard operation
aiarena-web copied to clipboard

Make our replays compatible with sc2reader

Open eladyaniv01 opened this issue 4 years ago • 1 comments

below is a starting point suggested on discord

        try:
            self.region = details['cache_handles'][0].server.lower()
            self.map_hash = details['cache_handles'][-1].hash
            self.map_file = details['cache_handles'][-1]
        except:
            ...
        if hashlib.sha256('Standard Data: Void.SC2Mod'.encode('utf8')).hexdigest() in dependency_hashes:
            self.expansion = 'LotV'
        elif hashlib.sha256('Standard Data: Swarm.SC2Mod'.encode('utf8')).hexdigest() in dependency_hashes:
            self.expansion = 'HotS'
        elif hashlib.sha256('Standard Data: Liberty.SC2Mod'.encode('utf8')).hexdigest() in dependency_hashes:
            self.expansion = 'WoL'
        else:
            self.expansion = 'LotV'
            self.speed = 'Faster'

these hacks get the sc2reader a little further @DrInfy#2523

eladyaniv01 avatar Nov 02 '20 17:11 eladyaniv01