4 //float PS_PM_IN_DB = -1; // playerstats_prematch_in_db // db for info COLLECTED at the beginning of a match
5 int PS_GR_OUT_DB = -1; // playerstats_gamereport_out_db // db of info SENT at the end of a match
6 //float PS_GR_IN_DB = -1; // playerstats_gamereport_in_db // db for info COLLECTED at the end of a match
7 int PS_B_IN_DB = -1; // playerstats_playerbasic_in_db // db for info COLLECTED for basic player info (ELO)
11 int PS_D_IN_DB = -1; // playerstats_playerdetail_in_db // db for info COLLECTED for detailed player profile display
15 //string PS_PM_IN_EVL; // playerstats_prematch_in_events_last
16 string PS_GR_OUT_TL; // playerstats_gamereport_out_teams_last
17 string PS_GR_OUT_PL; // playerstats_gamereport_out_players_last
18 string PS_GR_OUT_EVL; // playerstats_gamereport_out_events_last
19 //string PS_GR_IN_PL; // playerstats_gamereport_in_players_last
20 //string PS_GR_IN_EVL; // playerstats_gamereport_in_events_last
21 //string PS_B_IN_PL; // playerstats_playerbasic_in_players_last
22 //string PS_B_IN_EVL; // playerstats_playerbasic_in_events_last
26 string PS_D_IN_EVL; // playerstats_playerdetail_in_events_last
31 // time the player was alive and kicking
32 const string PLAYERSTATS_ALIVETIME = "alivetime";
33 const string PLAYERSTATS_AVGLATENCY = "avglatency";
34 const string PLAYERSTATS_WINS = "wins";
35 const string PLAYERSTATS_MATCHES = "matches";
36 const string PLAYERSTATS_JOINS = "joins";
37 const string PLAYERSTATS_SCOREBOARD_VALID = "scoreboardvalid";
38 const string PLAYERSTATS_RANK = "rank";
39 const string PLAYERSTATS_SCOREBOARD_POS = "scoreboardpos";
41 const string PLAYERSTATS_TOTAL = "total-";
42 const string PLAYERSTATS_SCOREBOARD = "scoreboard-";
43 const string PLAYERSTATS_ANTICHEAT = "anticheat-";
45 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3 = "achievement-kill-spree-3";
46 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5 = "achievement-kill-spree-5";
47 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10 = "achievement-kill-spree-10";
48 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_15 = "achievement-kill-spree-15";
49 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_20 = "achievement-kill-spree-20";
50 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_25 = "achievement-kill-spree-25";
51 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_30 = "achievement-kill-spree-30";
52 const string PLAYERSTATS_ACHIEVEMENT_BOTLIKE = "achievement-botlike";
53 const string PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD = "achievement-firstblood";
54 const string PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM = "achievement-firstvictim";
56 // delay map switch until this is set
57 float PlayerStats_GameReport_DelayMapVote;
59 // call at initialization
60 void PlayerStats_GameReport_Init();
63 void PlayerStats_GameReport_AddPlayer(entity e);
66 void PlayerStats_GameReport_AddTeam(float t);
69 void PlayerStats_GameReport_AddEvent(string event_id);
71 // call on each event to track, or at player disconnect OR match end for "global stuff"
72 #define PS_GR_P_ADDVAL(ent,eventid,val) PlayerStats_GameReport_Event(ent.playerstats_id, eventid, val)
73 #define PS_GR_T_ADDVAL(team,eventid,val) PlayerStats_GameReport_Event(sprintf("team#%d", team), eventid, val)
74 float PlayerStats_GameReport_Event(string prefix, string event_id, float value);
76 void PlayerStats_GameReport_Accuracy(entity p);
78 // call this whenever a player leaves
79 void PlayerStats_GameReport_FinalizePlayer(entity p);
81 // call this at the end of the match
82 void PlayerStats_GameReport(float finished);
84 void PlayerStats_GameReport_Handler(entity fh, entity pass, float status);
86 .string playerstats_id;
88 //string autocvar_g_playerstats_uri;
90 string autocvar_g_playerstats_gamereport_ladder;
91 string autocvar_g_playerstats_gamereport_uri = "http://stats.xonotic.org/stats/submit";
93 const float PS_B_STATUS_ERROR = -2;
94 const float PS_B_STATUS_IDLE = -1;
95 const float PS_B_STATUS_WAITING = 0;
96 const float PS_B_STATUS_RECEIVED = 1;
97 const float PS_B_STATUS_UPDATING = 2;
98 .float playerstats_basicstatus;
99 string autocvar_g_playerstats_playerbasic_uri = "http://stats.xonotic.org";
101 void PlayerStats_PlayerBasic(entity joiningplayer, float newrequest);
102 void PlayerStats_PlayerBasic_CheckUpdate(entity joiningplayer);
103 void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status);
106 float PS_D_NEXTUPDATETIME;
107 float PS_D_LASTGAMECOUNT;
108 const float PS_D_STATUS_ERROR = -2;
109 const float PS_D_STATUS_IDLE = -1;
110 const float PS_D_STATUS_WAITING = 0;
111 const float PS_D_STATUS_RECEIVED = 1;
112 float PlayerStats_PlayerDetail_Status = PS_D_STATUS_IDLE;
113 string autocvar_g_playerstats_playerdetail_uri = "http://stats.xonotic.org/player/me";
114 float autocvar_g_playerstats_playerdetail_autoupdatetime = 1800; // automatically update every 30 minutes anyway
115 void PlayerStats_PlayerDetail();
116 void PlayerStats_PlayerDetail_CheckUpdate();
117 void PlayerStats_PlayerDetail_Handler(entity fh, entity p, float status);