2 Copyright (C) 1996-1997 Id Software, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 typedef struct server_static_s
27 /// number of svs.clients slots (updated by maxplayers command)
28 int maxclients, maxclients_next;
30 struct client_s *clients;
31 /// episode completion information
33 /// cleared when at SV_SpawnServer
34 qbool changelevel_issued;
36 char serverinfo[MAX_SERVERINFO_STRING];
39 unsigned char *csqc_progdata;
40 size_t csqc_progsize_deflated;
41 unsigned char *csqc_progdata_deflated;
43 // independent server thread (when running client)
44 qbool threaded; // true if server is running on separate thread
45 qbool volatile threadstop;
50 //=============================================================================
52 typedef enum server_state_e {ss_loading, ss_active} server_state_t;
54 #define MAX_CONNECTFLOODADDRESSES 16
55 #define MAX_GETSTATUSFLOODADDRESSES 128
56 typedef struct server_floodaddress_s
59 lhnetaddress_t address;
61 server_floodaddress_t;
63 typedef struct server_s
65 /// false if only a net client
70 /// handle connections specially
73 /// one of the PROTOCOL_ values
74 protocolversion_t protocol;
79 unsigned int spawnframe; // signals SV_Frame() to reset its timers
84 float perf_offset_avg;
85 float perf_offset_max;
86 float perf_offset_sdev;
87 // temporary performance data accumulators
88 float perf_acc_realtime;
89 float perf_acc_sleeptime;
91 float perf_acc_offset;
92 float perf_acc_offset_squared;
93 float perf_acc_offset_max;
94 int perf_acc_offset_samples;
96 // used by PF_checkclient
100 // crc of clientside progs at time of level start
101 int csqc_progcrc; // -1 = no progs
102 int csqc_progsize; // -1 = no progs
103 char csqc_progname[MAX_QPATH]; // copied from csqc_progname at level start
105 /// collision culling data
109 char name[64]; // %s followed by entrance name
110 // variants of map name
111 char worldbasename[MAX_QPATH]; // %s
112 char worldname[MAX_QPATH]; // maps/%s.bsp
113 char worldnamenoextension[MAX_QPATH]; // maps/%s
114 struct model_s *worldmodel;
116 // LadyHavoc: precaches are now MAX_QPATH rather than a pointer
117 // updated by SV_ModelIndex
118 char model_precache[MAX_MODELS][MAX_QPATH];
119 struct model_s *models[MAX_MODELS];
121 // LadyHavoc: precaches are now MAX_QPATH rather than a pointer
122 // updated by SV_SoundIndex
123 char sound_precache[MAX_SOUNDS][MAX_QPATH];
124 char lightstyles[MAX_LIGHTSTYLES][64];
125 /// some actions are only valid during load
126 server_state_t state;
129 unsigned char datagram_buf[NET_MAXMESSAGE];
131 // copied to all clients at end of frame
132 sizebuf_t reliable_datagram;
133 unsigned char reliable_datagram_buf[NET_MAXMESSAGE];
136 /// LadyHavoc: increased signon message buffer from 8192
137 unsigned char signon_buf[NET_MAXMESSAGE];
139 /// connection flood blocking
140 /// note this is in server_t rather than server_static_t so that it is
141 /// reset on each map command (such as New Game in singleplayer)
142 server_floodaddress_t connectfloodaddresses[MAX_CONNECTFLOODADDRESSES];
143 server_floodaddress_t getstatusfloodaddresses[MAX_GETSTATUSFLOODADDRESSES];
145 qbool particleeffectnamesloaded;
146 char particleeffectname[MAX_PARTICLEEFFECTNAME][MAX_QPATH];
148 int writeentitiestoclient_stats_culled_pvs;
149 int writeentitiestoclient_stats_culled_trace;
150 int writeentitiestoclient_stats_visibleentities;
151 int writeentitiestoclient_stats_totalentities;
152 int writeentitiestoclient_cliententitynumber;
153 int writeentitiestoclient_clientnumber;
154 sizebuf_t *writeentitiestoclient_msg;
155 vec3_t writeentitiestoclient_eyes[MAX_CLIENTNETWORKEYES];
156 int writeentitiestoclient_numeyes;
157 int writeentitiestoclient_pvsbytes;
158 unsigned char writeentitiestoclient_pvs[MAX_MAP_LEAFS/8];
159 const entity_state_t *writeentitiestoclient_sendstates[MAX_EDICTS];
160 unsigned short writeentitiestoclient_csqcsendstates[MAX_EDICTS];
163 entity_state_t sendentities[MAX_EDICTS];
164 entity_state_t *sendentitiesindex[MAX_EDICTS];
166 int sententitiesmark;
167 int sententities[MAX_EDICTS];
168 int sententitiesconsideration[MAX_EDICTS];
170 /// legacy support for self.Version based csqc entity networking
171 unsigned char csqcentityversion[MAX_EDICTS]; // legacy
174 #define NUM_CSQCENTITIES_PER_FRAME 256
175 typedef struct csqcentityframedb_s
179 unsigned short entno[NUM_CSQCENTITIES_PER_FRAME];
180 int sendflags[NUM_CSQCENTITIES_PER_FRAME];
181 } csqcentityframedb_t;
183 #define NUM_SPAWN_PARMS 16
185 typedef struct client_s
187 /// false = empty client slot
189 /// false = don't do ClientDisconnect on drop
190 qbool clientconnectcalled;
191 /// false = don't allow spawn
193 /// false = don't allow begin
195 /// false = don't send datagrams
197 /// 1 = send svc_serverinfo and advance to 2, 2 doesn't send, then advances to 0 (allowing unlimited sending) when prespawn is received
200 /// requested rate in bytes per second
203 /// temporarily exceed rate by this amount of bytes
206 /// realtime this client connected
209 /// keepalive messages must be sent periodically during signon
210 double keepalivetime;
212 /// communications handle
213 netconn_t *netconnection;
215 unsigned int movesequence;
216 signed char movement_count[NETGRAPH_PACKETS];
217 unsigned int movement_highestsequence_seen; // not the same as movesequence if prediction is off
220 /// intended motion calced from cmd
223 /// PRVM_EDICT_NUM(clientnum+1)
226 /// LadyHavoc: can be used for prediction or whatever...
229 /// this is used by sv_clmovement_minping code
230 double clmovement_disabletimeout;
231 /// this is used by sv_clmovement_inputtimeout code
232 float clmovement_inputtimeout;
234 /// spawn parms are carried from level to level
235 prvm_vec_t spawn_parms[NUM_SPAWN_PARMS];
237 // properties that are sent across the network only when changed
238 char name[MAX_SCOREBOARDNAME], old_name[MAX_SCOREBOARDNAME];
239 int colors, old_colors;
240 int frags, old_frags;
241 char playermodel[MAX_QPATH], old_model[MAX_QPATH];
242 char playerskin[MAX_QPATH], old_skin[MAX_QPATH];
244 /// netaddress support
245 char netaddress[MAX_QPATH];
248 float visibletime[MAX_EDICTS];
250 // scope is whether an entity is currently being networked to this client
251 // sendflags is what properties have changed on the entity since the last
252 // update that was sent
254 unsigned char csqcentityscope[MAX_EDICTS];
255 unsigned int csqcentitysendflags[MAX_EDICTS];
257 #define NUM_CSQCENTITYDB_FRAMES 256
258 csqcentityframedb_t csqcentityframehistory[NUM_CSQCENTITYDB_FRAMES];
259 int csqcentityframehistory_next;
260 int csqcentityframe_lastreset;
262 /// prevent animated names
265 /// latest received clc_ackframe (used to detect packet loss)
268 /// cache weaponmodel name lookups
269 char weaponmodel[MAX_QPATH];
270 int weaponmodelindex;
272 /// clientcamera (entity to use as camera)
275 entityframe_database_t *entitydatabase;
276 entityframe4_database_t *entitydatabase4;
277 entityframe5_database_t *entitydatabase5;
279 // delta compression of stats
280 unsigned char statsdeltabits[(MAX_CL_STATS+7)/8];
281 int stats[MAX_CL_STATS];
283 unsigned char unreliablemsg_data[NET_MAXMESSAGE];
284 sizebuf_t unreliablemsg;
285 int unreliablemsg_splitpoints;
286 int unreliablemsg_splitpoint[NET_MAXMESSAGE/16];
288 // information on an active download if any
289 qfile_t *download_file;
290 int download_expectedposition; ///< next position the client should ack
291 qbool download_started;
292 char download_name[MAX_QPATH];
293 qbool download_deflate;
296 qbool fixangle_angles_set;
297 vec3_t fixangle_angles;
300 qfile_t *sv_demo_file;
302 // number of skipped entity frames
303 // if it exceeds a limit, an empty entity frame is sent
304 int num_skippedentityframes;
306 // last sent move sequence
307 // if the move sequence changed, an empty entity frame is sent
308 unsigned int lastmovesequence;
312 //=============================================================================
314 // edict->movetype values
315 #define MOVETYPE_NONE 0 ///< never moves
316 #define MOVETYPE_ANGLENOCLIP 1
317 #define MOVETYPE_ANGLECLIP 2
318 #define MOVETYPE_WALK 3 ///< gravity
319 #define MOVETYPE_STEP 4 ///< gravity, special edge handling
320 #define MOVETYPE_FLY 5
321 #define MOVETYPE_TOSS 6 ///< gravity
322 #define MOVETYPE_PUSH 7 ///< no clip to world, push and crush
323 #define MOVETYPE_NOCLIP 8
324 #define MOVETYPE_FLYMISSILE 9 ///< extra size to monsters
325 #define MOVETYPE_BOUNCE 10
326 #define MOVETYPE_BOUNCEMISSILE 11 ///< bounce w/o gravity
327 #define MOVETYPE_FOLLOW 12 ///< track movement of aiment
328 #define MOVETYPE_FAKEPUSH 13 ///< tenebrae's push that doesn't push
329 #define MOVETYPE_PHYSICS 32 ///< indicates this object is physics controlled
330 #define MOVETYPE_FLY_WORLDONLY 33 ///< like MOVETYPE_FLY, but uses MOVE_WORLDONLY for all its traces; objects of this movetype better be SOLID_NOT or SOLID_TRIGGER please, or else...
331 #define MOVETYPE_USER_FIRST 128 ///< user defined movetypes
332 #define MOVETYPE_USER_LAST 191
334 // edict->solid values
335 #define SOLID_NOT 0 ///< no interaction with other objects
336 #define SOLID_TRIGGER 1 ///< touch on edge, but not blocking
337 #define SOLID_BBOX 2 ///< touch on edge, block
338 #define SOLID_SLIDEBOX 3 ///< touch on edge, but not an onground
339 #define SOLID_BSP 4 ///< bsp clip, touch on edge, block
340 // LadyHavoc: corpse code
341 #define SOLID_CORPSE 5 ///< same as SOLID_BBOX, except it behaves as SOLID_NOT against SOLID_SLIDEBOX objects (players/monsters)
342 // LadyHavoc: physics
343 // VorteX: now these fields are deprecated, as geomtype is more flexible
344 #define SOLID_PHYSICS_BOX 32 ///< physics object (mins, maxs, mass, origin, axis_forward, axis_left, axis_up, velocity, spinvelocity)
345 #define SOLID_PHYSICS_SPHERE 33 ///< physics object (mins, maxs, mass, origin, axis_forward, axis_left, axis_up, velocity, spinvelocity)
346 #define SOLID_PHYSICS_CAPSULE 34 ///< physics object (mins, maxs, mass, origin, axis_forward, axis_left, axis_up, velocity, spinvelocity)
347 #define SOLID_PHYSICS_TRIMESH 35 ///< physics object (mins, maxs, mass, origin, axis_forward, axis_left, axis_up, velocity, spinvelocity)
348 #define SOLID_PHYSICS_CYLINDER 36 ///< physics object (mins, maxs, mass, origin, axis_forward, axis_left, axis_up, velocity, spinvelocity)
350 // edict->deadflag values
362 #define FL_CONVEYOR 4
364 #define FL_INWATER 16
365 #define FL_MONSTER 32
366 #define FL_GODMODE 64
367 #define FL_NOTARGET 128
369 #define FL_ONGROUND 512
370 #define FL_PARTIALGROUND 1024 ///< not all corners are valid
371 #define FL_WATERJUMP 2048 ///< player jumping out of water
372 #define FL_JUMPRELEASED 4096 ///< for jump debouncing
374 #define SPAWNFLAG_NOT_EASY 256
375 #define SPAWNFLAG_NOT_MEDIUM 512
376 #define SPAWNFLAG_NOT_HARD 1024
377 #define SPAWNFLAG_NOT_DEATHMATCH 2048
379 //============================================================================
382 extern cvar_t deathmatch;
383 extern cvar_t fraglimit;
384 extern cvar_t gamecfg;
385 extern cvar_t noexit;
386 extern cvar_t nomonsters;
387 extern cvar_t pausable;
388 extern cvar_t pr_checkextension;
389 extern cvar_t samelevel;
390 extern cvar_t saved1;
391 extern cvar_t saved2;
392 extern cvar_t saved3;
393 extern cvar_t saved4;
394 extern cvar_t savedgamecfg;
395 extern cvar_t scratch1;
396 extern cvar_t scratch2;
397 extern cvar_t scratch3;
398 extern cvar_t scratch4;
400 extern cvar_t host_timescale;
401 extern cvar_t sv_accelerate;
402 extern cvar_t sv_aim;
403 extern cvar_t sv_airaccel_qw;
404 extern cvar_t sv_airaccel_sideways_friction;
405 extern cvar_t sv_airaccelerate;
406 extern cvar_t sv_airstopaccelerate;
407 extern cvar_t sv_airstrafeaccelerate;
408 extern cvar_t sv_maxairstrafespeed;
409 extern cvar_t sv_airstrafeaccel_qw;
410 extern cvar_t sv_aircontrol;
411 extern cvar_t sv_aircontrol_power;
412 extern cvar_t sv_aircontrol_penalty;
413 extern cvar_t sv_airspeedlimit_nonqw;
414 extern cvar_t sv_allowdownloads;
415 extern cvar_t sv_allowdownloads_archive;
416 extern cvar_t sv_allowdownloads_config;
417 extern cvar_t sv_allowdownloads_dlcache;
418 extern cvar_t sv_allowdownloads_inarchive;
419 extern cvar_t sv_areagrid_link_SOLID_NOT;
420 extern cvar_t sv_areagrid_mingridsize;
421 extern cvar_t sv_checkforpacketsduringsleep;
422 extern cvar_t sv_clmovement_enable;
423 extern cvar_t sv_clmovement_minping;
424 extern cvar_t sv_clmovement_minping_disabletime;
425 extern cvar_t sv_clmovement_inputtimeout;
426 extern cvar_t sv_clmovement_maxnetfps;
427 extern cvar_t sv_cullentities_nevercullbmodels;
428 extern cvar_t sv_cullentities_pvs;
429 extern cvar_t sv_cullentities_stats;
430 extern cvar_t sv_cullentities_trace;
431 extern cvar_t sv_cullentities_trace_delay;
432 extern cvar_t sv_cullentities_trace_enlarge;
433 extern cvar_t sv_cullentities_trace_prediction;
434 extern cvar_t sv_cullentities_trace_samples;
435 extern cvar_t sv_cullentities_trace_samples_extra;
436 extern cvar_t sv_debugmove;
437 extern cvar_t sv_echobprint;
438 extern cvar_t sv_edgefriction;
439 extern cvar_t sv_entpatch;
440 extern cvar_t sv_freezenonclients;
441 extern cvar_t sv_friction;
442 extern cvar_t sv_gameplayfix_blowupfallenzombies;
443 extern cvar_t sv_gameplayfix_consistentplayerprethink;
444 extern cvar_t sv_gameplayfix_delayprojectiles;
445 extern cvar_t sv_gameplayfix_droptofloorstartsolid;
446 extern cvar_t sv_gameplayfix_droptofloorstartsolid_nudgetocorrect;
447 extern cvar_t sv_gameplayfix_easierwaterjump;
448 extern cvar_t sv_gameplayfix_findradiusdistancetobox;
449 extern cvar_t sv_gameplayfix_gravityunaffectedbyticrate;
450 extern cvar_t sv_gameplayfix_grenadebouncedownslopes;
451 extern cvar_t sv_gameplayfix_multiplethinksperframe;
452 extern cvar_t sv_gameplayfix_noairborncorpse;
453 extern cvar_t sv_gameplayfix_noairborncorpse_allowsuspendeditems;
454 extern cvar_t sv_gameplayfix_nudgeoutofsolid;
455 extern cvar_t sv_gameplayfix_nudgeoutofsolid_separation;
456 extern cvar_t sv_gameplayfix_q2airaccelerate;
457 extern cvar_t sv_gameplayfix_nogravityonground;
458 extern cvar_t sv_gameplayfix_setmodelrealbox;
459 extern cvar_t sv_gameplayfix_slidemoveprojectiles;
460 extern cvar_t sv_gameplayfix_stepdown;
461 extern cvar_t sv_gameplayfix_stepmultipletimes;
462 extern cvar_t sv_gameplayfix_nostepmoveonsteepslopes;
463 extern cvar_t sv_gameplayfix_swiminbmodels;
464 extern cvar_t sv_gameplayfix_upwardvelocityclearsongroundflag;
465 extern cvar_t sv_gameplayfix_downtracesupportsongroundflag;
466 extern cvar_t sv_gameplayfix_q1bsptracelinereportstexture;
467 extern cvar_t sv_gameplayfix_unstickplayers;
468 extern cvar_t sv_gameplayfix_unstickentities;
469 extern cvar_t sv_gameplayfix_fixedcheckwatertransition;
470 extern cvar_t sv_gravity;
471 extern cvar_t sv_idealpitchscale;
472 extern cvar_t sv_jumpstep;
473 extern cvar_t sv_jumpvelocity;
474 extern cvar_t sv_legacy_bbox_expand;
475 extern cvar_t sv_maxairspeed;
476 extern cvar_t sv_maxrate;
477 extern cvar_t sv_maxspeed;
478 extern cvar_t sv_maxvelocity;
479 extern cvar_t sv_nostep;
480 extern cvar_t sv_playerphysicsqc;
481 extern cvar_t sv_progs;
482 extern cvar_t sv_protocolname;
483 extern cvar_t sv_random_seed;
484 extern cvar_t host_limitlocal;
485 extern cvar_t sv_sound_land;
486 extern cvar_t sv_sound_watersplash;
487 extern cvar_t sv_stepheight;
488 extern cvar_t sv_stopspeed;
489 extern cvar_t sv_wallfriction;
490 extern cvar_t sv_wateraccelerate;
491 extern cvar_t sv_waterfriction;
492 extern cvar_t sv_areadebug;
493 extern cvar_t sys_ticrate;
494 extern cvar_t teamplay;
496 extern cvar_t timelimit;
498 extern mempool_t *sv_mempool;
500 /// persistant server info
501 extern server_static_t svs;
505 extern client_t *host_client;
507 //===========================================================
510 double SV_Frame(double time);
511 void SV_Shutdown(void);
513 int SV_IsLocalServer(void);
515 void SV_StartParticle (vec3_t org, vec3_t dir, int color, int count);
516 void SV_StartEffect (vec3_t org, int modelindex, int startframe, int framecount, int framerate);
517 void SV_StartSound (prvm_edict_t *entity, int channel, const char *sample, int volume, float attenuation, qbool reliable, float speed);
518 void SV_StartPointSound (vec3_t origin, const char *sample, int volume, float attenuation, float speed);
520 void SV_ConnectClient (int clientnum, netconn_t *netconnection);
521 void SV_DropClient (qbool leaving, const char *reason, ... );
523 void SV_ClientCommands(const char *fmt, ...) DP_FUNC_PRINTF(1);
525 void SV_SendClientMessages(void);
527 void SV_ReadClientMessage(void);
529 // precachemode values:
530 // 0 = fail if not precached,
531 // 1 = warn if not found and precache if possible
533 int SV_ModelIndex(const char *s, int precachemode);
534 int SV_SoundIndex(const char *s, int precachemode);
536 int SV_ParticleEffectIndex(const char *name);
538 model_t *SV_GetModelByIndex(int modelindex);
539 model_t *SV_GetModelFromEdict(prvm_edict_t *ed);
541 void SV_SetIdealPitch (void);
543 void SV_AddUpdates (void);
545 void SV_PlayerPhysics (void);
547 void SV_ClientPrint(const char *msg);
548 void SV_ClientPrintf(const char *fmt, ...) DP_FUNC_PRINTF(1);
549 void SV_BroadcastPrint(const char *msg);
550 void SV_BroadcastPrintf(const char *fmt, ...) DP_FUNC_PRINTF(1);
552 void SV_Physics (void);
553 void SV_Physics_ClientMove (void);
554 //void SV_Physics_ClientEntity (prvm_edict_t *ent);
556 qbool SV_PlayerCheckGround (prvm_edict_t *ent);
557 qbool SV_CheckBottom (prvm_edict_t *ent);
558 qbool SV_movestep (prvm_edict_t *ent, vec3_t move, qbool relink, qbool noenemy, qbool settrace);
560 /*! Needs to be called any time an entity changes origin, mins, maxs, or solid
561 * sets ent->v.absmin and ent->v.absmax
562 * call TouchAreaGrid as well to fire triggers that overlap the box
564 void SV_LinkEdict(prvm_edict_t *ent);
565 void SV_LinkEdict_TouchAreaGrid(prvm_edict_t *ent);
566 void SV_LinkEdict_TouchAreaGrid_Call(prvm_edict_t *touch, prvm_edict_t *ent); // if we detected a touch from another source
568 /*! move an entity that is stuck by small amounts in various directions to try to nudge it back into the collision hull
569 * returns true if it found a better place
571 qbool SV_UnstickEntity (prvm_edict_t *ent);
573 /// calculates hitsupercontentsmask for a generic qc entity
574 int SV_GenericHitSuperContentsMask(const prvm_edict_t *edict);
575 /// traces a box move against worldmodel and all entities in the specified area
576 trace_t SV_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend);
577 trace_t SV_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend);
578 trace_t SV_TracePoint(const vec3_t start, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask);
579 int SV_EntitiesInBox(const vec3_t mins, const vec3_t maxs, int maxedicts, prvm_edict_t **resultedicts);
581 qbool SV_CanSeeBox(int numsamples, vec_t eyejitter, vec_t enlarge, vec_t entboxexpand, vec3_t eye, vec3_t entboxmins, vec3_t entboxmaxs);
583 void SV_MarkWriteEntityStateToClient(entity_state_t *s, client_t *client);
585 void SV_SendServerinfo(client_t *client);
586 void SV_WriteEntitiesToClient(client_t *client, prvm_edict_t *clent, sizebuf_t *msg, int maxsize);
587 void SV_AddCameraEyes(void);
589 int SV_PointSuperContents(const vec3_t point);
591 void SV_FlushBroadcastMessages(void);
592 void SV_WriteClientdataToMessage (client_t *client, prvm_edict_t *ent, sizebuf_t *msg, int *stats);
594 void VM_SV_MoveToGoal(prvm_prog_t *prog);
596 void SV_ApplyClientMove (void);
597 void SV_SaveSpawnparms (void);
599 void SV_SpawnServer (const char *map);
601 void SV_CheckVelocity (prvm_edict_t *ent);
603 void SV_SetupVM(void);
605 const char *SV_TimingReport(char *buf, size_t buflen); ///< for output in SV_Status_f
607 int SV_GetPitchSign(prvm_prog_t *prog, prvm_edict_t *ent);
608 void SV_GetEntityMatrix(prvm_prog_t *prog, prvm_edict_t *ent, matrix4x4_t *out, qbool viewmatrix);
610 void SV_StartThread(void);
611 void SV_StopThread(void);
612 #define SV_LockThreadMutex() (void)(svs.threaded ? Thread_LockMutex(svs.threadmutex) : 0)
613 #define SV_UnlockThreadMutex() (void)(svs.threaded ? Thread_UnlockMutex(svs.threadmutex) : 0)
615 void VM_CustomStats_Clear(void);
616 void VM_SV_UpdateCustomStats(client_t *client, prvm_edict_t *ent, sizebuf_t *msg, int *stats);
617 void SV_Name(int clientnum);
618 void SV_InitOperatorCommands(void);
620 void SV_Savegame_to(prvm_prog_t *prog, const char *name);
621 void SV_Savegame_f(cmd_state_t *cmd);
622 void SV_Loadgame_f(cmd_state_t *cmd);
624 void SV_PreSpawn_f(cmd_state_t *cmd);
625 void SV_Spawn_f(cmd_state_t *cmd);
626 void SV_Begin_f(cmd_state_t *cmd);
628 qbool SV_VM_ConsoleCommand(const char *text, size_t textlen);