Refactor message

This commit is contained in:
Gregoire Parant 2020-10-20 08:20:21 +02:00
parent ba9f9dcbe1
commit 7059c6e6e3
3 changed files with 15 additions and 2 deletions

View file

@ -673,7 +673,7 @@ class SocketManager {
client.send(serverToClientMessage.serializeBinary().buffer, true);
}
public emitSendUserMessage(messageToSend: {userUuid: string, message: string, type: string}): void {
public emitSendUserMessage(messageToSend: {userUuid: string, message: string, type: string}): ExSocketInterface {
const socket = this.searchClientByUuid(messageToSend.userUuid);
if(!socket){
throw 'socket was not found';
@ -689,6 +689,7 @@ class SocketManager {
if (!socket.disconnecting) {
socket.send(serverToClientMessage.serializeBinary().buffer, true);
}
return socket;
}
}