Exemplo n.º 1
0
def user1():
    with sock(HOST, PORT) as s:
        force_login(s, 'a')
        sleep(0.5)
        send(s, "challenge", {'other_username': '******'})
        sleep(0.5) # wait to accept
        recv(s) # recieve begin_match
Exemplo n.º 2
0
def user1():
    with sock(HOST, PORT) as s:
        force_login(s, 'a')
        sleep(0.2) # wait for the other user to conect
        send(s, "challenge", {'other_username': '******'})
        recv(s) # recive fail response
        send(s, "challenge", {'other_username': '******'})
        recv(s) # challenge refused
        send(s, "challenge", {'other_username': '******'})
        recv(s) # match_begin
Exemplo n.º 3
0
def user2():
    with sock(HOST, PORT) as s:
        force_login(s, 'b')
        r = recv(s) # recieve challenge

        send(s, 'accept_challenge', {'id': 10000}) # accept fake challenge
        recv(s) # recive fail response

        send(s, 'refuse_challenge', {'id': r[1]['challenge_id']}) # refuse real challenge

        r = recv(s) # recieve challenge
        send(s, 'accept_challenge', {'id': r[1]['challenge_id']}) # refuse real challenge

        recv(s) # match_begin
Exemplo n.º 4
0
def user2():
    with sock(HOST, PORT) as s:
        force_login(s, 'b')
        r = recv(s) # recieve challenge
        send(s, 'accept_challenge', {'id': r[1]['challenge_id']})
        recv(s) # recieve begin_match