Feat/96 add getlobbystatus command on server side #260

Merged
jona.walpert merged 4 commits from feat/96-add-getlobbystatus-command-on-server-side into main 2026-04-11 21:09:05 +02:00
Showing only changes of commit 46ccae40ad - Show all commits
@@ -11,13 +11,9 @@ import java.util.Optional;
/**
* Handler for the `GET_LOBBY_STATUS` command.
*
* <p>
* Resolves the target lobby either by the optional `ID` parameter or by
* `USERNAME`. If both are
* omitted the handler requires the session to be associated with a logged-in
* user (see the inline
* pre-execution check). On success a {@link GetLobbyStatusResponse} is
* dispatched, otherwise an
* <p>Resolves the target lobby either by the optional `ID` parameter or by `USERNAME`. If both are
* omitted the handler requires the session to be associated with a logged-in user (see the inline
* pre-execution check). On success a {@link GetLobbyStatusResponse} is dispatched, otherwise an
* {@link ErrorResponse} with code `LOBBY_NOT_FOUND` is sent.
*/
public class GetLobbyStatusHandler extends CommandHandler<GetLobbyStatusRequest> {
@@ -67,7 +63,8 @@ public class GetLobbyStatusHandler extends CommandHandler<GetLobbyStatusRequest>
}
}
var lobby = (request.getId() != null)
var lobby =
(request.getId() != null)
? lobbyManager.getLobby(LobbyId.of(request.getId()))
: (targetUsername != null
? lobbyManager.getLobbyByUsername(targetUsername)