X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fplayerstats.qc;h=4608b56df10f1330011e64e358e7c155035a42ef;hb=64b6c7420b3e1c307f408a9f17d9c765a268621a;hp=c94a5f22ac4262c8dc751b850ffa8cbcb9433100;hpb=9e17e0bc2f1af717f39d364ba26ef3a308842e17;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/playerstats.qc b/qcsrc/server/playerstats.qc index c94a5f22ac..4608b56df1 100644 --- a/qcsrc/server/playerstats.qc +++ b/qcsrc/server/playerstats.qc @@ -20,6 +20,7 @@ void PlayerStats_Init() // initiated before InitGameplayMode so that scores are serverflags |= SERVERFLAG_PLAYERSTATS; PlayerStats_AddEvent(PLAYERSTATS_ALIVETIME); + PlayerStats_AddEvent(PLAYERSTATS_AVGLATENCY); PlayerStats_AddEvent(PLAYERSTATS_WINS); PlayerStats_AddEvent(PLAYERSTATS_MATCHES); PlayerStats_AddEvent(PLAYERSTATS_JOINS); @@ -193,6 +194,7 @@ void PlayerStats_TeamScore(float t, string event_id, float value) // TODO: doesn e: followed by an event name, a space, and the event count/score event names can be: alivetime: total playing time of the player + avglatency: average network latency compounded throughout the match wins: number of games won (can only be set if matches is set) matches: number of matches played to the end (not aborted by map switch) joins: number of matches joined (always 1 unless player never played during the match) @@ -236,7 +238,7 @@ void PlayerStats_ready(entity fh, entity pass, float status) switch(status) { case URL_READY_CANWRITE: - url_fputs(fh, "V 4\n"); + url_fputs(fh, "V 5\n"); #ifdef WATERMARK url_fputs(fh, sprintf("R %s\n", WATERMARK())); #endif @@ -389,7 +391,10 @@ void PlayerStats_EndMatch(float finished) if((g_arena || g_lms || g_ca) && (p.alivetime <= 0)) { continue; } else if(p.classname != "player") { continue; } - + + float latency = (p.latency_sum / p.latency_cnt); + if(latency) { PlayerStats_Event(p, PLAYERSTATS_AVGLATENCY, latency); } + PlayerScore_PlayerStats(p); PlayerStats_Event(p, PLAYERSTATS_SCOREBOARD_VALID, 1); if(finished)