aboutsummaryrefslogtreecommitdiff
path: root/internal/game
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-29 01:00:17 -0400
committerhistoria <[not public]>2026-06-29 01:00:17 -0400
commite9d87838590a02c7ca028fad8cd16e42a582dd32 (patch)
tree0d9770d8fc728946c5452e732efbad393a745a23 /internal/game
parentfffc132263ab7d3c402992bffbaae4790161f7a7 (diff)
downloadthehouseoficarus-e9d87838590a02c7ca028fad8cd16e42a582dd32.tar.gz
feat: self-signed certificates
Diffstat (limited to 'internal/game')
-rw-r--r--internal/game/cmd_consume.go4
-rw-r--r--internal/game/cmd_verbs.go22
-rw-r--r--internal/game/combat_mob.go2
-rw-r--r--internal/game/core_login_char.go4
-rw-r--r--internal/game/game.go8
5 files changed, 21 insertions, 19 deletions
diff --git a/internal/game/cmd_consume.go b/internal/game/cmd_consume.go
index 423cddb..aec33c5 100644
--- a/internal/game/cmd_consume.go
+++ b/internal/game/cmd_consume.go
@@ -71,7 +71,7 @@ func (g *Game) doEat(sess *net.Session, input string) {
Timestamp: time.Now(),
})
- if !p.OptionBool("queue_silently") {
+ if p.OptionBool("show_queued_cmds") {
sess.WriteLine(fmt.Sprintf("You prepare to eat %s.", g.itemColorize(sess, def, def.Name)))
}
}
@@ -206,7 +206,7 @@ func (g *Game) doDrink(sess *net.Session, args []string) {
Timestamp: time.Now(),
})
- if !p.OptionBool("queue_silently") {
+ if p.OptionBool("show_queued_cmds") {
sess.WriteLine(fmt.Sprintf("You prepare to drink the %s.", g.itemColorize(sess, def, def.Name)))
}
}
diff --git a/internal/game/cmd_verbs.go b/internal/game/cmd_verbs.go
index d07ef2f..70b2fb2 100644
--- a/internal/game/cmd_verbs.go
+++ b/internal/game/cmd_verbs.go
@@ -9,7 +9,7 @@ import (
)
var alwaysAvailable = []string{
- "look", "l",
+ "look",
"say",
"global",
"who",
@@ -17,30 +17,30 @@ var alwaysAvailable = []string{
"map",
"walk",
"score", "stats",
- "inventory", "inv", "i",
- "equipment", "eq", "equip", "wear", "wield",
- "remove", "unwear", "unwield",
+ "inventory",
+ "equip",
+ "remove",
"style",
- "tech", "t",
- "option", "options",
- "color", "colors", "colortable",
+ "tech",
+ "option",
+ "color", "colortable",
"prompt",
"alias", "unalias",
"help",
"queued",
"stop",
"aps",
- "autotrigger", "auto",
+ "autotrigger",
"trigger",
"sneak",
- "mods", "modules", "modlist", "mod", "module",
- "id", "identify",
+ "mods",
+ "identify",
"eat", "drink",
"fletch",
"clean",
"burn", "stoke",
"search",
- "get", "take", "grab", "pick",
+ "get",
"drop",
}
diff --git a/internal/game/combat_mob.go b/internal/game/combat_mob.go
index a4bf435..4cdd27b 100644
--- a/internal/game/combat_mob.go
+++ b/internal/game/combat_mob.go
@@ -270,7 +270,7 @@ func (g *Game) killPlayer(sess *net.Session, p *player.Player, mob *world.MobIns
}
g.dropItemsOnDeath(p)
p.HP = p.MaxHP()
- p.RoomID = 1001
+ p.RoomID = g.StartingRoom
g.AccountStore.SaveCharacter(p)
if g.Hub != nil {
g.Hub.EnterRoom(sess, p.RoomID)
diff --git a/internal/game/core_login_char.go b/internal/game/core_login_char.go
index d705684..b1d3d26 100644
--- a/internal/game/core_login_char.go
+++ b/internal/game/core_login_char.go
@@ -41,8 +41,8 @@ func (g *Game) handleNewCharName(sess *net.Session, input string) {
}
p := player.New(name)
- p.RoomID = 1001
- p.Stats.RecordRoomVisit(1001)
+ p.RoomID = g.StartingRoom
+ p.Stats.RecordRoomVisit(g.StartingRoom)
if err := g.AccountStore.SaveCharacter(p); err != nil {
sess.WriteLine(fmt.Sprintf("Error creating character: %v", err))
diff --git a/internal/game/game.go b/internal/game/game.go
index bed75b0..c30f9aa 100644
--- a/internal/game/game.go
+++ b/internal/game/game.go
@@ -56,6 +56,7 @@ type Game struct {
queue *CommandQueue
safespot *SafespotManager
ValidationConfig config.ValidationConfig
+ StartingRoom int
// Per-tick / per-session runtime bookkeeping.
charsMu sync.Mutex
@@ -73,7 +74,7 @@ type Game struct {
shutdownMu sync.Mutex
}
-func New(dataDir string, colorConfig *config.ColorsConfig, valConfig config.ValidationConfig) *Game {
+func New(dataDir string, colorConfig *config.ColorsConfig, valConfig config.ValidationConfig, startingRoom int) *Game {
g := &Game{
Deps: Deps{
World: world.New(dataDir),
@@ -93,6 +94,7 @@ func New(dataDir string, colorConfig *config.ColorsConfig, valConfig config.Vali
queue: NewCommandQueue(),
safespot: NewSafespotManager(),
ValidationConfig: valConfig,
+ StartingRoom: startingRoom,
loggedInChars: make(map[string]*net.Session),
restTimers: make(map[string]uint64),
guardWatchTimers: make(map[string]int),
@@ -251,7 +253,7 @@ func (g *Game) handleGameCommand(sess *net.Session, input string) {
Args: strings.Join(parts[1:], " "),
Timestamp: time.Now(),
})
- if !p.OptionBool("queue_silently") {
+ if p.OptionBool("show_queued_cmds") {
sess.WriteLine(fmt.Sprintf("You prepare to %s.", cmd))
}
return
@@ -270,7 +272,7 @@ func (g *Game) handleGameCommand(sess *net.Session, input string) {
Timestamp: time.Now(),
})
g.cancelRest(p.Name)
- if !p.OptionBool("queue_silently") {
+ if p.OptionBool("show_queued_cmds") {
sess.WriteLine(fmt.Sprintf("You prepare to %s.", cmd))
}
}