diff --git a/knockoutwhistweb/app/model/sessions/UserSession.scala b/knockoutwhistweb/app/model/sessions/UserSession.scala index 0c1608f..64776fc 100644 --- a/knockoutwhistweb/app/model/sessions/UserSession.scala +++ b/knockoutwhistweb/app/model/sessions/UserSession.scala @@ -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() diff --git a/knockoutwhistweb/app/views/lobby/lobby.scala.html b/knockoutwhistweb/app/views/lobby/lobby.scala.html index 32b7fbc..dd7413b 100644 --- a/knockoutwhistweb/app/views/lobby/lobby.scala.html +++ b/knockoutwhistweb/app/views/lobby/lobby.scala.html @@ -60,7 +60,7 @@ Remove } else {