Skip to content

Commit

Permalink
Prevent duplicate account joining in Game.js
Browse files Browse the repository at this point in the history
  • Loading branch information
codergautam committed Jan 13, 2024
1 parent efe3fa5 commit 2a9d610
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions server/src/game/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,14 @@ class Game {
data.name = name;
}

if(client.account && client.account.id) {
// Make sure same account can't join twice
for (const player of this.players) {
if (player.account && player.account.id === client.account.id) {
return;
}
}
}

// if (this.isNameReserved(name)) return;

Expand Down

0 comments on commit 2a9d610

Please sign in to comment.