feat: FRO-31 Small backend changes (#108)
Force pushing Janis changes Co-authored-by: Janis <janis.e.20@gmx.de> Co-authored-by: Janis <janis-e@gmx.de> Reviewed-on: #108 Co-authored-by: lq64 <lq@blackhole.local> Co-committed-by: lq64 <lq@blackhole.local>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user