feat(api): Implemented session closed and kick event via websocket (#87)

Reviewed-on: #87
Reviewed-by: lq64 <lq@blackhole.local>
Co-authored-by: Janis <janis.e.20@gmx.de>
Co-committed-by: Janis <janis.e.20@gmx.de>
This commit is contained in:
2025-11-26 18:41:25 +01:00
committed by lq64
parent 576e5af87e
commit 1ef5e8a72f
14 changed files with 253 additions and 20 deletions

View File

@@ -89,7 +89,7 @@ class IngameController @Inject()(
val game = PodManager.getGame(gameId)
val playerToKickUUID = UUID.fromString(playerToKick)
val result = Try {
game.get.leaveGame(playerToKickUUID)
game.get.leaveGame(playerToKickUUID, true)
}
if (result.isSuccess) {
Ok(Json.obj(
@@ -107,7 +107,7 @@ class IngameController @Inject()(
def leaveGame(gameId: String): Action[AnyContent] = authAction { implicit request: AuthenticatedRequest[AnyContent] =>
val game = PodManager.getGame(gameId)
val result = Try {
game.get.leaveGame(request.user.id)
game.get.leaveGame(request.user.id, false)
}
if (result.isSuccess) {
Ok(Json.obj(