WIP on bloccage invitaion - no working at all yet
This commit is contained in:
parent
266feb22f4
commit
75ec5cd9c4
1 changed files with 8 additions and 7 deletions
|
|
@ -16,15 +16,16 @@ export function sendInvite(fastify: FastifyInstance, innerHtml: string, profil:
|
|||
let targetSocket;
|
||||
for (const socket of sockets) {
|
||||
const clientInfo: string = clientChat.get(socket.id)?.user || '';
|
||||
targetSocket = socket || null;
|
||||
if (!targetSocket) continue;
|
||||
console.log(color.yellow, 'DEBUG LOG: user online found', profil.user, 'socket', targetSocket.id);
|
||||
if (clientInfo === profil.user) {
|
||||
console.log(color.yellow, 'DEBUG LOG: user online found', profil.user);
|
||||
targetSocket = socket || '';
|
||||
break;
|
||||
profil.innerHtml = innerHtml ?? '';
|
||||
if (targetSocket.id) {
|
||||
targetSocket.emit('inviteGame', profil);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
profil.innerHtml = innerHtml ?? '';
|
||||
if (targetSocket) {
|
||||
targetSocket.emit('inviteGame', profil);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue