From d750b083171102e3dd49e13ff806faaa70032643 Mon Sep 17 00:00:00 2001 From: Hunter Freyer Date: Mon, 21 Jun 2021 17:25:31 -0400 Subject: [PATCH] Change SnakeResponse.Latency to be a string. (#45) Convert CLI Latency value from int to string, to match what the current game engine does. --- cli/commands/play.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/commands/play.go b/cli/commands/play.go index 69e08ac..4d07e7b 100644 --- a/cli/commands/play.go +++ b/cli/commands/play.go @@ -37,7 +37,7 @@ type SnakeResponse struct { Name string `json:"name"` Health int32 `json:"health"` Body []Coord `json:"body"` - Latency int32 `json:"latency"` + Latency string `json:"latency"` Head Coord `json:"head"` Length int32 `json:"length"` Shout string `json:"shout"` @@ -350,7 +350,7 @@ func snakeResponseFromSnake(snake rules.Snake) SnakeResponse { Name: Battlesnakes[snake.ID].Name, Health: snake.Health, Body: coordFromPointArray(snake.Body), - Latency: 0, + Latency: "0", Head: coordFromPoint(snake.Body[0]), Length: int32(len(snake.Body)), Shout: "",