blob: 67d81652db85c51f4999b820d0cebfc5afd26478 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
package game
import (
"fmt"
"thehouseoficarus/internal/net"
"thehouseoficarus/internal/player"
)
func (g *Game) doSay(sess *net.Session, msg string) {
p := sess.Player.(*player.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("\n%s says: %s", g.colorize(other, "player_name", p.Name), g.colorize(other, "say", msg)))
}
}
}
|