Example #1
0
while client.status():

    ans = client.handle_connection()
    if ans:
        who, typ, message = ans
    else:
        continue


    if who=="S":
        # chat and information
        if typ in ("_info","_chat","_error","wrong"):
            print("\r",end="")
            print(message)
        if typ == "_start":
            stage.printStage()
            print("\r",end="")
            print(message)

        # moves
        try:
            if typ == "move_X":
                stage.setX(message)
                stage.printStage()
            if typ == "move_O":
                stage.setO(message)
                stage.printStage()
            if typ == "stage":
                stage.setStage(message)
                stage.printStage()