HotFix ban user (#1318)

* HotFix ban user

 - Fix to permit to ban user with more sub tab openned
 - Fix to permit to send message ban to the user with more sub tab oppened

* Fix CI

* Run pretty
This commit is contained in:
grégoire parant 2021-07-27 14:42:32 +02:00 committed by GitHub
parent 95af568653
commit 3d657b4a18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 20 deletions

View file

@ -72,6 +72,15 @@ export class GameRoom {
public getUserById(id: number): User | undefined {
return this.users.get(id);
}
public getUsersByUuid(uuid: string): User[] {
const userList: User[] = [];
for (const user of this.users.values()) {
if (user.uuid === uuid) {
userList.push(user);
}
}
return userList;
}
public join(socket: UserSocket, joinRoomMessage: JoinRoomMessage): User {
const positionMessage = joinRoomMessage.getPositionmessage();