diff --git a/back/src/Model/Group.ts b/back/src/Model/Group.ts index 9afa9764..d3b042a6 100644 --- a/back/src/Model/Group.ts +++ b/back/src/Model/Group.ts @@ -117,4 +117,8 @@ export class Group implements Movable { this.leave(user); } } + + get getSize(){ + return this.users.size; + } } diff --git a/back/src/Services/SocketManager.ts b/back/src/Services/SocketManager.ts index 50bd149e..35f97c37 100644 --- a/back/src/Services/SocketManager.ts +++ b/back/src/Services/SocketManager.ts @@ -130,6 +130,7 @@ export class SocketManager { userJoinedMessage.setPosition(ProtobufUtils.toPositionMessage(player.position)); roomJoinedMessage.addUser(userJoinedMessage); + roomJoinedMessage.setTagList(client.tags); } else if (thing instanceof Group) { const groupUpdateMessage = new GroupUpdateMessage(); groupUpdateMessage.setGroupid(thing.getId()); @@ -493,6 +494,7 @@ export class SocketManager { const groupUpdateMessage = new GroupUpdateMessage(); groupUpdateMessage.setGroupid(group.getId()); groupUpdateMessage.setPosition(pointMessage); + groupUpdateMessage.setGroupsize(group.getSize); const subMessage = new SubMessage(); subMessage.setGroupupdatemessage(groupUpdateMessage); diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index bcef8fc2..c235d032 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -410,9 +410,14 @@ export class GameScene extends ResizableScene implements CenterListener { this.initCamera(); // Let's generate the circle for the group delimiter - const circleElement = Object.values(this.textures.list).find((object: Texture) => object.key === 'circleSprite'); + let circleElement = Object.values(this.textures.list).find((object: Texture) => object.key === 'circleSprite-white'); if (circleElement) { - this.textures.remove('circleSprite'); + this.textures.remove('circleSprite-white'); + } + + circleElement = Object.values(this.textures.list).find((object: Texture) => object.key === 'circleSprite-red'); + if (circleElement) { + this.textures.remove('circleSprite-red'); } //create white circle canvas use to create sprite