Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmd/ba/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func makeapp() *cli.App {
cli.StringFlag{Name: "map", Value: "hexagon", Usage: "Name of the map used by the trainer"},
cli.BoolFlag{Name: "no-browser", Usage: "Disable automatic browser opening at start"},
cli.BoolFlag{Name: "debug", Usage: "Enable debug logging"},
cli.BoolFlag{Name: "quiet", Usage: "Decrease verbosity of the output"},
cli.BoolFlag{Name: "profile", Usage: "Enable execution profiling"},
cli.BoolFlag{Name: "dump-raw-comm", Usage: "Dump all the communication between the agent and the server"},
cli.IntFlag{Name: "duration", Usage: "If set, game will stop after this durarion (in seconds)"},
Expand All @@ -105,6 +106,7 @@ func makeapp() *cli.App {
mapName := c.String("map")
nobrowser := c.Bool("no-browser")
isDebug := c.Bool("debug")
isQuiet := c.Bool("quiet")
shouldProfile := c.Bool("profile")
dumpRaw := c.Bool("dump-raw-comm")
duration := c.Int("duration")
Expand All @@ -118,6 +120,7 @@ func makeapp() *cli.App {
recordFile,
agents,
isDebug,
isQuiet,
mapName,
shouldProfile,
dumpRaw,
Expand Down
9 changes: 7 additions & 2 deletions subcommand/train/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func TrainAction(
recordFile string,
agentimages []string,
isDebug bool,
isQuiet bool,
mapName string,
shouldProfile,
dumpRaw bool,
Expand Down Expand Up @@ -156,13 +157,17 @@ func TrainAction(

switch t := msg.(type) {
case arenaserver.EventStatusGameUpdate:
fmt.Printf(GameColor("[game] %s\n"), t.Status)
if !isQuiet {
fmt.Printf(GameColor("[game] %s\n"), t.Status)
}

case arenaserver.EventAgentLog:
fmt.Printf(AgentColor("[agent] %s\n"), t.Value)

case arenaserver.EventLog:
fmt.Printf(LogColor("[log] %s\n"), t.Value)
if !isQuiet {
fmt.Printf(LogColor("[log] %s\n"), t.Value)
}

case arenaserver.EventDebug:
debug(t.Value)
Expand Down