From: Jan Behrens Date: Thu, 9 May 2013 14:55:01 +0000 (+0200) Subject: Generalizing team events for xonstat X-Git-Tag: xonotic-v0.7.0~23^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=885400067025c2585fab245a6c5a268257b77709;p=xonotic%2Fxonotic-data.pk3dir.git Generalizing team events for xonstat --- diff --git a/qcsrc/server/playerstats.qc b/qcsrc/server/playerstats.qc index f370ed6bb..432206873 100644 --- a/qcsrc/server/playerstats.qc +++ b/qcsrc/server/playerstats.qc @@ -220,7 +220,7 @@ void PlayerStats_ready(entity fh, entity pass, float status) string t, tn; string p, pn; string e, en; - string nn, tt, ts; + string nn, tt; string s; switch(status) @@ -244,9 +244,13 @@ void PlayerStats_ready(entity fh, entity pass, float status) for(t = teamstats_last; (tn = db_get(playerstats_db, sprintf("%d", stof(t)))) != ""; t = tn) { url_fputs(fh, sprintf("Q team#%s\n", t)); - ts = db_get(playerstats_db, sprintf("team#%d:%s", stof(t), strcat(PLAYERSTATS_SCOREBOARD, "score"))); - if(ts != "") - url_fputs(fh, sprintf("e %s %s\n", strcat(PLAYERSTATS_SCOREBOARD, "teamscore"), (ts != "" ? ts : "0"))); + for(e = events_last; (en = db_get(playerstats_db, sprintf("*:%s", e))) != ""; e = en) + { + float v; + v = stof(db_get(playerstats_db, sprintf("team#%d:%s", stof(t), e))); + if(v != 0) + url_fputs(fh, sprintf("e %s %g\n", e, v)); + } } } for(p = playerstats_last; (pn = db_get(playerstats_db, sprintf("%s:*", p))) != ""; p = pn)