lockstep changes for server sending max points
This commit is contained in:
parent
787bf9b435
commit
b964a14bba
@ -15,9 +15,12 @@ type BoardSize struct {
|
||||
Height float32 `json:"height"`
|
||||
}
|
||||
|
||||
// This is kind of misused here; we set Name, but expect to get the other
|
||||
// values back from the server
|
||||
type GameParam struct {
|
||||
BoardSize BoardSize `json:"boardsize"`
|
||||
name string
|
||||
MaxPoints int `json:"max_points"`
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
|
2
main.go
2
main.go
@ -48,7 +48,7 @@ func main() {
|
||||
port: *port,
|
||||
name: fmt.Sprintf("%s%d", *botname, i),
|
||||
game: GameParam{
|
||||
name: gameName,
|
||||
Name: gameName,
|
||||
},
|
||||
// XXX: update with missing fields
|
||||
stats: StatsRequest{
|
||||
|
6
robot.go
6
robot.go
@ -45,7 +45,7 @@ type robot struct {
|
||||
|
||||
func (r *robot) negociate() (err error) {
|
||||
if *verbose {
|
||||
log.Printf("%s: trying to connect to game '%s'", r.name, r.game.name)
|
||||
log.Printf("%s: trying to connect to game '%s'", r.name, r.game.Name)
|
||||
}
|
||||
r.ws, err = connect(r.server, r.port)
|
||||
if err != nil {
|
||||
@ -55,7 +55,7 @@ func (r *robot) negociate() (err error) {
|
||||
err = websocket.JSON.Send(r.ws, struct {
|
||||
Id string `json:"id"`
|
||||
}{
|
||||
r.game.name,
|
||||
r.game.Name,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
@ -94,7 +94,7 @@ func (r *robot) negociate() (err error) {
|
||||
}
|
||||
|
||||
conf := ClientConfig{
|
||||
ID: r.game.name,
|
||||
ID: r.game.Name,
|
||||
Stats: map[string]StatsRequest{
|
||||
r.name: r.stats,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user