can broadcast messages again

slack
Jordan Orelli 10 years ago
parent 634ca1301d
commit 4c688080b3

@ -54,7 +54,10 @@ type MakeBombState struct {
func MakeBomb(s *System) ConnectionState { func MakeBomb(s *System) ConnectionState {
m := &MakeBombState{System: s} m := &MakeBombState{System: s}
m.CommandSuite = CommandSet{ m.CommandSuite = CommandSet{
BroadcastCommand(s),
balCommand, balCommand,
helpCommand,
playersCommand,
} }
return m return m
} }

@ -112,17 +112,18 @@ var commandsCommand = Command{
}, },
} }
// var broadcastCommand = &Command{ func BroadcastCommand(sys *System) Command {
// name: "broadcast", return Command{
// help: "broadcast a message for all systems to hear", name: "broadcast",
// handler: func(conn *Connection, args ...string) { help: "broadcast a message for all systems to hear",
// msg := strings.Join(args, " ") handler: func(c *Connection, args ...string) {
// system := conn.System() msg := strings.Join(args, " ")
// b := NewBroadcast(system, msg) b := NewBroadcast(sys, msg)
// log_info("player %s send broadcast from system %s: %v\n", conn.Name(), system.Label(), msg) log_info("player %s send broadcast from system %v: %v\n", c.Name(), sys, msg)
// currentGame.Register(b) currentGame.Register(b)
// }, },
// } }
}
// var colonizeCommand = &Command{ // var colonizeCommand = &Command{
// name: "colonize", // name: "colonize",

@ -17,6 +17,7 @@ func Idle(sys *System) ConnectionState {
balCommand, balCommand,
helpCommand, helpCommand,
playersCommand, playersCommand,
BroadcastCommand(sys),
Command{ Command{
name: "goto", name: "goto",
help: "travel between star systems", help: "travel between star systems",

@ -16,6 +16,7 @@ func Mine(sys *System) ConnectionState {
balCommand, balCommand,
helpCommand, helpCommand,
playersCommand, playersCommand,
BroadcastCommand(sys),
Command{ Command{
name: "stop", name: "stop",
help: "stops mining", help: "stops mining",

Loading…
Cancel
Save