diff options
| author | historia <[not public]> | 2026-10-05 06:03:49 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-05 06:03:49 -0400 |
| commit | c84a9944356f590d90d819d652bdf1349ebacd40 (patch) | |
| tree | af1ee15992e141fb3eb6f26cac02cf06306d4982 /internal/net/server.go | |
| parent | 8b78aa4cd930fde145959704ba7bdc0e57465b9b (diff) | |
| download | thehouseoficarus-c84a9944356f590d90d819d652bdf1349ebacd40.tar.gz | |
feat: prediction exchange with live polymarket data
Diffstat (limited to 'internal/net/server.go')
| -rw-r--r-- | internal/net/server.go | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/internal/net/server.go b/internal/net/server.go index d983161..5cf7310 100644 --- a/internal/net/server.go +++ b/internal/net/server.go @@ -66,10 +66,22 @@ type Session struct { PendingUndigDir string PendingUndigRoom int // Casino spectator preferences are session-local, owner-goroutine only. - CasinoWatchRoom int - CasinoWatchTable string - promptVisible bool - writeMu sync.Mutex + PredictionActive bool + PredictionEpoch uint64 + PredictionCancel context.CancelFunc + PredictionSelected string + PredictionScreen string + PredictionBoardPage int + PredictionShowHints bool + PredictionUnavailable bool + PredictionBusy bool + PredictionIDs []string + PredictionPage int + PredictionSearch string + CasinoWatchRoom int + CasinoWatchTable string + promptVisible bool + writeMu sync.Mutex // Disconnect bookkeeping is written by the connection goroutine that // discovered the dead transport (Hub.Remove's deferred path) and read @@ -506,6 +518,14 @@ func (h *Hub) EnterRoom(s *Session, roomID int) { // room stops it, so leaving and returning does not silently resume it. s.CasinoWatchRoom = 0 s.CasinoWatchTable = "" + s.PredictionActive = false + if s.PredictionCancel != nil { + s.PredictionCancel() + s.PredictionCancel = nil + } + s.PredictionEpoch++ + s.PredictionBusy = false + s.PredictionSelected = "" h.leaveRoomLocked(s) if h.rooms[roomID] == nil { h.rooms[roomID] = make(map[*Session]bool) |
