Change SnakeResponse.Latency to be a string. (#45)

Convert CLI Latency value from int to string, to match what the current game engine does.
This commit is contained in:
Hunter Freyer 2021-06-21 17:25:31 -04:00 committed by GitHub
parent c2c1c8df50
commit d750b08317
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,7 +37,7 @@ type SnakeResponse struct {
Name string `json:"name"` Name string `json:"name"`
Health int32 `json:"health"` Health int32 `json:"health"`
Body []Coord `json:"body"` Body []Coord `json:"body"`
Latency int32 `json:"latency"` Latency string `json:"latency"`
Head Coord `json:"head"` Head Coord `json:"head"`
Length int32 `json:"length"` Length int32 `json:"length"`
Shout string `json:"shout"` Shout string `json:"shout"`
@ -350,7 +350,7 @@ func snakeResponseFromSnake(snake rules.Snake) SnakeResponse {
Name: Battlesnakes[snake.ID].Name, Name: Battlesnakes[snake.ID].Name,
Health: snake.Health, Health: snake.Health,
Body: coordFromPointArray(snake.Body), Body: coordFromPointArray(snake.Body),
Latency: 0, Latency: "0",
Head: coordFromPoint(snake.Body[0]), Head: coordFromPoint(snake.Body[0]),
Length: int32(len(snake.Body)), Length: int32(len(snake.Body)),
Shout: "", Shout: "",