2 //float PS_PM_IN_DB; // playerstats_prematch_in_db // db for info COLLECTED at the beginning of a match
3 float PS_GR_OUT_DB; // playerstats_gamereport_out_db // db of info SENT at the end of a match
4 //float PS_GR_IN_DB; // playerstats_gamereport_in_db // db for info COLLECTED at the end of a match
5 float PS_B_IN_DB; // playerstats_playerbasic_in_db // db for info COLLECTED for basic player info (ELO)
6 // http://stats.xonotic.org/player/GgXRw6piDtFIbMArMuiAi8JG4tiin8VLjZgsKB60Uds=/elo.txt -- this works,
7 // http://stats.xonotic.org/player/ENkUjf83vKMVZcNm%2F6Ao1EmXEj1apQ6XvdQTxwELvmA%3D/elo.txt -- but this doesn't?!?
8 // ENkUjf83vKMVZcNm/6Ao1EmXEj1apQ6XvdQTxwELvmA=
12 float PS_D_IN_DB; // playerstats_playerdetail_in_db // db for info COLLECTED for detailed player profile display
13 // http://stats.xonotic.org/player/me
17 //string PS_PM_IN_EVL; // playerstats_prematch_in_events_last
18 string PS_GR_OUT_TL; // playerstats_gamereport_out_teams_last
19 string PS_GR_OUT_PL; // playerstats_gamereport_out_players_las
20 string PS_GR_OUT_EVL; // playerstats_gamereport_out_events_last
21 //string PS_GR_IN_PL; // playerstats_gamereport_in_players_last
22 //string PS_GR_IN_EVL; // playerstats_gamereport_in_events_last
23 //string PS_B_IN_PL; // playerstats_playerbasic_in_players_last
24 //string PS_B_IN_EVL; // playerstats_playerbasic_in_events_last
28 string PS_D_IN_EVL; // playerstats_playerdetail_in_events_last
33 // time the player was alive and kicking
34 const string PLAYERSTATS_ALIVETIME = "alivetime";
35 const string PLAYERSTATS_AVGLATENCY = "avglatency";
36 const string PLAYERSTATS_WINS = "wins";
37 const string PLAYERSTATS_MATCHES = "matches";
38 const string PLAYERSTATS_JOINS = "joins";
39 const string PLAYERSTATS_SCOREBOARD_VALID = "scoreboardvalid";
40 const string PLAYERSTATS_RANK = "rank";
41 const string PLAYERSTATS_SCOREBOARD_POS = "scoreboardpos";
43 const string PLAYERSTATS_TOTAL = "total-";
44 const string PLAYERSTATS_SCOREBOARD = "scoreboard-";
46 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3 = "achievement-kill-spree-3";
47 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5 = "achievement-kill-spree-5";
48 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10 = "achievement-kill-spree-10";
49 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_15 = "achievement-kill-spree-15";
50 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_20 = "achievement-kill-spree-20";
51 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_25 = "achievement-kill-spree-25";
52 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_30 = "achievement-kill-spree-30";
53 const string PLAYERSTATS_ACHIEVEMENT_BOTLIKE = "achievement-botlike";
54 const string PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD = "achievement-firstblood";
55 const string PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM = "achievement-firstvictim";
57 // delay map switch until this is set
58 float PlayerStats_GameReport_DelayMapVote;
60 // call at initialization
61 void PlayerStats_GameReport_Init();
64 void PlayerStats_GameReport_AddPlayer(entity e);
67 void PlayerStats_GameReport_AddTeam(float t);
70 void PlayerStats_GameReport_AddEvent(string event_id);
72 // call on each event to track, or at player disconnect OR match end for "global stuff"
73 #define PS_GR_P_ADDVAL(ent,eventid,val) PlayerStats_GameReport_Event(ent.playerstats_id, eventid, val)
74 #define PS_GR_T_ADDVAL(team,eventid,val) PlayerStats_GameReport_Event(sprintf("team#%d", team), eventid, val)
75 float PlayerStats_GameReport_Event(string prefix, string event_id, float value);
77 void PlayerStats_GameReport_Accuracy(entity p);
79 // call this whenever a player leaves
80 void PlayerStats_GameReport_FinalizePlayer(entity p);
82 // call this at the end of the match
83 void PlayerStats_GameReport(float finished);
85 void PlayerStats_GameReport_Handler(entity fh, entity pass, float status);
87 .string playerstats_id;
89 //string autocvar_g_playerstats_uri;
91 string autocvar_g_playerstats_gamereport_ladder;
92 var string autocvar_g_playerstats_gamereport_uri = "http://stats.xonotic.org/stats/submit";
94 #define PS_B_STATUS_ERROR -2
95 #define PS_B_STATUS_IDLE -1
96 #define PS_B_STATUS_WAITING 0
97 #define PS_B_STATUS_RECEIVED 1
98 #define PS_B_STATUS_UPDATING 2
99 var float PlayerStats_PlayerBasic_Status = PS_B_STATUS_IDLE;
100 var string autocvar_g_playerstats_playerbasic_uri = "http://stats.xonotic.org";
102 void PlayerStats_PlayerBasic();
103 void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status);
106 float PS_D_NEXTUPDATETIME;
107 float PS_D_LASTGAMECOUNT;
108 #define PS_D_STATUS_ERROR -2
109 #define PS_D_STATUS_IDLE -1
110 #define PS_D_STATUS_WAITING 0
111 #define PS_D_STATUS_RECEIVED 1
112 var float PlayerStats_PlayerDetail_Status = PS_D_STATUS_IDLE;
113 var string autocvar_g_playerstats_playerdetail_uri = "http://stats.xonotic.org/player/me";
114 var float autocvar_g_playerstats_playerdetail_autoupdatetime = 1800; // automatically update every 30 minutes anyway
115 void PlayerStats_PlayerDetail(void);
116 void PlayerStats_PlayerDetail_CheckUpdate(void);
117 void PlayerStats_PlayerDetail_Handler(entity fh, entity p, float status);
121 //// WIP -zykure /////////////////////////////////////////////////////
124 //const string playerinfo_uri = "http://localhost:6543"; // FIXME
126 string PlayerInfo_GetItem(entity e, string item_id);
127 string PlayerInfo_GetItemLocal(string item_id);
129 void PlayerInfo_Init();
131 string autocvar_g_playerinfo_uri;
132 void PlayerInfo_Basic(entity p);
135 string autocvar_g_playerinfo_uri;
136 void PlayerInfo_Details();
140 //void PlayerInfo_Details();