Skip to content

Commit

Permalink
"lobby play" hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
evolutionleo committed Jun 4, 2021
1 parent aa961be commit eb04dea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions EmptyServer/custom/sendStuff.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}

// #################################
Expand Down
2 changes: 1 addition & 1 deletion EmptyServer/internal/entities/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = class Client extends SendStuff {
}

onPlay(lobby, start_pos) {
this.sendPlay(start_pos);
this.sendPlay(lobby, start_pos);
}

onDisconnect() {
Expand Down
3 changes: 2 additions & 1 deletion EmptyServer/internal/entities/lobby.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ module.exports = class Lobby {
}

play() {
var lobby = this;
this.players.forEach(function(player) {
addIntoPlay(player);
lobby.addIntoPlay(player);
})
}

Expand Down

0 comments on commit eb04dea

Please sign in to comment.