aboutsummaryrefslogtreecommitdiff
path: root/internal/game/game.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-03 07:11:58 -0400
committerhistoria <[not public]>2026-10-03 07:11:58 -0400
commit0fb83bdf433b9b48240f4ac7a5d4c912f6b808cc (patch)
treeac0af51cc2513b1ddd8a280f360af820d1f097af /internal/game/game.go
parent6232d41e5639f9c38e47b2bb65266e343ca26e8f (diff)
downloadthehouseoficarus-0fb83bdf433b9b48240f4ac7a5d4c912f6b808cc.tar.gz
feat: added big 6 wheel to the casino
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