Deleting world when empty.
This commit is contained in:
parent
d9e6b501b1
commit
9bdcc9da98
2 changed files with 7 additions and 0 deletions
|
@ -297,6 +297,9 @@ export class IoSocketController {
|
|||
const world : World|undefined = this.Worlds.get(Client.roomId);
|
||||
if(world){
|
||||
world.leave(Client);
|
||||
if (world.isEmpty()) {
|
||||
this.Worlds.delete(Client.roomId);
|
||||
}
|
||||
}
|
||||
//user leave previous room
|
||||
Client.leave(Client.roomId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue