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