]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/world.qh
Merge branch 'master' into z411/bai-server
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / world.qh
1 #pragma once
2
3 #include <common/weapons/_all.qh>
4
5 bool autocvar__sv_init;
6 bool autocvar__endmatch;
7 bool autocvar_g_use_ammunition;
8 bool autocvar_g_jetpack;
9 int autocvar_g_warmup;
10 bool autocvar_g_warmup_allguns;
11 bool autocvar_g_warmup_allow_timeout;
12 #define autocvar_g_weaponarena cvar_string("g_weaponarena")
13 string autocvar_quit_and_redirect;
14 float autocvar_quit_and_redirect_timer;
15 bool autocvar_quit_when_empty;
16 string autocvar_sessionid;
17 bool autocvar_sv_curl_serverpackages_auto;
18 bool autocvar_sv_db_saveasdump;
19 bool autocvar_sv_logscores_bots;
20 bool autocvar_sv_logscores_console;
21 bool autocvar_sv_logscores_file;
22 string autocvar_sv_logscores_filename;
23 float autocvar_sv_mapchange_delay;
24 float autocvar_timelimit_increment;
25 float autocvar_timelimit_decrement;
26 float autocvar_timelimit_min;
27 float autocvar_timelimit_max;
28 float autocvar_timelimit_overtime;
29 int autocvar_timelimit_overtimes;
30 float autocvar_timelimit_suddendeath;
31
32 // z411
33 bool autocvar_sv_jingle_end;
34 string autocvar_sv_jingle_end_list;
35 float autocvar_sv_jingle_end_volume;
36
37 float fragsleft;
38 int fragsleft_last;
39 bool autocvar_sv_mapformat_is_quake3;
40 bool autocvar_sv_mapformat_is_quake2;
41
42 float checkrules_equality;
43 float checkrules_suddendeathwarning;
44 float checkrules_suddendeathend;
45 int checkrules_overtimesadded; //how many overtimes have been already added
46
47 // flag set on worldspawn so that the code knows if it is dedicated or not
48 bool server_is_dedicated;
49
50 int world_initialized;
51
52 string cvar_changes;
53 string cvar_purechanges;
54 float cvar_purechanges_count;
55
56 string modname;
57
58 string autocvar__sv_vote_gametype_custom;
59 string gametype_custom_string;
60
61 string record_type;
62
63 string autocvar_sv_termsofservice_url;
64 // only escape the terms of service url on map change
65 string sv_termsofservice_url_escaped;
66
67 string clientstuff;
68
69 string matchid;
70
71 .string fog;
72
73 string redirection_target;
74
75 string cache_mutatormsg;
76 string cache_lastmutatormsg;
77
78 float default_player_alpha;
79 float default_weapon_alpha;
80
81 float g_pickup_shells_max;
82 float g_pickup_nails_max;
83 float g_pickup_rockets_max;
84 float g_pickup_cells_max;
85 float g_pickup_plasma_max;
86 float g_pickup_fuel_max;
87 float g_pickup_weapons_anyway;
88 float g_weaponarena;
89 WepSet g_weaponarena_weapons;
90 float g_weaponarena_random; // TODO
91 string g_weaponarena_list;
92
93 WepSet start_weapons;
94 WepSet start_weapons_default;
95 WepSet start_weapons_defaultmask;
96 int start_items;
97 float start_ammo_shells;
98 float start_ammo_nails;
99 float start_ammo_rockets;
100 float start_ammo_cells;
101 float start_ammo_plasma;
102 float start_ammo_fuel;
103 /// \brief Number of random start weapons to give to players.
104 int random_start_weapons_count;
105 /// \brief Holds a list of possible random start weapons.
106 string autocvar_g_random_start_weapons;
107 /// \brief Entity that contains amount of ammo to give with random start
108 /// weapons.
109 entity random_start_ammo;
110 float start_health;
111 float start_armorvalue;
112 WepSet warmup_start_weapons;
113 WepSet warmup_start_weapons_default;
114 WepSet warmup_start_weapons_defaultmask;
115 #define WARMUP_START_WEAPONS ((autocvar_g_warmup_allguns == 1) ? (warmup_start_weapons & (weaponsInMap | start_weapons)) : warmup_start_weapons)
116 float warmup_start_ammo_shells;
117 float warmup_start_ammo_nails;
118 float warmup_start_ammo_rockets;
119 float warmup_start_ammo_cells;
120 float warmup_start_ammo_plasma;
121 float warmup_start_ammo_fuel;
122 float warmup_start_health;
123 float warmup_start_armorvalue;
124 float g_weapon_stay;
125
126 float want_weapon(entity weaponinfo, float allguns); // WEAPONTODO: what still needs done?
127
128 float g_grappling_hook;
129 int warmup_stage;
130
131 bool sv_ready_restart_after_countdown;
132
133 .void(entity this) initialize_entity;
134 .int initialize_entity_order;
135 .entity initialize_entity_next;
136 entity initialize_entity_first;
137
138 void InitializeEntitiesRun();
139
140 void InitializeEntity(entity e, void(entity this) func, int order);
141
142 // database
143 float ServerProgsDB;
144 float TemporaryDB;
145
146 .float winning;
147 const int WINNING_NO = 0; // no winner, but time limits may terminate the game
148 const int WINNING_YES = 1; // winner found
149 const int WINNING_NEVER = 2; // no winner, enter overtime if time limit is reached
150 const int WINNING_STARTSUDDENDEATHOVERTIME = 3; // no winner, enter suddendeath overtime NOW
151
152 float WinningCondition_Scores(float limit, float leadlimit);
153 void SetWinners(.float field, float value);
154 void ReadyRestart(bool forceWarmupEnd);
155
156 void DumpStats(float final);
157
158 bool MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundmax, float goodcontents, float badcontents, float badsurfaceflags, int attempts, float maxaboveground, float minviewdistance, bool frompos);
159
160 float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance);
161
162 void CheckRules_World();
163 float RedirectionThink();
164
165 // quake 3 music compatibility
166 .string music;
167 .string noise;
168
169 void readplayerstartcvars();
170
171 void readlevelcvars();
172
173 .vector dropped_origin;
174 void droptofloor(entity this);
175
176 /* z411 for RJZ */
177 bool autocvar_rjz_count_shards = false;
178 bool autocvar_rjz_ranks = false;
179 int  total_shards = 0;
180 void send_TotalShards(entity to);
181 void send_TotalShardsAll();
182
183 IntrusiveList g_moveables;
184 STATIC_INIT(g_moveables) { g_moveables = IL_NEW(); }
185
186 bool observe_blocked_if_eliminated = false; // forbids eliminated players from observing