aboutsummaryrefslogtreecommitdiff
path: root/internal/object/store.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-18 16:13:49 -0400
committerhistoria <[not public]>2026-09-18 16:13:49 -0400
commit194164a77eb4f2479b94c19e6f0e1278ab608781 (patch)
tree53413add8ed6f32a34d1733397e380cc98ef70ef /internal/object/store.go
parent67e01aab85607b9e601185c7d62dff576af3bb43 (diff)
downloadthehouseoficarus-194164a77eb4f2479b94c19e6f0e1278ab608781.tar.gz
fix: more casino, economy, gameplay, security, and world data hardening gaps
Diffstat (limited to 'internal/object/store.go')
-rw-r--r--internal/object/store.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/object/store.go b/internal/object/store.go
index 997c324..ee154cf 100644
--- a/internal/object/store.go
+++ b/internal/object/store.go
@@ -2,6 +2,7 @@ package object
import (
"fmt"
+ "log"
"os"
"path/filepath"
"sync"
@@ -43,6 +44,10 @@ func (s *ObjectStore) Load(id string) (*ObjectDef, error) {
if err := yaml.Unmarshal(data, &def); err != nil {
return nil, fmt.Errorf("parse object %s: %w", id, err)
}
+ if def.ID != "" && def.ID != id {
+ log.Printf("object %s: file %s declares id %q but is loaded as %q; the filename is authoritative and the declared id is ignored",
+ id, path, def.ID, id)
+ }
def.ID = id
s.cache[id] = &def
return &def, nil