From edf27326658cc783250c023beeb820d650f412de Mon Sep 17 00:00:00 2001 From: Simon Pribylski Date: Wed, 12 Mar 2025 13:48:41 +0000 Subject: [PATCH] Update Networking protocol --- Networking-protocol.md | 46 +++++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/Networking-protocol.md b/Networking-protocol.md index 9767483..b73b64e 100644 --- a/Networking-protocol.md +++ b/Networking-protocol.md @@ -15,7 +15,25 @@ # Packets -## Client -> Server +## Client <--> Server + +### AcknowlegdementPacket + +The receiver sends this packet to confirm the successful receive to the sender + +| Name | Type | Description | +| ---- | ---- | ------------------------------------------ | +| Ack | Int | The sequence number of the received packet | + +### DisconnectPacket + +Packet sent by the client or server to indicate that the connexion should be closed + +| Name | Type | Description | +| ------ | ------ | ----------- | +| Reason | String | The reason + +## Client --> Server ### LoginPacket @@ -31,13 +49,12 @@ The client sends this packet when needing to update the list of rooms available. This packet has no body. -### RoomListPacket +### RequestActualRoomPacket -Sends the list of rooms available. +The client sends this packet when he wants to know in which room he is in. + +This packet has no body. -| Name | Type | Description | -| --------- | ------------------ | ---------------------- | -| RoomNames | ArrayList\ | the list of room names | ### CreateRoomPacket Create a room by name. The server responds with a ResponsePacket. @@ -66,7 +83,7 @@ Leave a room. This packet has no body -## Server -> Client +## Server --> Client ### ChatMessagePacket @@ -84,3 +101,18 @@ The server responds to the client when trying to perform operations such as auth | Name | Type | Description | | -------- | ---- | ----------------------------------------- | | Response | Int | a ServerResponse depending on the request | + +### ActualRoomPacket + +Sends the room in which the client is + +| Name | Type | Description | +| -------- | ------ | ---------------------- | +| RoomName | String | The room of the client | +### RoomListPacket + +Sends the list of rooms available. + +| Name | Type | Description | +| --------- | ------------------ | ---------------------- | +| RoomNames | ArrayList\ | the list of room names |