Users blocking now rely on UUID rather than ID

This way, if a user A blocks another user B, if user B refreshes the browser or leaves and re-enters the room, user B will still be blocked.
As a side effect, this allows us to completely remove the "sockets" property in the SocketManager on the Pusher.
This commit is contained in:
David Négrier 2021-07-07 11:24:51 +02:00
parent 28e4f59e50
commit 34cb0ebf39
15 changed files with 143 additions and 141 deletions

View file

@ -39,6 +39,7 @@ export type LeavesCallback = (thing: Movable, listener: User) => void;*/
export class UserDescriptor {
private constructor(
public readonly userId: number,
private userUuid: string,
private name: string,
private characterLayers: CharacterLayerMessage[],
private position: PositionMessage,
@ -57,6 +58,7 @@ export class UserDescriptor {
}
return new UserDescriptor(
message.getUserid(),
message.getUseruuid(),
message.getName(),
message.getCharacterlayersList(),
position,
@ -84,6 +86,7 @@ export class UserDescriptor {
userJoinedMessage.setVisitcardurl(this.visitCardUrl);
}
userJoinedMessage.setCompanion(this.companion);
userJoinedMessage.setUseruuid(this.userUuid);
return userJoinedMessage;
}