fixed negotiate misspelling

This commit is contained in:
Stephen McQuay 2016-07-13 12:31:28 -06:00
parent 50be2c5b88
commit 3668c09235
No known key found for this signature in database
GPG Key ID: 1ABF428F71BAFC3D
3 changed files with 6 additions and 6 deletions

View File

@ -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)
} }

View File

@ -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))

View File

@ -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)