add automatic room deletion

This commit is contained in:
Asraelite 2016-03-24 01:22:25 +00:00
parent df3f0d1436
commit f3619ba891
2 changed files with 9 additions and 0 deletions

View file

@ -29,6 +29,11 @@ class Room {
this.teamA.delete(player);
this.teamB.delete(player);
this.world.removePlayer(player);
if (this.players.size == 0) {
this.stop();
starbugs.gameServer.deleteRoom(this.name);
}
}
setTeam(player, team) {