WoL is now on version 18.104.22.16844 as of today.
HotS continues to be on version 22.214.171.12464.
Here's a WoL 126.96.36.19944 replay: http://ggtracker.com/matches/1785997
Using the version number is probably already wrong.
In the HotS beta, even now, you can go to Options->Gameplay and pick Expansion Level: Wings of Liberty.
So people can play Wings of Liberty games using the HotS client.
Presumably there is some other indicator inside the replay to say which version of the game is being played.
This will be mission-critical for GGTracker soon as in statistics we don't want to mix WoL and HotS.
Agreed, the version number is already wrong. I think for this we're going to have to fall back to map dependencies information. Specifically:
>>> import sc2reader
>>> from xml.etree import ElementTree
>>> hots = sc2reader.load_replay('hots.SC2Replay', load_map=True)
>>> hots_xml = ElementTree.fromstring(hots.map.archive.read_file('DocumentInfo'))
>>> [value.text for value in hots_xml.findall('Dependencies/Value')]
>>> wol = sc2reader.load_replay('wol.SC2Replay', load_map=True)
>>> wol_xml = ElementTree.fromstring(wol.map.archive.read_file('DocumentInfo'))
>>> [value.text for value in wol_xml.findall('Dependencies/Value')]
It may also be reasonable to do this at the replay level by looking for Swarm (Mod) in the list of map resources found here:
I'll try to implement something along these lines soon.
Okay, I'm pushing out an improved fix that doesn't involve fetching dependencies from the depots. Instead it takes advantage of the depot convention of naming files by the sha256 digest their contents. From what I can tell, HotS games depend on 'Standard Data: Swarm.SC2Mod' and WoL games depend on 'Standard Data: Liberty.SC2Mod'.
if hashlib.sha256('Standard Data: Swarm.SC2Mod').hexdigest() in dependency_hashes:
self.expansion = 'HotS'
elif hashlib.sha256('Standard Data: Liberty.SC2Mod').hexdigest() in dependency_hashes:
self.expansion = 'WoL'
self.expansion = ''
I'm pushing this out in the next batch of commits.
Outstanding, thank you!
Fix #97 and #103. Fix resource.expansion values.