server for my chess game
-rw-r--r--src/index.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/index.js b/src/index.js
index 0fd4578..020f23d 100644
--- a/src/index.js
+++ b/src/index.js
@@ -201,6 +201,7 @@ function handle_joinrequest(data, ws) {
if (color != undefined) {
// someone is trying to rejoin
console.log(`rejoin ${data.name} to ${color}`);
+ ws.send_packet({ idx: color == "w" ? 0 : 1 }, HEADERS.joinrequest);
game.add_client(ws, data, color == "w");
ws.send_packet(game.pgn, HEADERS.loadpgn); // pass them the pgn
send_info(true); // and send them their opponents info