Add some debug logs for players joining
This commit is contained in:
parent
5cadcfa90a
commit
5cee09f3f0
1 changed files with 2 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue