aboutsummaryrefslogtreecommitdiff
path: root/internal/net/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/net/server.go')
-rw-r--r--internal/net/server.go28
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)