Compare commits

..

8 Commits
4.4.0 ... 4.6.2

Author SHA1 Message Date
TeamCity
4156e1c9ce ci: bump version to v4.6.2 2025-12-01 20:21:02 +00:00
358556612e fix: FRO-6 Websocket Close Handle (#96)
Reviewed-on: #96
Co-authored-by: Janis <janis.e.20@gmx.de>
Co-committed-by: Janis <janis.e.20@gmx.de>
2025-12-01 21:17:58 +01:00
TeamCity
7f82d2eeae ci: bump version to v4.6.1 2025-12-01 19:44:13 +00:00
a55f0b4b61 fix(api): BAC-23 Remove old polling code (#95)
Reviewed-on: #95
Co-authored-by: Janis <janis.e.20@gmx.de>
Co-committed-by: Janis <janis.e.20@gmx.de>
2025-12-01 20:41:27 +01:00
TeamCity
f115c03ecb ci: bump version to v4.6.0 2025-12-01 19:07:26 +00:00
fd2467a9ea 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>
2025-12-01 20:04:17 +01:00
TeamCity
9d3f3940a9 ci: bump version to v4.5.0 2025-12-01 18:53:23 +00:00
0541bb58d1 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>
2025-12-01 19:50:19 +01:00
11 changed files with 43 additions and 63 deletions

View File

@@ -172,3 +172,23 @@
* **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:** 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)) * **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))
## (2025-12-01)
### Features
* **api:** BAC-11 Websocket - Return to Lobby ([#94](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/issues/94)) ([fd2467a](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/fd2467a9ea22dca64d5152a5a3e6db86d9a6f345))
## (2025-12-01)
### Bug Fixes
* **api:** BAC-23 Remove old polling code ([#95](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/issues/95)) ([a55f0b4](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/a55f0b4b6164a47e3524422650ed99d10f9c8b0d))
## (2025-12-01)
### Bug Fixes
* FRO-6 Websocket Close Handle ([#96](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/issues/96)) ([3585566](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/358556612ec74601c8b31125e4e65f750abf8c4c))

View File

@@ -64,6 +64,17 @@ class UserSession(val user: User, val host: Boolean, val gameLobby: GameLobby) e
case None => case None =>
println("Card Index not found or is not a number.") 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.")
}
case "ReturnToLobby" =>
gameLobby.returnToLobby(this)
} }
} }
lock.unlock() lock.unlock()

View File

@@ -10,7 +10,7 @@
<div class="row justify-content-center align-items-center flex-grow-1"> <div class="row justify-content-center align-items-center flex-grow-1">
@if((gamelobby.getUserSession(user.get.id).host)) { @if((gamelobby.getUserSession(user.get.id).host)) {
<div class="col-12 text-center mb-5"> <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> </div>
} else { } else {
<div class="col-12 text-center mt-3"> <div class="col-12 text-center mt-3">
@@ -23,16 +23,5 @@
</div> </div>
</main> </main>
<script> <script>
function waitForFunction(name, checkInterval = 100) {
return new Promise(resolve => {
const timer = setInterval(() => {
if (typeof window[name] === "function") {
clearInterval(timer);
resolve(window[name]);
}
}, checkInterval);
});
}
waitForFunction("pollForUpdates").then(fn => fn('@gamelobby.id'));
connectWebSocket() connectWebSocket()
</script> </script>

View File

@@ -130,17 +130,6 @@
</main> </main>
</div> </div>
<script> <script>
function waitForFunction(name, checkInterval = 100) {
return new Promise(resolve => {
const timer = setInterval(() => {
if (typeof window[name] === "function") {
clearInterval(timer);
resolve(window[name]);
}
}, checkInterval);
});
}
waitForFunction("pollForUpdates").then(fn => fn('@gamelobby.id'));
connectWebSocket() connectWebSocket()
canPlayCard = @gamelobby.logic.getCurrentPlayer.contains(player); canPlayCard = @gamelobby.logic.getCurrentPlayer.contains(player);
</script> </script>

View File

@@ -64,16 +64,5 @@
</div> </div>
</div> </div>
<script> <script>
function waitForFunction(name, checkInterval = 100) {
return new Promise(resolve => {
const timer = setInterval(() => {
if (typeof window[name] === "function") {
clearInterval(timer);
resolve(window[name]);
}
}, checkInterval);
});
}
waitForFunction("pollForUpdates").then(fn => fn('@gamelobby.id'));
connectWebSocket() connectWebSocket()
</script> </script>

View File

@@ -110,16 +110,5 @@
</div> </div>
</div> </div>
<script> <script>
function waitForFunction(name, checkInterval = 100) {
return new Promise(resolve => {
const timer = setInterval(() => {
if (typeof window[name] === "function") {
clearInterval(timer);
resolve(window[name]);
}
}, checkInterval);
});
}
waitForFunction("pollForUpdates").then(fn => fn('@gamelobby.id'));
connectWebSocket() connectWebSocket()
</script> </script>

View File

@@ -60,7 +60,7 @@
<a href="#" class="btn btn-danger disabled" aria-disabled="true" tabindex="-1">Remove</a> <a href="#" class="btn btn-danger disabled" aria-disabled="true" tabindex="-1">Remove</a>
} else { } else {
<h5 class="card-title">@playersession.name</h5> <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> Remove</div>
} }
</div> </div>
@@ -98,18 +98,5 @@
</div> </div>
</main> </main>
<script> <script>
/*
function waitForFunction(name, checkInterval = 100) {
return new Promise(resolve => {
const timer = setInterval(() => {
if (typeof window[name] === "function") {
clearInterval(timer);
resolve(window[name]);
}
}, checkInterval);
});
}
waitForFunction("pollForUpdates").then(fn => fn('@gamelobby.id'));
*/
connectWebSocket() connectWebSocket()
</script> </script>

View File

@@ -227,7 +227,7 @@ function receiveLobbyUpdateEvent(eventData) {
const inner = user.self ? `<h5 class="card-title">${user.name} (You)</h5> 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>` <a href="#" class="btn btn-danger disabled" aria-disabled="true" tabindex="-1">Remove</a>`
: ` <h5 class="card-title">${user.name}</h5> : ` <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"> newHtml += `<div class="col-auto my-auto m-3">
<div class="card" style="width: 18rem;"> <div class="card" style="width: 18rem;">

View File

@@ -73,5 +73,10 @@ function handleTrumpSelection(object) {
} }
function handleKickPlayer(playerId) { function handleKickPlayer(playerId) {
// TODO needs implementation sendEvent("KickPlayer", {
playerId: playerId
})
} }
function handleReturnToLobby() {
sendEvent("ReturnToLobby")
}

View File

@@ -87,6 +87,7 @@ function setupSocketHandlers(socket) {
} else { } else {
console.warn('Connection died unexpectedly.'); console.warn('Connection died unexpectedly.');
} }
location.href = "/mainmenu";
}; };
} }

View File

@@ -1,3 +1,3 @@
MAJOR=4 MAJOR=4
MINOR=4 MINOR=6
PATCH=0 PATCH=2