Protocol Version 74456
Closed this issue · 3 comments
Is there an ETA for protocol Version 74456? My people are getting nervous ;) TY!
I have been using 74071 for 74456 (copy and paste/ rename) and it seems to be working as expected. It would be ideal if the automatic job was actually running that updated the repo.
Looks like there was a issue with the build automation - I pushed a fix. Automated system has pushed the new protocol to git and pypi.
Thank you for the heads up.
@ipax77
FYI: ggtracker/sc2reader#88 (comment)
Basically s2_cli.py
is limiting factor here, since it doesn't even attempt to decode replay if there's no matching mappings file for particular build:
s2protocol/s2protocol/s2_cli.py
Lines 319 to 326 in 6613456
Considering that automated builds aren't fully reliable - pushed with a slight delay etc. I've came up with this for my wrapper script:
# The header's baseBuild determines which protocol to use
baseBuild = header['m_version']['m_baseBuild']
logging.debug('Protocol build: %s' % baseBuild)
try:
protocol = versions.build(baseBuild)
except Exception as e:
logging.warn('Unsupported protocol: (%s)' % str(e))
if baseBuild > 32283 and baseBuild < 51702:
protocol = versions.build(51702)
# in case there are some holes in releases of s2protocol between 51702 and 70154
# don't even attempt to decode so problem can be investigated
elif baseBuild < 70154:
sys.exit(ExitCodes.INTERNAL_ERROR)
# since 70154 things are stable so fallback to newest available if there's no direct match
else:
protocol = versions.latest()
logging.warn('Attempting to use %s instead' % protocol.__name__)
It's actually reliable. Since the way decoding is handled, if payload won't match expected structure it will just fail deeper in the code and throw an exception. But if protocol hasn't actually changed it will obviously work as good as always.
btw. I don't remember exact reason behind if baseBuild > 32283 and baseBuild < 51702:
rule, so you probably don't want to use it like that.