added verbose flag
This commit is contained in:
parent
1924d613f0
commit
e55e1c6883
4
main.go
4
main.go
@ -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")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user