aboutsummaryrefslogtreecommitdiff
path: root/internal/player/store.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-07 00:22:32 -0400
committerhistoria <[not public]>2026-07-07 00:22:32 -0400
commita51f7a53aa2c487ebf94ba0363038574ae8bb590 (patch)
treeb393a8f9e4732b40f6fe8058d086bd631537ad3b /internal/player/store.go
parent9292634f2f8d71a53879ff07e1330c671b207d51 (diff)
downloadthehouseoficarus-a51f7a53aa2c487ebf94ba0363038574ae8bb590.tar.gz
feat: hidden exits (and related flags) work with commands that change room ids. exit code simplified and unified between impassable and blocked exits.
Diffstat (limited to 'internal/player/store.go')
-rw-r--r--internal/player/store.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/internal/player/store.go b/internal/player/store.go
index bc5db11..2691d71 100644
--- a/internal/player/store.go
+++ b/internal/player/store.go
@@ -149,3 +149,27 @@ func (s *AccountStore) FindCharacter(name string) (string, error) {
}
return "", fmt.Errorf("character not found: %s", name)
}
+
+// ListCharacterNames returns the stem (character name) of every
+// data/players/characters/*.yaml file. Used by room-ID migration to walk and
+// rewrite offline characters. Online characters are excluded by the caller
+// (their in-memory state is updated directly).
+func (s *AccountStore) ListCharacterNames() ([]string, error) {
+ dir := filepath.Join(s.dataDir, "players", "characters")
+ entries, err := os.ReadDir(dir)
+ if err != nil {
+ return nil, err
+ }
+ var names []string
+ for _, e := range entries {
+ if e.IsDir() {
+ continue
+ }
+ name := strings.TrimSuffix(e.Name(), ".yaml")
+ if name == "" {
+ continue
+ }
+ names = append(names, name)
+ }
+ return names, nil
+}