Include robot Id in the Stats structure that gets sent back to the client
This commit is contained in:
+3
-1
@@ -312,7 +312,7 @@ encodingLoops:
|
||||
convertedStats := map[string]Stats{}
|
||||
for name, stats := range conf.Stats {
|
||||
dstat := DeriveStats(stats)
|
||||
convertedStats[name] = dstat
|
||||
|
||||
r := Robot{
|
||||
Stats: dstat,
|
||||
Id: c.Idg.Hash(),
|
||||
@@ -327,6 +327,8 @@ encodingLoops:
|
||||
log.Printf("%s: adding robot: %s", p.Id, r.Id)
|
||||
r.reset(game)
|
||||
p.Robots = append(p.Robots, &r)
|
||||
dstat.Id = r.Id
|
||||
convertedStats[name] = dstat
|
||||
}
|
||||
|
||||
statsPayload := struct {
|
||||
|
||||
Reference in New Issue
Block a user