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
64
65// call at initialization
67
68// add a new player
70
71// add a new team
73
74// add a new event
75void PlayerStats_GameReport_AddEvent(string event_id);
76
77// call on each event to track, or at player disconnect OR match end for "global stuff"
78#define PlayerStats_GameReport_Event_Player(ent, eventid, val) PlayerStats_GameReport_Event(ent.playerstats_id, eventid, val)
79#define PlayerStats_GameReport_Event_Team(team, eventid, val) PlayerStats_GameReport_Event(sprintf("team#%d", team), eventid, val)
80float PlayerStats_GameReport_Event(string prefix, string event_id, float value);
81
83
84// call this whenever a player leaves
86
87// call this at the end of the match
88void PlayerStats_GameReport(bool finished);
89
90void PlayerStats_GameReport_Handler(entity fh, entity pass, float status);
91
94
95//string autocvar_g_playerstats_uri;
96
98string autocvar_g_playerstats_gamereport_uri = "https://stats.xonotic.org/stats/submit";
99
100const float PS_B_STATUS_ERROR = -2;
101const float PS_B_STATUS_IDLE = -1;
102const float PS_B_STATUS_WAITING = 0;
103const float PS_B_STATUS_RECEIVED = 1;
104const float PS_B_STATUS_UPDATING = 2;
106string autocvar_g_playerstats_playerbasic_uri = "https://stats.xonotic.org";
107string autocvar_g_playerstats_balance_uri = "https://stats.xonotic.org/balance";
112
113void PlayerStats_PlayerBasic(entity joiningplayer, float newrequest);
115void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status);
116#endif //SVQC
117#ifdef MENUQC
120const float PS_D_STATUS_ERROR = -2;
121const float PS_D_STATUS_IDLE = -1;
122const float PS_D_STATUS_WAITING = 0;
123const float PS_D_STATUS_RECEIVED = 1;
125string autocvar_g_playerstats_playerdetail_uri = "https://stats.xonotic.org/player/me";
126float autocvar_g_playerstats_playerdetail_autoupdatetime = 1800; // automatically update every 30 minutes anyway
129void PlayerStats_PlayerDetail_Handler(entity fh, entity p, float status);
130
131#endif
132
133#ifdef GAMEQC
134
135REPLICATE_INIT(int, cvar_cl_allow_uid2name);
136REPLICATE_INIT(bool, cvar_cl_allow_uidranking);
137REPLICATE_INIT(int, cvar_cl_allow_uidtracking);
138
139#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
int autocvar_g_playerstats_balance_stability
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
int autocvar_g_playerstats_balance_maxdifference
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)
int autocvar_g_playerstats_balance_scorefactor
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()
string autocvar_g_playerstats_balance_uri
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
float autocvar_g_playerstats_balance_sigmarange
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
string PlayerStats_GetGametype()
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