log cleanup, maybe not send the entire deck over the wire

This commit is contained in:
stryan 2021-09-30 21:40:33 -04:00
parent 89a94ca081
commit 75e2e7f86e
2 changed files with 4 additions and 4 deletions

View File

@ -47,7 +47,7 @@ func serveWs(c *coordinator.Coordinator, w http.ResponseWriter, r *http.Request)
panic(err) panic(err)
} }
if cmd.Command != coordinator.SessionCmdPoll { if cmd.Command != coordinator.SessionCmdPoll {
log.Printf("sending: %v", resp) log.Printf("sending: %v", resp.Result)
} }
err = conn.WriteJSON(resp) err = conn.WriteJSON(resp)
if err != nil { if err != nil {

View File

@ -5,7 +5,7 @@ import "fmt"
type GameView struct { type GameView struct {
Board *Board `json:"board"` Board *Board `json:"board"`
Player *Player `json:"player"` Player *Player `json:"player"`
Deck *Deck `json:"deck"` DeckSize int `json:"deck_size"`
EnemyLife int `json:"enemy_life"` EnemyLife int `json:"enemy_life"`
EnemyDeckSize int `json:"enemy_deck_size"` EnemyDeckSize int `json:"enemy_deck_size"`
EnemyHandSize int `json:"enemy_hand_size"` EnemyHandSize int `json:"enemy_hand_size"`
@ -20,7 +20,7 @@ func NewView(id int, g *Game) *GameView {
return &GameView{ return &GameView{
Board: g.GameBoard, Board: g.GameBoard,
Player: g.SentinalPlayer, Player: g.SentinalPlayer,
Deck: g.SentinalDeck, DeckSize: g.SentinalDeck.Size(),
EnemyLife: g.ScourgePlayer.Life, EnemyLife: g.ScourgePlayer.Life,
EnemyDeckSize: g.ScourgeDeck.Size(), EnemyDeckSize: g.ScourgeDeck.Size(),
EnemyHandSize: len(g.ScourgePlayer.Hand), EnemyHandSize: len(g.ScourgePlayer.Hand),
@ -33,7 +33,7 @@ func NewView(id int, g *Game) *GameView {
return &GameView{ return &GameView{
Board: g.GameBoard, Board: g.GameBoard,
Player: g.ScourgePlayer, Player: g.ScourgePlayer,
Deck: g.ScourgeDeck, DeckSize: g.ScourgeDeck.Size(),
EnemyLife: g.SentinalPlayer.Life, EnemyLife: g.SentinalPlayer.Life,
EnemyDeckSize: g.SentinalDeck.Size(), EnemyDeckSize: g.SentinalDeck.Size(),
EnemyHandSize: len(g.SentinalPlayer.Hand), EnemyHandSize: len(g.SentinalPlayer.Hand),