From b3568f03e4103dd46db2ccc680fbab0a6454d604 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Tue, 15 Sep 2026 13:56:10 -0400 Subject: fix: telnet buffer reuse, bank stack handling, transport casino gate, and admin cache invalidation --- internal/admin/api_items.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'internal/admin/api_items.go') diff --git a/internal/admin/api_items.go b/internal/admin/api_items.go index 617908c..728997a 100644 --- a/internal/admin/api_items.go +++ b/internal/admin/api_items.go @@ -46,6 +46,14 @@ func (s *AdminServer) handleItemByID(w http.ResponseWriter, r *http.Request) { } } +// invalidateItemCache drops the in-game item cache after an editor write so +// gameplay picks up the change without a manual reload, and rebuilds the +// craft index. Also refreshes the path index in case the file was created +// or removed. +func (s *AdminServer) invalidateItemCache() { + s.invalidateEntityCaches("items") +} + func (s *AdminServer) findItemFile(id string) ([]byte, string, error) { data, path, err := readYAMLFile(s.dataDir, "items", id) if err == nil { @@ -103,6 +111,7 @@ func (s *AdminServer) updateItem(w http.ResponseWriter, r *http.Request, id stri OldContent: oldContent, NewContent: newContent, }) + s.invalidateItemCache() writeJSON(w, m) } @@ -127,6 +136,7 @@ func (s *AdminServer) deleteItem(w http.ResponseWriter, r *http.Request, id stri OldContent: oldContent, IsDelete: true, }) + s.invalidateItemCache() writeJSON(w, map[string]any{"deleted": id}) } @@ -162,6 +172,7 @@ func (s *AdminServer) createItem(w http.ResponseWriter, r *http.Request) { NewContent: newContent, IsCreate: true, }) + s.invalidateItemCache() writeJSON(w, m) } -- cgit v1.2.3