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;
|
let targetSocket;
|
||||||
for (const socket of sockets) {
|
for (const socket of sockets) {
|
||||||
const clientInfo: string = clientChat.get(socket.id)?.user || '';
|
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) {
|
if (clientInfo === profil.user) {
|
||||||
console.log(color.yellow, 'DEBUG LOG: user online found', profil.user);
|
|
||||||
targetSocket = socket || '';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
profil.innerHtml = innerHtml ?? '';
|
profil.innerHtml = innerHtml ?? '';
|
||||||
if (targetSocket) {
|
if (targetSocket.id) {
|
||||||
targetSocket.emit('inviteGame', profil);
|
targetSocket.emit('inviteGame', profil);
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue