server for my chess game
-rw-r--r--src/index.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/index.js b/src/index.js
index c64cf8d..c591696 100644
--- a/src/index.js
+++ b/src/index.js
@@ -253,11 +253,10 @@ function handle_spectate(data, ws) {
const game = games[data.gamecode];
game.add_spectator(ws);
const packet = {
- white: game.infos.get(0),
- black: game.infos.get(1),
+ white: game.get_info("w"),
+ black: game.get_info("b"),
pgn: game.pgn,
- }; // spectator starter kit
- // provides white info, black info, and pgn
+ }; // spectator starter kit: provides white info, black info, and pgn
ws.send_packet(packet, HEADERS.spectate);
}