feat(websocket)!: Implement WebSocket connection and event handling

This commit is contained in:
2025-11-22 18:32:28 +01:00
parent 09cc96141d
commit ba373f91e9
25 changed files with 420 additions and 80 deletions

View File

@@ -34,4 +34,5 @@
});
}
waitForFunction("pollForUpdates").then(fn => fn('@gamelobby.id'));
connectWebSocket()
</script>

View File

@@ -104,4 +104,5 @@
});
}
waitForFunction("pollForUpdates").then(fn => fn('@gamelobby.id'));
connectWebSocket()
</script>

View File

@@ -68,4 +68,5 @@
});
}
waitForFunction("pollForUpdates").then(fn => fn('@gamelobby.id'));
connectWebSocket()
</script>

View File

@@ -114,4 +114,5 @@
});
}
waitForFunction("pollForUpdates").then(fn => fn('@gamelobby.id'));
connectWebSocket()
</script>

View File

@@ -78,4 +78,5 @@
});
}
waitForFunction("pollForUpdates").then(fn => fn('@gamelobby.id'));
connectWebSocket()
</script>

View File

@@ -35,6 +35,7 @@
particlesJS.load('particles-js', 'assets/conf/particlesjs-config.json', function() {
console.log('callback - particles.js config loaded');
});
disconnectWebSocket();
</script>
<div id="particles-js" style="background-color: rgb(11, 8, 8);
background-size: cover;

View File

@@ -25,6 +25,7 @@
</body>
<script src="@routes.JavaScriptRoutingController.javascriptRoutes()" type="text/javascript"></script>
<script src="@routes.Assets.versioned("javascripts/main.js")" type="text/javascript"></script>
<script src="@routes.Assets.versioned("javascripts/ingame.js")" type="text/javascript"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@@5.3.8/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</html>

View File

@@ -27,4 +27,7 @@
<div class="btn btn-success" onclick="createGameJS()">Create Game</div>
</div>
</div>
</main>
</main>
<script>
disconnectWebSocket();
</script>

View File

@@ -175,3 +175,6 @@
</div>
</div>
</main>
<script>
disconnectWebSocket();
</script>