feat(api): BAC-10 Websockets - Kick Users (#93)
Reviewed-on: #93 Co-authored-by: Janis <janis.e.20@gmx.de> Co-committed-by: Janis <janis.e.20@gmx.de>
This commit is contained in:
@@ -64,6 +64,15 @@ class UserSession(val user: User, val host: Boolean, val gameLobby: GameLobby) e
|
||||
case None =>
|
||||
println("Card Index not found or is not a number.")
|
||||
}
|
||||
case "KickPlayer" =>
|
||||
val maybePlayerId: Option[String] = (data \ "playerId").asOpt[String]
|
||||
maybePlayerId match {
|
||||
case Some(id) =>
|
||||
val playerUUID = UUID.fromString(id)
|
||||
gameLobby.leaveGame(playerUUID, true)
|
||||
case None =>
|
||||
println("Player ID not found or is not a valid UUID.")
|
||||
}
|
||||
}
|
||||
}
|
||||
lock.unlock()
|
||||
|
||||
Reference in New Issue
Block a user