aboutsummaryrefslogtreecommitdiff
path: root/internal/game/core_utils.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-20 03:20:01 -0400
committerhistoria <[not public]>2026-06-20 03:20:01 -0400
commite4400c5f1e84c18d2126f2cb502ae10685977cbb (patch)
tree0523e9d68f1cfdc6f81b862e3068fe12c1a85054 /internal/game/core_utils.go
parent5ea082ab4e82409aebc889b496f43e52b003d4f7 (diff)
downloadthehouseoficarus-e4400c5f1e84c18d2126f2cb502ae10685977cbb.tar.gz
refactor: combined all station crafting
Diffstat (limited to 'internal/game/core_utils.go')
-rw-r--r--internal/game/core_utils.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/game/core_utils.go b/internal/game/core_utils.go
index 409422e..c169580 100644
--- a/internal/game/core_utils.go
+++ b/internal/game/core_utils.go
@@ -104,6 +104,22 @@ func formatPickupList(sess *net.Session, picked []string) {
}
}
+func (g *Game) broadcastAction(sess *net.Session, format string, args ...interface{}) {
+ if g.Hub == nil {
+ return
+ }
+ p := sess.Player
+ if p == nil {
+ return
+ }
+ msg := fmt.Sprintf(format, args...)
+ for _, other := range g.Hub.PlayersInRoom(p.RoomID) {
+ if other != sess && other.Player != nil {
+ other.WriteLine(g.colorize(other, "broadcast", msg))
+ }
+ }
+}
+
func (g *Game) newInventorySlot(itemID string, qty int) *player.InventorySlot {
slot := &player.InventorySlot{ItemID: itemID, Quantity: qty}
if def, err := g.ItemStore.Load(itemID); err == nil && def.MaxQuality > 0 {