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