Fix admin tags

- Fix get size group
- Fix admin tags
- Fix texture already used
This commit is contained in:
Gregoire Parant 2020-10-21 17:22:17 +02:00
parent 1df4cb3e17
commit e973921390
3 changed files with 13 additions and 2 deletions

View File

@ -117,4 +117,8 @@ export class Group implements Movable {
this.leave(user);
}
}
get getSize(){
return this.users.size;
}
}

View File

@ -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);

View File

@ -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