aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/api_rooms.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-16 14:41:15 -0400
committerhistoria <[not public]>2026-09-16 14:41:15 -0400
commit9192d94dea6be5498ab080f3e2df5667af871d7a (patch)
treee7aef3089d5d1e8da686c6b6ca9d4faeacb8b20b /internal/admin/api_rooms.go
parent2f34e75f27e5f99cfc1c5f8eaf6ab4ff2fddb1d9 (diff)
downloadthehouseoficarus-9192d94dea6be5498ab080f3e2df5667af871d7a.tar.gz
fix: casino room eviction, session close race fix, open-payout recovery evidence
Diffstat (limited to 'internal/admin/api_rooms.go')
-rw-r--r--internal/admin/api_rooms.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/admin/api_rooms.go b/internal/admin/api_rooms.go
index 3c96d53..01b7b9a 100644
--- a/internal/admin/api_rooms.go
+++ b/internal/admin/api_rooms.go
@@ -320,6 +320,11 @@ func (s *AdminServer) handleRoomByID(w http.ResponseWriter, r *http.Request) {
s.world.RebuildRoomIndex(s.dataDir)
s.world.ClearRoomState(id)
+ // Drop any cached in-room games (tables/machines) and refund their
+ // outstanding wagers — same eviction semantics as bulk delete.
+ if s.evictRoom != nil {
+ s.evictRoom(id)
+ }
allIDs, _ := listRoomIDs(s.dataDir)
var extraFiles []ExtraFile
@@ -1178,6 +1183,9 @@ func (s *AdminServer) handleResolveDuplicate(w http.ResponseWriter, r *http.Requ
return
}
s.world.RebuildRoomIndex(s.dataDir)
+ // No casino eviction: a duplicate-ID file was never in the room index,
+ // so no cached game is keyed to it (games are keyed by the indexed
+ // room's ID, which survives here untouched).
s.undoStack.Push(ChangeDesc{
Description: fmt.Sprintf("delete duplicate room file %s", body.Path),
FilePath: absPath,