This commit is contained in:
David Négrier
2020-09-29 10:57:14 +02:00
parent 2cea0e490b
commit a9b1313d39
18 changed files with 32 additions and 1075 deletions
+4 -6
View File
@@ -121,7 +121,7 @@ export class IoSocketController {
*
* @param token
*/
searchClientByToken(token: string): ExSocketInterface | null {
/* searchClientByToken(token: string): ExSocketInterface | null {
const clients: ExSocketInterface[] = Object.values(this.Io.sockets.sockets) as ExSocketInterface[];
for (let i = 0; i < clients.length; i++) {
const client = clients[i];
@@ -131,7 +131,7 @@ export class IoSocketController {
return client;
}
return null;
}
}*/
private authenticate(ws: WebSocket) {
//console.log(socket.handshake.query.token);
@@ -657,25 +657,23 @@ export class IoSocketController {
//socket.emit(SocketIoEvent.GROUP_CREATE_UPDATE, groupUpdateMessage.serializeBinary().buffer);
}
private emitDeleteGroupEvent(socket: Socket, groupId: number): void {
private emitDeleteGroupEvent(client: ExSocketInterface, groupId: number): void {
const groupDeleteMessage = new GroupDeleteMessage();
groupDeleteMessage.setGroupid(groupId);
const subMessage = new SubMessage();
subMessage.setGroupdeletemessage(groupDeleteMessage);
const client : ExSocketInterface = socket as ExSocketInterface;
emitInBatch(client, subMessage);
}
private emitUserLeftEvent(socket: Socket, userId: number): void {
private emitUserLeftEvent(client: ExSocketInterface, userId: number): void {
const userLeftMessage = new UserLeftMessage();
userLeftMessage.setUserid(userId);
const subMessage = new SubMessage();
subMessage.setUserleftmessage(userLeftMessage);
const client : ExSocketInterface = socket as ExSocketInterface;
emitInBatch(client, subMessage);
}