- for(p = playerstats_last; (pn = db_get(playerstats_db, sprintf("%s:*", p))) != ""; p = pn)
- {
- bufstr_set(b, i++, sprintf("P %s", p));
- nn = db_get(playerstats_db, sprintf("%s:_netname", p));
- if(nn != "")
- bufstr_set(b, i++, sprintf("n %s", nn));
- for(e = events_last; (en = db_get(playerstats_db, sprintf("*:%s", e))) != ""; e = en)
- {
- float v;
- v = stof(db_get(playerstats_db, sprintf("%s:%s", p, e)));
- if(v != 0)
- bufstr_set(b, i++, sprintf("e %s %g", e, v));
- }
- }
- bufstr_set(b, i++, "");
+ for(p = playerstats_last; (pn = db_get(playerstats_db, sprintf("%s:*", p))) != ""; p = pn)
+ {
+ bufstr_set(b, i++, sprintf("P %s", p));
+ nn = db_get(playerstats_db, sprintf("%s:_playerid", p));
+ if(nn != "")
+ bufstr_set(b, i++, sprintf("i %s", nn));
+ nn = db_get(playerstats_db, sprintf("%s:_netname", p));
+ if(nn != "")
+ bufstr_set(b, i++, sprintf("n %s", nn));
+ if(teamplay)
+ {
+ tt = db_get(playerstats_db, sprintf("%s:_team", p));
+ bufstr_set(b, i++, sprintf("t %s", tt));
+ }
+ for(e = events_last; (en = db_get(playerstats_db, sprintf("*:%s", e))) != ""; e = en)
+ {
+ float v;
+ v = stof(db_get(playerstats_db, sprintf("%s:%s", p, e)));
+ if(v != 0)
+ bufstr_set(b, i++, sprintf("e %s %g", e, v));
+ }
+ }
+ bufstr_set(b, i++, "");