]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/playerstats.qh
#include this
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / playerstats.qh
1 #ifndef PLAYERSTATS_H
2 #define PLAYERSTATS_H
3
4 #if defined(CSQC)
5     #include "util-pre.qh"
6     #include "../client/sys-pre.qh"
7     #include "../dpdefs/csprogsdefs.qc"
8     #include "../client/sys-post.qh"
9     #include "../client/Defs.qc"
10     #include "../dpdefs/keycodes.qc"
11     #include "constants.qh"
12     #include "stats.qh"
13     #include "../warpzonelib/anglestransform.qh"
14     #include "../warpzonelib/mathlib.qh"
15     #include "../warpzonelib/common.qh"
16     #include "../warpzonelib/client.qh"
17 #elif defined(MENUQC)
18     #include "util-pre.qh"
19     #include "../menu/sys-pre.qh"
20     #include "../dpdefs/menudefs.qc"
21     #include "../dpdefs/keycodes.qc"
22     #include "../menu/sys-post.qh"
23     #include "../menu/config.qh"
24     #include "../warpzonelib/mathlib.qh"
25     #include "util.qh"
26     #include "test.qh"
27     #include "../menu/oo/base.qh"
28 #elif defined(SVQC)
29     #include "util-pre.qh"
30     #include "../server/sys-pre.qh"
31     #include "../dpdefs/progsdefs.qc"
32     #include "../dpdefs/dpextensions.qc"
33     #include "../server/sys-post.qh"
34     #include "../warpzonelib/anglestransform.qh"
35     #include "../warpzonelib/mathlib.qh"
36     #include "../warpzonelib/common.qh"
37     #include "../warpzonelib/util_server.qh"
38     #include "../warpzonelib/server.qh"
39     #include "constants.qh"
40     #include "stats.qh"
41     #include "teams.qh"
42     #include "util.qh"
43     #include "nades.qh"
44     #include "buffs.qh"
45     #include "test.qh"
46     #include "counting.qh"
47     #include "urllib.qh"
48     #include "command/markup.qh"
49     #include "command/rpn.qh"
50     #include "command/generic.qh"
51     #include "command/shared_defs.qh"
52     #include "net_notice.qh"
53     #include "animdecide.qh"
54     #include "monsters/monsters.qh"
55     #include "monsters/sv_monsters.qh"
56     #include "monsters/spawn.qh"
57     #include "weapons/config.qh"
58     #include "weapons/weapons.qh"
59     #include "../server/weapons/accuracy.qh"
60     #include "../server/weapons/common.qh"
61     #include "../server/weapons/csqcprojectile.qh"
62     #include "../server/weapons/hitplot.qh"
63     #include "../server/weapons/selection.qh"
64     #include "../server/weapons/spawning.qh"
65     #include "../server/weapons/throwing.qh"
66     #include "../server/weapons/tracing.qh"
67     #include "../server/weapons/weaponstats.qh"
68     #include "../server/weapons/weaponsystem.qh"
69     #include "../server/t_items.qh"
70     #include "../server/autocvars.qh"
71     #include "../server/constants.qh"
72     #include "../server/defs.qh"
73     #include "notifications.qh"
74     #include "deathtypes.qh"
75     #include "../server/mutators/mutators_include.qh"
76     #include "../server/tturrets/include/turrets_early.qh"
77     #include "../server/vehicles/vehicles_def.qh"
78     #include "../server/campaign.qh"
79     #include "campaign_common.qh"
80     #include "mapinfo.qh"
81     #include "../server/command/common.qh"
82     #include "../server/command/banning.qh"
83     #include "../server/command/radarmap.qh"
84     #include "../server/command/vote.qh"
85     #include "../server/command/getreplies.qh"
86     #include "../server/command/cmd.qh"
87     #include "../server/command/sv_cmd.qh"
88     #include "csqcmodel_settings.qh"
89     #include "../csqcmodellib/common.qh"
90     #include "../csqcmodellib/sv_model.qh"
91     #include "../server/anticheat.qh"
92     #include "../server/cheats.qh"
93 #endif
94
95 #ifdef SVQC
96 //float PS_PM_IN_DB = -1;   // playerstats_prematch_in_db      // db for info COLLECTED at the beginning of a match
97 float PS_GR_OUT_DB = -1;  // playerstats_gamereport_out_db   // db of info SENT at the end of a match
98 //float PS_GR_IN_DB = -1;   // playerstats_gamereport_in_db    // db for info COLLECTED at the end of a match
99 float PS_B_IN_DB = -1;    // playerstats_playerbasic_in_db   // db for info COLLECTED for basic player info (ELO)
100 #endif
101
102 #ifdef MENUQC
103 float PS_D_IN_DB = -1; // playerstats_playerdetail_in_db  // db for info COLLECTED for detailed player profile display
104 #endif
105
106 #ifdef SVQC
107 //string PS_PM_IN_EVL;   // playerstats_prematch_in_events_last
108 string PS_GR_OUT_TL;   // playerstats_gamereport_out_teams_last
109 string PS_GR_OUT_PL;   // playerstats_gamereport_out_players_last
110 string PS_GR_OUT_EVL;  // playerstats_gamereport_out_events_last
111 //string PS_GR_IN_PL;    // playerstats_gamereport_in_players_last
112 //string PS_GR_IN_EVL;   // playerstats_gamereport_in_events_last
113 //string PS_B_IN_PL;     // playerstats_playerbasic_in_players_last
114 //string PS_B_IN_EVL;    // playerstats_playerbasic_in_events_last
115 #endif
116
117 #ifdef MENUQC
118 string PS_D_IN_EVL; // playerstats_playerdetail_in_events_last
119 #endif
120
121 #ifdef SVQC
122
123 // time the player was alive and kicking
124 const string PLAYERSTATS_ALIVETIME  = "alivetime";
125 const string PLAYERSTATS_AVGLATENCY = "avglatency";
126 const string PLAYERSTATS_WINS = "wins";
127 const string PLAYERSTATS_MATCHES = "matches";
128 const string PLAYERSTATS_JOINS = "joins";
129 const string PLAYERSTATS_SCOREBOARD_VALID = "scoreboardvalid";
130 const string PLAYERSTATS_RANK = "rank";
131 const string PLAYERSTATS_SCOREBOARD_POS = "scoreboardpos";
132
133 const string PLAYERSTATS_TOTAL = "total-";
134 const string PLAYERSTATS_SCOREBOARD = "scoreboard-";
135
136 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3 = "achievement-kill-spree-3";
137 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5 = "achievement-kill-spree-5";
138 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10 = "achievement-kill-spree-10";
139 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_15 = "achievement-kill-spree-15";
140 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_20 = "achievement-kill-spree-20";
141 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_25 = "achievement-kill-spree-25";
142 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_30 = "achievement-kill-spree-30";
143 const string PLAYERSTATS_ACHIEVEMENT_BOTLIKE = "achievement-botlike";
144 const string PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD = "achievement-firstblood";
145 const string PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM = "achievement-firstvictim";
146
147 // delay map switch until this is set
148 float PlayerStats_GameReport_DelayMapVote;
149
150 // call at initialization
151 void PlayerStats_GameReport_Init();
152
153 // add a new player
154 void PlayerStats_GameReport_AddPlayer(entity e);
155
156 // add a new team
157 void PlayerStats_GameReport_AddTeam(float t);
158
159 // add a new event
160 void PlayerStats_GameReport_AddEvent(string event_id);
161
162 // call on each event to track, or at player disconnect OR match end for "global stuff"
163 #define PS_GR_P_ADDVAL(ent,eventid,val) PlayerStats_GameReport_Event(ent.playerstats_id, eventid, val)
164 #define PS_GR_T_ADDVAL(team,eventid,val) PlayerStats_GameReport_Event(sprintf("team#%d", team), eventid, val)
165 float PlayerStats_GameReport_Event(string prefix, string event_id, float value);
166
167 void PlayerStats_GameReport_Accuracy(entity p);
168
169 // call this whenever a player leaves
170 void PlayerStats_GameReport_FinalizePlayer(entity p);
171
172 // call this at the end of the match
173 void PlayerStats_GameReport(float finished);
174
175 void PlayerStats_GameReport_Handler(entity fh, entity pass, float status);
176
177 .string playerstats_id;
178
179 //string autocvar_g_playerstats_uri;
180
181 string autocvar_g_playerstats_gamereport_ladder;
182 string autocvar_g_playerstats_gamereport_uri = "http://stats.xonotic.org/stats/submit";
183
184 const float PS_B_STATUS_ERROR = -2;
185 const float PS_B_STATUS_IDLE = -1;
186 const float PS_B_STATUS_WAITING = 0;
187 const float PS_B_STATUS_RECEIVED = 1;
188 const float PS_B_STATUS_UPDATING = 2;
189 .float playerstats_basicstatus;
190 string autocvar_g_playerstats_playerbasic_uri = "http://stats.xonotic.org";
191
192 void PlayerStats_PlayerBasic(entity joiningplayer, float newrequest);
193 void PlayerStats_PlayerBasic_CheckUpdate(entity joiningplayer);
194 void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status);
195 #endif //SVQC
196 #ifdef MENUQC
197 float PS_D_NEXTUPDATETIME;
198 float PS_D_LASTGAMECOUNT;
199 const float PS_D_STATUS_ERROR = -2;
200 const float PS_D_STATUS_IDLE = -1;
201 const float PS_D_STATUS_WAITING = 0;
202 const float PS_D_STATUS_RECEIVED = 1;
203 float PlayerStats_PlayerDetail_Status = PS_D_STATUS_IDLE;
204 string autocvar_g_playerstats_playerdetail_uri = "http://stats.xonotic.org/player/me";
205 float autocvar_g_playerstats_playerdetail_autoupdatetime = 1800; // automatically update every 30 minutes anyway
206 void PlayerStats_PlayerDetail(void);
207 void PlayerStats_PlayerDetail_CheckUpdate(void);
208 void PlayerStats_PlayerDetail_Handler(entity fh, entity p, float status);
209 #endif
210 #endif