How to use the slider.utils.consume_short function in slider

To help you get started, we’ve selected a few slider 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 llllllllll / slider / slider / replay.py View on Github external
)
                library = client.library

        buffer = bytearray(data)

        mode = GameMode(consume_byte(buffer))
        version = consume_int(buffer)
        beatmap_md5 = consume_string(buffer)
        player_name = consume_string(buffer)
        replay_md5 = consume_string(buffer)
        count_300 = consume_short(buffer)
        count_100 = consume_short(buffer)
        count_50 = consume_short(buffer)
        count_geki = consume_short(buffer)
        count_katu = consume_short(buffer)
        count_miss = consume_short(buffer)
        score = consume_int(buffer)
        max_combo = consume_short(buffer)
        full_combo = bool(consume_byte(buffer))
        mod_mask = consume_int(buffer)
        life_bar_graph = _consume_life_bar_graph(buffer)
        timestamp = consume_datetime(buffer)
        actions = _consume_actions(buffer)

        mod_kwargs = Mod.unpack(mod_mask)
        # delete the alias field names
        del mod_kwargs['relax2']
        del mod_kwargs['last_mod']

        if retrieve_beatmap:
            try:
                beatmap = library.lookup_by_md5(beatmap_md5)
github llllllllll / slider / slider / replay.py View on Github external
if library is not None:
                    raise ValueError(
                        'only one of library or client can be passed'
                    )
                library = client.library

        buffer = bytearray(data)

        mode = GameMode(consume_byte(buffer))
        version = consume_int(buffer)
        beatmap_md5 = consume_string(buffer)
        player_name = consume_string(buffer)
        replay_md5 = consume_string(buffer)
        count_300 = consume_short(buffer)
        count_100 = consume_short(buffer)
        count_50 = consume_short(buffer)
        count_geki = consume_short(buffer)
        count_katu = consume_short(buffer)
        count_miss = consume_short(buffer)
        score = consume_int(buffer)
        max_combo = consume_short(buffer)
        full_combo = bool(consume_byte(buffer))
        mod_mask = consume_int(buffer)
        life_bar_graph = _consume_life_bar_graph(buffer)
        timestamp = consume_datetime(buffer)
        actions = _consume_actions(buffer)

        mod_kwargs = Mod.unpack(mod_mask)
        # delete the alias field names
        del mod_kwargs['relax2']
        del mod_kwargs['last_mod']
github llllllllll / slider / slider / replay.py View on Github external
buffer = bytearray(data)

        mode = GameMode(consume_byte(buffer))
        version = consume_int(buffer)
        beatmap_md5 = consume_string(buffer)
        player_name = consume_string(buffer)
        replay_md5 = consume_string(buffer)
        count_300 = consume_short(buffer)
        count_100 = consume_short(buffer)
        count_50 = consume_short(buffer)
        count_geki = consume_short(buffer)
        count_katu = consume_short(buffer)
        count_miss = consume_short(buffer)
        score = consume_int(buffer)
        max_combo = consume_short(buffer)
        full_combo = bool(consume_byte(buffer))
        mod_mask = consume_int(buffer)
        life_bar_graph = _consume_life_bar_graph(buffer)
        timestamp = consume_datetime(buffer)
        actions = _consume_actions(buffer)

        mod_kwargs = Mod.unpack(mod_mask)
        # delete the alias field names
        del mod_kwargs['relax2']
        del mod_kwargs['last_mod']

        if retrieve_beatmap:
            try:
                beatmap = library.lookup_by_md5(beatmap_md5)
            except KeyError:
                if not use_client:
