Esempio 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
                                        })
Esempio 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()
               })
Esempio 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"]})
Esempio 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})
Esempio 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"]})
Esempio 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": ".."})