feat(api): BAC-11 Websocket - Return to Lobby (#94)
Reviewed-on: #94 Co-authored-by: Janis <janis.e.20@gmx.de> Co-committed-by: Janis <janis.e.20@gmx.de>
This commit is contained in:
@@ -73,6 +73,8 @@ class UserSession(val user: User, val host: Boolean, val gameLobby: GameLobby) e
|
||||
case None =>
|
||||
println("Player ID not found or is not a valid UUID.")
|
||||
}
|
||||
case "ReturnToLobby" =>
|
||||
gameLobby.returnToLobby(this)
|
||||
}
|
||||
}
|
||||
lock.unlock()
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="row justify-content-center align-items-center flex-grow-1">
|
||||
@if((gamelobby.getUserSession(user.get.id).host)) {
|
||||
<div class="col-12 text-center mb-5">
|
||||
<div class="btn btn-success" onclick="backToLobby('@gamelobby.id')">Return to lobby</div>
|
||||
<div class="btn btn-success" onclick="handleReturnToLobby()">Return to lobby</div>
|
||||
</div>
|
||||
} else {
|
||||
<div class="col-12 text-center mt-3">
|
||||
|
||||
@@ -77,3 +77,6 @@ function handleKickPlayer(playerId) {
|
||||
playerId: playerId
|
||||
})
|
||||
}
|
||||
function handleReturnToLobby() {
|
||||
sendEvent("ReturnToLobby")
|
||||
}
|
||||
Reference in New Issue
Block a user