From e4400c5f1e84c18d2126f2cb502ae10685977cbb Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Sat, 20 Jun 2026 03:20:01 -0400 Subject: refactor: combined all station crafting --- internal/game/core_utils.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'internal/game/core_utils.go') 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 { -- cgit v1.2.3