Added some debug logging
This commit is contained in:
parent
e02dc2f348
commit
ed39916f17
8
robot.go
8
robot.go
@ -126,6 +126,7 @@ func (r *robot) negociate() (err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
log.Printf("%s: recv stats", r.name)
|
||||||
|
|
||||||
// this player only ever has one robot, so we're just picking off our own
|
// this player only ever has one robot, so we're just picking off our own
|
||||||
// stats
|
// stats
|
||||||
@ -151,11 +152,18 @@ func (r *robot) play() {
|
|||||||
|
|
||||||
for {
|
for {
|
||||||
r.speed = float32(maxSpeed)
|
r.speed = float32(maxSpeed)
|
||||||
|
if *verbose {
|
||||||
|
log.Printf("%s: about to wait on boardstate", r.name)
|
||||||
|
}
|
||||||
err = websocket.JSON.Receive(r.ws, &r.boardstate)
|
err = websocket.JSON.Receive(r.ws, &r.boardstate)
|
||||||
|
if *verbose {
|
||||||
|
log.Printf("%s: one recv boardstate", r.name)
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("%s: Connection lost", r.name)
|
log.Printf("%s: Connection lost", r.name)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// TODO: I need a truly-verbose flag?
|
||||||
// if *verbose {
|
// if *verbose {
|
||||||
// log.Printf("\n\n%#v\n\n", r.boardstate)
|
// log.Printf("\n\n%#v\n\n", r.boardstate)
|
||||||
// }
|
// }
|
||||||
|
Loading…
Reference in New Issue
Block a user