aboutsummaryrefslogtreecommitdiff
path: root/internal/game/game.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/game.go')
-rw-r--r--internal/game/game.go16
1 files changed, 11 insertions, 5 deletions
diff --git a/internal/game/game.go b/internal/game/game.go
index e5192c0..a3a9684 100644
--- a/internal/game/game.go
+++ b/internal/game/game.go
@@ -343,8 +343,13 @@ func (g *Game) saveAllOnlineCharacters() error {
if p := sess.Player; p != nil {
g.restoreGodPlayer(p)
g.persistLockedOnDisconnect(p)
- if err := g.AccountStore.SaveCharacter(p); err != nil && firstErr == nil {
- firstErr = fmt.Errorf("save %s: %w", p.Name, err)
+ if err := g.AccountStore.SaveCharacter(p); err != nil {
+ if firstErr == nil {
+ firstErr = fmt.Errorf("save %s: %w", p.Name, err)
+ }
+ log.Printf("shutdown: character save failed: %s: %v", p.Name, err)
+ } else {
+ log.Printf("shutdown: character saved: %s room=%d explored=%d file=%s", p.Name, p.RoomID, p.Stats.RoomsVisited.Len(), g.AccountStore.CharPath(p.Name))
}
}
}
@@ -619,9 +624,10 @@ func (g *Game) handleGameCommand(sess *net.Session, input string) {
}
cmd := parts[0]
- // Seated casino players may shorten any casino verb to an unambiguous
- // prefix (b 1000 -> bet 1000). Exact commands always win, so movement and
- // the existing short aliases are never shadowed.
+ // Seated casino players may shorten any of their game's verbs to an
+ // unambiguous prefix (b 1000 -> bet 1000, sp -> spin at Big 6). Only the
+ // current game's vocabulary is considered, and exact commands still win, so
+ // movement and non-casino commands are never shadowed.
if canon, ok := g.casinoAbbreviation(sess, cmd); ok {
cmd = canon
parts[0] = canon