renamed package/directory

This commit is contained in:
sm
2014-04-23 14:28:06 -07:00
parent 7e4e6faa00
commit 51d0522833
4 changed files with 43 additions and 43 deletions
+11 -11
View File
@@ -1,4 +1,4 @@
package botclient
package client
import (
"encoding/gob"
@@ -7,7 +7,7 @@ import (
"fmt"
"log"
"bitbucket.org/hackerbots/botserv"
hbserver "bitbucket.org/hackerbots/server"
"code.google.com/p/go.net/websocket"
)
@@ -26,12 +26,12 @@ type Client struct {
Name string
Port int
Server string
StatsReq botserv.StatsRequest
StatsReq hbserver.StatsRequest
Verbose bool
Player Player
Game botserv.GameParam
Game hbserver.GameParam
boardstate botserv.Boardstate
boardstate hbserver.Boardstate
enc encoder
dec decoder
ws *websocket.Conn
@@ -114,9 +114,9 @@ func (c *Client) Negociate() (err error) {
c.dec = gob.NewDecoder(c.ws)
}
conf := botserv.ClientConfig{
conf := hbserver.ClientConfig{
ID: c.GameId,
Stats: map[string]botserv.StatsRequest{
Stats: map[string]hbserver.StatsRequest{
c.Name: c.StatsReq,
},
}
@@ -127,7 +127,7 @@ func (c *Client) Negociate() (err error) {
Id string `json:"id"`
Success bool `json:"success"`
Type string `json:"type"`
botserv.Failure
hbserver.Failure
}
websocket.JSON.Receive(c.ws, &handshake)
if !handshake.Success {
@@ -140,8 +140,8 @@ func (c *Client) Negociate() (err error) {
// we don't do anything useful with dstats, but could be interesting to
// pass along to the player?
dstats := struct {
Stats map[string]botserv.Stats `json:"stats"`
Type string `json:"type"`
Stats map[string]hbserver.Stats `json:"stats"`
Type string `json:"type"`
}{}
err = websocket.JSON.Receive(c.ws, &dstats)
if err != nil {
@@ -151,7 +151,7 @@ func (c *Client) Negociate() (err error) {
return nil
}
// Play contains the main game run loop. It gets a botserv.Boardstate from the
// Play contains the main game run loop. It gets a hbserver.Boardstate from the
// server, and passes this along to the embedded Player. Following this it
// sends the server the Player's instruction.
func (c *Client) Play() error {