From 7b4789dd2a06450892768081815e2b53097baba0 Mon Sep 17 00:00:00 2001 From: Jonas Weinz Date: Thu, 21 Mar 2019 14:15:00 +0100 Subject: [PATCH] more improvements --- main.js | 1 + online_match_manager.js | 9 +++++++-- websocket_connection.js | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 3dfe62c..6eae975 100644 --- a/main.js +++ b/main.js @@ -117,6 +117,7 @@ on_close_click = function() { else if (connection != null) { connection.on_close_click(); + match_control.hide(); } } diff --git a/online_match_manager.js b/online_match_manager.js index e32ef4a..d1f3c31 100644 --- a/online_match_manager.js +++ b/online_match_manager.js @@ -28,6 +28,11 @@ class OnlineMatchManager this.match_button.className = "infobar-button-active"; + if (this.match_state.active_player == this.local_player.get_name()) + { + this.game_server_connection.notify("your turn against " + this.online_opponent.get_name()); + } + this.is_closed = false; } @@ -70,9 +75,9 @@ class OnlineMatchManager this.match_state = match_state; this.match_button.className = "infobar-button-active"; - if (this.match_state.current_player != this.current_player_name) + if (this.match_state.active_player == this.local_player.get_name()) { - this.game_server_connection.notify("" + this.online_opponent.get_name() + " moved"); + this.game_server_connection.notify("your turn against " + this.online_opponent.get_name()); } } diff --git a/websocket_connection.js b/websocket_connection.js index d212c56..b5edc30 100644 --- a/websocket_connection.js +++ b/websocket_connection.js @@ -232,6 +232,7 @@ class WebsocketConnection }; this.socket.send(JSON.stringify(msg_object)); + } send_match_request(player_name)