Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
playerstats.qh
Go to the documentation of this file.
1#pragma once
2
3#ifdef SVQC
4//float PS_PM_IN_DB = -1; // playerstats_prematch_in_db // db for info COLLECTED at the beginning of a match
5int 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
7float PS_B_IN_DB = -1; // playerstats_playerbasic_in_db // db for info COLLECTED for basic player info (SKILL)
8#endif
9
10#ifdef MENUQC
11int PS_D_IN_DB = -1; // playerstats_playerdetail_in_db // db for info COLLECTED for detailed player profile display
12#endif
13
14#ifdef SVQC
15//string PS_PM_IN_EVL; // playerstats_prematch_in_events_last
16string PS_GR_OUT_TL; // playerstats_gamereport_out_teams_last
17string PS_GR_OUT_PL; // playerstats_gamereport_out_players_last
18string 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
23#endif
24
25#ifdef MENUQC
26string PS_D_IN_EVL; // playerstats_playerdetail_in_events_last
27#endif
28
29#ifdef SVQC
30
31// time the player was alive and kicking
32const string PLAYERSTATS_ALIVETIME = "alivetime";
33const string PLAYERSTATS_AVGLATENCY = "avglatency";
34const string PLAYERSTATS_WINS = "wins";
35const string PLAYERSTATS_MATCHES = "matches";
36const string PLAYERSTATS_JOINS = "joins";
37const string PLAYERSTATS_SCOREBOARD_VALID = "scoreboardvalid";
38const string PLAYERSTATS_RANK = "rank";
39const string PLAYERSTATS_SCOREBOARD_POS = "scoreboardpos";
40const string PLAYERSTATS_HANDICAP_GIVEN = "handicapgiven";
41const string PLAYERSTATS_HANDICAP_TAKEN = "handicaptaken";
42
43const string PLAYERSTATS_TOTAL = "total-";
44const string PLAYERSTATS_SCOREBOARD = "scoreboard-";
45const string PLAYERSTATS_ANTICHEAT = "anticheat-";
46
47const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3 = "achievement-kill-spree-3";
48const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5 = "achievement-kill-spree-5";
49const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10 = "achievement-kill-spree-10";
50const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_15 = "achievement-kill-spree-15";
51const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_20 = "achievement-kill-spree-20";
52const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_25 = "achievement-kill-spree-25";
53const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_30 = "achievement-kill-spree-30";
54const string PLAYERSTATS_ACHIEVEMENT_BOTLIKE = "achievement-botlike";
55const string PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD = "achievement-firstblood";
56const string PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM = "achievement-firstvictim";
57
58// delay map switch until this is set
60
62
63// call at initialization
65
66// add a new player
68
69// add a new team
71
72// add a new event
73void PlayerStats_GameReport_AddEvent(string event_id);
74
75// call on each event to track, or at player disconnect OR match end for "global stuff"
76#define PlayerStats_GameReport_Event_Player(ent, eventid, val) PlayerStats_GameReport_Event(ent.playerstats_id, eventid, val)
77#define PlayerStats_GameReport_Event_Team(team, eventid, val) PlayerStats_GameReport_Event(sprintf("team#%d", team), eventid, val)
78float PlayerStats_GameReport_Event(string prefix, string event_id, float value);
79
81
82// call this whenever a player leaves
84
85// call this at the end of the match
86void PlayerStats_GameReport(bool finished);
87
88void PlayerStats_GameReport_Handler(entity fh, entity pass, float status);
89
92
93//string autocvar_g_playerstats_uri;
94
96string autocvar_g_playerstats_gamereport_uri = "https://stats.xonotic.org/stats/submit";
97
98const float PS_B_STATUS_ERROR = -2;
99const float PS_B_STATUS_IDLE = -1;
100const float PS_B_STATUS_WAITING = 0;
101const float PS_B_STATUS_RECEIVED = 1;
102const float PS_B_STATUS_UPDATING = 2;
104string autocvar_g_playerstats_playerbasic_uri = "https://stats.xonotic.org";
105
106void PlayerStats_PlayerBasic(entity joiningplayer, float newrequest);
108void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status);
109#endif //SVQC
110#ifdef MENUQC
113const float PS_D_STATUS_ERROR = -2;
114const float PS_D_STATUS_IDLE = -1;
115const float PS_D_STATUS_WAITING = 0;
116const float PS_D_STATUS_RECEIVED = 1;
118string autocvar_g_playerstats_playerdetail_uri = "https://stats.xonotic.org/player/me";
119float autocvar_g_playerstats_playerdetail_autoupdatetime = 1800; // automatically update every 30 minutes anyway
122void PlayerStats_PlayerDetail_Handler(entity fh, entity p, float status);
123
124#endif
125
126#ifdef GAMEQC
127
128REPLICATE_INIT(int, cvar_cl_allow_uid2name);
129REPLICATE_INIT(bool, cvar_cl_allow_uidranking);
130REPLICATE_INIT(int, cvar_cl_allow_uidtracking);
131
132#endif
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define pass(name, colormin, colormax)
#define REPLICATE_INIT(type, name)
Definition replicate.qh:7
float PlayerStats_GameReport_Event(string prefix, string event_id, float value)
const string PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD
float PS_B_IN_DB
Definition playerstats.qh:7
float scoreboard_pos
void PlayerStats_GameReport(bool finished)
const string PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM
const string PLAYERSTATS_MATCHES
void PlayerStats_PlayerBasic(entity joiningplayer, float newrequest)
const string PLAYERSTATS_ANTICHEAT
const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_25
const string PLAYERSTATS_HANDICAP_TAKEN
const string PLAYERSTATS_WINS
const string PLAYERSTATS_ACHIEVEMENT_BOTLIKE
float PlayerStats_PlayerDetail_Status
void PlayerStats_GameReport_FinalizePlayer(entity p)
float PS_D_LASTGAMECOUNT
const string PLAYERSTATS_JOINS
float playerstats_basicstatus
float PS_D_NEXTUPDATETIME
const string PLAYERSTATS_SCOREBOARD
const float PS_B_STATUS_RECEIVED
void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
string PS_D_IN_EVL
string autocvar_g_playerstats_gamereport_uri
void PlayerStats_PlayerDetail_Handler(entity fh, entity p, float status)
const float PS_B_STATUS_ERROR
const float PS_B_STATUS_UPDATING
void PlayerStats_PlayerBasic_CheckUpdate(entity joiningplayer)
const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_20
const float PS_D_STATUS_WAITING
void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status)
void PlayerStats_GameReport_Accuracy(entity p)
const float PS_D_STATUS_RECEIVED
void PlayerStats_GameReport_AddPlayer(entity e)
string autocvar_g_playerstats_playerdetail_uri
const float PS_B_STATUS_WAITING
const string PLAYERSTATS_SCOREBOARD_VALID
string autocvar_g_playerstats_playerbasic_uri
string playerstats_id
void PlayerStats_GameReport_Init()
const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3
void PlayerStats_GameReport_Reset_All()
void PlayerStats_PlayerDetail_CheckUpdate()
const string PLAYERSTATS_HANDICAP_GIVEN
void PlayerStats_GameReport_AddTeam(float t)
const string PLAYERSTATS_TOTAL
const string PLAYERSTATS_RANK
const float PS_D_STATUS_ERROR
const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_30
int PS_D_IN_DB
const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10
float autocvar_g_playerstats_playerdetail_autoupdatetime
string autocvar_g_playerstats_gamereport_ladder
const string PLAYERSTATS_AVGLATENCY
string PS_GR_OUT_EVL
const string PLAYERSTATS_ALIVETIME
const string PLAYERSTATS_SCOREBOARD_POS
string PS_GR_OUT_PL
const float PS_B_STATUS_IDLE
void PlayerStats_PlayerDetail()
void PlayerStats_GameReport_AddEvent(string event_id)
string PS_GR_OUT_TL
bool PlayerStats_GameReport_DelayMapVote
const float PS_D_STATUS_IDLE
const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_15
const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5
int PS_GR_OUT_DB
Definition playerstats.qh:5