First pass of multibot support

This commit is contained in:
Fraser Graham
2013-11-08 21:25:42 -08:00
parent 49ff6af1f3
commit e39a97089e
6 changed files with 350 additions and 278 deletions
+7 -4
View File
@@ -83,11 +83,14 @@ func listGames(w http.ResponseWriter, req *http.Request) {
ids := make([]gl, 0)
for id, g := range games.m {
players := make([]pout, 0)
// TODO - players instead of robots?
for p, _ := range g.players {
players = append(players, pout{
Name: p.Robot.Name,
Id: p.Robot.Id,
})
for _, r := range p.Robots {
players = append(players, pout{
Name: r.Name,
Id: r.Id,
})
}
}
ids = append(ids, gl{
Id: id,