Providing the bot ID to name mapping to the player after negotiation
This commit is contained in:
@@ -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":
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user