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