Fix player reconnection by re-registering sync context

When an existing player reconnects to a game, their sync context
is now updated so they continue receiving real-time updates.
This commit is contained in:
Ryan Hamamura
2026-01-14 21:54:07 -10:00
parent 2cd5b1d289
commit ee762fb841
4 changed files with 51 additions and 10 deletions

View File

@@ -304,6 +304,9 @@ func main() {
Player: player,
Sync: c,
})
} else if gameExists && gi.GetPlayerColor(playerID) != 0 {
// Re-register sync context for existing players on reconnect
gi.RegisterSync(playerID, c)
}
c.View(func() h.H {