github llllllllll / slider / slider / replay.py View on Github external
use_client = client is not None
            if use_client:
                if library is not None:
                    raise ValueError(
                        'only one of library or client can be passed'
                    )
                library = client.library

        buffer = bytearray(data)

        mode = GameMode(consume_byte(buffer))
        version = consume_int(buffer)
        beatmap_md5 = consume_string(buffer)
        player_name = consume_string(buffer)
        replay_md5 = consume_string(buffer)
        count_300 = consume_short(buffer)
        count_100 = consume_short(buffer)
        count_50 = consume_short(buffer)
        count_geki = consume_short(buffer)
        count_katu = consume_short(buffer)
        count_miss = consume_short(buffer)
        score = consume_int(buffer)
        max_combo = consume_short(buffer)
        full_combo = bool(consume_byte(buffer))
        mod_mask = consume_int(buffer)
        life_bar_graph = _consume_life_bar_graph(buffer)
        timestamp = consume_datetime(buffer)
        actions = _consume_actions(buffer)

        mod_kwargs = Mod.unpack(mod_mask)
        # delete the alias field names
        del mod_kwargs['relax2']
github llllllllll / slider / slider / replay.py View on Github external
if use_client:
                if library is not None:
                    raise ValueError(
                        'only one of library or client can be passed'
                    )
                library = client.library

        buffer = bytearray(data)

        mode = GameMode(consume_byte(buffer))
        version = consume_int(buffer)
        beatmap_md5 = consume_string(buffer)
        player_name = consume_string(buffer)
        replay_md5 = consume_string(buffer)
        count_300 = consume_short(buffer)
        count_100 = consume_short(buffer)
        count_50 = consume_short(buffer)
        count_geki = consume_short(buffer)
        count_katu = consume_short(buffer)
        count_miss = consume_short(buffer)
        score = consume_int(buffer)
        max_combo = consume_short(buffer)
        full_combo = bool(consume_byte(buffer))
        mod_mask = consume_int(buffer)
        life_bar_graph = _consume_life_bar_graph(buffer)
        timestamp = consume_datetime(buffer)
        actions = _consume_actions(buffer)

        mod_kwargs = Mod.unpack(mod_mask)
        # delete the alias field names
        del mod_kwargs['relax2']
        del mod_kwargs['last_mod']
github llllllllll / slider / slider / replay.py View on Github external
'only one of library or client can be passed'
                    )
                library = client.library

        buffer = bytearray(data)

        mode = GameMode(consume_byte(buffer))
        version = consume_int(buffer)
        beatmap_md5 = consume_string(buffer)
        player_name = consume_string(buffer)
        replay_md5 = consume_string(buffer)
        count_300 = consume_short(buffer)
        count_100 = consume_short(buffer)
        count_50 = consume_short(buffer)
        count_geki = consume_short(buffer)
        count_katu = consume_short(buffer)
        count_miss = consume_short(buffer)
        score = consume_int(buffer)
        max_combo = consume_short(buffer)
        full_combo = bool(consume_byte(buffer))
        mod_mask = consume_int(buffer)
        life_bar_graph = _consume_life_bar_graph(buffer)
        timestamp = consume_datetime(buffer)
        actions = _consume_actions(buffer)

        mod_kwargs = Mod.unpack(mod_mask)
        # delete the alias field names
        del mod_kwargs['relax2']
        del mod_kwargs['last_mod']

        if retrieve_beatmap:
            try:
github llllllllll / slider / slider / replay.py View on Github external
raise ValueError(
                        'only one of library or client can be passed'
                    )
                library = client.library

        buffer = bytearray(data)

        mode = GameMode(consume_byte(buffer))
        version = consume_int(buffer)
        beatmap_md5 = consume_string(buffer)
        player_name = consume_string(buffer)
        replay_md5 = consume_string(buffer)
        count_300 = consume_short(buffer)
        count_100 = consume_short(buffer)
        count_50 = consume_short(buffer)
        count_geki = consume_short(buffer)
        count_katu = consume_short(buffer)
        count_miss = consume_short(buffer)
        score = consume_int(buffer)
        max_combo = consume_short(buffer)
        full_combo = bool(consume_byte(buffer))
        mod_mask = consume_int(buffer)
        life_bar_graph = _consume_life_bar_graph(buffer)
        timestamp = consume_datetime(buffer)
        actions = _consume_actions(buffer)

        mod_kwargs = Mod.unpack(mod_mask)
        # delete the alias field names
        del mod_kwargs['relax2']
        del mod_kwargs['last_mod']

        if retrieve_beatmap: