fixed negotiate misspelling
This commit is contained in:
parent
50be2c5b88
commit
3668c09235
@ -36,9 +36,9 @@ func main() {
|
|||||||
Player: client.Spectator{},
|
Player: client.Spectator{},
|
||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
err = c.Negociate("spectator")
|
err = c.Negotiate("spectator")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "%s: failed to negociate: %s\n", c.Name, err)
|
fmt.Fprintf(os.Stderr, "%s: failed to negotiate: %s\n", c.Name, err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ func connect(server string, port int) (*websocket.Conn, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Client keeps track of connection to server and has two interesting methods:
|
// Client keeps track of connection to server and has two interesting methods:
|
||||||
// Negociate and Play. Users of this struct will likely use most everything as
|
// Negotiate and Play. Users of this struct will likely use most everything as
|
||||||
// is while defining their own Player to specify desired game play behavior.
|
// is while defining their own Player to specify desired game play behavior.
|
||||||
type Client struct {
|
type Client struct {
|
||||||
ForceJSON bool
|
ForceJSON bool
|
||||||
@ -51,8 +51,8 @@ type decoder interface {
|
|||||||
Decode(v interface{}) error
|
Decode(v interface{}) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// Negociate runs through the hackerbots negociation protocol.
|
// Negotiate runs through the hackerbots negociation protocol.
|
||||||
func (c *Client) Negociate(clientType string) (err error) {
|
func (c *Client) Negotiate(clientType string) (err error) {
|
||||||
c.ws, err = connect(c.Server, c.Port)
|
c.ws, err = connect(c.Server, c.Port)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.New(fmt.Sprintf("connection failure: %s", err))
|
return errors.New(fmt.Sprintf("connection failure: %s", err))
|
||||||
|
@ -62,7 +62,7 @@ func main() {
|
|||||||
Player: client.NewSimplePlayer(800, 600),
|
Player: client.NewSimplePlayer(800, 600),
|
||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
err = c.Negociate("robot")
|
err = c.Negotiate("robot")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "%s: failed to negociate: %s\n", c.Name, err)
|
fmt.Fprintf(os.Stderr, "%s: failed to negociate: %s\n", c.Name, err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user