Skip to content

Conversation

@Ilia1177
Copy link
Collaborator

WebSocket connexion and disconnection are better handled:

  • Closing with error code and reason.
  • Game session are limited to 2 players: Player A & Player B, input have also been limited.
  • Local game has been desactivate (to reactivate later).
  • Players can disconnect & reconnect to game session.
  • If running, a game doesnt stop until a winner has been defined. If no players in a game session, and the game is not running, the session is deleted.

@Ilia1177 Ilia1177 linked an issue Jan 14, 2026 that may be closed by this pull request
5 tasks
Copy link
Collaborator

@rom98759 rom98759 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok pour moi

reason: reason.toString(),
});
upstreamWs.close();
upstreamWs.close(code, reason);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trop bien et plus clair

Comment on lines +77 to +91
// showPanel(panel: 'settings' | 'game-logs' | 'game-sessions') {
// ['settings', 'game-logs', 'game-sessions'].forEach((id) => {
// const el = document.getElementById(id);
// if (el) {
// el.classList.toggle('hidden', id !== panel);
// }
// });
// if (panel === 'game-sessions') {
// this.sessionsInterval = window.setInterval(() => this.loadSessions(), 2000);
// } else if (this.sessionsInterval) {
// clearInterval(this.sessionsInterval);
// this.sessionsInterval = null;
// }
// }

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A supp ?

<div class="bg-white/10 backdrop-blur-lg rounded-lg p-4 max-w-2xl mx-auto">
<div class="flex justify-around text-white">
<div class="text-center">
<p class="text-sm text-purple-300">Player 1</p>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mettre le nom des joueurs ?

Copy link
Owner

@codastream codastream left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool pour le dockerfile dev

est-ce qu;on peut faire en sorte que les PR a partir de maintenant n'ajoutent pas de lints ESLint ? (on peut typer autrement qu'avec any, enlever les variables non utilisées, utiliser const plutôt que var et si possible que let

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cette partie du Makefile est aussi modifiée dans la PR #48
qu'est-ce qu'il faudrait garder ?
Si c'est juste toi @Ilia1177 qui utilise Colima et que le processeur de JM est Intel, on peut garder le check proposé de la PR 48 (si MAC et si ARM, alors colima), plus simple.

};
}

export async function webSocketConnect(this: FastifyInstance, socket: any, req: FastifyRequest) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ws fournit un type WebSocket ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Game - Better WebSocket connexion/disconnexion

4 participants