Update ban feature
This commit is contained in:
parent
871ee6b192
commit
d2ee52ce43
10 changed files with 68 additions and 26 deletions
|
@ -79,23 +79,20 @@ export class SocketManager implements ZoneEventListener {
|
|||
}
|
||||
|
||||
async handleAdminRoom(client: ExAdminSocketInterface, roomId: string): Promise<void> {
|
||||
console.log('Calling adminRoom')
|
||||
const apiClient = await apiClientRepository.getClient(roomId);
|
||||
const adminRoomStream = apiClient.adminRoom();
|
||||
client.adminConnection = adminRoomStream;
|
||||
|
||||
adminRoomStream.on('data', (message: ServerToAdminClientMessage) => {
|
||||
if (message.hasUseruuidjoinedroom()) {
|
||||
const userUuid = message.getUseruuidjoinedroom();
|
||||
|
||||
if (message.hasUseruuidnamejoinedroom()) {
|
||||
const userUuidName = message.getUseruuidnamejoinedroom();
|
||||
if (!client.disconnecting) {
|
||||
client.send('MemberJoin:'+userUuid+';'+roomId);
|
||||
client.send('MemberJoin:'+userUuidName+';'+roomId);
|
||||
}
|
||||
} else if (message.hasUseruuidleftroom()) {
|
||||
const userUuid = message.getUseruuidleftroom();
|
||||
|
||||
} else if (message.hasUseruuidnameleftroom()) {
|
||||
const userUuidName = message.getUseruuidnameleftroom();
|
||||
if (!client.disconnecting) {
|
||||
client.send('MemberLeave:'+userUuid+';'+roomId);
|
||||
client.send('MemberLeave:'+userUuidName+';'+roomId);
|
||||
}
|
||||
} else {
|
||||
throw new Error('Unexpected admin message');
|
||||
|
@ -151,6 +148,7 @@ export class SocketManager implements ZoneEventListener {
|
|||
|
||||
const joinRoomMessage = new JoinRoomMessage();
|
||||
joinRoomMessage.setUseruuid(client.userUuid);
|
||||
joinRoomMessage.setIpaddress(client.IPAddress);
|
||||
joinRoomMessage.setRoomid(client.roomId);
|
||||
joinRoomMessage.setName(client.name);
|
||||
joinRoomMessage.setPositionmessage(ProtobufUtils.toPositionMessage(client.position));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue