Adding support for leaving the group if the socket is closed
This commit is contained in:
parent
bf0fa516d4
commit
c778afcbca
1 changed files with 4 additions and 1 deletions
|
@ -34,7 +34,10 @@ export class World {
|
|||
}
|
||||
|
||||
public leave(user : ExSocketInterface){
|
||||
/*TODO leaver user in group*/
|
||||
let userObj = this.users.get(user.id);
|
||||
if (userObj !== undefined && typeof userObj.group !== 'undefined') {
|
||||
this.leaveGroup(user);
|
||||
}
|
||||
this.users.delete(user.userId);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue