Exemplo n.º 1
0
def game_chat(game_id, message, move_number, type="main"):
    data = get_data()
    comm_socket.emit("game/chat", data={"game_id": game_id,
                                        "player_id": data["user"]["id"],
                                        "type": type,
                                        "body": message,
                                        "move_number": move_number
                                        })
Exemplo n.º 2
0
 def authenticate():
     data = get_data()
     self.emit("authenticate",
               data={
                   "auth": get_chat_auth(),
                   "player_id": data["user"]["id"],
                   "username": data["user"]["username"],
                   "jwt": get_user_jwt()
               })
Exemplo n.º 3
0
def _chat_connect():
    from ogs_api.access_tokens import get_data, get_chat_auth
    data = get_data()
    global _user_id
    _user_id = data['user']['id']
    comm_socket.emit("chat/connect", data={"auth": get_chat_auth(),
                                           "player_id": data["user"]["id"],
                                           "ranking": data["user"]["ranking"],
                                           "username": data["user"]["username"],
                                           "ui_class": data["user"]["ui_class"]})
Exemplo n.º 4
0
def game_connect(game_id, connect_to_gamechat=0):
    data = get_data()
    comm_socket.emit("game/connect", data={"game_id": game_id,
                                           "player_id": data["user"]["id"],
                                           "chat": connect_to_gamechat})
Exemplo n.º 5
0
def game_resume(game_id):
    data = get_data()
    comm_socket.emit("game/resume", data={"game_id": game_id,
                                          "player_id": data["user"]["id"]})
Exemplo n.º 6
0
def game_pass(game_id):
    data = get_data()
    comm_socket.emit("game/move", data={"game_id": game_id,
                                        "player_id": data["user"]["id"],
                                        "move": ".."})