diff options
| author | historia <[not public]> | 2026-06-20 03:20:01 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-20 03:20:01 -0400 |
| commit | e4400c5f1e84c18d2126f2cb502ae10685977cbb (patch) | |
| tree | 0523e9d68f1cfdc6f81b862e3068fe12c1a85054 /internal/game/core_utils.go | |
| parent | 5ea082ab4e82409aebc889b496f43e52b003d4f7 (diff) | |
| download | thehouseoficarus-e4400c5f1e84c18d2126f2cb502ae10685977cbb.tar.gz | |
refactor: combined all station crafting
Diffstat (limited to 'internal/game/core_utils.go')
| -rw-r--r-- | internal/game/core_utils.go | 16 |
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 { |
