Compare commits

..

1 Commits
3.0.0 ... 2.0.0

Author SHA1 Message Date
TeamCity
c721edb022 ci: bump version to v2.0.0 2025-11-19 21:57:55 +00:00
9 changed files with 23 additions and 22 deletions

View File

@@ -111,7 +111,7 @@
* removed trailing ([c7dd72e](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/c7dd72ecc2786ef63daf2b4288093025a8e22bfd)) * removed trailing ([c7dd72e](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/c7dd72ecc2786ef63daf2b4288093025a8e22bfd))
* removed trailing ([42a5adb](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/42a5adbae01802587a48a9de15bad44b5ef014cf)) * removed trailing ([42a5adb](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/42a5adbae01802587a48a9de15bad44b5ef014cf))
## (2025-11-20) ## (2025-11-19)
### ⚠ BREAKING CHANGES ### ⚠ BREAKING CHANGES
@@ -124,7 +124,3 @@
* **game:** Fixed polling, SPA, Gameplayloop etc. ([#59](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/issues/59)) ([a58b2e0](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/a58b2e03b11a54667d63ba6604f579a8e328c9d1)) * **game:** Fixed polling, SPA, Gameplayloop etc. ([#59](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/issues/59)) ([a58b2e0](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/a58b2e03b11a54667d63ba6604f579a8e328c9d1))
* **ui:** added js routing, updated ingame ui, added tricktable ([#50](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/issues/50)) ([c220e54](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/c220e54bb8d87f4f0f37a089bcd993e8df806123)), closes [#43](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/issues/43) [#43](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/issues/43) * **ui:** added js routing, updated ingame ui, added tricktable ([#50](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/issues/50)) ([c220e54](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/c220e54bb8d87f4f0f37a089bcd993e8df806123)), closes [#43](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/issues/43) [#43](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/issues/43)
* **ui:** implement tie & trump menu, fixed some critical bugs ([#52](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/issues/52)) ([5d245d0](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/5d245d0011a5fb03193514303b45702cd8329224)) * **ui:** implement tie & trump menu, fixed some critical bugs ([#52](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/issues/52)) ([5d245d0](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/5d245d0011a5fb03193514303b45702cd8329224))
### Bug Fixes
* **polling:** Improve polling mechanism and delay handling ([#60](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/issues/60)) ([641c892](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/641c892981649eb85640527cc0fe325ff683fa77))

View File

@@ -2,12 +2,11 @@ package components
import de.knockoutwhist.components.DefaultConfiguration import de.knockoutwhist.components.DefaultConfiguration
import de.knockoutwhist.ui.UI import de.knockoutwhist.ui.UI
import de.knockoutwhist.utils.DelayHandler
import de.knockoutwhist.utils.events.EventListener import de.knockoutwhist.utils.events.EventListener
class WebApplicationConfiguration extends DefaultConfiguration { class WebApplicationConfiguration extends DefaultConfiguration {
override def uis: Set[UI] = Set() override def uis: Set[UI] = Set()
override def listener: Set[EventListener] = Set(DelayHandler) override def listener: Set[EventListener] = Set()
} }

View File

@@ -59,6 +59,7 @@ class IngameController @Inject() (
case Some(g) => case Some(g) =>
val results = Try { val results = Try {
returnInnerHTML(g, request.user) returnInnerHTML(g, request.user)
} }
if (results.isSuccess) { if (results.isSuccess) {
Ok(views.html.main("In-Game - Knockout Whist")(results.get)) Ok(views.html.main("In-Game - Knockout Whist")(results.get))
@@ -66,7 +67,7 @@ class IngameController @Inject() (
InternalServerError(results.failed.get.getMessage) InternalServerError(results.failed.get.getMessage)
} }
case None => case None =>
Redirect(routes.MainMenuController.mainMenu()) NotFound("Game not found")
} }
} }
def startGame(gameId: String): Action[AnyContent] = authAction { implicit request: AuthenticatedRequest[AnyContent] => def startGame(gameId: String): Action[AnyContent] = authAction { implicit request: AuthenticatedRequest[AnyContent] =>

View File

@@ -78,8 +78,7 @@ class PollingController @Inject() (
"name" -> u.name, "name" -> u.name,
"id" -> u.id, "id" -> u.id,
"self" -> (u.id == userSession.id) "self" -> (u.id == userSession.id)
)), ))
"maxPlayers" -> game.maxPlayers
) )
} }

View File

@@ -119,6 +119,15 @@ class GameLobby private(
} }
} }
} }
waitingPromises.keys.foreach { playerId =>
val queue = eventsPerPlayer(playerId)
if (queue.nonEmpty) {
val promise = waitingPromises(playerId)
promise.success(queue.dequeue())
waitingPromises.remove(playerId)
}
}
} }
/** /**

View File

@@ -14,7 +14,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="p-3 text-center fs-4" id="playerAmount">Playeramount: @gamelobby.getPlayers.size / @gamelobby.maxPlayers</div> <div class="p-3 text-center fs-4">Playeramount: @gamelobby.getPlayers.size / @gamelobby.maxPlayers</div>
</div> </div>
</div> </div>
<div class="row justify-content-center align-items-center flex-grow-1"> <div class="row justify-content-center align-items-center flex-grow-1">

View File

@@ -79,13 +79,7 @@
}) })
})() })()
let polling = false;
function pollForUpdates(gameId) { function pollForUpdates(gameId) {
if (polling) {
console.log("[DEBUG] Polling already in progress. Skipping this cycle.");
return;
}
polling = true;
console.log(`[DEBUG] Starting poll cycle for Game ID: ${gameId} at ${new Date().toISOString()}`); console.log(`[DEBUG] Starting poll cycle for Game ID: ${gameId} at ${new Date().toISOString()}`);
if (!gameId) { if (!gameId) {
console.error("[DEBUG] Game ID is missing. Stopping poll."); console.error("[DEBUG] Game ID is missing. Stopping poll.");
@@ -96,7 +90,7 @@ function pollForUpdates(gameId) {
const $mainmenuElement = $('#main-menu-screen') const $mainmenuElement = $('#main-menu-screen')
const $mainbody = $('#main-body') const $mainbody = $('#main-body')
if (!$handElement.length && !$lobbyElement.length && !$mainmenuElement.length && !$mainbody.length) { if (!$handElement.length && !$lobbyElement.length && !$mainmenuElement.length && !$mainbody.length) {
setTimeout(() => { polling = false; pollForUpdates(gameId) }, 1000); setTimeout(() => pollForUpdates(gameId), 1000);
return; return;
} }
const route = jsRoutes.controllers.PollingController.polling(gameId); const route = jsRoutes.controllers.PollingController.polling(gameId);
@@ -260,7 +254,6 @@ function pollForUpdates(gameId) {
}) })
} }
$("#players").html(newHtml); $("#players").html(newHtml);
$('#playerAmount').text(`Playeramount: ${data.users.length} / ${data.maxPlayers}`);
} else { } else {
console.warn(`[DEBUG] Received unknown status: ${data.status}`); console.warn(`[DEBUG] Received unknown status: ${data.status}`);
} }
@@ -274,7 +267,11 @@ function pollForUpdates(gameId) {
} }
}), }),
complete: (() => { complete: (() => {
setTimeout(() => { polling = false; pollForUpdates(gameId) }, 200); if (!window.location.href.includes("game")) {
console.log("[DEBUG] Page URL changed. Stopping poll restart.");
return;
}
setTimeout(() => pollForUpdates(gameId), 200);
}) })
}) })
} }

View File

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