Exemplo n.º 1
0
def delete_pre_end_of_game(connection: LeagueConnection):
    ''' Deletes pre end of game sequence event '''
    res = connection.get('/lol-pre-end-of-game/v1/currentSequenceEvent')
    res_json = res.json()
    name = res_json['name']
    connection.post('/lol-pre-end-of-game/v1/complete/%s' % name)
    connection.delete('/lol-pre-end-of-game/v1/registration/%s' % name)
Exemplo n.º 2
0
def create_lobby(connection: LeagueConnection, queue_id):
    ''' Creates a lobby with the queue id given '''
    data = {"queueId": queue_id}
    if queue_id in [2000, 2010, 2020]:
        connection.post('/lol-lobby/v2/matchmaking/quick-search', json=data)
        return None
    res = connection.post('/lol-lobby/v2/lobby', json=data)
    res = res.json()
    if 'errorCode' in res:
        return res['message']
    return None
Exemplo n.º 3
0
def buy(connection: LeagueConnection, item_id, val):
    ''' Buys a specific item from the store '''
    data = {
        'items': [{
            'itemKey': {
                'inventoryType': 'CHAMPION',
                'itemId': item_id
            },
            'purchaseCurrencyInfo': {
                'currencyType': 'IP',
                'price': val,
                'purchasable': True,
            },
            'quantity': 1
        }]
    }
    connection.post('/lol-purchase-widget/v1/purchaseItems', json=data)
Exemplo n.º 4
0
def honor(connection: LeagueConnection, data):
    ''' Honors a player account of the given player data '''
    connection.post('/lol-honor-v2/v1/honor-player', json=data)
Exemplo n.º 5
0
def skip_stats(connection: LeagueConnection):
    ''' Skips waiting for stats '''
    connection.post('/lol-end-of-game/v1/state/dismiss-stats')
Exemplo n.º 6
0
def reconnect(connection: LeagueConnection):
    ''' Reconnects to the game '''
    connection.post('/lol-gameflow/v1/reconnect')
Exemplo n.º 7
0
def send_invitations(connection: LeagueConnection, data):
    '''Send an game invite to given id'''
    connection.post('/lol-lobby/v2/lobby/invitations', json=data)
Exemplo n.º 8
0
def accept_invitation(connection: LeagueConnection, invitation_id):
    '''Accepts the incoming invitation'''
    connection.post(
        f'/lol-lobby/v2/received-invitations/{invitation_id}/accept')
Exemplo n.º 9
0
def accept_queue(connection: LeagueConnection):
    ''' Accepts the ready check '''
    connection.post("/lol-matchmaking/v1/ready-check/accept")
Exemplo n.º 10
0
def start_matchmaking(connection: LeagueConnection):
    ''' Starts the matchmaking process '''
    connection.post("/lol-lobby/v2/lobby/matchmaking/search")
Exemplo n.º 11
0
def process_control_quit(connection: LeagueConnection):
    ''' Quits league using proceses contrl '''
    connection.post('/process-control/v1/process/quit')