feat(ui): Websocket

Started implementing functionality to Websocket.
This commit is contained in:
LQ63
2025-11-26 01:35:46 +01:00
committed by Janis
parent 2aee79bb68
commit e0f16a224d
14 changed files with 258 additions and 8 deletions

View File

@@ -69,7 +69,7 @@
}
</div>
<div class="col-12 text-center mb-5">
<div class="btn btn-success" onclick="startGame('@gamelobby.id')">Start Game</div>
<div class="btn btn-success" onclick="startGame('@gamelobby.id', '@user.get.id', '@user.get.name','@user.get.passwordHash', @user.get.internalId)">Start Game</div>
</div>
} else {
<div id="players" class="justify-content-center align-items-center d-flex">
@@ -98,6 +98,7 @@
</div>
</main>
<script>
/*
function waitForFunction(name, checkInterval = 100) {
return new Promise(resolve => {
const timer = setInterval(() => {
@@ -109,5 +110,6 @@
});
}
waitForFunction("pollForUpdates").then(fn => fn('@gamelobby.id'));
*/
connectWebSocket()
</script>

View File

@@ -30,4 +30,4 @@
</main>
<script>
disconnectWebSocket();
</script>
</script>