Providing the bot ID to name mapping to the player after negotiation

This commit is contained in:
Fraser Graham
2016-07-13 21:28:57 -06:00
parent 6c67d83f49
commit 9be5f226f5
5 changed files with 81 additions and 25 deletions
+7
View File
@@ -135,10 +135,17 @@ func (c *Client) Negotiate(clientType string, player Player) (err error) {
Stats map[string]server.Stats `json:"stats"`
Type string `json:"type"`
}{}
err = websocket.JSON.Receive(c.ws, &dstats)
if err != nil {
return err
}
ids := make(map[string]string)
for name, entry := range dstats.Stats {
ids[entry.Id] = name
}
player.SetIDs(ids)
case "spectator":
}