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:
@@ -10,6 +10,14 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// notifyWasmReady signalisiert JavaScript dass WASM vollständig geladen ist
|
||||
func (g *Game) notifyWasmReady() {
|
||||
if readyFunc := js.Global().Get("onWasmReady"); !readyFunc.IsUndefined() {
|
||||
readyFunc.Invoke()
|
||||
log.Println("✅ WASM Ready-Signal an JavaScript gesendet")
|
||||
}
|
||||
}
|
||||
|
||||
// setupJavaScriptBridge registriert JavaScript-Funktionen für HTML-Menü Interaktion
|
||||
func (g *Game) setupJavaScriptBridge() {
|
||||
// startGame(mode, playerName, roomID, teamName, isHost)
|
||||
@@ -107,6 +115,8 @@ func (g *Game) setupJavaScriptBridge() {
|
||||
js.Global().Set("setTeamName_WASM", setTeamNameFunc)
|
||||
|
||||
log.Println("✅ JavaScript Bridge registriert")
|
||||
log.Printf("🔍 window.startGame defined: %v", !js.Global().Get("startGame").IsUndefined())
|
||||
log.Printf("🔍 window.startGameFromLobby_WASM defined: %v", !js.Global().Get("startGameFromLobby_WASM").IsUndefined())
|
||||
}
|
||||
|
||||
// Leaderboard an JavaScript senden
|
||||
|
||||
Reference in New Issue
Block a user