Performing proper cleanup when a user leaves

This commit is contained in:
David Négrier 2021-12-17 18:29:52 +01:00 committed by PizZaKatZe
parent cd805fab31
commit c96b65549f

View File

@ -154,6 +154,14 @@ export class GameRoom {
if (userObj !== undefined && typeof userObj.group !== "undefined") {
this.leaveGroup(userObj);
}
if (user.hasFollowers()) {
user.stopLeading();
}
if (user.following) {
user.following.delFollower(user);
}
this.users.delete(user.id);
this.usersByUuid.delete(user.uuid);