From f467d9ebe216ead3f8ae5c52a7b04e352c5a273a Mon Sep 17 00:00:00 2001 From: Jona Walpert Date: Sat, 11 Apr 2026 21:12:30 +0200 Subject: [PATCH] Docs: Add new get_lobby_list command --- .../networking/commands/protocol-document.md | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/documents/docs/networking/commands/protocol-document.md b/documents/docs/networking/commands/protocol-document.md index 266bb29..e953ba2 100644 --- a/documents/docs/networking/commands/protocol-document.md +++ b/documents/docs/networking/commands/protocol-document.md @@ -50,6 +50,12 @@ This document describes the protocol for client-server communication in our appl - [Error Response](#error-response-6) - [Example Request](#example-request-4) - [Example Response](#example-response-4) + - [GET_LOBBY_LIST command](#get_lobby_list-command) + - [Required pre-execution checks](#required-pre-execution-checks) + - [Request Parameters](#request-parameters) + - [Success Response](#success-response) + - [Example Request](#example-request) + - [Example Response](#example-response) @@ -515,6 +521,60 @@ END END ``` +## GET_LOBBY_LIST command + +The `GET_LOBBY_LIST` command requests the server to return a list of currently available lobbies with basic metadata. + +### Required pre-execution checks +None. + +### Request Parameters +No parameters. + +### Implementation notes + +- Parser: `GetLobbyListParser` — creates `GetLobbyListRequest` (no parameters). +- Handler: `GetLobbyListHandler` — queries `LobbyManager#getAllLobbies()` and returns `GetLobbyListResponse`. +- Response: `GetLobbyListResponse` — builds a `LOBBIES` collection with repeated `LOBBY` blocks containing `ID`, `NAME`, `PLAYER_COUNT`. + +### Success Response + +The response contains a `LOBBIES` collection with nested `LOBBY` entries. + +Example response structure: + +``` ++OK + LOBBIES + LOBBY + ID=1 + NAME=Room 1 + PLAYER_COUNT=2 + END + LOBBY + ID=2 + NAME=Room 2 + PLAYER_COUNT=3 + END + END +END +``` + +### Example Request + +``` +GET_LOBBY_LIST +``` + +### Example Response (error) + +``` +-ERR + CODE=NO_LOBBIES_AVAILABLE + MESSAGE=No lobbies available +END +``` + ## GET_LOBBY_STATUS command The `GET_LOBBY_STATUS` command requests the server to return the current state of a lobby, including the list of players and their ready state.