.float playerstats_addedglobalinfo;
.string playerstats_id;
-void PlayerStats_Init()
+void PlayerStats_Init() // initiated before InitGameplayMode so that scores are added properly
{
string uri;
playerstats_db = -1;
if(playerstats_db >= 0)
playerstats_waitforme = FALSE; // must wait for it at match end
- serverflags |= SERVERFLAG_PLAYERSTATS;
+ serverflags |= SERVERFLAG_PLAYERSTATS;
PlayerStats_AddEvent(PLAYERSTATS_ALIVETIME);
PlayerStats_AddEvent(PLAYERSTATS_WINS);
{
if(playerstats_db < 0)
return;
-
+
string key;
key = sprintf("*:%s", event_id);
The following keys are defined:
- V: format version (always 1) - this MUST be the first line!
+ V: format version (always a fixed number) - this MUST be the first line!
#: comment (MUST be ignored by any parser)
R: release information on the server
T: time at which the game ended
switch(status)
{
case URL_READY_CANWRITE:
- url_fputs(fh, "V 1\n");
+ url_fputs(fh, "V 3\n");
#ifdef WATERMARK
url_fputs(fh, sprintf("R %s\n", WATERMARK()));
#endif
PlayerStats_Event(p, strcat("acc-", w.netname, "-frags"), a.(accuracy_frags[i-1]));
}
+ //backtrace(strcat("adding player stat accuracy for ", p.netname, ".\n"));
}
void PlayerStats_AddGlobalInfo(entity p)
winner = PlayerScore_Sort(score_dummyfield);
FOR_EACH_CLIENT(p) // spectators intentionally not included
{
- PlayerStats_Accuracy(p);
+ //PlayerStats_Accuracy(p); // stats are already written with PlayerStats_AddGlobalInfo(entity), don't double them up.
+
if(g_arena || g_lms || g_ca)
- {
- if(p.alivetime <= 0)
- continue;
- }
+ if(p.alivetime <= 0) { continue; }
else
- {
- if(p.classname != "player")
- continue;
- }
+ if(p.classname != "player") { continue; }
+
PlayerScore_PlayerStats(p);
PlayerStats_Event(p, PLAYERSTATS_SCOREBOARD_VALID, 1);
if(finished)