#ifdef SVQC
-float PS_PM_IN_DB; // playerstats_prematch_in_db // db for info COLLECTED at the beginning of a match
+//float PS_PM_IN_DB; // playerstats_prematch_in_db // db for info COLLECTED at the beginning of a match
float PS_GR_OUT_DB; // playerstats_gamereport_out_db // db of info SENT at the end of a match
-float PS_GR_IN_DB; // playerstats_gamereport_in_db // db for info COLLECTED at the end of a match
-float PS_B_IN_DB; // playerstats_playerbasic_in_db // db for info COLLECTED for basic player info (ELO)
+//float PS_GR_IN_DB; // playerstats_gamereport_in_db // db for info COLLECTED at the end of a match
+//float PS_B_IN_DB; // playerstats_playerbasic_in_db // db for info COLLECTED for basic player info (ELO)
// http://stats.xonotic.org/player/GgXRw6piDtFIbMArMuiAi8JG4tiin8VLjZgsKB60Uds=/elo.txt
#endif
#ifdef MENUQC
-float PS_D_IN_DB; // playerstats_playerdetail_in_db // db for info COLLECTED for detailed player profile display
+//float PS_D_IN_DB; // playerstats_playerdetail_in_db // db for info COLLECTED for detailed player profile display
// http://stats.xonotic.org/player/me
#endif
#ifdef SVQC
-string PS_PM_IN_EVL; // playerstats_prematch_in_events_last
+//string PS_PM_IN_EVL; // playerstats_prematch_in_events_last
string PS_GR_OUT_TL; // playerstats_gamereport_out_teams_last
string PS_GR_OUT_PL; // playerstats_gamereport_out_players_las
string PS_GR_OUT_EVL; // playerstats_gamereport_out_events_last
-string PS_GR_IN_PL; // playerstats_gamereport_in_players_last
-string PS_GR_IN_EVL; // playerstats_gamereport_in_events_last
-string PS_B_IN_PL; // playerstats_playerbasic_in_players_las
-string PS_B_IN_EVL; // playerstats_playerbasic_in_events_last
+//string PS_GR_IN_PL; // playerstats_gamereport_in_players_last
+//string PS_GR_IN_EVL; // playerstats_gamereport_in_events_last
+//string PS_B_IN_PL; // playerstats_playerbasic_in_players_las
+//string PS_B_IN_EVL; // playerstats_playerbasic_in_events_last
#endif
#ifdef MENUQC
-string PS_D_IN_EVL; // playerstats_playerdetail_in_events_last
+//string PS_D_IN_EVL; // playerstats_playerdetail_in_events_last
#endif
#ifdef SVQC
PS_GR_OUT_EVL = strzone(event_id);
}
}
-#define PS_GR_P_ADDVAL(ent,eventid,val) PlayerStats_GameReport_Event(ent.playerstats_id, eventid, val)
-#define PS_GR_T_ADDVAL(team,eventid,val) PlayerStats_GameReport_Event(sprintf("team#%d", team), eventid, val)
+
// referred to by PS_GR_P_ADDVAL and PS_GR_T_ADDVAL
float PlayerStats_GameReport_Event(string prefix, string event_id, float value)
{
if(stof(db_get(PS_GR_OUT_DB, sprintf("%s:%s", p.playerstats_id, PLAYERSTATS_ALIVETIME))) > 0)
PS_GR_P_ADDVAL(p, PLAYERSTATS_JOINS, 1);
- PlayerStats_Accuracy(p);
+ PlayerStats_GameReport_Accuracy(p);
if(IS_REAL_CLIENT(p))
{
float playerstats_waitforme;
// call at initialization
-void PlayerStats_Init();
+void PlayerStats_GameReport_Init();
// add a new player
-void PlayerStats_AddPlayer(entity e);
+void PlayerStats_GameReport_AddPlayer(entity e);
// add a new team
-void PlayerStats_AddTeam(float t);
+void PlayerStats_GameReport_AddTeam(float t);
// add a new event
-void PlayerStats_AddEvent(string event_id);
+void PlayerStats_GameReport_AddEvent(string event_id);
// call on each event to track, or at player disconnect OR match end for "global stuff"
-float PlayerStats_Event(entity e, string event_id, float value);
-
-// add a team score
-float PlayerStats_TeamScore(float t, string event_id, float value);
+#define PS_GR_P_ADDVAL(ent,eventid,val) PlayerStats_GameReport_Event(ent.playerstats_id, eventid, val)
+#define PS_GR_T_ADDVAL(team,eventid,val) PlayerStats_GameReport_Event(sprintf("team#%d", team), eventid, val)
+float PlayerStats_GameReport_Event(string prefix, string event_id, float value);
// call at game over
-void PlayerStats_Shutdown(); // send stats to the server
+void PlayerStats_GameReport_Shutdown(); // send stats to the server
-void PlayerStats_Accuracy(entity p);
+void PlayerStats_GameReport_Accuracy(entity p);
// call this whenever a player leaves
-void PlayerStats_AddGlobalInfo(entity p);
+void PlayerStats_GameReport_AddGlobalInfo(entity p);
// call this at the end of the match
-void PlayerStats_EndMatch(float finished);
+void PlayerStats_GameReport_EndMatch(float finished);
+
+void PlayerStats_GameReport_Handler(entity fh, entity pass, float status);
+
+.string playerstats_id;
string autocvar_g_playerstats_uri;
-
+/*
//// WIP -zykure /////////////////////////////////////////////////////
//void PlayerInfo_Details();
#endif
+*/
if(argv(0) == "debugstats")
{
- PlayerInfo_Init();
- PlayerInfo_Details();
+ //PlayerInfo_Init();
+ //PlayerInfo_Details();
return;
}
cvar_set("_menu_initialized", "1");
}
- PlayerInfo_Details();
+ //PlayerInfo_Details();
}
const float MENU_ASPECT = 1.25; // 1280x1024
if(self.alivetime)
{
if(!warmup_stage)
- PlayerStats_Event(self, PLAYERSTATS_ALIVETIME, time - self.alivetime);
+ PS_GR_P_ADDVAL(self, PLAYERSTATS_ALIVETIME, time - self.alivetime);
self.alivetime = 0;
}
player_count = 0;
}
- PlayerInfo_Basic(self);
+ //PlayerInfo_Basic(self);
PlayerScore_Attach(self);
ClientData_Attach();
accuracy_init(self);
self.playerid = (playerid_last = playerid_last + 1);
- PlayerStats_AddEvent(sprintf("kills-%d", self.playerid));
+ PlayerStats_GameReport_AddEvent(sprintf("kills-%d", self.playerid));
if(IS_BOT_CLIENT(self))
- PlayerStats_AddPlayer(self);
+ PlayerStats_GameReport_AddPlayer(self);
if(autocvar_sv_eventlog)
GameLogEcho(strcat(":join:", ftos(self.playerid), ":", ftos(num_for_edict(self)), ":", ((IS_REAL_CLIENT(self)) ? self.netaddress : "bot"), ":", self.netname));
return;
}
- PlayerStats_AddGlobalInfo(self);
+ PlayerStats_GameReport_AddGlobalInfo(self);
CheatShutdownClient();
if(self.alivetime)
{
- PlayerStats_Event(self, PLAYERSTATS_ALIVETIME, time - self.alivetime);
+ PS_GR_P_ADDVAL(self, PLAYERSTATS_ALIVETIME, time - self.alivetime);
self.alivetime = 0;
}
{
tmp_player.alivetime = 0;
tmp_player.killcount = 0;
- PlayerStats_Event(tmp_player, PLAYERSTATS_ALIVETIME, -PlayerStats_Event(tmp_player, PLAYERSTATS_ALIVETIME, 0));
+ PS_GR_P_ADDVAL(tmp_player, PLAYERSTATS_ALIVETIME, -PS_GR_P_ADDVAL(tmp_player, PLAYERSTATS_ALIVETIME, 0));
}
restart_mapalreadyrestarted = 0; // reset this var, needed when cvar sv_ready_restart_repeatable is in use
// regular frag
PlayerScore_Add(attacker, SP_KILLS, 1);
if(targ.playerid)
- PlayerStats_Event(attacker, sprintf("kills-%d", targ.playerid), 1);
+ PS_GR_P_ADDVAL(attacker, sprintf("kills-%d", targ.playerid), 1);
}
PlayerScore_Add(targ, SP_DEATHS, 1);
case counta: \
{ \
Send_Notification(NOTIF_ONE, attacker, MSG_ANNCE, ANNCE_KILLSTREAK_##countb); \
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_##counta, 1); \
+ PS_GR_P_ADDVAL(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_##counta, 1); \
break; \
}
switch(attacker.killcount)
{
checkrules_firstblood = TRUE;
notif_firstblood = TRUE; // modify the current messages so that they too show firstblood information
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD, 1);
- PlayerStats_Event(targ, PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM, 1);
+ PS_GR_P_ADDVAL(attacker, PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD, 1);
+ PS_GR_P_ADDVAL(targ, PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM, 1);
// tell spree_inf and spree_cen that this is a first-blood and first-victim event
kill_count_to_attacker = -1;
if(PlayerScore_Add(targ, SP_SCORE, 0) == -5)
{
Send_Notification(NOTIF_ONE, targ, MSG_ANNCE, ANNCE_ACHIEVEMENT_BOTLIKE);
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_BOTLIKE, 1);
+ PS_GR_P_ADDVAL(attacker, PLAYERSTATS_ACHIEVEMENT_BOTLIKE, 1);
}
}
BADPREFIX("g_playerstats_");
BADPREFIX("g_respawn_ghosts");
BADPREFIX("g_voice_flood_");
- BADCVAR("g_playerstats_ladder");
BADPREFIX("rcon_");
BADPREFIX("sv_allowdownloads");
BADPREFIX("sv_autodemo");
Map_MarkAsRecent(mapname);
- PlayerStats_Init(); // we need this to be initiated before InitGameplayMode
+ PlayerStats_GameReport_Init(); // we need this to be initiated before InitGameplayMode
precache_model ("null"); // we need this one before InitGameplayMode
InitGameplayMode();
DumpStats(TRUE);
- // send statistics
+ // send statistics // fixme
entity e;
- PlayerStats_EndMatch(1);
+ PlayerStats_GameReport_EndMatch(1);
FOR_EACH_CLIENT(e)
- PlayerStats_AddGlobalInfo(e);
- PlayerStats_Shutdown();
+ PlayerStats_GameReport_AddGlobalInfo(e);
+ PlayerStats_GameReport_Shutdown();
WeaponStats_Shutdown();
Kill_Notification(NOTIF_ALL, world, MSG_CENTER, 0); // kill all centerprints now
print("Saving persistent data...\n");
Ban_SaveBans();
- PlayerStats_EndMatch(0);
+ // fixme
+ PlayerStats_GameReport_EndMatch(0);
FOR_EACH_CLIENT(e)
- PlayerStats_AddGlobalInfo(e);
- PlayerStats_Shutdown();
+ PlayerStats_GameReport_AddGlobalInfo(e);
+ PlayerStats_GameReport_Shutdown();
if(!cheatcount_total)
{
if (s == "cl_weaponpriority")
self.switchweapon = w_getbestweapon(self);
if (s == "cl_allow_uidtracking")
- PlayerStats_AddPlayer(self);
+ PlayerStats_GameReport_AddPlayer(self);
}
}
Net_LinkEntity(ts, FALSE, 0, TeamScore_SendEntity);
teamscorekeepers[t - 1] = ts;
++teamscores_entities_count;
- PlayerStats_AddTeam(t);
+ PlayerStats_GameReport_AddTeam(t);
}
float TeamScore_AddToTeam(float t, float scorefield, float score)
}
if(label != "")
{
- PlayerStats_AddEvent(strcat(PLAYERSTATS_TOTAL, label));
- PlayerStats_AddEvent(strcat(PLAYERSTATS_SCOREBOARD, label));
+ PlayerStats_GameReport_AddEvent(strcat(PLAYERSTATS_TOTAL, label));
+ PlayerStats_GameReport_AddEvent(strcat(PLAYERSTATS_SCOREBOARD, label));
}
}
}
if(label != "")
{
- PlayerStats_AddEvent(strcat(PLAYERSTATS_TOTAL, label));
- PlayerStats_AddEvent(strcat(PLAYERSTATS_SCOREBOARD, label));
+ PlayerStats_GameReport_AddEvent(strcat(PLAYERSTATS_TOTAL, label));
+ PlayerStats_GameReport_AddEvent(strcat(PLAYERSTATS_SCOREBOARD, label));
}
}
if(scores_label[scorefield] != "")
s.SendFlags |= pow(2, scorefield);
if(!warmup_stage)
- PlayerStats_Event(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label[scorefield]), score);
+ PS_GR_P_ADDVAL(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label[scorefield]), score);
return (s.(scores[scorefield]) += score);
}
for(i = 0; i < MAX_SCORE; ++i)
if(s.(scores[i]) != 0)
if(scores_label[i] != "")
- PlayerStats_Event(s.owner, strcat(PLAYERSTATS_SCOREBOARD, scores_label[i]), s.(scores[i]));
+ PS_GR_P_ADDVAL(s.owner, strcat(PLAYERSTATS_SCOREBOARD, scores_label[i]), s.(scores[i]));
}
void PlayerScore_TeamStats(void)
if(sk.(teamscores[i]) != 0)
if(teamscores_label[i] != "")
// the +1 is important here!
- PlayerStats_TeamScore(t+1, strcat(PLAYERSTATS_SCOREBOARD, teamscores_label[i]), sk.(teamscores[i]));
+ PS_GR_T_ADDVAL(t+1, strcat(PLAYERSTATS_SCOREBOARD, teamscores_label[i]), sk.(teamscores[i]));
}
}