added pong keepalive

This commit is contained in:
Maieul BOYER 2026-01-10 17:58:11 +01:00 committed by Maix0
parent 901e3e5a8e
commit 1b169fca13
3 changed files with 22 additions and 12 deletions

View file

@ -48,6 +48,13 @@ class StateI {
};
}
private getHello(socket: SSocket) {
const user = this.users.get(socket.authUser.id);
if (isNullish(user)) return;
user.lastSeen = Date.now();
}
private registerForTournament(sock: SSocket, name: string | null) {
const user = this.users.get(sock.authUser.id);
if (isNullish(user)) return;
@ -327,6 +334,7 @@ class StateI {
socket.on('tourCreate', () => this.createTournament(socket));
socket.on('tourStart', () => this.startTournament(socket));
socket.on('hello', () => this.getHello(socket));
}
private updateClient(socket: SSocket): void {