From b17aae5795b35ce3805db87c9bf741a5a96cd5ac Mon Sep 17 00:00:00 2001 From: lq64 Date: Thu, 11 Dec 2025 07:10:24 +0100 Subject: [PATCH] feat: FRO-31 Small backend changes (#108) Force pushing Janis changes Co-authored-by: Janis Co-authored-by: Janis Reviewed-on: https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/pulls/108 Co-authored-by: lq64 Co-committed-by: lq64 --- knockoutwhistweb/app/controllers/StatusController.scala | 6 +++--- knockoutwhistweb/app/util/WebsocketEventMapper.scala | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/knockoutwhistweb/app/controllers/StatusController.scala b/knockoutwhistweb/app/controllers/StatusController.scala index 72daedb..e57f5a4 100644 --- a/knockoutwhistweb/app/controllers/StatusController.scala +++ b/knockoutwhistweb/app/controllers/StatusController.scala @@ -34,7 +34,7 @@ class StatusController @Inject()( Json.obj( "status" -> "authenticated", "username" -> user.name, - "inGame" -> "false" + "inGame" -> false ) ) } else { @@ -43,7 +43,7 @@ class StatusController @Inject()( Json.obj( "status" -> "authenticated", "username" -> user.name, - "inGame" -> "true", + "inGame" -> true, "gameId" -> game.id ) ) @@ -80,7 +80,7 @@ class StatusController @Inject()( }} private def getUserFromSession(request: RequestHeader): Option[User] = { - val session = request.cookies.get("sessionId") + val session = request.cookies.get("accessToken") if (session.isDefined) return sessionManager.getUserBySession(session.get.value) None diff --git a/knockoutwhistweb/app/util/WebsocketEventMapper.scala b/knockoutwhistweb/app/util/WebsocketEventMapper.scala index 4e3bb32..522bd56 100644 --- a/knockoutwhistweb/app/util/WebsocketEventMapper.scala +++ b/knockoutwhistweb/app/util/WebsocketEventMapper.scala @@ -57,7 +57,8 @@ object WebsocketEventMapper { Json.obj( "id" -> ("request-" + java.util.UUID.randomUUID().toString), "event" -> obj.id, - "state" -> stateToJson(session), + "state" -> session.gameLobby.getLogic.getCurrentState.toString, + "stateData" -> stateToJson(session), "data" -> data ) }