From 5a6986a8c539364b7a166abdfb608b3cc00ecb3b Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Mon, 13 Jul 2026 23:01:45 -0400 Subject: feat(admin): convert players page into characters page with basic stats/yaml --- internal/player/store.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'internal/player/store.go') diff --git a/internal/player/store.go b/internal/player/store.go index 2691d71..9bfdf40 100644 --- a/internal/player/store.go +++ b/internal/player/store.go @@ -154,6 +154,26 @@ func (s *AccountStore) FindCharacter(name string) (string, error) { // 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) ListAccountNames() ([]string, error) { + dir := filepath.Join(s.dataDir, "players", "accounts") + 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 +} + func (s *AccountStore) ListCharacterNames() ([]string, error) { dir := filepath.Join(s.dataDir, "players", "characters") entries, err := os.ReadDir(dir) -- cgit v1.2.3