]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/playerstats.qh
Merge remote-tracking branch 'origin/master' into TimePath/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 #endif
7
8 #ifdef MENUQC
9 float PS_D_IN_DB; // playerstats_playerdetail_in_db  // db for info COLLECTED for detailed player profile display
10 #endif
11
12 #ifdef SVQC
13 //string PS_PM_IN_EVL;   // playerstats_prematch_in_events_last
14 string PS_GR_OUT_TL;   // playerstats_gamereport_out_teams_last
15 string PS_GR_OUT_PL;   // playerstats_gamereport_out_players_las
16 string PS_GR_OUT_EVL;  // playerstats_gamereport_out_events_last
17 //string PS_GR_IN_PL;    // playerstats_gamereport_in_players_last
18 //string PS_GR_IN_EVL;   // playerstats_gamereport_in_events_last
19 //string PS_B_IN_PL;     // playerstats_playerbasic_in_players_last
20 //string PS_B_IN_EVL;    // playerstats_playerbasic_in_events_last
21 #endif
22
23 #ifdef MENUQC
24 string PS_D_IN_EVL; // playerstats_playerdetail_in_events_last
25 #endif
26
27 #ifdef SVQC
28
29 // time the player was alive and kicking
30 const string PLAYERSTATS_ALIVETIME  = "alivetime";
31 const string PLAYERSTATS_AVGLATENCY = "avglatency";
32 const string PLAYERSTATS_WINS = "wins";
33 const string PLAYERSTATS_MATCHES = "matches";
34 const string PLAYERSTATS_JOINS = "joins";
35 const string PLAYERSTATS_SCOREBOARD_VALID = "scoreboardvalid";
36 const string PLAYERSTATS_RANK = "rank";
37 const string PLAYERSTATS_SCOREBOARD_POS = "scoreboardpos";
38
39 const string PLAYERSTATS_TOTAL = "total-";
40 const string PLAYERSTATS_SCOREBOARD = "scoreboard-";
41
42 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3 = "achievement-kill-spree-3";
43 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5 = "achievement-kill-spree-5";
44 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10 = "achievement-kill-spree-10";
45 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_15 = "achievement-kill-spree-15";
46 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_20 = "achievement-kill-spree-20";
47 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_25 = "achievement-kill-spree-25";
48 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_30 = "achievement-kill-spree-30";
49 const string PLAYERSTATS_ACHIEVEMENT_BOTLIKE = "achievement-botlike";
50 const string PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD = "achievement-firstblood";
51 const string PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM = "achievement-firstvictim";
52
53 // delay map switch until this is set
54 float PlayerStats_GameReport_DelayMapVote;
55
56 // call at initialization
57 void PlayerStats_GameReport_Init();
58
59 // add a new player
60 void PlayerStats_GameReport_AddPlayer(entity e);
61
62 // add a new team
63 void PlayerStats_GameReport_AddTeam(float t);
64
65 // add a new event
66 void PlayerStats_GameReport_AddEvent(string event_id);
67
68 // call on each event to track, or at player disconnect OR match end for "global stuff"
69 #define PS_GR_P_ADDVAL(ent,eventid,val) PlayerStats_GameReport_Event(ent.playerstats_id, eventid, val)
70 #define PS_GR_T_ADDVAL(team,eventid,val) PlayerStats_GameReport_Event(sprintf("team#%d", team), eventid, val)
71 float PlayerStats_GameReport_Event(string prefix, string event_id, float value);
72
73 void PlayerStats_GameReport_Accuracy(entity p);
74
75 // call this whenever a player leaves
76 void PlayerStats_GameReport_FinalizePlayer(entity p);
77
78 // call this at the end of the match
79 void PlayerStats_GameReport(float finished);
80
81 void PlayerStats_GameReport_Handler(entity fh, entity pass, float status);
82
83 .string playerstats_id;
84
85 //string autocvar_g_playerstats_uri;
86
87 string autocvar_g_playerstats_gamereport_ladder;
88 var string autocvar_g_playerstats_gamereport_uri = "http://stats.xonotic.org/stats/submit";
89
90 #define PS_B_STATUS_ERROR -2
91 #define PS_B_STATUS_IDLE -1
92 #define PS_B_STATUS_WAITING 0
93 #define PS_B_STATUS_RECEIVED 1
94 #define PS_B_STATUS_UPDATING 2
95 .float playerstats_basicstatus;
96 var string autocvar_g_playerstats_playerbasic_uri = "http://stats.xonotic.org";
97
98 void PlayerStats_PlayerBasic(entity joiningplayer, float newrequest);
99 void PlayerStats_PlayerBasic_CheckUpdate(entity joiningplayer);
100 void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status);
101 #endif //SVQC
102 #ifdef MENUQC
103 float PS_D_NEXTUPDATETIME;
104 float PS_D_LASTGAMECOUNT;
105 #define PS_D_STATUS_ERROR -2
106 #define PS_D_STATUS_IDLE -1
107 #define PS_D_STATUS_WAITING 0
108 #define PS_D_STATUS_RECEIVED 1
109 var float PlayerStats_PlayerDetail_Status = PS_D_STATUS_IDLE;
110 var string autocvar_g_playerstats_playerdetail_uri = "http://stats.xonotic.org/player/me";
111 var float autocvar_g_playerstats_playerdetail_autoupdatetime = 1800; // automatically update every 30 minutes anyway
112 void PlayerStats_PlayerDetail(void);
113 void PlayerStats_PlayerDetail_CheckUpdate(void);
114 void PlayerStats_PlayerDetail_Handler(entity fh, entity p, float status);
115 #endif