0
0
Fork 0

Add some debug logs for players joining

This commit is contained in:
Oliver-Akins 2021-01-02 00:33:10 -07:00
parent 5cadcfa90a
commit 5cee09f3f0

View file

@ -49,6 +49,7 @@ export default (io: Server, socket: Socket, data: JoinGame) => {
// Assert game is not in-progess
if (game.ingame) {
log.debug(`${data.name} tried to connect to gID:${game.id} in the middle of a game.`);
socket.emit(`GameJoined`, {
status: 403,
message: `Cannot connect to a game that's in progress.`,
@ -60,6 +61,7 @@ export default (io: Server, socket: Socket, data: JoinGame) => {
let player = new Player(data.name, socket);
game.players.push(player);
log.debug(`${data.name} joined gID:${game.id}`);
socket.join(game.id);
socket.emit(`GameJoined`, {
status: 200,