From: David NĂ©grier Date: Wed, 29 Apr 2020 21:18:42 +0000 (+0200) Subject: Adding support for leaving the group if the socket is closed X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c778afcbca777412e091890a49182b9be8301e8b;p=libreadventure.git Adding support for leaving the group if the socket is closed --- diff --git a/back/src/Model/World.ts b/back/src/Model/World.ts index 06bcf88..795cc8b 100644 --- a/back/src/Model/World.ts +++ b/back/src/Model/World.ts @@ -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); }