diff --git a/cmd/server/server.go b/cmd/server/server.go index d014c9b..2c26a69 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -47,7 +47,7 @@ func serveWs(c *coordinator.Coordinator, w http.ResponseWriter, r *http.Request) panic(err) } if cmd.Command != coordinator.SessionCmdPoll { - log.Printf("sending: %v", resp) + log.Printf("sending: %v", resp.Result) } err = conn.WriteJSON(resp) if err != nil { diff --git a/internal/game/game_view.go b/internal/game/game_view.go index 23968cf..20a2514 100644 --- a/internal/game/game_view.go +++ b/internal/game/game_view.go @@ -5,7 +5,7 @@ import "fmt" type GameView struct { Board *Board `json:"board"` Player *Player `json:"player"` - Deck *Deck `json:"deck"` + DeckSize int `json:"deck_size"` EnemyLife int `json:"enemy_life"` EnemyDeckSize int `json:"enemy_deck_size"` EnemyHandSize int `json:"enemy_hand_size"` @@ -20,7 +20,7 @@ func NewView(id int, g *Game) *GameView { return &GameView{ Board: g.GameBoard, Player: g.SentinalPlayer, - Deck: g.SentinalDeck, + DeckSize: g.SentinalDeck.Size(), EnemyLife: g.ScourgePlayer.Life, EnemyDeckSize: g.ScourgeDeck.Size(), EnemyHandSize: len(g.ScourgePlayer.Hand), @@ -33,7 +33,7 @@ func NewView(id int, g *Game) *GameView { return &GameView{ Board: g.GameBoard, Player: g.ScourgePlayer, - Deck: g.ScourgeDeck, + DeckSize: g.ScourgeDeck.Size(), EnemyLife: g.SentinalPlayer.Life, EnemyDeckSize: g.SentinalDeck.Size(), EnemyHandSize: len(g.SentinalPlayer.Hand),