Performing proper cleanup when a user leaves
This commit is contained in:
parent
cd805fab31
commit
c96b65549f
|
@ -154,6 +154,14 @@ export class GameRoom {
|
||||||
if (userObj !== undefined && typeof userObj.group !== "undefined") {
|
if (userObj !== undefined && typeof userObj.group !== "undefined") {
|
||||||
this.leaveGroup(userObj);
|
this.leaveGroup(userObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (user.hasFollowers()) {
|
||||||
|
user.stopLeading();
|
||||||
|
}
|
||||||
|
if (user.following) {
|
||||||
|
user.following.delFollower(user);
|
||||||
|
}
|
||||||
|
|
||||||
this.users.delete(user.id);
|
this.users.delete(user.id);
|
||||||
this.usersByUuid.delete(user.uuid);
|
this.usersByUuid.delete(user.uuid);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue