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 @@ -86,6 +86,7 @@ func makeapp() *cli.App {
cli.StringFlag{Name: "host", Value: "", Usage: "IP serving the trainer; required"},
cli.StringSliceFlag{Name: "agent", Usage: "Agent images"},
cli.IntFlag{Name: "port", Value: 8080, Usage: "Port serving the trainer"},
cli.StringFlag{Name: "viz-host", Value: "127.0.0.1", Usage: "Specify a host for the visualization server"},
cli.StringFlag{Name: "record-file", Value: "", Usage: "Destination file for recording the game"},
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"},
Expand All @@ -99,6 +100,7 @@ func makeapp() *cli.App {
host := c.String("host")
agents := c.StringSlice("agent")
port := c.Int("port")
vizhost := c.String("viz-host")
recordFile := c.String("record-file")
mapName := c.String("map")
nobrowser := c.Bool("no-browser")
Expand All @@ -111,6 +113,7 @@ func makeapp() *cli.App {
tps,
host,
port,
vizhost,
nobrowser,
recordFile,
agents,
Expand Down
5 changes: 3 additions & 2 deletions subcommand/train/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func TrainAction(
tps int,
host string,
vizport int,
vizhost string,
nobrowser bool,
recordFile string,
agentimages []string,
Expand Down Expand Up @@ -224,7 +225,7 @@ func TrainAction(
vizgames[0] = viztypes.NewVizGame(game, gamedescription)

vizservice := visualization.NewVizService(
"127.0.0.1:"+strconv.Itoa(vizport),
vizhost+":"+strconv.Itoa(vizport),
mapName,
func() ([]*viztypes.VizGame, error) { return vizgames, nil },
recorder,
Expand All @@ -239,7 +240,7 @@ func TrainAction(
utils.FailWith(startErr)
}

url := "http://localhost:" + strconv.Itoa(vizport) + "/arena/1"
url := "http://" + vizhost + ":" + strconv.Itoa(vizport) + "/arena/1"

if !nobrowser {
open.Run(url)
Expand Down