]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/playerstats.qh
Merge remote-tracking branch 'origin/master' into samual/combined_updates
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / playerstats.qh
1 #ifdef SVQC
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=
9 #endif
10
11 #ifdef MENUQC
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
14 #endif
15
16 #ifdef SVQC
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
25 #endif
26
27 #ifdef MENUQC
28 string PS_D_IN_EVL; // playerstats_playerdetail_in_events_last
29 #endif
30
31 #ifdef SVQC
32
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";
42
43 const string PLAYERSTATS_TOTAL = "total-";
44 const string PLAYERSTATS_SCOREBOARD = "scoreboard-";
45
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";
56
57 // delay map switch until this is set
58 float PlayerStats_GameReport_DelayMapVote;
59
60 // call at initialization
61 void PlayerStats_GameReport_Init();
62
63 // add a new player
64 void PlayerStats_GameReport_AddPlayer(entity e);
65
66 // add a new team
67 void PlayerStats_GameReport_AddTeam(float t);
68
69 // add a new event
70 void PlayerStats_GameReport_AddEvent(string event_id);
71
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);
76
77 void PlayerStats_GameReport_Accuracy(entity p);
78
79 // call this whenever a player leaves
80 void PlayerStats_GameReport_FinalizePlayer(entity p);
81
82 // call this at the end of the match
83 void PlayerStats_GameReport(float finished);
84
85 void PlayerStats_GameReport_Handler(entity fh, entity pass, float status);
86
87 .string playerstats_id;
88
89 //string autocvar_g_playerstats_uri;
90
91 string autocvar_g_playerstats_gamereport_ladder;
92 var string autocvar_g_playerstats_gamereport_uri = "http://stats.xonotic.org/stats/submit";
93 var string autocvar_g_playerstats_playerbasic_uri = "http://stats.xonotic.org";
94
95 void PlayerStats_PlayerBasic();
96 void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status);
97 #endif //SVQC
98 #ifdef MENUQC
99 #define PS_D_STATUS_ERROR -2
100 #define PS_D_STATUS_IDLE -1
101 #define PS_D_STATUS_WAITING 0
102 #define PS_D_STATUS_RECEIVED 1
103 var float PlayerStats_PlayerDetail_Status = PS_D_STATUS_IDLE;
104 var string autocvar_g_playerstats_playerdetail_uri = "http://stats.xonotic.org/player/me";
105 void PlayerStats_PlayerDetail();
106 void PlayerStats_PlayerDetail_Handler(entity fh, entity p, float status);
107 #endif
108
109
110 /*
111 //// WIP -zykure /////////////////////////////////////////////////////
112
113
114 //const string playerinfo_uri = "http://localhost:6543"; // FIXME
115
116 string PlayerInfo_GetItem(entity e, string item_id);
117 string PlayerInfo_GetItemLocal(string item_id);
118
119 void PlayerInfo_Init();
120 #ifdef SVQC
121 string autocvar_g_playerinfo_uri;
122 void PlayerInfo_Basic(entity p);
123 #endif
124 #ifdef MENUQC
125 string autocvar_g_playerinfo_uri;
126 void PlayerInfo_Details();
127 #endif
128 #ifdef CSQC
129
130 //void PlayerInfo_Details();
131 #endif
132 */