added verbose flag

This commit is contained in:
Stephen McQuay 2013-10-14 08:51:06 -07:00
parent 1924d613f0
commit e55e1c6883
1 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,7 @@ var scannerRadius = flag.Int("srad", 100, "scanner radius")
var server = flag.String("server", "localhost", "server hostname")
var port = flag.Int("port", 8666, "server port")
var botname = flag.String("name", "gobot", "the name that other players will see")
var verbose = flag.Bool("verbose", false, "run verbosly")
type infos struct {
id string
@ -228,6 +229,9 @@ func main() {
Turn int `json:"turn"`
}
err = websocket.JSON.Receive(ws, &boardstate)
if *verbose {
log.Printf("%+v", boardstate)
}
if err != nil {
log.Fatal("Connection lost")
}