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