Integrate direct WebSocket-based leaderboard functionality for real-time updates and requests. Refactor related client-side logic to utilize this new connection.
This commit is contained in:
17
cmd/client/gamestart_wasm.go
Normal file
17
cmd/client/gamestart_wasm.go
Normal file
@@ -0,0 +1,17 @@
|
||||
//go:build js && wasm
|
||||
// +build js,wasm
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"syscall/js"
|
||||
)
|
||||
|
||||
// notifyGameStarted benachrichtigt JavaScript dass das Spiel startet
|
||||
func (g *Game) notifyGameStarted() {
|
||||
if startFunc := js.Global().Get("onGameStarted"); !startFunc.IsUndefined() {
|
||||
startFunc.Invoke()
|
||||
log.Println("🎮 Game Started - Benachrichtigung an JavaScript gesendet")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user