From 02557637eefe8c68e29f88c794c90c4b9a7fe9a7 Mon Sep 17 00:00:00 2001 From: Simon Pribylski Date: Sun, 2 Feb 2025 22:52:19 +0000 Subject: [PATCH] Update Sudoku networking --- Sudoku-networking.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sudoku-networking.md b/Sudoku-networking.md index 3c4049d..c605f5f 100644 --- a/Sudoku-networking.md +++ b/Sudoku-networking.md @@ -1,4 +1,3 @@ - # Protocol overview - The Client first tries to log in with his pseudo (**LoginPacket**) @@ -105,8 +104,10 @@ The server send one packet every 5s and the client should respond with the same The connexions are done by Java **Socket**s, so the protocol used is TCP/IP. A connexion between a client and the server is represented by the abstract **Connexion** class. This class implements the **PacketVisitor** interface so that it can process the recieved packets. + The server and the clients inherits this class (**ServerConnexion** and **ClientConnexion**) to process the packets based on their needs. A client keeps one **ClientConnexion** class while the server keeps one **ServerConnexion** per player. Each **Connexion** class spawns a new Thread for reading. This means that the server owns a thread per player so it might not scale well with a lot of players. In addition, the server holds another thread to handle new connexions. + When a valid **Packet** is read by the **Connexion** class, it calls the **visitPacket** method on himself to allow different behaviors depending on the packet recieved by subclasses. \ No newline at end of file