diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 43ddf6b8..52337169 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,13 @@ CHANGELOG ============ +1.3.0 - November 16, 2018 +------------------------- +* Added support for protocol 70154 (StarCraft 4.7.0) +* Added support for Zeratul +* Updated CircleCI build for Python 3.7 +* Fixed a bug with printing TrackerEvent + 1.2.0 - October 7, 2018 ----------------------- * Added support for Tychus diff --git a/sc2reader/data/attributes.json b/sc2reader/data/attributes.json index 751f8dc8..773be8c3 100644 --- a/sc2reader/data/attributes.json +++ b/sc2reader/data/attributes.json @@ -714,7 +714,8 @@ "Swan": "Swann", "Tych": "Tychus", "Vora": "Vorazun", - "Zaga": "Zagara" + "Zaga": "Zagara", + "Zera": "Zeratul" } ], "3014": [ diff --git a/sc2reader/readers.py b/sc2reader/readers.py index 1428186e..54bf3f54 100644 --- a/sc2reader/readers.py +++ b/sc2reader/readers.py @@ -118,7 +118,7 @@ def __call__(self, data, replay): working_set_slot_id=data.read_uint8() if replay.base_build >= 24764 and data.read_bool() else None, rewards=[data.read_uint32() for i in range(data.read_bits(17 if replay.base_build >= 34784 else 6 if replay.base_build >= 24764 else 5))], toon_handle=data.read_aligned_string(data.read_bits(7)) if replay.base_build >= 17266 else None, - licenses=[data.read_uint32() for i in range(data.read_bits(9))] if replay.base_build >= 19132 else [], + licenses=[data.read_uint32() for i in range(data.read_bits(13 if replay.base_build >= 70154 else 9))] if replay.base_build >= 19132 else [], tandem_leader_user_id=data.read_bits(4) if replay.base_build >= 34784 and data.read_bool() else None, commander=data.read_aligned_bytes(data.read_bits(9)) if replay.base_build >= 34784 else None, commander_level=data.read_uint32() if replay.base_build >= 36442 else None, diff --git a/setup.py b/setup.py index c14bc2a2..c06d6fce 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setuptools.setup( license="MIT", name="sc2reader", - version='1.2.0', + version='1.3.0', keywords=["starcraft 2", "sc2", "replay", "parser"], description="Utility for parsing Starcraft II replay files", long_description=open("README.rst").read()+"\n\n"+open("CHANGELOG.rst").read(), diff --git a/test_replays/4.7.0.70154/1.SC2Replay b/test_replays/4.7.0.70154/1.SC2Replay new file mode 100644 index 00000000..3633b09e Binary files /dev/null and b/test_replays/4.7.0.70154/1.SC2Replay differ diff --git a/test_replays/test_all.py b/test_replays/test_all.py index 1667fe1a..b779e7cf 100644 --- a/test_replays/test_all.py +++ b/test_replays/test_all.py @@ -596,6 +596,13 @@ def test_event_print(self): sys.stdout = sys.__stdout__ capturedOutput.close() + def test_70154(self): + for replayfilename in [ + "test_replays/4.7.0.70154/1.SC2Replay", + ]: + factory = sc2reader.factories.SC2Factory() + replay = factory.load_replay(replayfilename) + class TestGameEngine(unittest.TestCase): class TestEvent(object):