package game import ( "fmt" "strings" "thehouseoficarus/internal/net" ) func (g *Game) executeSay(sess *net.Session, args []string, rawInput string) { if len(args) == 0 { sess.WriteLine("Say what?") } else { g.doSay(sess, strings.Join(rawArgsFrom(rawInput, "say"), " ")) } } func (g *Game) doSay(sess *net.Session, msg string) { p := sess.Player roomID := p.RoomID for _, other := range g.Hub.PlayersInRoom(roomID) { if other == sess { other.WriteLine(fmt.Sprintf("You say: %s", g.colorize(sess, "say", msg))) } else { other.WriteLine(fmt.Sprintf("%s says: %s", g.colorize(other, "player_name", p.Name), g.colorize(other, "say", msg))) } } }