Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d3f3940a9 | ||
| 0541bb58d1 |
@@ -172,3 +172,8 @@
|
||||
|
||||
* **api:** Fixed websocket routing ([#88](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/issues/88)) ([46c96d4](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/46c96d4ceb935ac91fc515a1fdaef195e5ebc0a7))
|
||||
* **api:** fixes - reimplemented animations ([#90](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/issues/90)) ([cfcd967](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/cfcd967ce08ecf07f3f06826c337f684eb3b0c5f))
|
||||
## (2025-12-01)
|
||||
|
||||
### Features
|
||||
|
||||
* **api:** BAC-10 Websockets - Kick Users ([#93](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/issues/93)) ([0541bb5](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/0541bb58d19efd98d134b3d0412f39b4b1001783))
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
<a href="#" class="btn btn-danger disabled" aria-disabled="true" tabindex="-1">Remove</a>
|
||||
} else {
|
||||
<h5 class="card-title">@playersession.name</h5>
|
||||
<div class="btn btn-danger" onclick="removePlayer('@gamelobby.id', '@playersession.id')">
|
||||
<div class="btn btn-danger" onclick="handleKickPlayer('@playersession.id')">
|
||||
Remove</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -227,7 +227,7 @@ function receiveLobbyUpdateEvent(eventData) {
|
||||
const inner = user.self ? `<h5 class="card-title">${user.name} (You)</h5>
|
||||
<a href="#" class="btn btn-danger disabled" aria-disabled="true" tabindex="-1">Remove</a>`
|
||||
: ` <h5 class="card-title">${user.name}</h5>
|
||||
<div class="btn btn-danger" onclick="removePlayer('${user.id}')">Remove</div>`
|
||||
<div class="btn btn-danger" onclick="handleKickPlayer('${user.id}')">Remove</div>`
|
||||
|
||||
newHtml += `<div class="col-auto my-auto m-3">
|
||||
<div class="card" style="width: 18rem;">
|
||||
|
||||
@@ -73,5 +73,7 @@ function handleTrumpSelection(object) {
|
||||
|
||||
}
|
||||
function handleKickPlayer(playerId) {
|
||||
// TODO needs implementation
|
||||
sendEvent("KickPlayer", {
|
||||
playerId: playerId
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
MAJOR=4
|
||||
MINOR=4
|
||||
MINOR=5
|
||||
PATCH=0
|
||||
|
||||
Reference in New Issue
Block a user