How to use the s2protocol.mpyq.mpyq function in s2protocol

To help you get started, we’ve selected a few s2protocol examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github karlgluck / heroes-of-the-storm-replay-parser / stormreplay / stormreplay.py View on Github external
def __init__(self, replayFile):

        # The replayFile can be either the name of a file or any object that has a 'read()' method.
        self.mpq = mpyq.MPQArchive(replayFile)

        self.buildStormReplay = protocol15405.decode_replay_header(self.mpq.header['user_data_header']['content'])['m_version']['m_baseBuild']

        try:
            self.protocol = __import__('s2protocol' + '.protocol%s' % self.buildStormReplay, fromlist=['protocol2'])
        except ImportError:
            raise Exception('Unsupported build number: %i' % self.buildStormReplay)
github karlgluck / heroes-of-the-storm-replay-parser / api / StormReplayParser.py View on Github external
def __init__(self, replayFile):

        # The replayFile can be either the name of a file or any object that has a 'read()' method.
        self.mpq = mpyq.MPQArchive(replayFile)

        self.buildStormReplay = protocol15405.decode_replay_header(self.mpq.header['user_data_header']['content'])['m_version']['m_baseBuild']

        try:
            self.protocol = __import__('s2protocol' + '.protocol%s' % self.buildStormReplay, fromlist=['protocol2'])
        except ImportError:
            raise Exception('Unsupported build number: %i' % self.buildStormReplay)
github karlgluck / heroes-of-the-storm-replay-parser / stormreplay / reader.py View on Github external
def __init__(self, replayFile):

        # The replayFile can be either the name of a file or any object that has a 'read()' method.
        self.mpq = mpyq.MPQArchive(replayFile)

        self.buildStormReplay = protocol15405.decode_replay_header(self.mpq.header['user_data_header']['content'])['m_version']['m_baseBuild']

        try:
            self.protocol = __import__('s2protocol' + '.protocol%s' % self.buildStormReplay, fromlist=['protocol2'])
        except ImportError:
            raise Exception('Unsupported build number: %i' % self.buildStormReplay)