]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/client/main.qh
Merge branch 'master' into z411/bai-server
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / main.qh
1 #pragma once
2
3 #include <common/constants.qh>
4 #include <common/weapons/_all.qh>
5 #include <common/items/inventory.qh>
6
7 // z411
8 string hostname_full;
9 string motd_permanent;
10 int sv_timer_countdown;
11
12 bool autocvar_cl_db_saveasdump;
13 bool autocvar_cl_spawn_event_particles;
14 bool autocvar_cl_spawn_event_sound = 1;
15 // float autocvar_cl_spawn_point_model;
16 bool autocvar_cl_spawn_point_particles;
17 float autocvar_cl_spawn_point_dist_max = 1200;
18 bool autocvar_cl_unpress_zoom_on_spawn = true;
19 bool autocvar_cl_unpress_zoom_on_death = true;
20 bool autocvar_cl_unpress_zoom_on_weapon_switch = true;
21 bool autocvar_cl_unpress_attack_on_weapon_switch = false;
22 bool autocvar_hud_showbinds;
23 bool autocvar_hud_showbinds_limit;
24 bool autocvar__hud_showbinds_reload;
25 bool autocvar_developer_csqcentities;
26 bool autocvar_cl_race_cptimes_onlyself; // TODO: move to race gamemode
27 bool autocvar_cl_race_cptimes_showself = false;
28 bool autocvar_cl_welcome = true;
29
30 // Map coordinate base calculations need these
31 vector mi_center;
32 vector mi_scale;
33 // Minimap
34 string minimapname;
35
36 bool postinit;
37 entity gametype;
38 // temporary hack
39 #define ISGAMETYPE(NAME) (gametype == MAPINFO_TYPE_##NAME)
40
41 float FONT_USER = 8;
42
43
44 void PostInit();
45
46 void Ent_Remove(entity this);
47
48 void Gamemode_Init();
49
50 entity players;
51 entity teams;
52 float team_count; // real teams
53
54 void AuditLists();
55
56 float RegisterPlayer(entity player);
57
58 void RemovePlayer(entity player);
59
60 void MoveToLast(entity e);
61
62 float RegisterTeam(entity Team);
63
64 void RemoveTeam(entity Team);
65
66 entity GetTeam(int Team, bool add);
67
68 bool SetTeam(entity pl, int Team);
69
70 vector hud_fontsize;
71
72 float RANKINGS_RECEIVED_CNT;
73 float RANKINGS_DISPLAY_CNT;
74 string grecordholder[RANKINGS_CNT];
75 float grecordtime[RANKINGS_CNT];
76
77 entity playerslots[255]; // 255 is engine limit on maxclients
78 entity teamslots[17];    // 17 teams (including "spectator team")
79 .bool gotscores;
80 .entity owner;
81 .bool ready;
82 .bool eliminated;
83
84 IntrusiveList g_drawables;
85 IntrusiveList g_drawables_2d;
86 IntrusiveList g_radarlinks;
87 IntrusiveList g_radaricons;
88 STATIC_INIT(main)
89 {
90         g_drawables = IL_NEW();
91         g_drawables_2d = IL_NEW();
92         g_radarlinks = IL_NEW();
93         g_radaricons = IL_NEW();
94 }
95
96 .void(entity) draw;
97 .void(entity) draw2d;
98 .void(entity) entremove;
99 float drawframetime;
100 vector view_origin, view_forward, view_right, view_up;
101
102 .float renderflags; // engine field
103
104 bool button_zoom;
105 bool spectatorbutton_zoom;
106 bool button_attack2;
107
108 float current_viewzoom;
109 float zoomin_effect;
110 bool warmup_stage;
111
112 string hostname;
113 string welcome_msg;
114 float welcome_msg_menu_check_maxtime;
115 void Welcome_Message_Show_Try();
116
117 void Fog_Force();
118
119 string _getcommandkey(string text, string command, bool forcename);
120 #define getcommandkey(cmd_name, command) _getcommandkey(cmd_name, command, false)
121 #define getcommandkey_forcename(cmd_name, command) _getcommandkey(cmd_name, command, true)
122
123 void Release_Common_Keys();
124
125 string vote_called_vote;
126 bool ready_waiting;
127 bool ready_waiting_for_me;
128 bool vote_waiting;
129 bool vote_waiting_for_me;
130
131 float current_zoomfraction;
132
133 int vid_width, vid_height;
134 float vid_pixelheight;
135
136 float camera_active;            // Demo camera is active if set to true
137 float chase_active_backup;
138 float camera_roll;
139 vector camera_direction;
140
141 const float ALPHA_MIN_VISIBLE = 0.003;
142
143 float armorblockpercent;
144 float damagepush_speedfactor;
145
146 //hooks
147 int calledhooks;
148 const int HOOK_START =    1;
149 const int HOOK_END =      2;
150
151 .float ping, ping_packetloss, ping_movementloss;
152
153 float g_trueaim_minrange;
154
155 int hud;
156 float view_quality;
157
158 int num_spectators;
159 const int MAX_SPECTATORS = 7;
160 int spectatorlist[MAX_SPECTATORS];
161
162 int framecount;
163
164 float GetSpeedUnitFactor(int speed_unit);
165 string GetSpeedUnit(int speed_unit);
166
167 .int enttype; // entity type sent from server
168 .int sv_entnum; // entity number sent from server
169
170 // z411 accuracy info
171 .float accuracy_frags[REGISTRY_MAX(Weapons)];
172 .float accuracy_hit[REGISTRY_MAX(Weapons)];
173 .float accuracy_cnt_hit[REGISTRY_MAX(Weapons)];
174 .float accuracy_cnt_fired[REGISTRY_MAX(Weapons)];
175
176 .int team;
177 .int team_size;
178 .int countrycode;
179 .string rank;
180
181 int binddb;
182
183 // Spectating
184 // -1 - observing
185 // 0 - playing
186 // >0 - id of spectated player
187 float spectatee_status;
188 float spectatee_status_changed_time;
189
190 #define player_currententnum (spectatee_status > 0 ? spectatee_status : player_localnum + 1)
191
192 // short mapname
193 string shortmapname;
194
195 // database for misc stuff
196 int tempdb;
197 int ClientProgsDB;
198 vector hook_shotorigin[4]; // WEAPONTODO
199 vector lightning_shotorigin[4]; // TODO: unused
200
201 float serverprevtime, serverdeltatime;
202
203 float ticrate;
204
205 int serverflags;
206