Add cache-busting for JS/WASM assets, WASM readiness signaling to JS, and robust fetch with cache control. Improve lobby updates and refine WebSocket logic.
Some checks failed
Dynamic Branch Deploy / build-and-deploy (push) Failing after 46s
Some checks failed
Dynamic Branch Deploy / build-and-deploy (push) Failing after 46s
This commit is contained in:
@@ -81,8 +81,15 @@ func (g *Game) connectToServer() {
|
||||
}
|
||||
|
||||
g.stateMutex.Lock()
|
||||
oldPlayerCount := len(g.gameState.Players)
|
||||
g.gameState = state
|
||||
newPlayerCount := len(g.gameState.Players)
|
||||
g.stateMutex.Unlock()
|
||||
|
||||
// Lobby-UI aktualisieren wenn sich Spieleranzahl geändert hat
|
||||
if oldPlayerCount != newPlayerCount {
|
||||
g.sendLobbyUpdateToJS()
|
||||
}
|
||||
}
|
||||
|
||||
case "leaderboard_response":
|
||||
@@ -192,7 +199,8 @@ func (g *Game) sendInput(input game.ClientInput) {
|
||||
|
||||
// startGame sendet den Start-Befehl über WebSocket
|
||||
func (g *Game) startGame() {
|
||||
myID := g.getMyPlayerID()
|
||||
// PlayerID ist der playerName (Server verwendet req.Name als PlayerID)
|
||||
myID := g.playerName
|
||||
msg := WebSocketMessage{
|
||||
Type: "start",
|
||||
Payload: game.StartRequest{
|
||||
|
||||
Reference in New Issue
Block a user