From eb04deaa1e993a69fd5f88c48aa412854851c67a Mon Sep 17 00:00:00 2001 From: Evoleo Date: Fri, 4 Jun 2021 17:46:33 +0300 Subject: [PATCH] "lobby play" hotfix --- EmptyServer/custom/sendStuff.js | 4 ++-- EmptyServer/internal/entities/client.js | 2 +- EmptyServer/internal/entities/lobby.js | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/EmptyServer/custom/sendStuff.js b/EmptyServer/custom/sendStuff.js index feddc1f..fbd2c30 100644 --- a/EmptyServer/custom/sendStuff.js +++ b/EmptyServer/custom/sendStuff.js @@ -88,8 +88,8 @@ module.exports = class SendStuff { this.write({ cmd: 'lobby list', lobbies: Object.values(global.lobbies).map(lobby => lobby.serialize()) }); // lobbies as an array } - sendPlay(start_pos) { - this.write({ cmd: 'play', start_pos: start_pos }); + sendPlay(lobby, start_pos) { + this.write({ cmd: 'play', lobby: lobby, start_pos: start_pos }); } // ################################# diff --git a/EmptyServer/internal/entities/client.js b/EmptyServer/internal/entities/client.js index 21f6b24..8f3c223 100644 --- a/EmptyServer/internal/entities/client.js +++ b/EmptyServer/internal/entities/client.js @@ -36,7 +36,7 @@ module.exports = class Client extends SendStuff { } onPlay(lobby, start_pos) { - this.sendPlay(start_pos); + this.sendPlay(lobby, start_pos); } onDisconnect() { diff --git a/EmptyServer/internal/entities/lobby.js b/EmptyServer/internal/entities/lobby.js index cda9f68..1e7c46b 100644 --- a/EmptyServer/internal/entities/lobby.js +++ b/EmptyServer/internal/entities/lobby.js @@ -83,8 +83,9 @@ module.exports = class Lobby { } play() { + var lobby = this; this.players.forEach(function(player) { - addIntoPlay(player); + lobby.addIntoPlay(player); }) }