diff options
| author | historia <[not public]> | 2026-09-19 01:55:34 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-19 01:55:34 -0400 |
| commit | cc33072eced3d5460512c09c42ec4531c807d7af (patch) | |
| tree | b1b451fa87fa389cb8343a3645372f3b43f5523e /internal/admin/api_map.go | |
| parent | 2c38386484cdb507c4687caceb37e0b963e33594 (diff) | |
| download | thehouseoficarus-cc33072eced3d5460512c09c42ec4531c807d7af.tar.gz | |
fix: casino stake preservation, world state reconciliation, casino game registration
Diffstat (limited to 'internal/admin/api_map.go')
| -rw-r--r-- | internal/admin/api_map.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/admin/api_map.go b/internal/admin/api_map.go index d0372df..231f52b 100644 --- a/internal/admin/api_map.go +++ b/internal/admin/api_map.go @@ -246,6 +246,10 @@ func (s *AdminServer) handleMap(w http.ResponseWriter, r *http.Request) { var upLinks []UDLink var downLinks []UDLink + // Hoist the room index once: RoomIndex builds a fresh map copy under the + // world lock, and calling it per exit made this loop O(rooms x exits x + // rooms) with a mutex acquisition each time. + roomIndex := s.world.RoomIndex() seenLinks := make(map[string]bool) for rid, room := range roomData { c := g.Coord[rid] @@ -255,7 +259,7 @@ func (s *AdminServer) handleMap(w http.ResponseWriter, r *http.Request) { continue } targetCoord, hasCoord := g.Coord[target] - targetExists := s.world.RoomIndex()[target] + _, targetExists := roomIndex[target] if !targetExists || !hasCoord { if dir != world.Up && dir != world.Down { |
