vkQuake2 doxygen  1.0 dev
qcommon.h File Reference

Go to the source code of this file.

Classes

struct  sizebuf_s
 
struct  netadr_t
 
struct  netchan_t
 

Macros

#define VERSION   3.21
 
#define BASEDIRNAME   "baseq2"
 
#define BUILDSTRING   "NON-WIN32"
 
#define CPUSTRING   "NON-WIN32"
 
#define PROTOCOL_VERSION   34
 
#define PORT_MASTER   27900
 
#define PORT_CLIENT   27901
 
#define PORT_SERVER   27910
 
#define UPDATE_BACKUP   16
 
#define UPDATE_MASK   (UPDATE_BACKUP-1)
 
#define PS_M_TYPE   (1<<0)
 
#define PS_M_ORIGIN   (1<<1)
 
#define PS_M_VELOCITY   (1<<2)
 
#define PS_M_TIME   (1<<3)
 
#define PS_M_FLAGS   (1<<4)
 
#define PS_M_GRAVITY   (1<<5)
 
#define PS_M_DELTA_ANGLES   (1<<6)
 
#define PS_VIEWOFFSET   (1<<7)
 
#define PS_VIEWANGLES   (1<<8)
 
#define PS_KICKANGLES   (1<<9)
 
#define PS_BLEND   (1<<10)
 
#define PS_FOV   (1<<11)
 
#define PS_WEAPONINDEX   (1<<12)
 
#define PS_WEAPONFRAME   (1<<13)
 
#define PS_RDFLAGS   (1<<14)
 
#define CM_ANGLE1   (1<<0)
 
#define CM_ANGLE2   (1<<1)
 
#define CM_ANGLE3   (1<<2)
 
#define CM_FORWARD   (1<<3)
 
#define CM_SIDE   (1<<4)
 
#define CM_UP   (1<<5)
 
#define CM_BUTTONS   (1<<6)
 
#define CM_IMPULSE   (1<<7)
 
#define SND_VOLUME   (1<<0)
 
#define SND_ATTENUATION   (1<<1)
 
#define SND_POS   (1<<2)
 
#define SND_ENT   (1<<3)
 
#define SND_OFFSET   (1<<4)
 
#define DEFAULT_SOUND_PACKET_VOLUME   1.0
 
#define DEFAULT_SOUND_PACKET_ATTENUATION   1.0
 
#define U_ORIGIN1   (1<<0)
 
#define U_ORIGIN2   (1<<1)
 
#define U_ANGLE2   (1<<2)
 
#define U_ANGLE3   (1<<3)
 
#define U_FRAME8   (1<<4)
 
#define U_EVENT   (1<<5)
 
#define U_REMOVE   (1<<6)
 
#define U_MOREBITS1   (1<<7)
 
#define U_NUMBER16   (1<<8)
 
#define U_ORIGIN3   (1<<9)
 
#define U_ANGLE1   (1<<10)
 
#define U_MODEL   (1<<11)
 
#define U_RENDERFX8   (1<<12)
 
#define U_EFFECTS8   (1<<14)
 
#define U_MOREBITS2   (1<<15)
 
#define U_SKIN8   (1<<16)
 
#define U_FRAME16   (1<<17)
 
#define U_RENDERFX16   (1<<18)
 
#define U_EFFECTS16   (1<<19)
 
#define U_MODEL2   (1<<20)
 
#define U_MODEL3   (1<<21)
 
#define U_MODEL4   (1<<22)
 
#define U_MOREBITS3   (1<<23)
 
#define U_OLDORIGIN   (1<<24)
 
#define U_SKIN16   (1<<25)
 
#define U_SOUND   (1<<26)
 
#define U_SOLID   (1<<27)
 
#define EXEC_NOW   0
 
#define EXEC_INSERT   1
 
#define EXEC_APPEND   2
 
#define PORT_ANY   -1
 
#define MAX_MSGLEN   1400
 
#define PACKET_HEADER   10
 
#define OLD_AVG   0.99
 
#define MAX_LATENT   32
 
#define ERR_FATAL   0
 
#define ERR_DROP   1
 
#define ERR_QUIT   2
 
#define EXEC_NOW   0
 
#define EXEC_INSERT   1
 
#define EXEC_APPEND   2
 
#define PRINT_ALL   0
 
#define PRINT_DEVELOPER   1
 
#define NUMVERTEXNORMALS   162
 

Typedefs

typedef struct sizebuf_s sizebuf_t
 
typedef void(* xcommand_t) (void)
 

Enumerations

enum  svc_ops_e {
  svc_bad, svc_muzzleflash, svc_muzzleflash2, svc_temp_entity,
  svc_layout, svc_inventory, svc_nop, svc_disconnect,
  svc_reconnect, svc_sound, svc_print, svc_stufftext,
  svc_serverdata, svc_configstring, svc_spawnbaseline, svc_centerprint,
  svc_download, svc_playerinfo, svc_packetentities, svc_deltapacketentities,
  svc_frame
}
 
enum  clc_ops_e {
  clc_bad, clc_nop, clc_move, clc_userinfo,
  clc_stringcmd
}
 
enum  netadrtype_t {
  NA_LOOPBACK, NA_BROADCAST, NA_IP, NA_IPX,
  NA_BROADCAST_IPX
}
 
enum  netsrc_t { NS_CLIENT, NS_SERVER }
 

Functions

void SZ_Init (sizebuf_t *buf, byte *data, int length)
 
void SZ_Clear (sizebuf_t *buf)
 
voidSZ_GetSpace (sizebuf_t *buf, int length)
 
void SZ_Write (sizebuf_t *buf, void *data, int length)
 
void SZ_Print (sizebuf_t *buf, char *data)
 
void MSG_WriteChar (sizebuf_t *sb, int c)
 
void MSG_WriteByte (sizebuf_t *sb, int c)
 
void MSG_WriteShort (sizebuf_t *sb, int c)
 
void MSG_WriteLong (sizebuf_t *sb, int c)
 
void MSG_WriteFloat (sizebuf_t *sb, float f)
 
void MSG_WriteString (sizebuf_t *sb, char *s)
 
void MSG_WriteCoord (sizebuf_t *sb, float f)
 
void MSG_WritePos (sizebuf_t *sb, vec3_t pos)
 
void MSG_WriteAngle (sizebuf_t *sb, float f)
 
void MSG_WriteAngle16 (sizebuf_t *sb, float f)
 
void MSG_WriteDeltaUsercmd (sizebuf_t *sb, struct usercmd_s *from, struct usercmd_s *cmd)
 
void MSG_WriteDeltaEntity (struct entity_state_s *from, struct entity_state_s *to, sizebuf_t *msg, qboolean force, qboolean newentity)
 
void MSG_WriteDir (sizebuf_t *sb, vec3_t vector)
 
void MSG_BeginReading (sizebuf_t *sb)
 
int MSG_ReadChar (sizebuf_t *sb)
 
int MSG_ReadByte (sizebuf_t *sb)
 
int MSG_ReadShort (sizebuf_t *sb)
 
int MSG_ReadLong (sizebuf_t *sb)
 
float MSG_ReadFloat (sizebuf_t *sb)
 
char * MSG_ReadString (sizebuf_t *sb)
 
char * MSG_ReadStringLine (sizebuf_t *sb)
 
float MSG_ReadCoord (sizebuf_t *sb)
 
void MSG_ReadPos (sizebuf_t *sb, vec3_t pos)
 
float MSG_ReadAngle (sizebuf_t *sb)
 
float MSG_ReadAngle16 (sizebuf_t *sb)
 
void MSG_ReadDeltaUsercmd (sizebuf_t *sb, struct usercmd_s *from, struct usercmd_s *cmd)
 
void MSG_ReadDir (sizebuf_t *sb, vec3_t vector)
 
void MSG_ReadData (sizebuf_t *sb, void *buffer, int size)
 
short BigShort (short l)
 
short LittleShort (short l)
 
int BigLong (int l)
 
int LittleLong (int l)
 
float BigFloat (float l)
 
float LittleFloat (float l)
 
int COM_Argc (void)
 
char * COM_Argv (int arg)
 
void COM_ClearArgv (int arg)
 
int COM_CheckParm (char *parm)
 
void COM_AddParm (char *parm)
 
void COM_Init (void)
 
void COM_InitArgv (int argc, char **argv)
 
char * CopyString (char *in)
 
void Info_Print (char *s)
 
void CRC_Init (unsigned short *crcvalue)
 
void CRC_ProcessByte (unsigned short *crcvalue, byte data)
 
unsigned short CRC_Value (unsigned short crcvalue)
 
unsigned short CRC_Block (byte *start, int count)
 
void Cbuf_Init (void)
 
void Cbuf_AddText (char *text)
 
void Cbuf_InsertText (char *text)
 
void Cbuf_ExecuteText (int exec_when, char *text)
 
void Cbuf_AddEarlyCommands (qboolean clear)
 
qboolean Cbuf_AddLateCommands (void)
 
void Cbuf_Execute (void)
 
void Cbuf_CopyToDefer (void)
 
void Cbuf_InsertFromDefer (void)
 
void Cmd_Init (void)
 
void Cmd_AddCommand (char *cmd_name, xcommand_t function)
 
void Cmd_RemoveCommand (char *cmd_name)
 
qboolean Cmd_Exists (char *cmd_name)
 
char * Cmd_CompleteCommand (char *partial)
 
int Cmd_Argc (void)
 
char * Cmd_Argv (int arg)
 
char * Cmd_Args (void)
 
void Cmd_TokenizeString (char *text, qboolean macroExpand)
 
void Cmd_ExecuteString (char *text)
 
void Cmd_ForwardToServer (void)
 
cvar_tCvar_Get (char *var_name, char *value, int flags)
 
cvar_tCvar_Set (char *var_name, char *value)
 
cvar_tCvar_ForceSet (char *var_name, char *value)
 
cvar_tCvar_FullSet (char *var_name, char *value, int flags)
 
void Cvar_SetValue (char *var_name, float value)
 
float Cvar_VariableValue (char *var_name)
 
char * Cvar_VariableString (char *var_name)
 
char * Cvar_CompleteVariable (char *partial)
 
void Cvar_GetLatchedVars (void)
 
qboolean Cvar_Command (void)
 
void Cvar_WriteVariables (char *path)
 
void Cvar_Init (void)
 
char * Cvar_Userinfo (void)
 
char * Cvar_Serverinfo (void)
 
void NET_Init (void)
 
void NET_Shutdown (void)
 
void NET_Config (qboolean multiplayer)
 
qboolean NET_GetPacket (netsrc_t sock, netadr_t *net_from, sizebuf_t *net_message)
 
void NET_SendPacket (netsrc_t sock, int length, void *data, netadr_t to)
 
qboolean NET_CompareAdr (netadr_t a, netadr_t b)
 
qboolean NET_CompareBaseAdr (netadr_t a, netadr_t b)
 
qboolean NET_IsLocalAddress (netadr_t adr)
 
char * NET_AdrToString (netadr_t a)
 
qboolean NET_StringToAdr (char *s, netadr_t *a)
 
void NET_Sleep (int msec)
 
void Netchan_Init (void)
 
void Netchan_Setup (netsrc_t sock, netchan_t *chan, netadr_t adr, int qport)
 
qboolean Netchan_NeedReliable (netchan_t *chan)
 
void Netchan_Transmit (netchan_t *chan, int length, byte *data)
 
void Netchan_OutOfBand (int net_socket, netadr_t adr, int length, byte *data)
 
void Netchan_OutOfBandPrint (int net_socket, netadr_t adr, char *format,...)
 
qboolean Netchan_Process (netchan_t *chan, sizebuf_t *msg)
 
qboolean Netchan_CanReliable (netchan_t *chan)
 
cmodel_tCM_LoadMap (char *name, qboolean clientload, unsigned *checksum)
 
cmodel_tCM_InlineModel (char *name)
 
int CM_NumClusters (void)
 
int CM_NumInlineModels (void)
 
char * CM_EntityString (void)
 
int CM_HeadnodeForBox (vec3_t mins, vec3_t maxs)
 
int CM_PointContents (vec3_t p, int headnode)
 
int CM_TransformedPointContents (vec3_t p, int headnode, vec3_t origin, vec3_t angles)
 
trace_t CM_BoxTrace (vec3_t start, vec3_t end, vec3_t mins, vec3_t maxs, int headnode, int brushmask)
 
trace_t CM_TransformedBoxTrace (vec3_t start, vec3_t end, vec3_t mins, vec3_t maxs, int headnode, int brushmask, vec3_t origin, vec3_t angles)
 
byteCM_ClusterPVS (int cluster)
 
byteCM_ClusterPHS (int cluster)
 
int CM_PointLeafnum (vec3_t p)
 
int CM_BoxLeafnums (vec3_t mins, vec3_t maxs, int *list, int listsize, int *topnode)
 
int CM_LeafContents (int leafnum)
 
int CM_LeafCluster (int leafnum)
 
int CM_LeafArea (int leafnum)
 
void CM_SetAreaPortalState (int portalnum, qboolean open)
 
qboolean CM_AreasConnected (int area1, int area2)
 
int CM_WriteAreaBits (byte *buffer, int area)
 
qboolean CM_HeadnodeVisible (int headnode, byte *visbits)
 
void CM_WritePortalState (FILE *f)
 
void CM_ReadPortalState (FILE *f)
 
void Pmove (pmove_t *pmove)
 
void FS_InitFilesystem (void)
 
void FS_SetGamedir (char *dir)
 
char * FS_Gamedir (void)
 
char * FS_NextPath (char *prevpath)
 
void FS_ExecAutoexec (void)
 
int FS_FOpenFile (char *filename, FILE **file)
 
void FS_FCloseFile (FILE *f)
 
int FS_LoadFile (char *path, void **buffer)
 
void FS_Read (void *buffer, int len, FILE *f)
 
void FS_FreeFile (void *buffer)
 
void FS_CreatePath (char *path)
 
void Com_BeginRedirect (int target, char *buffer, int buffersize, void(*flush))
 
void Com_EndRedirect (void)
 
void Com_Printf (char *fmt,...)
 
void Com_DPrintf (char *fmt,...)
 
void Com_Error (int code, char *fmt,...)
 
void Com_Quit (void)
 
int Com_ServerState (void)
 
void Com_SetServerState (int state)
 
unsigned Com_BlockChecksum (void *buffer, int length)
 
byte COM_BlockSequenceCRCByte (byte *base, int length, int sequence)
 
float frand (void)
 
float crand (void)
 
void Z_Free (void *ptr)
 
voidZ_Malloc (int size)
 
voidZ_TagMalloc (int size, int tag)
 
void Z_FreeTags (int tag)
 
void Qcommon_Init (int argc, char **argv)
 
void Qcommon_Frame (int msec)
 
void Qcommon_Shutdown (void)
 
void SCR_DebugGraph (float value, int color)
 
void Sys_Init (void)
 
void Sys_AppActivate (void)
 
void Sys_UnloadGame (void)
 
voidSys_GetGameAPI (void *parms)
 
char * Sys_ConsoleInput (void)
 
void Sys_ConsoleOutput (char *string)
 
void Sys_SendKeyEvents (void)
 
void Sys_Error (char *error,...)
 
void Sys_Quit (void)
 
char * Sys_GetClipboardData (void)
 
void Sys_CopyProtect (void)
 
void CL_Init (void)
 
void CL_Drop (void)
 
void CL_Shutdown (void)
 
void CL_Frame (int msec)
 
void Con_Print (char *text)
 
void SCR_BeginLoadingPlaque (void)
 
void SV_Init (void)
 
void SV_Shutdown (char *finalmsg, qboolean reconnect)
 
void SV_Frame (int msec)
 

Variables

qboolean bigendien
 
cvar_tcvar_vars
 
qboolean userinfo_modified
 
netadr_t net_from
 
sizebuf_t net_message
 
byte net_message_buffer [MAX_MSGLEN]
 
float pm_airaccelerate
 
cvar_tdeveloper
 
cvar_tdedicated
 
cvar_thost_speeds
 
cvar_tlog_stats
 
FILE * log_stats_file
 
int time_before_game
 
int time_after_game
 
int time_before_ref
 
int time_after_ref
 
vec3_t bytedirs [NUMVERTEXNORMALS]
 

Macro Definition Documentation

◆ BASEDIRNAME

#define BASEDIRNAME   "baseq2"

Definition at line 28 of file qcommon.h.

◆ BUILDSTRING

#define BUILDSTRING   "NON-WIN32"

Definition at line 85 of file qcommon.h.

◆ CM_ANGLE1

#define CM_ANGLE1   (1<<0)

Definition at line 289 of file qcommon.h.

◆ CM_ANGLE2

#define CM_ANGLE2   (1<<1)

Definition at line 290 of file qcommon.h.

◆ CM_ANGLE3

#define CM_ANGLE3   (1<<2)

Definition at line 291 of file qcommon.h.

◆ CM_BUTTONS

#define CM_BUTTONS   (1<<6)

Definition at line 295 of file qcommon.h.

◆ CM_FORWARD

#define CM_FORWARD   (1<<3)

Definition at line 292 of file qcommon.h.

◆ CM_IMPULSE

#define CM_IMPULSE   (1<<7)

Definition at line 296 of file qcommon.h.

◆ CM_SIDE

#define CM_SIDE   (1<<4)

Definition at line 293 of file qcommon.h.

◆ CM_UP

#define CM_UP   (1<<5)

Definition at line 294 of file qcommon.h.

◆ CPUSTRING

#define CPUSTRING   "NON-WIN32"

Definition at line 86 of file qcommon.h.

◆ DEFAULT_SOUND_PACKET_ATTENUATION

#define DEFAULT_SOUND_PACKET_ATTENUATION   1.0

Definition at line 308 of file qcommon.h.

◆ DEFAULT_SOUND_PACKET_VOLUME

#define DEFAULT_SOUND_PACKET_VOLUME   1.0

Definition at line 307 of file qcommon.h.

◆ ERR_DROP

#define ERR_DROP   1

Definition at line 744 of file qcommon.h.

◆ ERR_FATAL

#define ERR_FATAL   0

Definition at line 743 of file qcommon.h.

◆ ERR_QUIT

#define ERR_QUIT   2

Definition at line 745 of file qcommon.h.

◆ EXEC_APPEND [1/2]

#define EXEC_APPEND   2

Definition at line 749 of file qcommon.h.

◆ EXEC_APPEND [2/2]

#define EXEC_APPEND   2

Definition at line 749 of file qcommon.h.

◆ EXEC_INSERT [1/2]

#define EXEC_INSERT   1

Definition at line 748 of file qcommon.h.

◆ EXEC_INSERT [2/2]

#define EXEC_INSERT   1

Definition at line 748 of file qcommon.h.

◆ EXEC_NOW [1/2]

#define EXEC_NOW   0

Definition at line 747 of file qcommon.h.

◆ EXEC_NOW [2/2]

#define EXEC_NOW   0

Definition at line 747 of file qcommon.h.

◆ MAX_LATENT

#define MAX_LATENT   32

Definition at line 580 of file qcommon.h.

◆ MAX_MSGLEN

#define MAX_MSGLEN   1400

Definition at line 544 of file qcommon.h.

◆ NUMVERTEXNORMALS

#define NUMVERTEXNORMALS   162

Definition at line 792 of file qcommon.h.

◆ OLD_AVG

#define OLD_AVG   0.99

Definition at line 578 of file qcommon.h.

◆ PACKET_HEADER

#define PACKET_HEADER   10

Definition at line 545 of file qcommon.h.

◆ PORT_ANY

#define PORT_ANY   -1

Definition at line 542 of file qcommon.h.

◆ PORT_CLIENT

#define PORT_CLIENT   27901

Definition at line 202 of file qcommon.h.

◆ PORT_MASTER

#define PORT_MASTER   27900

Definition at line 201 of file qcommon.h.

◆ PORT_SERVER

#define PORT_SERVER   27910

Definition at line 203 of file qcommon.h.

◆ PRINT_ALL

#define PRINT_ALL   0

Definition at line 751 of file qcommon.h.

◆ PRINT_DEVELOPER

#define PRINT_DEVELOPER   1

Definition at line 752 of file qcommon.h.

◆ PROTOCOL_VERSION

#define PROTOCOL_VERSION   34

Definition at line 197 of file qcommon.h.

◆ PS_BLEND

#define PS_BLEND   (1<<10)

Definition at line 278 of file qcommon.h.

◆ PS_FOV

#define PS_FOV   (1<<11)

Definition at line 279 of file qcommon.h.

◆ PS_KICKANGLES

#define PS_KICKANGLES   (1<<9)

Definition at line 277 of file qcommon.h.

◆ PS_M_DELTA_ANGLES

#define PS_M_DELTA_ANGLES   (1<<6)

Definition at line 273 of file qcommon.h.

◆ PS_M_FLAGS

#define PS_M_FLAGS   (1<<4)

Definition at line 271 of file qcommon.h.

◆ PS_M_GRAVITY

#define PS_M_GRAVITY   (1<<5)

Definition at line 272 of file qcommon.h.

◆ PS_M_ORIGIN

#define PS_M_ORIGIN   (1<<1)

Definition at line 268 of file qcommon.h.

◆ PS_M_TIME

#define PS_M_TIME   (1<<3)

Definition at line 270 of file qcommon.h.

◆ PS_M_TYPE

#define PS_M_TYPE   (1<<0)

Definition at line 267 of file qcommon.h.

◆ PS_M_VELOCITY

#define PS_M_VELOCITY   (1<<2)

Definition at line 269 of file qcommon.h.

◆ PS_RDFLAGS

#define PS_RDFLAGS   (1<<14)

Definition at line 282 of file qcommon.h.

◆ PS_VIEWANGLES

#define PS_VIEWANGLES   (1<<8)

Definition at line 276 of file qcommon.h.

◆ PS_VIEWOFFSET

#define PS_VIEWOFFSET   (1<<7)

Definition at line 275 of file qcommon.h.

◆ PS_WEAPONFRAME

#define PS_WEAPONFRAME   (1<<13)

Definition at line 281 of file qcommon.h.

◆ PS_WEAPONINDEX

#define PS_WEAPONINDEX   (1<<12)

Definition at line 280 of file qcommon.h.

◆ SND_ATTENUATION

#define SND_ATTENUATION   (1<<1)

Definition at line 302 of file qcommon.h.

◆ SND_ENT

#define SND_ENT   (1<<3)

Definition at line 304 of file qcommon.h.

◆ SND_OFFSET

#define SND_OFFSET   (1<<4)

Definition at line 305 of file qcommon.h.

◆ SND_POS

#define SND_POS   (1<<2)

Definition at line 303 of file qcommon.h.

◆ SND_VOLUME

#define SND_VOLUME   (1<<0)

Definition at line 301 of file qcommon.h.

◆ U_ANGLE1

#define U_ANGLE1   (1<<10)

Definition at line 327 of file qcommon.h.

◆ U_ANGLE2

#define U_ANGLE2   (1<<2)

Definition at line 317 of file qcommon.h.

◆ U_ANGLE3

#define U_ANGLE3   (1<<3)

Definition at line 318 of file qcommon.h.

◆ U_EFFECTS16

#define U_EFFECTS16   (1<<19)

Definition at line 337 of file qcommon.h.

◆ U_EFFECTS8

#define U_EFFECTS8   (1<<14)

Definition at line 330 of file qcommon.h.

◆ U_EVENT

#define U_EVENT   (1<<5)

Definition at line 320 of file qcommon.h.

◆ U_FRAME16

#define U_FRAME16   (1<<17)

Definition at line 335 of file qcommon.h.

◆ U_FRAME8

#define U_FRAME8   (1<<4)

Definition at line 319 of file qcommon.h.

◆ U_MODEL

#define U_MODEL   (1<<11)

Definition at line 328 of file qcommon.h.

◆ U_MODEL2

#define U_MODEL2   (1<<20)

Definition at line 338 of file qcommon.h.

◆ U_MODEL3

#define U_MODEL3   (1<<21)

Definition at line 339 of file qcommon.h.

◆ U_MODEL4

#define U_MODEL4   (1<<22)

Definition at line 340 of file qcommon.h.

◆ U_MOREBITS1

#define U_MOREBITS1   (1<<7)

Definition at line 322 of file qcommon.h.

◆ U_MOREBITS2

#define U_MOREBITS2   (1<<15)

Definition at line 331 of file qcommon.h.

◆ U_MOREBITS3

#define U_MOREBITS3   (1<<23)

Definition at line 341 of file qcommon.h.

◆ U_NUMBER16

#define U_NUMBER16   (1<<8)

Definition at line 325 of file qcommon.h.

◆ U_OLDORIGIN

#define U_OLDORIGIN   (1<<24)

Definition at line 344 of file qcommon.h.

◆ U_ORIGIN1

#define U_ORIGIN1   (1<<0)

Definition at line 315 of file qcommon.h.

◆ U_ORIGIN2

#define U_ORIGIN2   (1<<1)

Definition at line 316 of file qcommon.h.

◆ U_ORIGIN3

#define U_ORIGIN3   (1<<9)

Definition at line 326 of file qcommon.h.

◆ U_REMOVE

#define U_REMOVE   (1<<6)

Definition at line 321 of file qcommon.h.

◆ U_RENDERFX16

#define U_RENDERFX16   (1<<18)

Definition at line 336 of file qcommon.h.

◆ U_RENDERFX8

#define U_RENDERFX8   (1<<12)

Definition at line 329 of file qcommon.h.

◆ U_SKIN16

#define U_SKIN16   (1<<25)

Definition at line 345 of file qcommon.h.

◆ U_SKIN8

#define U_SKIN8   (1<<16)

Definition at line 334 of file qcommon.h.

◆ U_SOLID

#define U_SOLID   (1<<27)

Definition at line 347 of file qcommon.h.

◆ U_SOUND

#define U_SOUND   (1<<26)

Definition at line 346 of file qcommon.h.

◆ UPDATE_BACKUP

#define UPDATE_BACKUP   16

Definition at line 207 of file qcommon.h.

◆ UPDATE_MASK

#define UPDATE_MASK   (UPDATE_BACKUP-1)

Definition at line 209 of file qcommon.h.

◆ VERSION

#define VERSION   3.21

Definition at line 26 of file qcommon.h.

Typedef Documentation

◆ sizebuf_t

typedef struct sizebuf_s sizebuf_t

◆ xcommand_t

typedef void(* xcommand_t) (void)

Definition at line 419 of file qcommon.h.

Enumeration Type Documentation

◆ clc_ops_e

enum clc_ops_e
Enumerator
clc_bad 
clc_nop 
clc_move 
clc_userinfo 
clc_stringcmd 

Definition at line 254 of file qcommon.h.

255 {
256  clc_bad,
257  clc_nop,
258  clc_move, // [[usercmd_t]
259  clc_userinfo, // [[userinfo string]
260  clc_stringcmd // [string] message
261 };

◆ netadrtype_t

Enumerator
NA_LOOPBACK 
NA_BROADCAST 
NA_IP 
NA_IPX 
NA_BROADCAST_IPX 

Definition at line 547 of file qcommon.h.

◆ netsrc_t

enum netsrc_t
Enumerator
NS_CLIENT 
NS_SERVER 

Definition at line 549 of file qcommon.h.

◆ svc_ops_e

enum svc_ops_e
Enumerator
svc_bad 
svc_muzzleflash 
svc_muzzleflash2 
svc_temp_entity 
svc_layout 
svc_inventory 
svc_nop 
svc_disconnect 
svc_reconnect 
svc_sound 
svc_print 
svc_stufftext 
svc_serverdata 
svc_configstring 
svc_spawnbaseline 
svc_centerprint 
svc_download 
svc_playerinfo 
svc_packetentities 
svc_deltapacketentities 
svc_frame 

Definition at line 220 of file qcommon.h.

221 {
222  svc_bad,
223 
224  // these ops are known to the game dll
228  svc_layout,
230 
231  // the rest are private to the client and server
232  svc_nop,
235  svc_sound, // <see code>
236  svc_print, // [byte] id [string] null terminated string
237  svc_stufftext, // [string] stuffed into client's console buffer, should be \n terminated
238  svc_serverdata, // [long] protocol ...
239  svc_configstring, // [short] [string]
241  svc_centerprint, // [string] to put in center of the screen
242  svc_download, // [short] size [size bytes]
243  svc_playerinfo, // variable
244  svc_packetentities, // [...]
245  svc_deltapacketentities, // [...]
246  svc_frame
247 };

Function Documentation

◆ BigFloat()

float BigFloat ( float  l)

Definition at line 949 of file q_shared.c.

949 {return _BigFloat(l);}

◆ BigLong()

int BigLong ( int  l)

Definition at line 947 of file q_shared.c.

947 {return _BigLong(l);}

◆ BigShort()

short BigShort ( short  l)

◆ Cbuf_AddEarlyCommands()

void Cbuf_AddEarlyCommands ( qboolean  clear)

Definition at line 263 of file cmd.c.

264 {
265  int i;
266  char *s;
267 
268  for (i=0 ; i<COM_Argc() ; i++)
269  {
270  s = COM_Argv(i);
271  if (strcmp (s, "+set"))
272  continue;
273  Cbuf_AddText (va("set %s %s\n", COM_Argv(i+1), COM_Argv(i+2)));
274  if (clear)
275  {
276  COM_ClearArgv(i);
277  COM_ClearArgv(i+1);
278  COM_ClearArgv(i+2);
279  }
280  i+=2;
281  }
282 }

Referenced by Qcommon_Init().

◆ Cbuf_AddLateCommands()

qboolean Cbuf_AddLateCommands ( void  )

Definition at line 296 of file cmd.c.

297 {
298  int i, j;
299  int s;
300  char *text, *build, c;
301  int argc;
302  qboolean ret;
303 
304 // build the combined string to parse from
305  s = 0;
306  argc = COM_Argc();
307  for (i=1 ; i<argc ; i++)
308  {
309  s += (int)strlen (COM_Argv(i)) + 1;
310  }
311  if (!s)
312  return false;
313 
314  text = Z_Malloc (s+1);
315  text[0] = 0;
316  for (i=1 ; i<argc ; i++)
317  {
318  strcat (text,COM_Argv(i));
319  if (i != argc-1)
320  strcat (text, " ");
321  }
322 
323 // pull out the commands
324  build = Z_Malloc (s+1);
325  build[0] = 0;
326 
327  for (i=0 ; i<s-1 ; i++)
328  {
329  if (text[i] == '+')
330  {
331  i++;
332 
333  for (j=i ; (text[j] != '+') && (text[j] != '-') && (text[j] != 0) ; j++)
334  ;
335 
336  c = text[j];
337  text[j] = 0;
338 
339  strcat (build, text+i);
340  strcat (build, "\n");
341  text[j] = c;
342  i = j-1;
343  }
344  }
345 
346  ret = (build[0] != 0);
347  if (ret)
348  Cbuf_AddText (build);
349 
350  Z_Free (text);
351  Z_Free (build);
352 
353  return ret;
354 }

Referenced by Qcommon_Init().

◆ Cbuf_AddText()

◆ Cbuf_CopyToDefer()

void Cbuf_CopyToDefer ( void  )

Definition at line 147 of file cmd.c.

148 {
151  cmd_text.cursize = 0;
152 }

Referenced by SV_Map().

◆ Cbuf_Execute()

void Cbuf_Execute ( void  )

Definition at line 194 of file cmd.c.

195 {
196  int i;
197  char *text;
198  char line[1024];
199  int quotes;
200 
201  alias_count = 0; // don't allow infinite alias loops
202 
203  while (cmd_text.cursize)
204  {
205 // find a \n or ; line break
206  text = (char *)cmd_text.data;
207 
208  quotes = 0;
209  for (i=0 ; i< cmd_text.cursize ; i++)
210  {
211  if (text[i] == '"')
212  quotes++;
213  if ( !(quotes&1) && text[i] == ';')
214  break; // don't break if inside a quoted string
215  if (text[i] == '\n')
216  break;
217  }
218 
219 
220  memcpy (line, text, i);
221  line[i] = 0;
222 
223 // delete the text from the command buffer and move remaining commands down
224 // this is necessary because commands (exec, alias) can insert data at the
225 // beginning of the text buffer
226 
227  if (i == cmd_text.cursize)
228  cmd_text.cursize = 0;
229  else
230  {
231  i++;
232  cmd_text.cursize -= i;
233  memmove (text, text+i, cmd_text.cursize);
234  }
235 
236 // execute the command line
237  Cmd_ExecuteString (line);
238 
239  if (cmd_wait)
240  {
241  // skip out while text still remains in buffer, leaving it
242  // for next frame
243  cmd_wait = false;
244  break;
245  }
246  }
247 }

Referenced by CL_Init(), CL_ParseServerMessage(), CL_SendCommand(), ControlsResetDefaultsFunc(), Qcommon_Frame(), and Qcommon_Init().

◆ Cbuf_ExecuteText()

void Cbuf_ExecuteText ( int  exec_when,
char *  text 
)

Definition at line 171 of file cmd.c.

172 {
173  switch (exec_when)
174  {
175  case EXEC_NOW:
176  Cmd_ExecuteString (text);
177  break;
178  case EXEC_INSERT:
179  Cbuf_InsertText (text);
180  break;
181  case EXEC_APPEND:
182  Cbuf_AddText (text);
183  break;
184  default:
185  Com_Error (ERR_FATAL, "Cbuf_ExecuteText: bad exec_when");
186  }
187 }

Referenced by VID_LoadRefresh().

◆ Cbuf_Init()

void Cbuf_Init ( void  )

Definition at line 78 of file cmd.c.

79 {
81 }

Referenced by Qcommon_Init().

◆ Cbuf_InsertFromDefer()

void Cbuf_InsertFromDefer ( void  )

Definition at line 159 of file cmd.c.

160 {
162  defer_text_buf[0] = 0;
163 }

Referenced by SV_Begin_f().

◆ Cbuf_InsertText()

void Cbuf_InsertText ( char *  text)

Definition at line 114 of file cmd.c.

115 {
116  char *temp;
117  int templen;
118 
119 // copy off any commands still remaining in the exec buffer
120  templen = cmd_text.cursize;
121  if (templen)
122  {
123  temp = Z_Malloc (templen);
124  memcpy (temp, cmd_text.data, templen);
125  SZ_Clear (&cmd_text);
126  }
127  else
128  temp = NULL; // shut up compiler
129 
130 // add the entire text of the file
131  Cbuf_AddText (text);
132 
133 // add the copied off data
134  if (templen)
135  {
136  SZ_Write (&cmd_text, temp, templen);
137  Z_Free (temp);
138  }
139 }

Referenced by Cbuf_ExecuteText(), Cbuf_InsertFromDefer(), Cmd_Exec_f(), Cmd_ExecuteString(), and Keys_MenuKey().

◆ CL_Drop()

void CL_Drop ( void  )

Definition at line 399 of file cl_main.c.

400 {
401  if (cls.state == ca_uninitialized)
402  return;
403  if (cls.state == ca_disconnected)
404  return;
405 
406  CL_Disconnect ();
407 
408  // drop loading plaque unless this is the initial game start
409  if (cls.disable_servercount != -1)
410  SCR_EndLoadingPlaque (); // get rid of loading plaque
411 }

Referenced by Com_Error(), and SV_InitGame().

◆ CL_Frame()

void CL_Frame ( int  msec)

Definition at line 1681 of file cl_main.c.

1682 {
1683  static int extratime;
1684  static int lasttimecalled;
1685 
1686  if (dedicated->value)
1687  return;
1688 
1689  extratime += msec;
1690 
1691  if (!cl_timedemo->value)
1692  {
1693  if (cls.state == ca_connected && extratime < 100)
1694  return; // don't flood packets out while connecting
1695  if (extratime < 1000/cl_maxfps->value)
1696  return; // framerate is too high
1697  }
1698 
1699  // let the mouse activate or deactivate
1700  IN_Frame ();
1701 
1702  // decide the simulation time
1703  cls.frametime = extratime/1000.0;
1704  cl.time += extratime;
1705  cls.realtime = curtime;
1706 
1707  extratime = 0;
1708 #if 0
1709  if (cls.frametime > (1.0 / cl_minfps->value))
1710  cls.frametime = (1.0 / cl_minfps->value);
1711 #else
1712  if (cls.frametime > (1.0 / 5))
1713  cls.frametime = (1.0 / 5);
1714 #endif
1715 
1716  // if in the debugger last frame, don't timeout
1717  if (msec > 5000)
1719 
1720  // fetch results from server
1721  CL_ReadPackets ();
1722 
1723  // send a new command message to the server
1724  CL_SendCommand ();
1725 
1726  // predict all unacknowledged movements
1727  CL_PredictMovement ();
1728 
1729  // allow rendering DLL change
1730  VID_CheckChanges ();
1731  if (!cl.refresh_prepped && cls.state == ca_active)
1732  CL_PrepRefresh ();
1733 
1734  // update the screen
1735  if (host_speeds->value)
1737  SCR_UpdateScreen ();
1738  if (host_speeds->value)
1740 
1741  // update audio
1743 
1744  CDAudio_Update();
1745  Miniaudio_Update();
1746 
1747  // advance local effects for next frame
1748  CL_RunDLights ();
1749  CL_RunLightStyles ();
1750  SCR_RunCinematic ();
1751  SCR_RunConsole ();
1752 
1753  cls.framecount++;
1754 
1755  if ( log_stats->value )
1756  {
1757  if ( cls.state == ca_active )
1758  {
1759  if ( !lasttimecalled )
1760  {
1761  lasttimecalled = Sys_Milliseconds();
1762  if ( log_stats_file )
1763  fprintf( log_stats_file, "0\n" );
1764  }
1765  else
1766  {
1767  int now = Sys_Milliseconds();
1768 
1769  if ( log_stats_file )
1770  fprintf( log_stats_file, "%d\n", now - lasttimecalled );
1771  lasttimecalled = now;
1772  }
1773  }
1774  }
1775 }

Referenced by Qcommon_Frame().

◆ CL_Init()

void CL_Init ( void  )

Definition at line 1785 of file cl_main.c.

1786 {
1787  if (dedicated->value)
1788  return; // nothing running on the client
1789 
1790  // all archived variables will now be loaded
1791 
1792  Con_Init ();
1793 #if defined __linux__ || defined __sgi
1794  S_Init ();
1795  VID_Init ();
1796 #else
1797  VID_Init ();
1798  S_Init (); // sound must be initialized after window is created
1799 #endif
1800 
1801  V_Init ();
1802 
1805 
1806  M_Init ();
1807 
1808  SCR_Init ();
1809  cls.disable_screen = true; // don't draw yet
1810 
1811  CDAudio_Init ();
1812  Miniaudio_Init ();
1813  CL_InitLocal ();
1814  IN_Init ();
1815 
1816 // Cbuf_AddText ("exec autoexec.cfg\n");
1817  FS_ExecAutoexec ();
1818  Cbuf_Execute ();
1819 
1820 }

Referenced by Qcommon_Init().

◆ CL_Shutdown()

void CL_Shutdown ( void  )

Definition at line 1831 of file cl_main.c.

1832 {
1833  static qboolean isdown = false;
1834 
1835  if (isdown)
1836  {
1837  printf ("recursive shutdown\n");
1838  return;
1839  }
1840  isdown = true;
1841 
1843 
1844  CDAudio_Shutdown ();
1846  S_Shutdown();
1847  IN_Shutdown ();
1848  VID_Shutdown();
1849 }

Referenced by Com_Error(), Com_Quit(), Sys_Error(), and Sys_Quit().

◆ CM_AreasConnected()

qboolean CM_AreasConnected ( int  area1,
int  area2 
)

Definition at line 1662 of file cmodel.c.

1663 {
1664  if (map_noareas->value)
1665  return true;
1666 
1667  if (area1 > numareas || area2 > numareas)
1668  Com_Error (ERR_DROP, "area > numareas");
1669 
1670  if (map_areas[area1].floodnum == map_areas[area2].floodnum)
1671  return true;
1672  return false;
1673 }

Referenced by PF_inPHS(), PF_inPVS(), SV_BuildClientFrame(), SV_InitGameProgs(), and SV_Multicast().

◆ CM_BoxLeafnums()

int CM_BoxLeafnums ( vec3_t  mins,
vec3_t  maxs,
int list,
int  listsize,
int topnode 
)

Definition at line 903 of file cmodel.c.

904 {
905  return CM_BoxLeafnums_headnode (mins, maxs, list,
906  listsize, map_cmodels[0].headnode, topnode);
907 }

Referenced by SV_FatPVS(), and SV_LinkEdict().

◆ CM_BoxTrace()

trace_t CM_BoxTrace ( vec3_t  start,
vec3_t  end,
vec3_t  mins,
vec3_t  maxs,
int  headnode,
int  brushmask 
)

Definition at line 1350 of file cmodel.c.

1353 {
1354  int i;
1355 
1356  checkcount++; // for multi-check avoidance
1357 
1358  c_traces++; // for statistics, may be zeroed
1359 
1360  // fill in a default trace
1361  memset (&trace_trace, 0, sizeof(trace_trace));
1362  trace_trace.fraction = 1;
1364 
1365  if (!numnodes) // map not loaded
1366  return trace_trace;
1367 
1368  trace_contents = brushmask;
1369  VectorCopy (start, trace_start);
1370  VectorCopy (end, trace_end);
1371  VectorCopy (mins, trace_mins);
1372  VectorCopy (maxs, trace_maxs);
1373 
1374  //
1375  // check for position test special case
1376  //
1377  if (start[0] == end[0] && start[1] == end[1] && start[2] == end[2])
1378  {
1379  int leafs[1024];
1380  int i, numleafs;
1381  vec3_t c1, c2;
1382  int topnode;
1383 
1384  VectorAdd (start, mins, c1);
1385  VectorAdd (start, maxs, c2);
1386  for (i=0 ; i<3 ; i++)
1387  {
1388  c1[i] -= 1;
1389  c2[i] += 1;
1390  }
1391 
1392  numleafs = CM_BoxLeafnums_headnode (c1, c2, leafs, 1024, headnode, &topnode);
1393  for (i=0 ; i<numleafs ; i++)
1394  {
1395  CM_TestInLeaf (leafs[i]);
1396  if (trace_trace.allsolid)
1397  break;
1398  }
1399  VectorCopy (start, trace_trace.endpos);
1400  return trace_trace;
1401  }
1402 
1403  //
1404  // check for point special case
1405  //
1406  if (mins[0] == 0 && mins[1] == 0 && mins[2] == 0
1407  && maxs[0] == 0 && maxs[1] == 0 && maxs[2] == 0)
1408  {
1409  trace_ispoint = true;
1411  }
1412  else
1413  {
1414  trace_ispoint = false;
1415  trace_extents[0] = -mins[0] > maxs[0] ? -mins[0] : maxs[0];
1416  trace_extents[1] = -mins[1] > maxs[1] ? -mins[1] : maxs[1];
1417  trace_extents[2] = -mins[2] > maxs[2] ? -mins[2] : maxs[2];
1418  }
1419 
1420  //
1421  // general sweeping through world
1422  //
1423  CM_RecursiveHullCheck (headnode, 0, 1, start, end);
1424 
1425  if (trace_trace.fraction == 1)
1426  {
1427  VectorCopy (end, trace_trace.endpos);
1428  }
1429  else
1430  {
1431  for (i=0 ; i<3 ; i++)
1432  trace_trace.endpos[i] = start[i] + trace_trace.fraction * (end[i] - start[i]);
1433  }
1434  return trace_trace;
1435 }

Referenced by CL_PMTrace(), CM_TransformedBoxTrace(), and SV_Trace().

◆ CM_ClusterPHS()

byte* CM_ClusterPHS ( int  cluster)

Definition at line 1584 of file cmodel.c.

1585 {
1586  if (cluster == -1)
1587  memset (phsrow, 0, (numclusters+7)>>3);
1588  else
1590  return phsrow;
1591 }

Referenced by PF_inPHS(), SV_BuildClientFrame(), and SV_Multicast().

◆ CM_ClusterPVS()

byte* CM_ClusterPVS ( int  cluster)

Definition at line 1575 of file cmodel.c.

1576 {
1577  if (cluster == -1)
1578  memset (pvsrow, 0, (numclusters+7)>>3);
1579  else
1581  return pvsrow;
1582 }

Referenced by PF_inPVS(), SV_FatPVS(), and SV_Multicast().

◆ CM_EntityString()

char* CM_EntityString ( void  )

Definition at line 662 of file cmodel.c.

663 {
664  return map_entitystring;
665 }

Referenced by SV_SpawnServer().

◆ CM_HeadnodeForBox()

int CM_HeadnodeForBox ( vec3_t  mins,
vec3_t  maxs 
)

Definition at line 775 of file cmodel.c.

776 {
777  box_planes[0].dist = maxs[0];
778  box_planes[1].dist = -maxs[0];
779  box_planes[2].dist = mins[0];
780  box_planes[3].dist = -mins[0];
781  box_planes[4].dist = maxs[1];
782  box_planes[5].dist = -maxs[1];
783  box_planes[6].dist = mins[1];
784  box_planes[7].dist = -mins[1];
785  box_planes[8].dist = maxs[2];
786  box_planes[9].dist = -maxs[2];
787  box_planes[10].dist = mins[2];
788  box_planes[11].dist = -mins[2];
789 
790  return box_headnode;
791 }

Referenced by CL_ClipMoveToEntities(), and SV_HullForEntity().

◆ CM_HeadnodeVisible()

qboolean CM_HeadnodeVisible ( int  headnode,
byte visbits 
)

Definition at line 1748 of file cmodel.c.

1749 {
1750  int leafnum;
1751  int cluster;
1752  cnode_t *node;
1753 
1754  if (nodenum < 0)
1755  {
1756  leafnum = -1-nodenum;
1757  cluster = map_leafs[leafnum].cluster;
1758  if (cluster == -1)
1759  return false;
1760  if (visbits[cluster>>3] & (1<<(cluster&7)))
1761  return true;
1762  return false;
1763  }
1764 
1765  node = &map_nodes[nodenum];
1766  if (CM_HeadnodeVisible(node->children[0], visbits))
1767  return true;
1768  return CM_HeadnodeVisible(node->children[1], visbits);
1769 }

Referenced by CM_HeadnodeVisible(), and SV_BuildClientFrame().

◆ CM_InlineModel()

cmodel_t* CM_InlineModel ( char *  name)

Definition at line 639 of file cmodel.c.

640 {
641  int num;
642 
643  if (!name || name[0] != '*')
644  Com_Error (ERR_DROP, "CM_InlineModel: bad name");
645  num = atoi (name+1);
646  if (num < 1 || num >= numcmodels)
647  Com_Error (ERR_DROP, "CM_InlineModel: bad number");
648 
649  return &map_cmodels[num];
650 }

Referenced by CL_ParseConfigString(), CL_PrepRefresh(), PF_setmodel(), and SV_SpawnServer().

◆ CM_LeafArea()

int CM_LeafArea ( int  leafnum)

Definition at line 681 of file cmodel.c.

682 {
683  if (leafnum < 0 || leafnum >= numleafs)
684  Com_Error (ERR_DROP, "CM_LeafArea: bad number");
685  return map_leafs[leafnum].area;
686 }

Referenced by PF_inPHS(), PF_inPVS(), SV_BuildClientFrame(), SV_LinkEdict(), and SV_Multicast().

◆ CM_LeafCluster()

int CM_LeafCluster ( int  leafnum)

Definition at line 674 of file cmodel.c.

675 {
676  if (leafnum < 0 || leafnum >= numleafs)
677  Com_Error (ERR_DROP, "CM_LeafCluster: bad number");
678  return map_leafs[leafnum].cluster;
679 }

Referenced by PF_inPHS(), PF_inPVS(), SV_BuildClientFrame(), SV_FatPVS(), SV_LinkEdict(), and SV_Multicast().

◆ CM_LeafContents()

int CM_LeafContents ( int  leafnum)

Definition at line 667 of file cmodel.c.

668 {
669  if (leafnum < 0 || leafnum >= numleafs)
670  Com_Error (ERR_DROP, "CM_LeafContents: bad number");
671  return map_leafs[leafnum].contents;
672 }

◆ CM_LoadMap()

cmodel_t* CM_LoadMap ( char *  name,
qboolean  clientload,
unsigned *  checksum 
)

Definition at line 548 of file cmodel.c.

549 {
550  unsigned *buf;
551  int i;
552  dheader_t header;
553  int length;
554  static unsigned last_checksum;
555 
556  map_noareas = Cvar_Get ("map_noareas", "0", 0);
557 
558  if ( !strcmp (map_name, name) && (clientload || !Cvar_VariableValue ("flushmap")) )
559  {
560  *checksum = last_checksum;
561  if (!clientload)
562  {
563  memset (portalopen, 0, sizeof(portalopen));
565  }
566  return &map_cmodels[0]; // still have the right version
567  }
568 
569  // free old stuff
570  numplanes = 0;
571  numnodes = 0;
572  numleafs = 0;
573  numcmodels = 0;
574  numvisibility = 0;
575  numentitychars = 0;
576  map_entitystring[0] = 0;
577  map_name[0] = 0;
578 
579  if (!name || !name[0])
580  {
581  numleafs = 1;
582  numclusters = 1;
583  numareas = 1;
584  *checksum = 0;
585  return &map_cmodels[0]; // cinematic servers won't have anything at all
586  }
587 
588  //
589  // load the file
590  //
591  length = FS_LoadFile (name, (void **)&buf);
592  if (!buf)
593  Com_Error (ERR_DROP, "Couldn't load %s", name);
594 
595  last_checksum = LittleLong (Com_BlockChecksum (buf, length));
596  *checksum = last_checksum;
597 
598  header = *(dheader_t *)buf;
599  for (i=0 ; i<sizeof(dheader_t)/4 ; i++)
600  ((int *)&header)[i] = LittleLong ( ((int *)&header)[i]);
601 
602  if (header.version != BSPVERSION)
603  Com_Error (ERR_DROP, "CMod_LoadBrushModel: %s has wrong version number (%i should be %i)"
604  , name, header.version, BSPVERSION);
605 
606  cmod_base = (byte *)buf;
607 
608  // load into heap
610  CMod_LoadLeafs (&header.lumps[LUMP_LEAFS]);
612  CMod_LoadPlanes (&header.lumps[LUMP_PLANES]);
616  CMod_LoadNodes (&header.lumps[LUMP_NODES]);
617  CMod_LoadAreas (&header.lumps[LUMP_AREAS]);
621 
622  FS_FreeFile (buf);
623 
624  CM_InitBoxHull ();
625 
626  memset (portalopen, 0, sizeof(portalopen));
628 
629  strcpy (map_name, name);
630 
631  return &map_cmodels[0];
632 }

Referenced by CL_Precache_f(), CL_RequestNextDownload(), and SV_SpawnServer().

◆ CM_NumClusters()

int CM_NumClusters ( void  )

Definition at line 652 of file cmodel.c.

653 {
654  return numclusters;
655 }

Referenced by SV_FatPVS().

◆ CM_NumInlineModels()

int CM_NumInlineModels ( void  )

Definition at line 657 of file cmodel.c.

658 {
659  return numcmodels;
660 }

Referenced by SV_SpawnServer().

◆ CM_PointContents()

int CM_PointContents ( vec3_t  p,
int  headnode 
)

Definition at line 917 of file cmodel.c.

918 {
919  int l;
920 
921  if (!numnodes) // map not loaded
922  return 0;
923 
924  l = CM_PointLeafnum_r (p, headnode);
925 
926  return map_leafs[l].contents;
927 }

Referenced by CL_PMpointcontents(), and SV_PointContents().

◆ CM_PointLeafnum()

int CM_PointLeafnum ( vec3_t  p)

Definition at line 826 of file cmodel.c.

827 {
828  if (!numplanes)
829  return 0; // sound may call this without map loaded
830  return CM_PointLeafnum_r (p, 0);
831 }

Referenced by PF_inPHS(), PF_inPVS(), SV_BuildClientFrame(), and SV_Multicast().

◆ CM_ReadPortalState()

void CM_ReadPortalState ( FILE *  f)

Definition at line 1734 of file cmodel.c.

1735 {
1736  FS_Read (portalopen, sizeof(portalopen), f);
1738 }

Referenced by SV_ReadLevelFile().

◆ CM_SetAreaPortalState()

void CM_SetAreaPortalState ( int  portalnum,
qboolean  open 
)

Definition at line 1653 of file cmodel.c.

1654 {
1655  if (portalnum > numareaportals)
1656  Com_Error (ERR_DROP, "areaportal > numareaportals");
1657 
1658  portalopen[portalnum] = open;
1660 }

Referenced by SV_InitGameProgs().

◆ CM_TransformedBoxTrace()

trace_t CM_TransformedBoxTrace ( vec3_t  start,
vec3_t  end,
vec3_t  mins,
vec3_t  maxs,
int  headnode,
int  brushmask,
vec3_t  origin,
vec3_t  angles 
)

Definition at line 1451 of file cmodel.c.

1455 {
1456  trace_t trace;
1457  vec3_t start_l, end_l;
1458  vec3_t a;
1459  vec3_t forward, right, up;
1460  vec3_t temp;
1461  qboolean rotated;
1462 
1463  // subtract origin offset
1464  VectorSubtract (start, origin, start_l);
1465  VectorSubtract (end, origin, end_l);
1466 
1467  // rotate start and end into the models frame of reference
1468  if (headnode != box_headnode &&
1469  (angles[0] || angles[1] || angles[2]) )
1470  rotated = true;
1471  else
1472  rotated = false;
1473 
1474  if (rotated)
1475  {
1476  AngleVectors (angles, forward, right, up);
1477 
1478  VectorCopy (start_l, temp);
1479  start_l[0] = DotProduct (temp, forward);
1480  start_l[1] = -DotProduct (temp, right);
1481  start_l[2] = DotProduct (temp, up);
1482 
1483  VectorCopy (end_l, temp);
1484  end_l[0] = DotProduct (temp, forward);
1485  end_l[1] = -DotProduct (temp, right);
1486  end_l[2] = DotProduct (temp, up);
1487  }
1488 
1489  // sweep the box through the model
1490  trace = CM_BoxTrace (start_l, end_l, mins, maxs, headnode, brushmask);
1491 
1492  if (rotated && trace.fraction != 1.0)
1493  {
1494  // FIXME: figure out how to do this with existing angles
1495  VectorNegate (angles, a);
1496  AngleVectors (a, forward, right, up);
1497 
1498  VectorCopy (trace.plane.normal, temp);
1499  trace.plane.normal[0] = DotProduct (temp, forward);
1500  trace.plane.normal[1] = -DotProduct (temp, right);
1501  trace.plane.normal[2] = DotProduct (temp, up);
1502  }
1503 
1504  trace.endpos[0] = start[0] + trace.fraction * (end[0] - start[0]);
1505  trace.endpos[1] = start[1] + trace.fraction * (end[1] - start[1]);
1506  trace.endpos[2] = start[2] + trace.fraction * (end[2] - start[2]);
1507 
1508  return trace;
1509 }

Referenced by CL_ClipMoveToEntities(), and SV_ClipMoveToEntities().

◆ CM_TransformedPointContents()

int CM_TransformedPointContents ( vec3_t  p,
int  headnode,
vec3_t  origin,
vec3_t  angles 
)

Definition at line 937 of file cmodel.c.

938 {
939  vec3_t p_l;
940  vec3_t temp;
942  int l;
943 
944  // subtract origin offset
945  VectorSubtract (p, origin, p_l);
946 
947  // rotate start and end into the models frame of reference
948  if (headnode != box_headnode &&
949  (angles[0] || angles[1] || angles[2]) )
950  {
951  AngleVectors (angles, forward, right, up);
952 
953  VectorCopy (p_l, temp);
954  p_l[0] = DotProduct (temp, forward);
955  p_l[1] = -DotProduct (temp, right);
956  p_l[2] = DotProduct (temp, up);
957  }
958 
959  l = CM_PointLeafnum_r (p_l, headnode);
960 
961  return map_leafs[l].contents;
962 }

Referenced by CL_PMpointcontents(), and SV_PointContents().

◆ CM_WriteAreaBits()

int CM_WriteAreaBits ( byte buffer,
int  area 
)

Definition at line 1686 of file cmodel.c.

1687 {
1688  int i;
1689  int floodnum;
1690  int bytes;
1691 
1692  bytes = (numareas+7)>>3;
1693 
1694  if (map_noareas->value)
1695  { // for debugging, send everything
1696  memset (buffer, 255, bytes);
1697  }
1698  else
1699  {
1700  memset (buffer, 0, bytes);
1701 
1702  floodnum = map_areas[area].floodnum;
1703  for (i=0 ; i<numareas ; i++)
1704  {
1705  if (map_areas[i].floodnum == floodnum || !area)
1706  buffer[i>>3] |= 1<<(i&7);
1707  }
1708  }
1709 
1710  return bytes;
1711 }

Referenced by SV_BuildClientFrame().

◆ CM_WritePortalState()

void CM_WritePortalState ( FILE *  f)

Definition at line 1721 of file cmodel.c.

1722 {
1723  fwrite (portalopen, sizeof(portalopen), 1, f);
1724 }

Referenced by SV_WriteLevelFile().

◆ Cmd_AddCommand()

void Cmd_AddCommand ( char *  cmd_name,
xcommand_t  function 
)

Definition at line 691 of file cmd.c.

692 {
693  cmd_function_t *cmd;
694 
695 // fail if the command is a variable name
696  if (Cvar_VariableString(cmd_name)[0])
697  {
698  Com_Printf ("Cmd_AddCommand: %s already defined as a var\n", cmd_name);
699  return;
700  }
701 
702 // fail if the command already exists
703  for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
704  {
705  if (!strcmp (cmd_name, cmd->name))
706  {
707  Com_Printf ("Cmd_AddCommand: %s already defined\n", cmd_name);
708  return;
709  }
710  }
711 
712  cmd = Z_Malloc (sizeof(cmd_function_t));
713  cmd->name = cmd_name;
714  cmd->function = function;
715  cmd->next = cmd_functions;
716  cmd_functions = cmd;
717 }

Referenced by CDAudio_Init(), CL_InitInput(), CL_InitLocal(), Cmd_Init(), Con_Init(), Cvar_Init(), FS_InitFilesystem(), IN_Init(), Key_Init(), M_Init(), Miniaudio_Init(), Qcommon_Init(), S_Init(), SCR_Init(), SV_InitOperatorCommands(), V_Init(), VID_Init(), and VID_LoadRefresh().

◆ Cmd_Argc()

◆ Cmd_Args()

char* Cmd_Args ( void  )

Definition at line 531 of file cmd.c.

532 {
533  return cmd_args;
534 }

Referenced by CL_ForwardToServer_f(), Cmd_ForwardToServer(), SV_ConSay_f(), and SV_InitGameProgs().

◆ Cmd_Argv()

◆ Cmd_CompleteCommand()

char* Cmd_CompleteCommand ( char *  partial)

Definition at line 772 of file cmd.c.

773 {
774  cmd_function_t *cmd;
775  int len;
776  cmdalias_t *a;
777 
778  len = (int)strlen(partial);
779 
780  if (!len)
781  return NULL;
782 
783 // check for exact match
784  for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
785  if (!strcmp (partial,cmd->name))
786  return cmd->name;
787  for (a=cmd_alias ; a ; a=a->next)
788  if (!strcmp (partial, a->name))
789  return a->name;
790 
791 // check for partial match
792  for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
793  if (!strncmp (partial,cmd->name, len))
794  return cmd->name;
795  for (a=cmd_alias ; a ; a=a->next)
796  if (!strncmp (partial, a->name, len))
797  return a->name;
798 
799  return NULL;
800 }

Referenced by CompleteCommand().

◆ Cmd_ExecuteString()

void Cmd_ExecuteString ( char *  text)

Definition at line 811 of file cmd.c.

812 {
813  cmd_function_t *cmd;
814  cmdalias_t *a;
815 
816  Cmd_TokenizeString (text, true);
817 
818  // execute the command line
819  if (!Cmd_Argc())
820  return; // no tokens
821 
822  // check functions
823  for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
824  {
825  if (!Q_strcasecmp (cmd_argv[0],cmd->name))
826  {
827  if (!cmd->function)
828  { // forward to server command
829  Cmd_ExecuteString (va("cmd %s", text));
830  }
831  else
832  cmd->function ();
833  return;
834  }
835  }
836 
837  // check alias
838  for (a=cmd_alias ; a ; a=a->next)
839  {
840  if (!Q_strcasecmp (cmd_argv[0], a->name))
841  {
842  if (++alias_count == ALIAS_LOOP_COUNT)
843  {
844  Com_Printf ("ALIAS_LOOP_COUNT\n");
845  return;
846  }
847  Cbuf_InsertText (a->value);
848  return;
849  }
850  }
851 
852  // check cvars
853  if (Cvar_Command ())
854  return;
855 
856  // send it as a server command if we are connected
858 }

Referenced by Cbuf_Execute(), Cbuf_ExecuteText(), Cmd_ExecuteString(), and SVC_RemoteCommand().

◆ Cmd_Exists()

qboolean Cmd_Exists ( char *  cmd_name)

Definition at line 752 of file cmd.c.

753 {
754  cmd_function_t *cmd;
755 
756  for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
757  {
758  if (!strcmp (cmd_name,cmd->name))
759  return true;
760  }
761 
762  return false;
763 }

◆ Cmd_ForwardToServer()

void Cmd_ForwardToServer ( void  )

Definition at line 286 of file cl_main.c.

287 {
288  char *cmd;
289 
290  cmd = Cmd_Argv(0);
291  if (cls.state <= ca_connected || *cmd == '-' || *cmd == '+')
292  {
293  Com_Printf ("Unknown command \"%s\"\n", cmd);
294  return;
295  }
296 
298  SZ_Print (&cls.netchan.message, cmd);
299  if (Cmd_Argc() > 1)
300  {
301  SZ_Print (&cls.netchan.message, " ");
303  }
304 }

◆ Cmd_Init()

void Cmd_Init ( void  )

Definition at line 881 of file cmd.c.

882 {
883 //
884 // register our commands
885 //
886  Cmd_AddCommand ("cmdlist",Cmd_List_f);
887  Cmd_AddCommand ("exec",Cmd_Exec_f);
888  Cmd_AddCommand ("echo",Cmd_Echo_f);
889  Cmd_AddCommand ("alias",Cmd_Alias_f);
890  Cmd_AddCommand ("wait", Cmd_Wait_f);
891 }

Referenced by Qcommon_Init().

◆ Cmd_RemoveCommand()

void Cmd_RemoveCommand ( char *  cmd_name)

Definition at line 724 of file cmd.c.

725 {
726  cmd_function_t *cmd, **back;
727 
728  back = &cmd_functions;
729  while (1)
730  {
731  cmd = *back;
732  if (!cmd)
733  {
734  Com_Printf ("Cmd_RemoveCommand: %s not added\n", cmd_name);
735  return;
736  }
737  if (!strcmp (cmd_name, cmd->name))
738  {
739  *back = cmd->next;
740  Z_Free (cmd);
741  return;
742  }
743  back = &cmd->next;
744  }
745 }

Referenced by Miniaudio_Shutdown(), S_Shutdown(), and VID_LoadRefresh().

◆ Cmd_TokenizeString()

void Cmd_TokenizeString ( char *  text,
qboolean  macroExpand 
)

Definition at line 620 of file cmd.c.

621 {
622  int i;
623  char *com_token;
624 
625 // clear the args from the last string
626  for (i=0 ; i<cmd_argc ; i++)
627  Z_Free (cmd_argv[i]);
628 
629  cmd_argc = 0;
630  cmd_args[0] = 0;
631 
632  // macro expand the text
633  if (macroExpand)
634  text = Cmd_MacroExpandString (text);
635  if (!text)
636  return;
637 
638  while (1)
639  {
640 // skip whitespace up to a /n
641  while (*text && *text <= ' ' && *text != '\n')
642  {
643  text++;
644  }
645 
646  if (*text == '\n')
647  { // a newline seperates commands in the buffer
648  text++;
649  break;
650  }
651 
652  if (!*text)
653  return;
654 
655  // set cmd_args to everything after the first arg
656  if (cmd_argc == 1)
657  {
658  int l;
659 
660  strcpy (cmd_args, text);
661 
662  // strip off any trailing whitespace
663  l = (int)strlen(cmd_args) - 1;
664  for ( ; l >= 0 ; l--)
665  if (cmd_args[l] <= ' ')
666  cmd_args[l] = 0;
667  else
668  break;
669  }
670 
671  com_token = COM_Parse (&text);
672  if (!text)
673  return;
674 
676  {
677  cmd_argv[cmd_argc] = Z_Malloc ((int)strlen(com_token)+1);
678  strcpy (cmd_argv[cmd_argc], com_token);
679  cmd_argc++;
680  }
681  }
682 
683 }

Referenced by CL_ConnectionlessPacket(), Cmd_ExecuteString(), SV_ConnectionlessPacket(), and SV_ExecuteUserCommand().

◆ COM_AddParm()

void COM_AddParm ( char *  parm)

Definition at line 1016 of file common.c.

1017 {
1018  if (com_argc == MAX_NUM_ARGVS)
1019  Com_Error (ERR_FATAL, "COM_AddParm: MAX_NUM)ARGS");
1020  com_argv[com_argc++] = parm;
1021 }

◆ COM_Argc()

int COM_Argc ( void  )

Definition at line 968 of file common.c.

969 {
970  return com_argc;
971 }

Referenced by Cbuf_AddEarlyCommands(), and Cbuf_AddLateCommands().

◆ COM_Argv()

char* COM_Argv ( int  arg)

Definition at line 973 of file common.c.

974 {
975  if (arg < 0 || arg >= com_argc || !com_argv[arg])
976  return "";
977  return com_argv[arg];
978 }

Referenced by Cbuf_AddEarlyCommands(), and Cbuf_AddLateCommands().

◆ Com_BeginRedirect()

void Com_BeginRedirect ( int  target,
char *  buffer,
int  buffersize,
void flush 
)

Definition at line 74 of file common.c.

75 {
76  if (!target || !buffer || !buffersize || !flush)
77  return;
78  rd_target = target;
79  rd_buffer = buffer;
80  rd_buffersize = buffersize;
81  rd_flush = flush;
82 
83  *rd_buffer = 0;
84 }

Referenced by SVC_RemoteCommand(), and SVC_Status().

◆ Com_BlockChecksum()

unsigned Com_BlockChecksum ( void buffer,
int  length 
)

Definition at line 213 of file md4.c.

214 {
215  uint32_t digest[4];
216  unsigned val;
217 
218  PerformMD4((unsigned char *)buffer, length, (unsigned char *)digest);
219 
220  val = digest[0] ^ digest[1] ^ digest[2] ^ digest[3];
221 
222  return val;
223 }

Referenced by CM_LoadMap(), COM_BlockSequenceCheckByte(), and FS_LoadPackFile().

◆ COM_BlockSequenceCRCByte()

byte COM_BlockSequenceCRCByte ( byte base,
int  length,
int  sequence 
)

Definition at line 1338 of file common.c.

1339 {
1340  int n;
1341  byte *p;
1342  int x;
1343  byte chkb[60 + 4];
1344  unsigned short crc;
1345 
1346 
1347  if (sequence < 0)
1348  Sys_Error("sequence < 0, this shouldn't happen\n");
1349 
1350  p = chktbl + (sequence % (sizeof(chktbl) - 4));
1351 
1352  if (length > 60)
1353  length = 60;
1354  memcpy (chkb, base, length);
1355 
1356  chkb[length] = p[0];
1357  chkb[length+1] = p[1];
1358  chkb[length+2] = p[2];
1359  chkb[length+3] = p[3];
1360 
1361  length += 4;
1362 
1363  crc = CRC_Block(chkb, length);
1364 
1365  for (x=0, n=0; n<length; n++)
1366  x += chkb[n];
1367 
1368  crc = (crc ^ x) & 0xff;
1369 
1370  return crc;
1371 }

Referenced by CL_SendCmd(), and SV_ExecuteClientMessage().

◆ COM_CheckParm()

int COM_CheckParm ( char *  parm)

Definition at line 955 of file common.c.

956 {
957  int i;
958 
959  for (i=1 ; i<com_argc ; i++)
960  {
961  if (!strcmp (parm,com_argv[i]))
962  return i;
963  }
964 
965  return 0;
966 }

◆ COM_ClearArgv()

void COM_ClearArgv ( int  arg)

Definition at line 980 of file common.c.

981 {
982  if (arg < 0 || arg >= com_argc || !com_argv[arg])
983  return;
984  com_argv[arg] = "";
985 }

Referenced by Cbuf_AddEarlyCommands().

◆ Com_DPrintf()

◆ Com_EndRedirect()

void Com_EndRedirect ( void  )

Definition at line 86 of file common.c.

87 {
89 
90  rd_target = 0;
91  rd_buffer = NULL;
92  rd_buffersize = 0;
93  rd_flush = NULL;
94 }

Referenced by SVC_RemoteCommand(), and SVC_Status().

◆ Com_Error()

void Com_Error ( int  code,
char *  fmt,
  ... 
)

Definition at line 181 of file common.c.

182 {
183  va_list argptr;
184  static char msg[MAXPRINTMSG];
185  static qboolean recursive;
186 
187  if (recursive)
188  Sys_Error ("recursive error after: %s", msg);
189  recursive = true;
190 
191  va_start (argptr,fmt);
192  vsnprintf (msg,MAXPRINTMSG,fmt,argptr);
193  va_end (argptr);
194 
195  if (code == ERR_DISCONNECT)
196  {
197  CL_Drop ();
198  recursive = false;
199  longjmp (abortframe, -1);
200  }
201  else if (code == ERR_DROP)
202  {
203  Com_Printf ("********************\nERROR: %s\n********************\n", msg);
204  SV_Shutdown (va("Server crashed: %s\n", msg), false);
205  CL_Drop ();
206  recursive = false;
207  shutdown_game = true;
208  longjmp (abortframe, -1);
209  }
210  else
211  {
212  SV_Shutdown (va("Server fatal crashed: %s\n", msg), false);
214  CL_Shutdown ();
215  }
216 
217  if (logfile)
218  {
219  fclose (logfile);
220  logfile = NULL;
221  }
222 
223  Sys_Error ("%s", msg);
224 }

Referenced by CalcFov(), Cbuf_ExecuteText(), CL_Disconnect_f(), CL_GetEntitySoundOrigin(), CL_ParseConfigString(), CL_ParseFrame(), CL_ParseMuzzleFlash(), CL_ParseMuzzleFlash2(), CL_ParsePacketEntities(), CL_ParseServerData(), CL_ParseServerMessage(), CL_ParseStartSoundPacket(), CL_ParseTEnt(), CL_RequestNextDownload(), CL_SetLightstyle(), CM_AreasConnected(), CM_InitBoxHull(), CM_InlineModel(), CM_LeafArea(), CM_LeafCluster(), CM_LeafContents(), CM_LoadMap(), CM_SetAreaPortalState(), CMod_LoadAreaPortals(), CMod_LoadAreas(), CMod_LoadBrushes(), CMod_LoadBrushSides(), CMod_LoadEntityString(), CMod_LoadLeafBrushes(), CMod_LoadLeafs(), CMod_LoadNodes(), CMod_LoadPlanes(), CMod_LoadSubmodels(), CMod_LoadSurfaces(), CMod_LoadVisibility(), COM_AddParm(), Com_Error_f(), COM_InitArgv(), FloodArea_r(), FS_FOpenFile(), FS_LoadPackFile(), FS_Read(), GetWavinfo(), Key_Event(), M_PopMenu(), M_PushMenu(), MSG_ReadDir(), MSG_WriteByte(), MSG_WriteChar(), MSG_WriteDeltaEntity(), MSG_WriteShort(), NET_GetPacket(), NET_Init(), NET_OpenIP(), NET_SendPacket(), PF_Configstring(), PF_cprintf(), PF_error(), PF_setmodel(), S_AliasName(), S_FindName(), S_PickChannel(), SCR_ExecuteLayoutString(), SCR_ReadNextFrame(), StartServer_MenuInit(), SV_BeginDemoserver(), SV_FatPVS(), SV_FindIndex(), SV_HullForEntity(), SV_InitGameProgs(), SV_Multicast(), SV_SendClientMessages(), SV_StartSound(), Sys_CopyProtect(), Sys_GetGameAPI(), Sys_UnloadGame(), SZ_GetSpace(), V_AddLightStyle(), VID_CheckChanges(), VID_Error(), VID_FreeReflib(), VID_LoadRefresh(), Z_Free(), and Z_TagMalloc().

◆ COM_Init()

void COM_Init ( void  )

◆ COM_InitArgv()

void COM_InitArgv ( int  argc,
char **  argv 
)

Definition at line 993 of file common.c.

994 {
995  int i;
996 
997  if (argc > MAX_NUM_ARGVS)
998  Com_Error (ERR_FATAL, "argc > MAX_NUM_ARGVS");
999  com_argc = argc;
1000  for (i=0 ; i<argc ; i++)
1001  {
1002  if (!argv[i] || strlen(argv[i]) >= MAX_TOKEN_CHARS )
1003  com_argv[i] = "";
1004  else
1005  com_argv[i] = argv[i];
1006  }
1007 }

Referenced by Qcommon_Init().

◆ Com_Printf()

void Com_Printf ( char *  fmt,
  ... 
)

Definition at line 104 of file common.c.

105 {
106  va_list argptr;
107  char msg[MAXPRINTMSG];
108 
109  va_start (argptr,fmt);
110  vsnprintf (msg,MAXPRINTMSG,fmt,argptr);
111  va_end (argptr);
112 
113  if (rd_target)
114  {
115  if ((strlen (msg) + strlen(rd_buffer)) > (rd_buffersize - 1))
116  {
118  *rd_buffer = 0;
119  }
120  strcat (rd_buffer, msg);
121  return;
122  }
123 
124  Con_Print (msg);
125 
126  // also echo to debugging console
128 
129  // logfile
131  {
132  char name[MAX_QPATH];
133 
134  if (!logfile)
135  {
136  Com_sprintf (name, sizeof(name), "%s/qconsole.log", FS_Gamedir ());
137  if (logfile_active->value > 2)
138  logfile = fopen (name, "a");
139  else
140  logfile = fopen (name, "w");
141  }
142  if (logfile)
143  fprintf (logfile, "%s", msg);
144  if (logfile_active->value > 1)
145  fflush (logfile); // force it to save every time
146  }
147 }

◆ Com_Quit()

void Com_Quit ( void  )

Definition at line 235 of file common.c.

236 {
237  SV_Shutdown ("Server quit\n", false);
239  CL_Shutdown ();
240 
241  if (logfile)
242  {
243  fclose (logfile);
244  logfile = NULL;
245  }
246 
247  Sys_Quit ();
248 }

Referenced by CL_Quit_f(), MainWndProc(), Qcommon_Init(), and WinMain().

◆ Com_ServerState()

◆ Com_SetServerState()

void Com_SetServerState ( int  state)

Definition at line 266 of file common.c.

267 {
268  server_state = state;
269 }

Referenced by SV_Shutdown(), and SV_SpawnServer().

◆ Con_Print()

void Con_Print ( char *  text)

Definition at line 352 of file console.c.

353 {
354  int y;
355  int c, l;
356  static int cr;
357  int mask;
358 
359  if (!con.initialized)
360  return;
361 
362  if (txt[0] == 1 || txt[0] == 2)
363  {
364  mask = 128; // go to colored text
365  txt++;
366  }
367  else
368  mask = 0;
369 
370 
371  while ( (c = *txt) )
372  {
373  // count word length
374  for (l=0 ; l< con.linewidth ; l++)
375  if ( txt[l] <= ' ')
376  break;
377 
378  // word wrap
379  if (l != con.linewidth && (con.x + l > con.linewidth) )
380  con.x = 0;
381 
382  txt++;
383 
384  if (cr)
385  {
386  con.current--;
387  cr = false;
388  }
389 
390 
391  if (!con.x)
392  {
393  Con_Linefeed ();
394  // mark time for transparent overlay
395  if (con.current >= 0)
397  }
398 
399  switch (c)
400  {
401  case '\n':
402  con.x = 0;
403  break;
404 
405  case '\r':
406  con.x = 0;
407  cr = 1;
408  break;
409 
410  default: // display character and advance
411  y = con.current % con.totallines;
412  con.text[y*con.linewidth+con.x] = c | mask | con.ormask;
413  con.x++;
414  if (con.x >= con.linewidth)
415  con.x = 0;
416  break;
417  }
418 
419  }
420 }

Referenced by Com_Printf().

◆ CopyString()

char* CopyString ( char *  in)

Definition at line 1038 of file common.c.

1039 {
1040  char *out;
1041 
1042  out = Z_Malloc ((int)strlen(in)+1);
1043  strcpy (out, in);
1044  return out;
1045 }

Referenced by Cmd_Alias_f(), Cvar_FullSet(), Cvar_Get(), Cvar_Set2(), and FS_Link_f().

◆ crand()

◆ CRC_Block()

unsigned short CRC_Block ( byte start,
int  count 
)

Definition at line 82 of file crc.c.

83 {
84  unsigned short crc;
85 
86  CRC_Init (&crc);
87  while (count--)
88  crc = (crc << 8) ^ crctable[(crc >> 8) ^ *start++];
89 
90  return crc;
91 }

Referenced by COM_BlockSequenceCRCByte().

◆ CRC_Init()

void CRC_Init ( unsigned short *  crcvalue)

Definition at line 67 of file crc.c.

68 {
69  *crcvalue = CRC_INIT_VALUE;
70 }

Referenced by CRC_Block().

◆ CRC_ProcessByte()

void CRC_ProcessByte ( unsigned short *  crcvalue,
byte  data 
)

Definition at line 72 of file crc.c.

73 {
74  *crcvalue = (*crcvalue << 8) ^ crctable[(*crcvalue >> 8) ^ data];
75 }

◆ CRC_Value()

unsigned short CRC_Value ( unsigned short  crcvalue)

Definition at line 77 of file crc.c.

78 {
79  return crcvalue ^ CRC_XOR_VALUE;
80 }

◆ Cvar_Command()

qboolean Cvar_Command ( void  )

Definition at line 363 of file cvar.c.

364 {
365  cvar_t *v;
366 
367 // check variables
368  v = Cvar_FindVar (Cmd_Argv(0));
369  if (!v)
370  return false;
371 
372 // perform a variable print or set
373  if (Cmd_Argc() == 1)
374  {
375  Com_Printf ("\"%s\" is \"%s\"\n", v->name, v->string);
376  return true;
377  }
378 
379  Cvar_Set (v->name, Cmd_Argv(1));
380  return true;
381 }

Referenced by Cmd_ExecuteString().

◆ Cvar_CompleteVariable()

char* Cvar_CompleteVariable ( char *  partial)

Definition at line 95 of file cvar.c.

96 {
97  cvar_t *cvar;
98  int len;
99 
100  len = (int)strlen(partial);
101 
102  if (!len)
103  return NULL;
104 
105  // check exact match
106  for (cvar=cvar_vars ; cvar ; cvar=cvar->next)
107  if (!strcmp (partial,cvar->name))
108  return cvar->name;
109 
110  // check partial match
111  for (cvar=cvar_vars ; cvar ; cvar=cvar->next)
112  if (!strncmp (partial,cvar->name, len))
113  return cvar->name;
114 
115  return NULL;
116 }

Referenced by CompleteCommand().

◆ Cvar_ForceSet()

cvar_t* Cvar_ForceSet ( char *  var_name,
char *  value 
)

Definition at line 268 of file cvar.c.

269 {
270  return Cvar_Set2 (var_name, value, true);
271 }

Referenced by EasyGameFunc(), HardGameFunc(), MediumGameFunc(), SV_InitGameProgs(), and SV_ReadServerFile().

◆ Cvar_FullSet()

cvar_t* Cvar_FullSet ( char *  var_name,
char *  value,
int  flags 
)

Definition at line 288 of file cvar.c.

289 {
290  cvar_t *var;
291 
292  var = Cvar_FindVar (var_name);
293  if (!var)
294  { // create it
295  return Cvar_Get (var_name, value, flags);
296  }
297 
298  var->modified = true;
299 
300  if (var->flags & CVAR_USERINFO)
301  userinfo_modified = true; // transmit at next oportunity
302 
303  Z_Free (var->string); // free the old value string
304 
305  var->string = CopyString(value);
306  var->value = atof (var->string);
307  var->flags = flags;
308 
309  return var;
310 }

Referenced by Cvar_Set_f(), FS_SetGamedir(), SV_InitGame(), and SV_SpawnServer().

◆ Cvar_Get()

cvar_t* Cvar_Get ( char *  var_name,
char *  value,
int  flags 
)

Definition at line 127 of file cvar.c.

128 {
129  cvar_t *var;
130 
131  if (flags & (CVAR_USERINFO | CVAR_SERVERINFO))
132  {
133  if (!Cvar_InfoValidate (var_name))
134  {
135  Com_Printf("invalid info cvar name\n");
136  return NULL;
137  }
138  }
139 
140  var = Cvar_FindVar (var_name);
141  if (var)
142  {
143  var->flags |= flags;
144  return var;
145  }
146 
147  if (!var_value)
148  return NULL;
149 
150  if (flags & (CVAR_USERINFO | CVAR_SERVERINFO))
151  {
152  if (!Cvar_InfoValidate (var_value))
153  {
154  Com_Printf("invalid info cvar value\n");
155  return NULL;
156  }
157  }
158 
159  var = Z_Malloc (sizeof(*var));
160  var->name = CopyString (var_name);
161  var->string = CopyString (var_value);
162  var->modified = true;
163  var->value = atof (var->string);
164 
165  // link the variable in
166  var->next = cvar_vars;
167  cvar_vars = var;
168 
169  var->flags = flags;
170 
171  return var;
172 }

Referenced by AddressBook_MenuInit(), CDAudio_Init(), CL_FixCvarCheats(), CL_InitInput(), CL_InitLocal(), CL_PingServers_f(), CM_LoadMap(), Con_Init(), Cvar_FullSet(), Cvar_Set2(), FS_InitFilesystem(), IN_Init(), IN_StartupJoystick(), IN_StartupMouse(), Miniaudio_Init(), NET_Init(), NET_OpenIP(), NET_OpenIPX(), Netchan_Init(), Options_MenuInit(), PlayerConfig_MenuInit(), Qcommon_Init(), S_Init(), SCR_Init(), SNDDMA_Init(), SV_Init(), SV_InitGameProgs(), V_Init(), VID_Init(), VID_LoadRefresh(), and VID_MenuInit().

◆ Cvar_GetLatchedVars()

void Cvar_GetLatchedVars ( void  )

Definition at line 336 of file cvar.c.

337 {
338  cvar_t *var;
339 
340  for (var = cvar_vars ; var ; var = var->next)
341  {
342  if (!var->latched_string)
343  continue;
344  Z_Free (var->string);
345  var->string = var->latched_string;
346  var->latched_string = NULL;
347  var->value = atof(var->string);
348  if (!strcmp(var->name, "game"))
349  {
350  FS_SetGamedir (var->string);
351  FS_ExecAutoexec ();
352  }
353  }
354 }

Referenced by SV_InitGame().

◆ Cvar_Init()

void Cvar_Init ( void  )

Definition at line 522 of file cvar.c.

523 {
524  Cmd_AddCommand ("set", Cvar_Set_f);
525  Cmd_AddCommand ("cvarlist", Cvar_List_f);
526 
527 }

Referenced by Qcommon_Init().

◆ Cvar_Serverinfo()

char* Cvar_Serverinfo ( void  )

Definition at line 510 of file cvar.c.

511 {
512  return Cvar_BitInfo (CVAR_SERVERINFO);
513 }

Referenced by SV_Serverinfo_f(), SV_ShowServerinfo_f(), and SV_StatusString().

◆ Cvar_Set()

◆ Cvar_SetValue()

◆ Cvar_Userinfo()

char* Cvar_Userinfo ( void  )

Definition at line 504 of file cvar.c.

505 {
506  return Cvar_BitInfo (CVAR_USERINFO);
507 }

Referenced by CL_SendCmd(), CL_SendConnectPacket(), and CL_Userinfo_f().

◆ Cvar_VariableString()

char* Cvar_VariableString ( char *  var_name)

Definition at line 79 of file cvar.c.

80 {
81  cvar_t *var;
82 
83  var = Cvar_FindVar (var_name);
84  if (!var)
85  return "";
86  return var->string;
87 }

Referenced by CL_PingServers_f(), Cmd_AddCommand(), Cmd_MacroExpandString(), FS_ExecAutoexec(), StartServer_MenuInit(), SV_New_f(), SV_Nextserver(), and SV_ServerRecord_f().

◆ Cvar_VariableValue()

◆ Cvar_WriteVariables()

void Cvar_WriteVariables ( char *  path)

Definition at line 429 of file cvar.c.

430 {
431  cvar_t *var;
432  char buffer[1024];
433  FILE *f;
434 
435  f = fopen (path, "a");
436  for (var = cvar_vars ; var ; var = var->next)
437  {
438  if (var->flags & CVAR_ARCHIVE)
439  {
440  Com_sprintf (buffer, sizeof(buffer), "set %s \"%s\"\n", var->name, var->string);
441  fprintf (f, "%s", buffer);
442  }
443  }
444  fclose (f);
445 }

Referenced by CL_WriteConfiguration().

◆ frand()

◆ FS_CreatePath()

void FS_CreatePath ( char *  path)

Definition at line 125 of file files.c.

126 {
127  char *ofs;
128 
129  for (ofs = path+1 ; *ofs ; ofs++)
130  {
131  if (*ofs == '/')
132  { // create the directory
133  *ofs = 0;
134  Sys_Mkdir (path);
135  *ofs = '/';
136  }
137  }
138 }

Referenced by CL_ParseDownload(), CL_Record_f(), Con_Dump_f(), SV_CopySaveGame(), SV_GameMap_f(), and SV_ServerRecord_f().

◆ FS_ExecAutoexec()

void FS_ExecAutoexec ( void  )

Definition at line 572 of file files.c.

573 {
574  char *dir;
575  char name [MAX_QPATH];
576 
577  dir = Cvar_VariableString("gamedir");
578  if (*dir)
579  Com_sprintf(name, sizeof(name), "%s/%s/autoexec.cfg", fs_basedir->string, dir);
580  else
581  Com_sprintf(name, sizeof(name), "%s/%s/autoexec.cfg", fs_basedir->string, BASEDIRNAME);
583  Cbuf_AddText ("exec autoexec.cfg\n");
584  Sys_FindClose();
585 }

Referenced by CL_Init(), Cvar_GetLatchedVars(), and Cvar_Set2().

◆ FS_FCloseFile()

void FS_FCloseFile ( FILE *  f)

Definition at line 149 of file files.c.

150 {
151  fclose (f);
152 }

Referenced by S_RegisterSexedSound().

◆ FS_FOpenFile()

int FS_FOpenFile ( char *  filename,
FILE **  file 
)

Definition at line 206 of file files.c.

207 {
208  searchpath_t *search;
209  char netpath[MAX_OSPATH];
210  pack_t *pak;
211  int i;
212  filelink_t *link;
213 
214  file_from_pak = 0;
215 
216  // check for links first
217  for (link = fs_links ; link ; link=link->next)
218  {
219  if (!strncmp (filename, link->from, link->fromlength))
220  {
221  Com_sprintf (netpath, sizeof(netpath), "%s%s",link->to, filename+link->fromlength);
222  *file = fopen (netpath, "rb");
223  if (*file)
224  {
225  Com_DPrintf ("link file: %s\n",netpath);
226  return FS_filelength (*file);
227  }
228  return -1;
229  }
230  }
231 
232 //
233 // search through the path, one element at a time
234 //
235  for (search = fs_searchpaths ; search ; search = search->next)
236  {
237  // is the element a pak file?
238  if (search->pack)
239  {
240  // look through all the pak file elements
241  pak = search->pack;
242  for (i=0 ; i<pak->numfiles ; i++)
243  if (!Q_strcasecmp (pak->files[i].name, filename))
244  { // found it!
245  file_from_pak = 1;
246  Com_DPrintf ("PackFile: %s : %s\n",pak->filename, filename);
247  // open a new file on the pakfile
248  *file = fopen (pak->filename, "rb");
249  if (!*file)
250  Com_Error (ERR_FATAL, "Couldn't reopen %s", pak->filename);
251  fseek (*file, pak->files[i].filepos, SEEK_SET);
252  return pak->files[i].filelen;
253  }
254  }
255  else
256  {
257  // check a file in the directory tree
258 
259  Com_sprintf (netpath, sizeof(netpath), "%s/%s",search->filename, filename);
260 #ifndef _WIN32
261  // some expansion packs use backslashes in file paths which works only on Windows
262  char *np = netpath;
263  while ( *np++ ) *np = *np == '\\' ? '/' : *np;
264 #endif
265  *file = fopen (netpath, "rb");
266  if (!*file)
267  continue;
268 
269  Com_DPrintf ("FindFile: %s\n",netpath);
270 
271  return FS_filelength (*file);
272  }
273 
274  }
275 
276  Com_DPrintf ("FindFile: can't find %s\n", filename);
277 
278  *file = NULL;
279  return -1;
280 }

Referenced by FS_LoadFile(), S_RegisterSexedSound(), SCR_PlayCinematic(), and SV_BeginDemoserver().

◆ FS_FreeFile()

◆ FS_Gamedir()

◆ FS_InitFilesystem()

void FS_InitFilesystem ( void  )

Definition at line 848 of file files.c.

849 {
850  Cmd_AddCommand ("path", FS_Path_f);
851  Cmd_AddCommand ("link", FS_Link_f);
852  Cmd_AddCommand ("dir", FS_Dir_f );
853 
854  //
855  // basedir <path>
856  // allows the game to run from outside the data tree
857  //
858  fs_basedir = Cvar_Get ("basedir", ".", CVAR_NOSET);
859 
860  //
861  // cddir <path>
862  // Logically concatenates the cddir after the basedir for
863  // allows the game to run from outside the data tree
864  //
865  fs_cddir = Cvar_Get ("cddir", "", CVAR_NOSET);
866  if (fs_cddir->string[0])
868 
869  //
870  // start up with baseq2 by default
871  //
873 
874  // any set gamedirs will be freed up to here
876 
877  // check for game override
879  if (fs_gamedirvar->string[0])
881 }

Referenced by Qcommon_Init().

◆ FS_LoadFile()

int FS_LoadFile ( char *  path,
void **  buffer 
)

Definition at line 398 of file files.c.

399 {
400  FILE *h;
401  byte *buf;
402  int len;
403 
404  buf = NULL; // quiet compiler warning
405 
406 // look for it in the filesystem or pack files
407  len = FS_FOpenFile (path, &h);
408  if (!h)
409  {
410  if (buffer)
411  *buffer = NULL;
412  return -1;
413  }
414 
415  if (!buffer)
416  {
417  fclose (h);
418  return len;
419  }
420 
421  buf = Z_Malloc(len);
422  *buffer = buf;
423 
424  FS_Read (buf, len, h);
425 
426  fclose (h);
427 
428  return len;
429 }

Referenced by CL_CheckOrDownloadFile(), CL_Download_f(), CL_RequestNextDownload(), CM_LoadMap(), Cmd_Exec_f(), M_Menu_Credits_f(), S_LoadSound(), SCR_LoadPCX(), StartServer_MenuInit(), SV_BeginDownload_f(), SV_Map_f(), and VID_LoadRefresh().

◆ FS_NextPath()

char* FS_NextPath ( char *  prevpath)

Definition at line 821 of file files.c.

822 {
823  searchpath_t *s;
824  char *prev;
825 
826  if (!prevpath)
827  return fs_gamedir;
828 
829  prev = fs_gamedir;
830  for (s=fs_searchpaths ; s ; s=s->next)
831  {
832  if (s->pack)
833  continue;
834  if (prevpath == prev)
835  return s->filename;
836  prev = s->filename;
837  }
838 
839  return NULL;
840 }

Referenced by FS_Dir_f(), PlayerConfig_ScanDirectories(), and Sys_GetGameAPI().

◆ FS_Read()

void FS_Read ( void buffer,
int  len,
FILE *  f 
)

Definition at line 350 of file files.c.

351 {
352  int block, remaining;
353  int read;
354  byte *buf;
355  int tries;
356 
357  buf = (byte *)buffer;
358 
359  // read in chunks for progress bar
360  remaining = len;
361  tries = 0;
362  while (remaining)
363  {
364  block = remaining;
365  if (block > MAX_READ)
366  block = MAX_READ;
367  read = (int)fread (buf, 1, block, f);
368  if (read == 0)
369  {
370  // we might have been trying to read from a CD
371  if (!tries)
372  {
373  tries = 1;
374  CDAudio_Stop();
375  }
376  else
377  Com_Error (ERR_FATAL, "FS_Read: 0 bytes read");
378  }
379 
380  if (read == -1)
381  Com_Error (ERR_FATAL, "FS_Read: -1 bytes read");
382 
383  // do some progress bar thing here...
384 
385  remaining -= read;
386  buf += read;
387  }
388 }

Referenced by CM_ReadPortalState(), Create_Savestrings(), FS_LoadFile(), Huff1TableInit(), SCR_PlayCinematic(), SCR_ReadNextFrame(), SV_ReadLevelFile(), and SV_ReadServerFile().

◆ FS_SetGamedir()

void FS_SetGamedir ( char *  dir)

Definition at line 595 of file files.c.

596 {
597  searchpath_t *next;
598 
599  if (strstr(dir, "..") || strstr(dir, "/")
600  || strstr(dir, "\\") || strstr(dir, ":") )
601  {
602  Com_Printf ("Gamedir should be a single filename, not a path\n");
603  return;
604  }
605 
606  //
607  // free up any current game dir info
608  //
610  {
611  if (fs_searchpaths->pack)
612  {
613  fclose (fs_searchpaths->pack->handle);
616  }
617  next = fs_searchpaths->next;
619  fs_searchpaths = next;
620  }
621 
622  //
623  // flush all data, so it will be forced to reload
624  //
625  if (dedicated && !dedicated->value)
626  Cbuf_AddText ("vid_restart\nsnd_restart\n");
627 
628  Com_sprintf (fs_gamedir, sizeof(fs_gamedir), "%s/%s", fs_basedir->string, dir);
629 
630  if (!strcmp(dir,BASEDIRNAME) || (*dir == 0))
631  {
632  Cvar_FullSet ("gamedir", "", CVAR_SERVERINFO|CVAR_NOSET);
634  }
635  else
636  {
637  Cvar_FullSet ("gamedir", dir, CVAR_SERVERINFO|CVAR_NOSET);
638  if (fs_cddir->string[0])
639  FS_AddGameDirectory (va("%s/%s", fs_cddir->string, dir) );
640  FS_AddGameDirectory (va("%s/%s", fs_basedir->string, dir) );
641  }
642 }

Referenced by Cvar_GetLatchedVars(), Cvar_Set2(), and FS_InitFilesystem().

◆ Info_Print()

void Info_Print ( char *  s)

Definition at line 1049 of file common.c.

1050 {
1051  char key[512];
1052  char value[512];
1053  char *o;
1054  int l;
1055 
1056  if (*s == '\\')
1057  s++;
1058  while (*s)
1059  {
1060  o = key;
1061  while (*s && *s != '\\')
1062  *o++ = *s++;
1063 
1064  l = o - key;
1065  if (l < 20)
1066  {
1067  memset (o, ' ', 20-l);
1068  key[20] = 0;
1069  }
1070  else
1071  *o = 0;
1072  Com_Printf ("%s", key);
1073 
1074  if (!*s)
1075  {
1076  Com_Printf ("MISSING VALUE\n");
1077  return;
1078  }
1079 
1080  o = value;
1081  s++;
1082  while (*s && *s != '\\')
1083  *o++ = *s++;
1084  *o = 0;
1085 
1086  if (*s)
1087  s++;
1088  Com_Printf ("%s\n", value);
1089  }
1090 }

Referenced by CL_Userinfo_f(), SV_DumpUser_f(), SV_Serverinfo_f(), and SV_ShowServerinfo_f().

◆ LittleFloat()

◆ LittleLong()

◆ LittleShort()

◆ MSG_BeginReading()

void MSG_BeginReading ( sizebuf_t sb)

Definition at line 684 of file common.c.

685 {
686  msg->readcount = 0;
687 }

Referenced by CL_ConnectionlessPacket(), Netchan_Process(), SV_ConnectionlessPacket(), and SV_ReadPackets().

◆ MSG_ReadAngle()

float MSG_ReadAngle ( sizebuf_t sb)

Definition at line 825 of file common.c.

826 {
827  return MSG_ReadChar(msg_read) * (360.0/256);
828 }

Referenced by CL_ParseDelta().

◆ MSG_ReadAngle16()

float MSG_ReadAngle16 ( sizebuf_t sb)

Definition at line 830 of file common.c.

831 {
832  return SHORT2ANGLE(MSG_ReadShort(msg_read));
833 }

Referenced by CL_ParsePlayerstate().

◆ MSG_ReadByte()

int MSG_ReadByte ( sizebuf_t sb)

Definition at line 703 of file common.c.

704 {
705  int c;
706 
707  if (msg_read->readcount+1 > msg_read->cursize)
708  c = -1;
709  else
710  c = (unsigned char)msg_read->data[msg_read->readcount];
711  msg_read->readcount++;
712 
713  return c;
714 }

Referenced by CL_ParseDelta(), CL_ParseDownload(), CL_ParseEntityBits(), CL_ParseFrame(), CL_ParseMuzzleFlash(), CL_ParseMuzzleFlash2(), CL_ParseParticles(), CL_ParsePlayerstate(), CL_ParseServerData(), CL_ParseServerMessage(), CL_ParseStartSoundPacket(), CL_ParseSteam(), CL_ParseTEnt(), MSG_ReadData(), MSG_ReadDeltaUsercmd(), MSG_ReadDir(), and SV_ExecuteClientMessage().

◆ MSG_ReadChar()

int MSG_ReadChar ( sizebuf_t sb)

Definition at line 690 of file common.c.

691 {
692  int c;
693 
694  if (msg_read->readcount+1 > msg_read->cursize)
695  c = -1;
696  else
697  c = (signed char)msg_read->data[msg_read->readcount];
698  msg_read->readcount++;
699 
700  return c;
701 }

Referenced by CL_ParsePlayerstate(), MSG_ReadAngle(), MSG_ReadString(), and MSG_ReadStringLine().

◆ MSG_ReadCoord()

float MSG_ReadCoord ( sizebuf_t sb)

Definition at line 813 of file common.c.

814 {
815  return MSG_ReadShort(msg_read) * (1.0/8);
816 }

Referenced by CL_ParseDelta().

◆ MSG_ReadData()

void MSG_ReadData ( sizebuf_t sb,
void buffer,
int  size 
)

Definition at line 874 of file common.c.

875 {
876  int i;
877 
878  for (i=0 ; i<len ; i++)
879  ((byte *)data)[i] = MSG_ReadByte (msg_read);
880 }

Referenced by CL_ParseFrame().

◆ MSG_ReadDeltaUsercmd()

void MSG_ReadDeltaUsercmd ( sizebuf_t sb,
struct usercmd_s from,
struct usercmd_s cmd 
)

Definition at line 835 of file common.c.

836 {
837  int bits;
838 
839  memcpy (move, from, sizeof(*move));
840 
841  bits = MSG_ReadByte (msg_read);
842 
843 // read current angles
844  if (bits & CM_ANGLE1)
845  move->angles[0] = MSG_ReadShort (msg_read);
846  if (bits & CM_ANGLE2)
847  move->angles[1] = MSG_ReadShort (msg_read);
848  if (bits & CM_ANGLE3)
849  move->angles[2] = MSG_ReadShort (msg_read);
850 
851 // read movement
852  if (bits & CM_FORWARD)
853  move->forwardmove = MSG_ReadShort (msg_read);
854  if (bits & CM_SIDE)
855  move->sidemove = MSG_ReadShort (msg_read);
856  if (bits & CM_UP)
857  move->upmove = MSG_ReadShort (msg_read);
858 
859 // read buttons
860  if (bits & CM_BUTTONS)
861  move->buttons = MSG_ReadByte (msg_read);
862 
863  if (bits & CM_IMPULSE)
864  move->impulse = MSG_ReadByte (msg_read);
865 
866 // read time to run command
867  move->msec = MSG_ReadByte (msg_read);
868 
869 // read the light level
870  move->lightlevel = MSG_ReadByte (msg_read);
871 }

Referenced by SV_ExecuteClientMessage().

◆ MSG_ReadDir()

void MSG_ReadDir ( sizebuf_t sb,
vec3_t  vector 
)

Definition at line 464 of file common.c.

465 {
466  int b;
467 
468  b = MSG_ReadByte (sb);
469  if (b >= NUMVERTEXNORMALS)
470  Com_Error (ERR_DROP, "MSF_ReadDir: out of range");
471  VectorCopy (bytedirs[b], dir);
472 }

Referenced by CL_ParseParticles(), CL_ParseSteam(), and CL_ParseTEnt().

◆ MSG_ReadFloat()

float MSG_ReadFloat ( sizebuf_t sb)

Definition at line 748 of file common.c.

749 {
750  union
751  {
752  byte b[4];
753  float f;
754  int l;
755  } dat;
756 
757  if (msg_read->readcount+4 > msg_read->cursize)
758  dat.f = -1;
759  else
760  {
761  dat.b[0] = msg_read->data[msg_read->readcount];
762  dat.b[1] = msg_read->data[msg_read->readcount+1];
763  dat.b[2] = msg_read->data[msg_read->readcount+2];
764  dat.b[3] = msg_read->data[msg_read->readcount+3];
765  }
766  msg_read->readcount += 4;
767 
768  dat.l = LittleLong (dat.l);
769 
770  return dat.f;
771 }

◆ MSG_ReadLong()

int MSG_ReadLong ( sizebuf_t sb)

Definition at line 731 of file common.c.

732 {
733  int c;
734 
735  if (msg_read->readcount+4 > msg_read->cursize)
736  c = -1;
737  else
738  c = msg_read->data[msg_read->readcount]
739  + (msg_read->data[msg_read->readcount+1]<<8)
740  + (msg_read->data[msg_read->readcount+2]<<16)
741  + (msg_read->data[msg_read->readcount+3]<<24);
742 
743  msg_read->readcount += 4;
744 
745  return c;
746 }

Referenced by CL_ConnectionlessPacket(), CL_ParseDelta(), CL_ParseFrame(), CL_ParsePlayerstate(), CL_ParseServerData(), CL_ParseSteam(), Netchan_Process(), SV_ConnectionlessPacket(), SV_ExecuteClientMessage(), and SV_ReadPackets().

◆ MSG_ReadPos()

void MSG_ReadPos ( sizebuf_t sb,
vec3_t  pos 
)

Definition at line 818 of file common.c.

819 {
820  pos[0] = MSG_ReadShort(msg_read) * (1.0/8);
821  pos[1] = MSG_ReadShort(msg_read) * (1.0/8);
822  pos[2] = MSG_ReadShort(msg_read) * (1.0/8);
823 }

Referenced by CL_ParseBeam(), CL_ParseBeam2(), CL_ParseDelta(), CL_ParseLaser(), CL_ParseLightning(), CL_ParseNuke(), CL_ParseParticles(), CL_ParsePlayerBeam(), CL_ParseStartSoundPacket(), CL_ParseSteam(), CL_ParseTEnt(), and CL_ParseWidow().

◆ MSG_ReadShort()

int MSG_ReadShort ( sizebuf_t sb)

Definition at line 716 of file common.c.

717 {
718  int c;
719 
720  if (msg_read->readcount+2 > msg_read->cursize)
721  c = -1;
722  else
723  c = (short)(msg_read->data[msg_read->readcount]
724  + (msg_read->data[msg_read->readcount+1]<<8));
725 
726  msg_read->readcount += 2;
727 
728  return c;
729 }

Referenced by CL_ParseBeam(), CL_ParseBeam2(), CL_ParseConfigString(), CL_ParseDelta(), CL_ParseDownload(), CL_ParseEntityBits(), CL_ParseInventory(), CL_ParseLightning(), CL_ParseMuzzleFlash(), CL_ParseMuzzleFlash2(), CL_ParsePlayerBeam(), CL_ParsePlayerstate(), CL_ParseServerData(), CL_ParseStartSoundPacket(), CL_ParseSteam(), CL_ParseTEnt(), CL_ParseWidow(), MSG_ReadAngle16(), MSG_ReadCoord(), MSG_ReadDeltaUsercmd(), MSG_ReadPos(), Netchan_Process(), and SV_ReadPackets().

◆ MSG_ReadString()

char* MSG_ReadString ( sizebuf_t sb)

Definition at line 773 of file common.c.

774 {
775  static char string[2048];
776  int l,c;
777 
778  l = 0;
779  do
780  {
781  c = MSG_ReadChar (msg_read);
782  if (c == -1 || c == 0)
783  break;
784  string[l] = c;
785  l++;
786  } while (l < sizeof(string)-1);
787 
788  string[l] = 0;
789 
790  return string;
791 }

Referenced by CL_ConnectionlessPacket(), CL_ParseConfigString(), CL_ParseServerData(), CL_ParseServerMessage(), CL_ParseStatusMessage(), and SV_ExecuteClientMessage().

◆ MSG_ReadStringLine()

char* MSG_ReadStringLine ( sizebuf_t sb)

Definition at line 793 of file common.c.

794 {
795  static char string[2048];
796  int l,c;
797 
798  l = 0;
799  do
800  {
801  c = MSG_ReadChar (msg_read);
802  if (c == -1 || c == 0 || c == '\n')
803  break;
804  string[l] = c;
805  l++;
806  } while (l < sizeof(string)-1);
807 
808  string[l] = 0;
809 
810  return string;
811 }

Referenced by CL_ConnectionlessPacket(), and SV_ConnectionlessPacket().

◆ MSG_WriteAngle()

void MSG_WriteAngle ( sizebuf_t sb,
float  f 
)

Definition at line 376 of file common.c.

377 {
378  MSG_WriteByte (sb, (int)(f*256/360) & 255);
379 }

Referenced by MSG_WriteDeltaEntity(), and PF_WriteAngle().

◆ MSG_WriteAngle16()

void MSG_WriteAngle16 ( sizebuf_t sb,
float  f 
)

Definition at line 381 of file common.c.

382 {
383  MSG_WriteShort (sb, ANGLE2SHORT(f));
384 }

Referenced by SV_WritePlayerstateToClient().

◆ MSG_WriteByte()

◆ MSG_WriteChar()

void MSG_WriteChar ( sizebuf_t sb,
int  c 
)

Definition at line 290 of file common.c.

291 {
292  byte *buf;
293 
294 #ifdef PARANOID
295  if (c < -128 || c > 127)
296  Com_Error (ERR_FATAL, "MSG_WriteChar: range error");
297 #endif
298 
299  buf = SZ_GetSpace (sb, 1);
300  buf[0] = c;
301 }

Referenced by CL_ConnectionlessPacket(), CL_Reconnect_f(), PF_Configstring(), PF_WriteChar(), SV_FindIndex(), and SV_WritePlayerstateToClient().

◆ MSG_WriteCoord()

void MSG_WriteCoord ( sizebuf_t sb,
float  f 
)

Definition at line 364 of file common.c.

365 {
366  MSG_WriteShort (sb, (int)(f*8));
367 }

Referenced by MSG_WriteDeltaEntity().

◆ MSG_WriteDeltaEntity()

void MSG_WriteDeltaEntity ( struct entity_state_s from,
struct entity_state_s to,
sizebuf_t msg,
qboolean  force,
qboolean  newentity 
)

Definition at line 483 of file common.c.

484 {
485  int bits;
486 
487  if (!to->number)
488  Com_Error (ERR_FATAL, "Unset entity number");
489  if (to->number >= MAX_EDICTS)
490  Com_Error (ERR_FATAL, "Entity number >= MAX_EDICTS");
491 
492 // send an update
493  bits = 0;
494 
495  if (to->number >= 256)
496  bits |= U_NUMBER16; // number8 is implicit otherwise
497 
498  if (to->origin[0] != from->origin[0])
499  bits |= U_ORIGIN1;
500  if (to->origin[1] != from->origin[1])
501  bits |= U_ORIGIN2;
502  if (to->origin[2] != from->origin[2])
503  bits |= U_ORIGIN3;
504 
505  if ( to->angles[0] != from->angles[0] )
506  bits |= U_ANGLE1;
507  if ( to->angles[1] != from->angles[1] )
508  bits |= U_ANGLE2;
509  if ( to->angles[2] != from->angles[2] )
510  bits |= U_ANGLE3;
511 
512  if ( to->skinnum != from->skinnum )
513  {
514  if ((unsigned)to->skinnum < 256)
515  bits |= U_SKIN8;
516  else if ((unsigned)to->skinnum < 0x10000)
517  bits |= U_SKIN16;
518  else
519  bits |= (U_SKIN8|U_SKIN16);
520  }
521 
522  if ( to->frame != from->frame )
523  {
524  if (to->frame < 256)
525  bits |= U_FRAME8;
526  else
527  bits |= U_FRAME16;
528  }
529 
530  if ( to->effects != from->effects )
531  {
532  if (to->effects < 256)
533  bits |= U_EFFECTS8;
534  else if (to->effects < 0x8000)
535  bits |= U_EFFECTS16;
536  else
537  bits |= U_EFFECTS8|U_EFFECTS16;
538  }
539 
540  if ( to->renderfx != from->renderfx )
541  {
542  if (to->renderfx < 256)
543  bits |= U_RENDERFX8;
544  else if (to->renderfx < 0x8000)
545  bits |= U_RENDERFX16;
546  else
547  bits |= U_RENDERFX8|U_RENDERFX16;
548  }
549 
550  if ( to->solid != from->solid )
551  bits |= U_SOLID;
552 
553  // event is not delta compressed, just 0 compressed
554  if ( to->event )
555  bits |= U_EVENT;
556 
557  if ( to->modelindex != from->modelindex )
558  bits |= U_MODEL;
559  if ( to->modelindex2 != from->modelindex2 )
560  bits |= U_MODEL2;
561  if ( to->modelindex3 != from->modelindex3 )
562  bits |= U_MODEL3;
563  if ( to->modelindex4 != from->modelindex4 )
564  bits |= U_MODEL4;
565 
566  if ( to->sound != from->sound )
567  bits |= U_SOUND;
568 
569  if (newentity || (to->renderfx & RF_BEAM))
570  bits |= U_OLDORIGIN;
571 
572  //
573  // write the message
574  //
575  if (!bits && !force)
576  return; // nothing to send!
577 
578  //----------
579 
580  if (bits & 0xff000000)
581  bits |= U_MOREBITS3 | U_MOREBITS2 | U_MOREBITS1;
582  else if (bits & 0x00ff0000)
583  bits |= U_MOREBITS2 | U_MOREBITS1;
584  else if (bits & 0x0000ff00)
585  bits |= U_MOREBITS1;
586 
587  MSG_WriteByte (msg, bits&255 );
588 
589  if (bits & 0xff000000)
590  {
591  MSG_WriteByte (msg, (bits>>8)&255 );
592  MSG_WriteByte (msg, (bits>>16)&255 );
593  MSG_WriteByte (msg, (bits>>24)&255 );
594  }
595  else if (bits & 0x00ff0000)
596  {
597  MSG_WriteByte (msg, (bits>>8)&255 );
598  MSG_WriteByte (msg, (bits>>16)&255 );
599  }
600  else if (bits & 0x0000ff00)
601  {
602  MSG_WriteByte (msg, (bits>>8)&255 );
603  }
604 
605  //----------
606 
607  if (bits & U_NUMBER16)
608  MSG_WriteShort (msg, to->number);
609  else
610  MSG_WriteByte (msg, to->number);
611 
612  if (bits & U_MODEL)
614  if (bits & U_MODEL2)
616  if (bits & U_MODEL3)
618  if (bits & U_MODEL4)
620 
621  if (bits & U_FRAME8)
622  MSG_WriteByte (msg, to->frame);
623  if (bits & U_FRAME16)
624  MSG_WriteShort (msg, to->frame);
625 
626  if ((bits & U_SKIN8) && (bits & U_SKIN16)) //used for laser colors
627  MSG_WriteLong (msg, to->skinnum);
628  else if (bits & U_SKIN8)
629  MSG_WriteByte (msg, to->skinnum);
630  else if (bits & U_SKIN16)
631  MSG_WriteShort (msg, to->skinnum);
632 
633 
634  if ( (bits & (U_EFFECTS8|U_EFFECTS16)) == (U_EFFECTS8|U_EFFECTS16) )
635  MSG_WriteLong (msg, to->effects);
636  else if (bits & U_EFFECTS8)
637  MSG_WriteByte (msg, to->effects);
638  else if (bits & U_EFFECTS16)
639  MSG_WriteShort (msg, to->effects);
640 
641  if ( (bits & (U_RENDERFX8|U_RENDERFX16)) == (U_RENDERFX8|U_RENDERFX16) )
642  MSG_WriteLong (msg, to->renderfx);
643  else if (bits & U_RENDERFX8)
644  MSG_WriteByte (msg, to->renderfx);
645  else if (bits & U_RENDERFX16)
646  MSG_WriteShort (msg, to->renderfx);
647 
648  if (bits & U_ORIGIN1)
649  MSG_WriteCoord (msg, to->origin[0]);
650  if (bits & U_ORIGIN2)
651  MSG_WriteCoord (msg, to->origin[1]);
652  if (bits & U_ORIGIN3)
653  MSG_WriteCoord (msg, to->origin[2]);
654 
655  if (bits & U_ANGLE1)
656  MSG_WriteAngle(msg, to->angles[0]);
657  if (bits & U_ANGLE2)
658  MSG_WriteAngle(msg, to->angles[1]);
659  if (bits & U_ANGLE3)
660  MSG_WriteAngle(msg, to->angles[2]);
661 
662  if (bits & U_OLDORIGIN)
663  {
664  MSG_WriteCoord (msg, to->old_origin[0]);
665  MSG_WriteCoord (msg, to->old_origin[1]);
666  MSG_WriteCoord (msg, to->old_origin[2]);
667  }
668 
669  if (bits & U_SOUND)
670  MSG_WriteByte (msg, to->sound);
671  if (bits & U_EVENT)
672  MSG_WriteByte (msg, to->event);
673  if (bits & U_SOLID)
674  MSG_WriteShort (msg, to->solid);
675 }

Referenced by CL_Record_f(), SV_Baselines_f(), SV_EmitPacketEntities(), and SV_RecordDemoMessage().

◆ MSG_WriteDeltaUsercmd()

void MSG_WriteDeltaUsercmd ( sizebuf_t sb,
struct usercmd_s from,
struct usercmd_s cmd 
)

Definition at line 387 of file common.c.

388 {
389  int bits;
390 
391 //
392 // send the movement message
393 //
394  bits = 0;
395  if (cmd->angles[0] != from->angles[0])
396  bits |= CM_ANGLE1;
397  if (cmd->angles[1] != from->angles[1])
398  bits |= CM_ANGLE2;
399  if (cmd->angles[2] != from->angles[2])
400  bits |= CM_ANGLE3;
401  if (cmd->forwardmove != from->forwardmove)
402  bits |= CM_FORWARD;
403  if (cmd->sidemove != from->sidemove)
404  bits |= CM_SIDE;
405  if (cmd->upmove != from->upmove)
406  bits |= CM_UP;
407  if (cmd->buttons != from->buttons)
408  bits |= CM_BUTTONS;
409  if (cmd->impulse != from->impulse)
410  bits |= CM_IMPULSE;
411 
412  MSG_WriteByte (buf, bits);
413 
414  if (bits & CM_ANGLE1)
415  MSG_WriteShort (buf, cmd->angles[0]);
416  if (bits & CM_ANGLE2)
417  MSG_WriteShort (buf, cmd->angles[1]);
418  if (bits & CM_ANGLE3)
419  MSG_WriteShort (buf, cmd->angles[2]);
420 
421  if (bits & CM_FORWARD)
422  MSG_WriteShort (buf, cmd->forwardmove);
423  if (bits & CM_SIDE)
424  MSG_WriteShort (buf, cmd->sidemove);
425  if (bits & CM_UP)
426  MSG_WriteShort (buf, cmd->upmove);
427 
428  if (bits & CM_BUTTONS)
429  MSG_WriteByte (buf, cmd->buttons);
430  if (bits & CM_IMPULSE)
431  MSG_WriteByte (buf, cmd->impulse);
432 
433  MSG_WriteByte (buf, cmd->msec);
434  MSG_WriteByte (buf, cmd->lightlevel);
435 }

Referenced by CL_SendCmd().

◆ MSG_WriteDir()

void MSG_WriteDir ( sizebuf_t sb,
vec3_t  vector 
)

Definition at line 438 of file common.c.

439 {
440  int i, best;
441  float d, bestd;
442 
443  if (!dir)
444  {
445  MSG_WriteByte (sb, 0);
446  return;
447  }
448 
449  bestd = 0;
450  best = 0;
451  for (i=0 ; i<NUMVERTEXNORMALS ; i++)
452  {
453  d = DotProduct (dir, bytedirs[i]);
454  if (d > bestd)
455  {
456  bestd = d;
457  best = i;
458  }
459  }
460  MSG_WriteByte (sb, best);
461 }

Referenced by PF_WriteDir().

◆ MSG_WriteFloat()

void MSG_WriteFloat ( sizebuf_t sb,
float  f 
)

Definition at line 341 of file common.c.

342 {
343  union
344  {
345  float f;
346  int l;
347  } dat;
348 
349 
350  dat.f = f;
351  dat.l = LittleLong (dat.l);
352 
353  SZ_Write (sb, &dat.l, 4);
354 }

Referenced by PF_WriteFloat().

◆ MSG_WriteLong()

void MSG_WriteLong ( sizebuf_t sb,
int  c 
)

Definition at line 330 of file common.c.

331 {
332  byte *buf;
333 
334  buf = SZ_GetSpace (sb, 4);
335  buf[0] = c&0xff;
336  buf[1] = (c>>8)&0xff;
337  buf[2] = (c>>16)&0xff;
338  buf[3] = c>>24;
339 }

Referenced by CL_Record_f(), CL_SendCmd(), MSG_WriteDeltaEntity(), Netchan_OutOfBand(), Netchan_Transmit(), PF_WriteLong(), SV_New_f(), SV_RecordDemoMessage(), SV_ServerRecord_f(), SV_WriteFrameToClient(), and SV_WritePlayerstateToClient().

◆ MSG_WritePos()

void MSG_WritePos ( sizebuf_t sb,
vec3_t  pos 
)

Definition at line 369 of file common.c.

370 {
371  MSG_WriteShort (sb, (int)(pos[0]*8));
372  MSG_WriteShort (sb, (int)(pos[1]*8));
373  MSG_WriteShort (sb, (int)(pos[2]*8));
374 }

Referenced by PF_WritePos(), and SV_StartSound().

◆ MSG_WriteShort()

void MSG_WriteShort ( sizebuf_t sb,
int  c 
)

Definition at line 316 of file common.c.

317 {
318  byte *buf;
319 
320 #ifdef PARANOID
321  if (c < ((short)0x8000) || c > (short)0x7fff)
322  Com_Error (ERR_FATAL, "MSG_WriteShort: range error");
323 #endif
324 
325  buf = SZ_GetSpace (sb, 2);
326  buf[0] = c&0xff;
327  buf[1] = c>>8;
328 }

Referenced by CL_Record_f(), MSG_WriteAngle16(), MSG_WriteCoord(), MSG_WriteDeltaEntity(), MSG_WriteDeltaUsercmd(), MSG_WritePos(), Netchan_Transmit(), PF_Configstring(), PF_WriteShort(), SV_BeginDownload_f(), SV_Configstrings_f(), SV_EmitPacketEntities(), SV_FindIndex(), SV_New_f(), SV_NextDownload_f(), SV_RecordDemoMessage(), SV_ServerRecord_f(), SV_StartSound(), and SV_WritePlayerstateToClient().

◆ MSG_WriteString()

◆ NET_AdrToString()

char* NET_AdrToString ( netadr_t  a)

Definition at line 161 of file net_wins.c.

162 {
163  static char s[64];
164 
165  if (a.type == NA_LOOPBACK)
166  Com_sprintf (s, sizeof(s), "loopback");
167  else if (a.type == NA_IP)
168  Com_sprintf (s, sizeof(s), "%i.%i.%i.%i:%i", a.ip[0], a.ip[1], a.ip[2], a.ip[3], ntohs(a.port));
169  else
170  Com_sprintf (s, sizeof(s), "%02x%02x%02x%02x:%02x%02x%02x%02x%02x%02x:%i", a.ipx[0], a.ipx[1], a.ipx[2], a.ipx[3], a.ipx[4], a.ipx[5], a.ipx[6], a.ipx[7], a.ipx[8], a.ipx[9], ntohs(a.port));
171 
172  return s;
173 }

Referenced by CL_ConnectionlessPacket(), CL_ReadPackets(), JoinServerFunc(), Master_Heartbeat(), Master_Shutdown(), NET_GetPacket(), NET_SendPacket(), Netchan_Process(), Netchan_Transmit(), SV_ConnectionlessPacket(), SV_SetMaster_f(), SV_Status_f(), SVC_Ack(), SVC_DirectConnect(), and SVC_RemoteCommand().

◆ NET_CompareAdr()

qboolean NET_CompareAdr ( netadr_t  a,
netadr_t  b 
)

Definition at line 104 of file net_wins.c.

105 {
106  if (a.type != b.type)
107  return false;
108 
109  if (a.type == NA_LOOPBACK)
110  return TRUE;
111 
112  if (a.type == NA_IP)
113  {
114  if (a.ip[0] == b.ip[0] && a.ip[1] == b.ip[1] && a.ip[2] == b.ip[2] && a.ip[3] == b.ip[3] && a.port == b.port)
115  return true;
116  return false;
117  }
118 
119  if (a.type == NA_IPX)
120  {
121  if ((memcmp(a.ipx, b.ipx, 10) == 0) && a.port == b.port)
122  return true;
123  return false;
124  }
125 
126  return TRUE;
127 }

Referenced by CL_ReadPackets().

◆ NET_CompareBaseAdr()

qboolean NET_CompareBaseAdr ( netadr_t  a,
netadr_t  b 
)

Definition at line 136 of file net_wins.c.

137 {
138  if (a.type != b.type)
139  return false;
140 
141  if (a.type == NA_LOOPBACK)
142  return TRUE;
143 
144  if (a.type == NA_IP)
145  {
146  if (a.ip[0] == b.ip[0] && a.ip[1] == b.ip[1] && a.ip[2] == b.ip[2] && a.ip[3] == b.ip[3])
147  return true;
148  return false;
149  }
150 
151  if (a.type == NA_IPX)
152  {
153  if ((memcmp(a.ipx, b.ipx, 10) == 0))
154  return true;
155  return false;
156  }
157 
158  return TRUE;
159 }

Referenced by SV_ReadPackets(), SVC_DirectConnect(), and SVC_GetChallenge().

◆ NET_Config()

void NET_Config ( qboolean  multiplayer)

Definition at line 695 of file net_wins.c.

696 {
697  int i;
698  static qboolean old_config;
699 
700  if (old_config == multiplayer)
701  return;
702 
703  old_config = multiplayer;
704 
705  if (!multiplayer)
706  { // shut down any existing sockets
707  for (i=0 ; i<2 ; i++)
708  {
709  if (ip_sockets[i])
710  {
711  closesocket (ip_sockets[i]);
712  ip_sockets[i] = 0;
713  }
714  if (ipx_sockets[i])
715  {
716  closesocket (ipx_sockets[i]);
717  ipx_sockets[i] = 0;
718  }
719  }
720  }
721  else
722  { // open sockets
723  if (! noudp->value)
724  NET_OpenIP ();
725  if (! noipx->value)
726  NET_OpenIPX ();
727  }
728 }

Referenced by CL_Connect_f(), CL_Packet_f(), CL_PingServers_f(), CL_Rcon_f(), NET_Shutdown(), SV_InitGame(), and SV_KillServer_f().

◆ NET_GetPacket()

qboolean NET_GetPacket ( netsrc_t  sock,
netadr_t net_from,
sizebuf_t net_message 
)

Definition at line 336 of file net_wins.c.

337 {
338  int ret;
339  struct sockaddr from;
340  int fromlen;
341  int net_socket;
342  int protocol;
343  int err;
344 
346  return true;
347 
348  for (protocol = 0 ; protocol < 2 ; protocol++)
349  {
350  if (protocol == 0)
351  net_socket = ip_sockets[sock];
352  else
353  net_socket = ipx_sockets[sock];
354 
355  if (!net_socket)
356  continue;
357 
358  fromlen = sizeof(from);
359  ret = recvfrom (net_socket, net_message->data, net_message->maxsize
360  , 0, (struct sockaddr *)&from, &fromlen);
361 
362  SockadrToNetadr (&from, net_from);
363 
364  if (ret == -1)
365  {
366  err = WSAGetLastError();
367 
368  if (err == WSAEWOULDBLOCK)
369  continue;
370  if (err == WSAEMSGSIZE) {
371  Com_Printf ("Warning: Oversize packet from %s\n",
373  continue;
374  }
375 
376  if (dedicated->value) // let dedicated servers continue after errors
377  Com_Printf ("NET_GetPacket: %s from %s\n", NET_ErrorString(),
379  else
380  Com_Error (ERR_DROP, "NET_GetPacket: %s from %s",
382  continue;
383  }
384 
385  if (ret == net_message->maxsize)
386  {
387  Com_Printf ("Oversize packet from %s\n", NET_AdrToString (*net_from));
388  continue;
389  }
390 
391  net_message->cursize = ret;
392  return true;
393  }
394 
395  return false;
396 }

Referenced by CL_DumpPackets(), CL_ReadPackets(), and SV_ReadPackets().

◆ NET_Init()

void NET_Init ( void  )

Definition at line 767 of file net_wins.c.

768 {
769  WORD wVersionRequested;
770  int r;
771 
772  wVersionRequested = MAKEWORD(1, 1);
773 
774  r = WSAStartup (MAKEWORD(1, 1), &winsockdata);
775 
776  if (r)
777  Com_Error (ERR_FATAL,"Winsock initialization failed.");
778 
779  Com_Printf("Winsock Initialized\n");
780 
781  noudp = Cvar_Get ("noudp", "0", CVAR_NOSET);
782  noipx = Cvar_Get ("noipx", "0", CVAR_NOSET);
783 
784  net_shownet = Cvar_Get ("net_shownet", "0", 0);
785 }

Referenced by Qcommon_Init().

◆ NET_IsLocalAddress()

qboolean NET_IsLocalAddress ( netadr_t  adr)

Definition at line 282 of file net_wins.c.

283 {
284  return adr.type == NA_LOOPBACK;
285 }

Referenced by CL_ConnectionlessPacket(), and SVC_DirectConnect().

◆ NET_SendPacket()

void NET_SendPacket ( netsrc_t  sock,
int  length,
void data,
netadr_t  to 
)

Definition at line 400 of file net_wins.c.

401 {
402  int ret;
403  struct sockaddr addr;
404  int net_socket;
405 
406  if ( to.type == NA_LOOPBACK )
407  {
408  NET_SendLoopPacket (sock, length, data, to);
409  return;
410  }
411 
412  if (to.type == NA_BROADCAST)
413  {
414  net_socket = ip_sockets[sock];
415  if (!net_socket)
416  return;
417  }
418  else if (to.type == NA_IP)
419  {
420  net_socket = ip_sockets[sock];
421  if (!net_socket)
422  return;
423  }
424  else if (to.type == NA_IPX)
425  {
426  net_socket = ipx_sockets[sock];
427  if (!net_socket)
428  return;
429  }
430  else if (to.type == NA_BROADCAST_IPX)
431  {
432  net_socket = ipx_sockets[sock];
433  if (!net_socket)
434  return;
435  }
436  else
437  Com_Error (ERR_FATAL, "NET_SendPacket: bad address type");
438 
439  NetadrToSockadr (&to, &addr);
440 
441  ret = sendto (net_socket, data, length, 0, &addr, sizeof(addr) );
442  if (ret == -1)
443  {
444  int err = WSAGetLastError();
445 
446  // wouldblock is silent
447  if (err == WSAEWOULDBLOCK)
448  return;
449 
450  // some PPP links dont allow broadcasts
451  if ((err == WSAEADDRNOTAVAIL) && ((to.type == NA_BROADCAST) || (to.type == NA_BROADCAST_IPX)))
452  return;
453 
454  if (dedicated->value) // let dedicated servers continue after errors
455  {
456  Com_Printf ("NET_SendPacket ERROR: %s to %s\n", NET_ErrorString(),
457  NET_AdrToString (to));
458  }
459  else
460  {
461  if (err == WSAEADDRNOTAVAIL)
462  {
463  Com_DPrintf ("NET_SendPacket Warning: %s : %s\n",
465  }
466  else
467  {
468  Com_Error (ERR_DROP, "NET_SendPacket ERROR: %s to %s\n",
470  }
471  }
472  }
473 }

Referenced by CL_Packet_f(), CL_Rcon_f(), Netchan_OutOfBand(), and Netchan_Transmit().

◆ NET_Shutdown()

void NET_Shutdown ( void  )

Definition at line 793 of file net_wins.c.

794 {
795  NET_Config (false); // close sockets
796 
797  WSACleanup ();
798 }

◆ NET_Sleep()

void NET_Sleep ( int  msec)

Definition at line 731 of file net_wins.c.

732 {
733  struct timeval timeout;
734  fd_set fdset;
735  extern cvar_t *dedicated;
736  int i;
737 
738  if (!dedicated || !dedicated->value)
739  return; // we're not a server, just run full speed
740 
741  FD_ZERO(&fdset);
742  i = 0;
743  if (ip_sockets[NS_SERVER]) {
744  FD_SET(ip_sockets[NS_SERVER], &fdset); // network socket
746  }
747  if (ipx_sockets[NS_SERVER]) {
748  FD_SET(ipx_sockets[NS_SERVER], &fdset); // network socket
749  if (ipx_sockets[NS_SERVER] > i)
751  }
752  timeout.tv_sec = msec/1000;
753  timeout.tv_usec = (msec%1000)*1000;
754  select(i+1, &fdset, NULL, NULL, &timeout);
755 }

Referenced by SV_Frame().

◆ NET_StringToAdr()

qboolean NET_StringToAdr ( char *  s,
netadr_t a 
)

Definition at line 262 of file net_wins.c.

263 {
264  struct sockaddr sadr;
265 
266  if (!strcmp (s, "localhost"))
267  {
268  memset (a, 0, sizeof(*a));
269  a->type = NA_LOOPBACK;
270  return true;
271  }
272 
273  if (!NET_StringToSockaddr (s, &sadr))
274  return false;
275 
276  SockadrToNetadr (&sadr, a);
277 
278  return true;
279 }

Referenced by CL_CheckForResend(), CL_Packet_f(), CL_PingServers_f(), CL_Rcon_f(), CL_SendConnectPacket(), SV_InitGame(), and SV_SetMaster_f().

◆ Netchan_CanReliable()

qboolean Netchan_CanReliable ( netchan_t chan)

Definition at line 175 of file net_chan.c.

176 {
177  if (chan->reliable_length)
178  return false; // waiting for ack
179  return true;
180 }

◆ Netchan_Init()

void Netchan_Init ( void  )

Definition at line 91 of file net_chan.c.

92 {
93  int port;
94 
95  // pick a port value that should be nice and random
96  port = Sys_Milliseconds() & 0xffff;
97 
98  showpackets = Cvar_Get ("showpackets", "0", 0);
99  showdrop = Cvar_Get ("showdrop", "0", 0);
100  qport = Cvar_Get ("qport", va("%i", port), CVAR_NOSET);
101 }

Referenced by Qcommon_Init().

◆ Netchan_NeedReliable()

qboolean Netchan_NeedReliable ( netchan_t chan)

Definition at line 183 of file net_chan.c.

184 {
185  qboolean send_reliable;
186 
187 // if the remote side dropped the last reliable message, resend it
188  send_reliable = false;
189 
192  send_reliable = true;
193 
194 // if the reliable transmit buffer is empty, copy the current message out
195  if (!chan->reliable_length && chan->message.cursize)
196  {
197  send_reliable = true;
198  }
199 
200  return send_reliable;
201 }

Referenced by Netchan_Transmit().

◆ Netchan_OutOfBand()

void Netchan_OutOfBand ( int  net_socket,
netadr_t  adr,
int  length,
byte data 
)

Definition at line 110 of file net_chan.c.

111 {
112  sizebuf_t send;
113  byte send_buf[MAX_MSGLEN];
114 
115 // write the packet header
116  SZ_Init (&send, send_buf, sizeof(send_buf));
117 
118  MSG_WriteLong (&send, -1); // -1 sequence means out of band
119  SZ_Write (&send, data, length);
120 
121 // send the datagram
122  NET_SendPacket (net_socket, send.cursize, send.data, adr);
123 }

Referenced by Netchan_OutOfBandPrint().

◆ Netchan_OutOfBandPrint()

void Netchan_OutOfBandPrint ( int  net_socket,
netadr_t  adr,
char *  format,
  ... 
)

Definition at line 132 of file net_chan.c.

133 {
134  va_list argptr;
135  static char string[MAX_MSGLEN - 4];
136 
137  va_start (argptr, format);
138  vsnprintf (string,MAX_MSGLEN-4,format,argptr);
139  va_end (argptr);
140 
141  Netchan_OutOfBand (net_socket, adr, (int)strlen(string), (byte *)string);
142 }

Referenced by CL_CheckForResend(), CL_ConnectionlessPacket(), CL_PingServers_f(), CL_SendConnectPacket(), Master_Heartbeat(), Master_Shutdown(), SV_FlushRedirect(), SV_SetMaster_f(), SVC_DirectConnect(), SVC_GetChallenge(), SVC_Info(), SVC_Ping(), and SVC_Status().

◆ Netchan_Process()

qboolean Netchan_Process ( netchan_t chan,
sizebuf_t msg 
)

Definition at line 298 of file net_chan.c.

299 {
300  unsigned sequence, sequence_ack;
301  unsigned reliable_ack, reliable_message;
302  int qport;
303 
304 // get sequence numbers
306  sequence = MSG_ReadLong (msg);
307  sequence_ack = MSG_ReadLong (msg);
308 
309  // read the qport if we are a server
310  if (chan->sock == NS_SERVER)
311  qport = MSG_ReadShort (msg);
312 
313  reliable_message = sequence >> 31;
314  reliable_ack = sequence_ack >> 31;
315 
316  sequence &= ~(1<<31);
317  sequence_ack &= ~(1<<31);
318 
319  if (showpackets->value)
320  {
321  if (reliable_message)
322  Com_Printf ("recv %4i : s=%i reliable=%i ack=%i rack=%i\n"
323  , msg->cursize
324  , sequence
325  , chan->incoming_reliable_sequence ^ 1
326  , sequence_ack
327  , reliable_ack);
328  else
329  Com_Printf ("recv %4i : s=%i ack=%i rack=%i\n"
330  , msg->cursize
331  , sequence
332  , sequence_ack
333  , reliable_ack);
334  }
335 
336 //
337 // discard stale or duplicated packets
338 //
339  if (sequence <= chan->incoming_sequence)
340  {
341  if (showdrop->value)
342  Com_Printf ("%s:Out of order packet %i at %i\n"
344  , sequence
345  , chan->incoming_sequence);
346  return false;
347  }
348 
349 //
350 // dropped packets don't keep the message from being used
351 //
352  chan->dropped = sequence - (chan->incoming_sequence+1);
353  if (chan->dropped > 0)
354  {
355  if (showdrop->value)
356  Com_Printf ("%s:Dropped %i packets at %i\n"
358  , chan->dropped
359  , sequence);
360  }
361 
362 //
363 // if the current outgoing reliable message has been acknowledged
364 // clear the buffer to make way for the next
365 //
366  if (reliable_ack == chan->reliable_sequence)
367  chan->reliable_length = 0; // it has been received
368 
369 //
370 // if this message contains a reliable message, bump incoming_reliable_sequence
371 //
372  chan->incoming_sequence = sequence;
373  chan->incoming_acknowledged = sequence_ack;
374  chan->incoming_reliable_acknowledged = reliable_ack;
375  if (reliable_message)
376  {
377  chan->incoming_reliable_sequence ^= 1;
378  }
379 
380 //
381 // the message can now be read from the current message pointer
382 //
383  chan->last_received = curtime;
384 
385  return true;
386 }

Referenced by CL_ReadPackets(), and SV_ReadPackets().

◆ Netchan_Setup()

void Netchan_Setup ( netsrc_t  sock,
netchan_t chan,
netadr_t  adr,
int  qport 
)

Definition at line 152 of file net_chan.c.

153 {
154  memset (chan, 0, sizeof(*chan));
155 
156  chan->sock = sock;
157  chan->remote_address = adr;
158  chan->qport = qport;
159  chan->last_received = curtime;
160  chan->incoming_sequence = 0;
161  chan->outgoing_sequence = 1;
162 
163  SZ_Init (&chan->message, chan->message_buf, sizeof(chan->message_buf));
164  chan->message.allowoverflow = true;
165 }

Referenced by CL_ConnectionlessPacket(), and SVC_DirectConnect().

◆ Netchan_Transmit()

void Netchan_Transmit ( netchan_t chan,
int  length,
byte data 
)

Definition at line 213 of file net_chan.c.

214 {
215  sizebuf_t send;
216  byte send_buf[MAX_MSGLEN];
217  qboolean send_reliable;
218  unsigned w1, w2;
219 
220 // check for message overflow
221  if (chan->message.overflowed)
222  {
223  chan->fatal_error = true;
224  Com_Printf ("%s:Outgoing message overflow\n"
225  , NET_AdrToString (chan->remote_address));
226  return;
227  }
228 
229  send_reliable = Netchan_NeedReliable (chan);
230 
231  if (!chan->reliable_length && chan->message.cursize)
232  {
233  memcpy (chan->reliable_buf, chan->message_buf, chan->message.cursize);
234  chan->reliable_length = chan->message.cursize;
235  chan->message.cursize = 0;
236  chan->reliable_sequence ^= 1;
237  }
238 
239 
240 // write the packet header
241  SZ_Init (&send, send_buf, sizeof(send_buf));
242 
243  w1 = ( chan->outgoing_sequence & ~(1<<31) ) | (send_reliable<<31);
244  w2 = ( chan->incoming_sequence & ~(1<<31) ) | (chan->incoming_reliable_sequence<<31);
245 
246  chan->outgoing_sequence++;
247  chan->last_sent = curtime;
248 
249  MSG_WriteLong (&send, w1);
250  MSG_WriteLong (&send, w2);
251 
252  // send the qport if we are a client
253  if (chan->sock == NS_CLIENT)
254  MSG_WriteShort (&send, qport->value);
255 
256 // copy the reliable message to the packet first
257  if (send_reliable)
258  {
259  SZ_Write (&send, chan->reliable_buf, chan->reliable_length);
261  }
262 
263 // add the unreliable part if space is available
264  if (send.maxsize - send.cursize >= length)
265  SZ_Write (&send, data, length);
266  else
267  Com_Printf ("Netchan_Transmit: dumped unreliable\n");
268 
269 // send the datagram
270  NET_SendPacket (chan->sock, send.cursize, send.data, chan->remote_address);
271 
272  if (showpackets->value)
273  {
274  if (send_reliable)
275  Com_Printf ("send %4i : s=%i reliable=%i ack=%i rack=%i\n"
276  , send.cursize
277  , chan->outgoing_sequence - 1
278  , chan->reliable_sequence
279  , chan->incoming_sequence
281  else
282  Com_Printf ("send %4i : s=%i ack=%i rack=%i\n"
283  , send.cursize
284  , chan->outgoing_sequence - 1
285  , chan->incoming_sequence
287  }
288 }

Referenced by CL_Disconnect(), CL_SendCmd(), SV_FinalMessage(), SV_SendClientDatagram(), and SV_SendClientMessages().

◆ Pmove()

void Pmove ( pmove_t pmove)

Definition at line 1240 of file pmove.c.

1241 {
1242  pm = pmove;
1243 
1244  // clear results
1245  pm->numtouch = 0;
1247  pm->viewheight = 0;
1248  pm->groundentity = 0;
1249  pm->watertype = 0;
1250  pm->waterlevel = 0;
1251 
1252  // clear all pmove local vars
1253  memset (&pml, 0, sizeof(pml));
1254 
1255  // convert origin and velocity to float values
1256  pml.origin[0] = pm->s.origin[0]*0.125;
1257  pml.origin[1] = pm->s.origin[1]*0.125;
1258  pml.origin[2] = pm->s.origin[2]*0.125;
1259 
1260  pml.velocity[0] = pm->s.velocity[0]*0.125;
1261  pml.velocity[1] = pm->s.velocity[1]*0.125;
1262  pml.velocity[2] = pm->s.velocity[2]*0.125;
1263 
1264  // save old org in case we get stuck
1266 
1267  pml.frametime = pm->cmd.msec * 0.001;
1268 
1269  PM_ClampAngles ();
1270 
1271  if (pm->s.pm_type == PM_SPECTATOR)
1272  {
1273  PM_FlyMove (false);
1274  PM_SnapPosition ();
1275  return;
1276  }
1277 
1278  if (pm->s.pm_type >= PM_DEAD)
1279  {
1280  pm->cmd.forwardmove = 0;
1281  pm->cmd.sidemove = 0;
1282  pm->cmd.upmove = 0;
1283  }
1284 
1285  if (pm->s.pm_type == PM_FREEZE)
1286  return; // no movement at all
1287 
1288  // set mins, maxs, and viewheight
1289  PM_CheckDuck ();
1290 
1291  if (pm->snapinitial)
1293 
1294  // set groundentity, watertype, and waterlevel
1296 
1297  if (pm->s.pm_type == PM_DEAD)
1298  PM_DeadMove ();
1299 
1301 
1302  // drop timing counter
1303  if (pm->s.pm_time)
1304  {
1305  int msec;
1306 
1307  msec = pm->cmd.msec >> 3;
1308  if (!msec)
1309  msec = 1;
1310  if ( msec >= pm->s.pm_time)
1311  {
1313  pm->s.pm_time = 0;
1314  }
1315  else
1316  pm->s.pm_time -= msec;
1317  }
1318 
1319  if (pm->s.pm_flags & PMF_TIME_TELEPORT)
1320  { // teleport pause stays exactly in place
1321  }
1322  else if (pm->s.pm_flags & PMF_TIME_WATERJUMP)
1323  { // waterjump has no control, but falls
1324  pml.velocity[2] -= pm->s.gravity * pml.frametime;
1325  if (pml.velocity[2] < 0)
1326  { // cancel as soon as we are falling down again
1328  pm->s.pm_time = 0;
1329  }
1330 
1331  PM_StepSlideMove ();
1332  }
1333  else
1334  {
1335  PM_CheckJump ();
1336 
1337  PM_Friction ();
1338 
1339  if (pm->waterlevel >= 2)
1340  PM_WaterMove ();
1341  else {
1342  vec3_t angles;
1343 
1344  VectorCopy(pm->viewangles, angles);
1345  if (angles[PITCH] > 180)
1346  angles[PITCH] = angles[PITCH] - 360;
1347  angles[PITCH] /= 3;
1348 
1349  AngleVectors (angles, pml.forward, pml.right, pml.up);
1350 
1351  PM_AirMove ();
1352  }
1353  }
1354 
1355  // set groundentity, watertype, and waterlevel for final spot
1357 
1358  PM_SnapPosition ();
1359 }

Referenced by CL_PredictMovement(), and SV_InitGameProgs().

◆ Qcommon_Frame()

void Qcommon_Frame ( int  msec)

Definition at line 1500 of file common.c.

1501 {
1502  char *s;
1503  int time_before, time_between, time_after;
1504 
1505  if (setjmp (abortframe) )
1506  {
1507  if (shutdown_game)
1509  shutdown_game = false;
1510  return; // an ERR_DROP was thrown
1511  }
1512 
1513  if ( log_stats->modified )
1514  {
1515  log_stats->modified = false;
1516  if ( log_stats->value )
1517  {
1518  if ( log_stats_file )
1519  {
1520  fclose( log_stats_file );
1521  log_stats_file = 0;
1522  }
1523  log_stats_file = fopen( "stats.log", "w" );
1524  if ( log_stats_file )
1525  fprintf( log_stats_file, "entities,dlights,parts,frame time\n" );
1526  }
1527  else
1528  {
1529  if ( log_stats_file )
1530  {
1531  fclose( log_stats_file );
1532  log_stats_file = 0;
1533  }
1534  }
1535  }
1536 
1537  if (fixedtime->value)
1538  msec = fixedtime->value;
1539  else if (timescale->value)
1540  {
1541  msec *= timescale->value;
1542  if (msec < 1)
1543  msec = 1;
1544  }
1545 
1546  if (showtrace->value)
1547  {
1548  extern int c_traces, c_brush_traces;
1549  extern int c_pointcontents;
1550 
1551  Com_Printf ("%4i traces %4i points\n", c_traces, c_pointcontents);
1552  c_traces = 0;
1553  c_brush_traces = 0;
1554  c_pointcontents = 0;
1555  }
1556 
1557  do
1558  {
1559  s = Sys_ConsoleInput ();
1560  if (s)
1561  Cbuf_AddText (va("%s\n",s));
1562  } while (s);
1563  Cbuf_Execute ();
1564 
1565  if (host_speeds->value)
1566  time_before = Sys_Milliseconds ();
1567 
1568  SV_Frame (msec);
1569 
1570  if (host_speeds->value)
1571  time_between = Sys_Milliseconds ();
1572 
1573  CL_Frame (msec);
1574 
1575  if (host_speeds->value)
1576  time_after = Sys_Milliseconds ();
1577 
1578 
1579  if (host_speeds->value)
1580  {
1581  int all, sv, gm, cl, rf;
1582 
1583  all = time_after - time_before;
1584  sv = time_between - time_before;
1585  cl = time_after - time_between;
1588  sv -= gm;
1589  cl -= rf;
1590  Com_Printf ("all:%3i sv:%3i gm:%3i cl:%3i rf:%3i\n",
1591  all, sv, gm, cl, rf);
1592  }
1593 }

Referenced by WinMain().

◆ Qcommon_Init()

void Qcommon_Init ( int  argc,
char **  argv 
)

Definition at line 1407 of file common.c.

1408 {
1409  char *s;
1410 
1411  if (setjmp (abortframe) )
1412  Sys_Error ("Error during initialization");
1413 
1415 
1416  // prepare enough of the subsystems to handle
1417  // cvar and command buffer management
1418  COM_InitArgv (argc, argv);
1419 
1420  Swap_Init ();
1421  Cbuf_Init ();
1422 
1423  Cmd_Init ();
1424  Cvar_Init ();
1425 
1426  Key_Init ();
1427 
1428  // we need to add the early commands twice, because
1429  // a basedir or cddir needs to be set before execing
1430  // config files, but we want other parms to override
1431  // the settings of the config files
1432  Cbuf_AddEarlyCommands (false);
1433  Cbuf_Execute ();
1434 
1435  FS_InitFilesystem ();
1436 
1437  Cbuf_AddText ("exec default.cfg\n");
1438  Cbuf_AddText ("exec config.cfg\n");
1439 
1440  Cbuf_AddEarlyCommands (true);
1441  Cbuf_Execute ();
1442 
1443  //
1444  // init commands and vars
1445  //
1446  Cmd_AddCommand ("z_stats", Z_Stats_f);
1447  Cmd_AddCommand ("error", Com_Error_f);
1448 
1449  host_speeds = Cvar_Get ("host_speeds", "0", 0);
1450  log_stats = Cvar_Get ("log_stats", "0", 0);
1451  developer = Cvar_Get ("developer", "0", 0);
1452  timescale = Cvar_Get ("timescale", "1", 0);
1453  fixedtime = Cvar_Get ("fixedtime", "0", 0);
1454  logfile_active = Cvar_Get ("logfile", "0", 0);
1455  showtrace = Cvar_Get ("showtrace", "0", 0);
1456 #ifdef DEDICATED_ONLY
1457  dedicated = Cvar_Get ("dedicated", "1", CVAR_NOSET);
1458 #else
1459  dedicated = Cvar_Get ("dedicated", "0", CVAR_NOSET);
1460 #endif
1461 
1462  s = va("%4.2f %s %s %s", VERSION, CPUSTRING, __DATE__, BUILDSTRING);
1463  Cvar_Get ("version", s, CVAR_SERVERINFO|CVAR_NOSET);
1464 
1465 
1466  if (dedicated->value)
1467  Cmd_AddCommand ("quit", Com_Quit);
1468 
1469  Sys_Init ();
1470 
1471  NET_Init ();
1472  Netchan_Init ();
1473 
1474  SV_Init ();
1475  CL_Init ();
1476 
1477  // add + commands from command line
1478  if (!Cbuf_AddLateCommands ())
1479  { // if the user didn't give any commands, run default action
1480  if (!dedicated->value)
1481  Cbuf_AddText ("d1\n");
1482  else
1483  Cbuf_AddText ("dedicated_start\n");
1484  Cbuf_Execute ();
1485  }
1486  else
1487  { // the user asked for something explicit
1488  // so drop the loading plaque
1490  }
1491 
1492  Com_Printf ("====== Quake2 Initialized ======\n\n");
1493 }

Referenced by WinMain().

◆ Qcommon_Shutdown()

void Qcommon_Shutdown ( void  )

Definition at line 1600 of file common.c.

1601 {
1602 }

Referenced by Sys_Error(), and Sys_Quit().

◆ SCR_BeginLoadingPlaque()

void SCR_BeginLoadingPlaque ( void  )

Definition at line 562 of file cl_scrn.c.

563 {
564  S_StopAllSounds ();
565  cl.sound_prepped = false; // don't play ambients
566  CDAudio_Stop ();
567  Miniaudio_Stop ();
568  if (cls.disable_screen)
569  return;
570  if (developer->value)
571  return;
572  if (cls.state == ca_disconnected)
573  return; // if at console, don't bring up the plaque
574  if (cls.key_dest == key_console)
575  return;
576  if (cl.cinematictime > 0)
577  scr_draw_loading = 2; // clear to balack first
578  else
579  scr_draw_loading = 1;
580  SCR_UpdateScreen ();
583 }

Referenced by CL_Changing_f(), SCR_RunCinematic(), SV_InitGame(), and SV_Map().

◆ SCR_DebugGraph()

void SCR_DebugGraph ( float  value,
int  color 
)

Definition at line 137 of file cl_scrn.c.

138 {
139  values[current&1023].value = value;
140  values[current&1023].color = color;
141  current++;
142 }

◆ SV_Frame()

void SV_Frame ( int  msec)

Definition at line 760 of file sv_main.c.

761 {
763 
764  // if server is not active, do nothing
765  if (!svs.initialized)
766  return;
767 
768  svs.realtime += msec;
769 
770  // keep the random time dependent
771  rand ();
772 
773  // check timeouts
774  SV_CheckTimeouts ();
775 
776  // get packets from clients
777  SV_ReadPackets ();
778 
779  // move autonomous things around if enough time has passed
780  if (!sv_timedemo->value && svs.realtime < sv.time)
781  {
782  // never let the time get too far off
783  if (sv.time - svs.realtime > 100)
784  {
785  if (sv_showclamp->value)
786  Com_Printf ("sv lowclamp\n");
787  svs.realtime = sv.time - 100;
788  }
790  return;
791  }
792 
793  // update ping based on the last known frame from all clients
794  SV_CalcPings ();
795 
796  // give the clients some timeslices
797  SV_GiveMsec ();
798 
799  // let everything in the world think and move
800  SV_RunGameFrame ();
801 
802  // send messages back to the clients that had packets read this frame
804 
805  // save the entire world state if recording a serverdemo
807 
808  // send a heartbeat to the master if needed
809  Master_Heartbeat ();
810 
811  // clear teleport flags, etc for next frame
813 
814 }

Referenced by Qcommon_Frame().

◆ SV_Init()

void SV_Init ( void  )

Definition at line 948 of file sv_main.c.

949 {
951 
952  rcon_password = Cvar_Get ("rcon_password", "", 0);
953  Cvar_Get ("skill", "1", 0);
954  Cvar_Get ("deathmatch", "0", CVAR_LATCH);
955  Cvar_Get ("coop", "0", CVAR_LATCH);
956  Cvar_Get ("dmflags", va("%i", DF_INSTANT_ITEMS), CVAR_SERVERINFO);
957  Cvar_Get ("fraglimit", "0", CVAR_SERVERINFO);
958  Cvar_Get ("timelimit", "0", CVAR_SERVERINFO);
959  Cvar_Get ("cheats", "0", CVAR_SERVERINFO|CVAR_LATCH);
960  Cvar_Get ("protocol", va("%i", PROTOCOL_VERSION), CVAR_SERVERINFO|CVAR_NOSET);;
961  maxclients = Cvar_Get ("maxclients", "1", CVAR_SERVERINFO | CVAR_LATCH);
962  hostname = Cvar_Get ("hostname", "noname", CVAR_SERVERINFO | CVAR_ARCHIVE);
963  msg_timeout = Cvar_Get ("timeout", "125", 0);
964  zombietime = Cvar_Get ("zombietime", "2", 0);
965  sv_showclamp = Cvar_Get ("showclamp", "0", 0);
966  sv_paused = Cvar_Get ("paused", "0", 0);
967  sv_timedemo = Cvar_Get ("timedemo", "0", 0);
968  sv_enforcetime = Cvar_Get ("sv_enforcetime", "0", 0);
969  allow_download = Cvar_Get ("allow_download", "1", CVAR_ARCHIVE);
970  allow_download_players = Cvar_Get ("allow_download_players", "0", CVAR_ARCHIVE);
971  allow_download_models = Cvar_Get ("allow_download_models", "1", CVAR_ARCHIVE);
972  allow_download_sounds = Cvar_Get ("allow_download_sounds", "1", CVAR_ARCHIVE);
973  allow_download_maps = Cvar_Get ("allow_download_maps", "1", CVAR_ARCHIVE);
974 
975  sv_noreload = Cvar_Get ("sv_noreload", "0", 0);
976 
977  sv_airaccelerate = Cvar_Get("sv_airaccelerate", "0", CVAR_LATCH);
978 
979  public_server = Cvar_Get ("public", "0", 0);
980 
981  sv_reconnect_limit = Cvar_Get ("sv_reconnect_limit", "3", CVAR_ARCHIVE);
982 
984 }

Referenced by Qcommon_Init().

◆ SV_Shutdown()

void SV_Shutdown ( char *  finalmsg,
qboolean  reconnect 
)

Definition at line 1035 of file sv_main.c.

1036 {
1037  if (svs.clients)
1038  SV_FinalMessage (finalmsg, reconnect);
1039 
1040  Master_Shutdown ();
1041  // calling this function here causes function stack to be corrupted on 64 bit builds when invoked from Com_Error()
1042  //SV_ShutdownGameProgs ();
1043 
1044  // free current level
1045  if (sv.demofile)
1046  fclose (sv.demofile);
1047  memset (&sv, 0, sizeof(sv));
1049 
1050  // free server static data
1051  if (svs.clients)
1052  Z_Free (svs.clients);
1053  if (svs.client_entities)
1055  if (svs.demofile)
1056  fclose (svs.demofile);
1057  memset (&svs, 0, sizeof(svs));
1058 }

Referenced by CL_Connect_f(), Com_Error(), Com_Quit(), SV_InitGame(), and SV_KillServer_f().

◆ Sys_AppActivate()

void Sys_AppActivate ( void  )

Definition at line 467 of file sys_win.c.

468 {
469  ShowWindow ( cl_hwnd, SW_RESTORE);
470  SetForegroundWindow ( cl_hwnd );
471 }

Referenced by CL_ConnectionlessPacket().

◆ Sys_ConsoleInput()

char* Sys_ConsoleInput ( void  )

Definition at line 289 of file sys_win.c.

290 {
291  INPUT_RECORD recs[1024];
292  int dummy;
293  int ch, numread, numevents;
294 
295  if (!dedicated || !dedicated->value)
296  return NULL;
297 
298 
299  for ( ;; )
300  {
301  if (!GetNumberOfConsoleInputEvents (hinput, &numevents))
302  Sys_Error ("Error getting # of console events");
303 
304  if (numevents <= 0)
305  break;
306 
307  if (!ReadConsoleInput(hinput, recs, 1, &numread))
308  Sys_Error ("Error reading console input");
309 
310  if (numread != 1)
311  Sys_Error ("Couldn't read console input");
312 
313  if (recs[0].EventType == KEY_EVENT)
314  {
315  if (!recs[0].Event.KeyEvent.bKeyDown)
316  {
317  ch = recs[0].Event.KeyEvent.uChar.AsciiChar;
318 
319  switch (ch)
320  {
321  case '\r':
322  WriteFile(houtput, "\r\n", 2, &dummy, NULL);
323 
324  if (console_textlen)
325  {
327  console_textlen = 0;
328  return console_text;
329  }
330  break;
331 
332  case '\b':
333  if (console_textlen)
334  {
335  console_textlen--;
336  WriteFile(houtput, "\b \b", 3, &dummy, NULL);
337  }
338  break;
339 
340  default:
341  if (ch >= ' ')
342  {
343  if (console_textlen < sizeof(console_text)-2)
344  {
345  WriteFile(houtput, &ch, 1, &dummy, NULL);
347  console_textlen++;
348  }
349  }
350 
351  break;
352 
353  }
354  }
355  }
356  }
357 
358  return NULL;
359 }

Referenced by Qcommon_Frame().

◆ Sys_ConsoleOutput()

void Sys_ConsoleOutput ( char *  string)

Definition at line 369 of file sys_win.c.

370 {
371  int dummy;
372  char text[256];
373 
374  if (!dedicated || !dedicated->value)
375  {
376 #ifdef WIN_DEBUG_CONSOLE
377  fputs(string, stderr);
378  OutputDebugString(string);
379 #endif
380  return;
381  }
382 
383  if (console_textlen)
384  {
385  text[0] = '\r';
386  memset(&text[1], ' ', console_textlen);
387  text[console_textlen+1] = '\r';
388  text[console_textlen+2] = 0;
389  WriteFile(houtput, text, console_textlen+2, &dummy, NULL);
390  }
391 
392  WriteFile(houtput, string, (DWORD)strlen(string), &dummy, NULL);
393 
394  if (console_textlen)
395  WriteFile(houtput, console_text, console_textlen, &dummy, NULL);
396 }

Referenced by Com_Printf().

◆ Sys_CopyProtect()

void Sys_CopyProtect ( void  )

Definition at line 191 of file sys_win.c.

192 {
193 #ifndef DEMO
194  char *cddir;
195 
196  cddir = Sys_ScanForCD();
197  if (!cddir[0])
198  Com_Error (ERR_FATAL, "You must have the Quake2 CD in the drive to play.");
199 #endif
200 }

Referenced by SV_InitGame().

◆ Sys_Error()

void Sys_Error ( char *  error,
  ... 
)

Definition at line 68 of file sys_win.c.

69 {
70  va_list argptr;
71  char text[1024];
72 
73  CL_Shutdown ();
75 
76  va_start (argptr, error);
77  vsnprintf (text, 1024, error, argptr);
78  va_end (argptr);
79 
80  MessageBox(NULL, text, "Error", 0 /* MB_OK */ );
81 
82  if (qwclsemaphore)
83  CloseHandle (qwclsemaphore);
84 
85 // shut down QHOST hooks if necessary
86  DeinitConProc ();
87 
88  exit (1);
89 }

Referenced by COM_BlockSequenceCheckByte(), COM_BlockSequenceCRCByte(), Com_Error(), Hunk_Alloc(), Hunk_Begin(), Hunk_End(), Qcommon_Init(), QVk_BeginFrame(), QVk_EndFrame(), QVk_GetStagingBuffer(), and Sys_FindFirst().

◆ Sys_GetClipboardData()

char* Sys_GetClipboardData ( void  )

Definition at line 431 of file sys_win.c.

432 {
433  char *data = NULL;
434  char *cliptext;
435 
436  if ( OpenClipboard( NULL ) != 0 )
437  {
438  HANDLE hClipboardData;
439 
440  if ( ( hClipboardData = GetClipboardData( CF_TEXT ) ) != 0 )
441  {
442  if ( ( cliptext = GlobalLock( hClipboardData ) ) != 0 )
443  {
444  data = malloc( GlobalSize( hClipboardData ) + 1 );
445  strcpy( data, cliptext );
446  GlobalUnlock( hClipboardData );
447  }
448  }
449  CloseClipboard();
450  }
451  return data;
452 }

Referenced by Field_Key(), and Key_Console().

◆ Sys_GetGameAPI()

void* Sys_GetGameAPI ( void parms)

Definition at line 502 of file sys_win.c.

503 {
504  void *(*GetGameAPI) (void *);
505  char name[MAX_OSPATH];
506  char *path;
507  char cwd[MAX_OSPATH];
508 #if defined _M_IX86
509  const char *gamename = "gamex86.dll";
510 
511 #ifdef NDEBUG
512  const char *debugdir = "release";
513 #else
514  const char *debugdir = "debug";
515 #endif
516 
517 #elif defined _M_X64
518  const char *gamename = "gamex64.dll";
519 
520 #ifdef NDEBUG
521  const char *debugdir = "releasex64";
522 #else
523  const char *debugdir = "debugx64";
524 #endif
525 
526 #elif defined _M_ALPHA
527  const char *gamename = "gameaxp.dll";
528 
529 #ifdef NDEBUG
530  const char *debugdir = "releaseaxp";
531 #else
532  const char *debugdir = "debugaxp";
533 #endif
534 
535 #endif
536 
537  if (game_library)
538  Com_Error (ERR_FATAL, "Sys_GetGameAPI without Sys_UnloadingGame");
539 
540  // check the current debug directory first for development purposes
541  _getcwd (cwd, sizeof(cwd));
542  Com_sprintf (name, sizeof(name), "%s/%s/%s", cwd, debugdir, gamename);
543  game_library = LoadLibrary ( name );
544  if (game_library)
545  {
546  Com_DPrintf ("LoadLibrary (%s)\n", name);
547  }
548  else
549  {
550 #ifdef DEBUG
551  // check the current directory for other development purposes
552  Com_sprintf (name, sizeof(name), "%s/%s", cwd, gamename);
553  game_library = LoadLibrary ( name );
554  if (game_library)
555  {
556  Com_DPrintf ("LoadLibrary (%s)\n", name);
557  }
558  else
559 #endif
560  {
561  // now run through the search paths
562  path = NULL;
563  while (1)
564  {
565  path = FS_NextPath (path);
566  if (!path)
567  return NULL; // couldn't find one anywhere
568  Com_sprintf (name, sizeof(name), "%s/%s", path, gamename);
569  game_library = LoadLibrary (name);
570  if (game_library)
571  {
572  Com_DPrintf ("LoadLibrary (%s)\n",name);
573  break;
574  }
575  }
576  }
577  }
578 
579  GetGameAPI = (void *)GetProcAddress (game_library, "GetGameAPI");
580  if (!GetGameAPI)
581  {
582  Sys_UnloadGame ();
583  return NULL;
584  }
585 
586  return GetGameAPI (parms);
587 }

Referenced by SV_InitGameProgs().

◆ Sys_Init()

void Sys_Init ( void  )

Definition at line 238 of file sys_win.c.

239 {
240  OSVERSIONINFO vinfo;
241 
242  timeBeginPeriod( 1 );
243 
244  vinfo.dwOSVersionInfoSize = sizeof(vinfo);
245 
246  if (!GetVersionEx (&vinfo))
247  Sys_Error ("Couldn't get OS info");
248 
249  if (vinfo.dwMajorVersion < 4)
250  Sys_Error ("Quake2 requires windows version 4 or greater");
251  if (vinfo.dwPlatformId == VER_PLATFORM_WIN32s)
252  Sys_Error ("Quake2 doesn't run on Win32s");
253  else if ( vinfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS )
254  s_win95 = true;
255 
256  if (dedicated->value)
257  {
258  if (!AllocConsole ())
259  Sys_Error ("Couldn't create dedicated server console");
260  hinput = GetStdHandle (STD_INPUT_HANDLE);
261  houtput = GetStdHandle (STD_OUTPUT_HANDLE);
262 
263  // let QHOST hook in
264  InitConProc (argc, argv);
265  }
266 #ifdef WIN_DEBUG_CONSOLE
267  else
268  {
269  AllocConsole();
270  SetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), 0x07);
271  DeleteMenu(GetSystemMenu(GetConsoleWindow(), false), SC_CLOSE, MF_BYCOMMAND);
272  freopen("CONOUT$", "w", stderr);
273  }
274 #endif
275 
276  // enable DPI awareness
278 }

Referenced by Qcommon_Init().

◆ Sys_Quit()

void Sys_Quit ( void  )

Definition at line 91 of file sys_win.c.

92 {
93  timeEndPeriod( 1 );
94 
95  CL_Shutdown();
97  CloseHandle (qwclsemaphore);
98  if (dedicated && dedicated->value)
99  FreeConsole ();
100 #ifdef WIN_DEBUG_CONSOLE
101  else
102  FreeConsole();
103 #endif
104 
105 // shut down QHOST hooks if necessary
106  DeinitConProc ();
107 
108  exit (0);
109 }

Referenced by Com_Quit(), and Sys_SendKeyEvents().

◆ Sys_SendKeyEvents()

void Sys_SendKeyEvents ( void  )

Definition at line 406 of file sys_win.c.

407 {
408  MSG msg;
409 
410  while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE))
411  {
412  if (!GetMessage (&msg, NULL, 0, 0))
413  Sys_Quit ();
414  sys_msg_time = msg.time;
415  TranslateMessage (&msg);
416  DispatchMessage (&msg);
417  }
418 
419  // grab frame time
420  sys_frame_time = timeGetTime(); // FIXME: should this be at start?
421 }

Referenced by CL_PrepRefresh(), CL_RegisterSounds(), CL_SendCommand(), CL_Skins_f(), and Key_GetKey().

◆ Sys_UnloadGame()

void Sys_UnloadGame ( void  )

Definition at line 488 of file sys_win.c.

489 {
490  if (!FreeLibrary (game_library))
491  Com_Error (ERR_FATAL, "FreeLibrary failed for game library");
492  game_library = NULL;
493 }

Referenced by SV_ShutdownGameProgs(), and Sys_GetGameAPI().

◆ SZ_Clear()

◆ SZ_GetSpace()

void* SZ_GetSpace ( sizebuf_t buf,
int  length 
)

Definition at line 898 of file common.c.

899 {
900  void *data;
901 
902  if (buf->cursize + length > buf->maxsize)
903  {
904  if (!buf->allowoverflow)
905  Com_Error (ERR_FATAL, "SZ_GetSpace: overflow without allowoverflow set");
906 
907  if (length > buf->maxsize)
908  Com_Error (ERR_FATAL, "SZ_GetSpace: %i is > full buffer size", length);
909 
910  Com_Printf ("SZ_GetSpace: overflow\n");
911  SZ_Clear (buf);
912  buf->overflowed = true;
913  }
914 
915  data = buf->data + buf->cursize;
916  buf->cursize += length;
917 
918  return data;
919 }

Referenced by MSG_WriteByte(), MSG_WriteChar(), MSG_WriteLong(), MSG_WriteShort(), SZ_Print(), and SZ_Write().

◆ SZ_Init()

void SZ_Init ( sizebuf_t buf,
byte data,
int  length 
)

Definition at line 885 of file common.c.

886 {
887  memset (buf, 0, sizeof(*buf));
888  buf->data = data;
889  buf->maxsize = length;
890 }

Referenced by Cbuf_Init(), CL_Record_f(), CL_SendCmd(), Netchan_OutOfBand(), Netchan_Setup(), Netchan_Transmit(), SV_Init(), SV_RecordDemoMessage(), SV_SendClientDatagram(), SV_ServerRecord_f(), SV_SpawnServer(), and SVC_DirectConnect().

◆ SZ_Print()

void SZ_Print ( sizebuf_t buf,
char *  data 
)

Definition at line 926 of file common.c.

927 {
928  int len;
929 
930  len = (int)strlen(data)+1;
931 
932  if (buf->cursize)
933  {
934  if (buf->data[buf->cursize-1])
935  memcpy ((byte *)SZ_GetSpace(buf, len),data,len); // no trailing 0
936  else
937  memcpy ((byte *)SZ_GetSpace(buf, len-1)-1,data,len); // write over trailing 0
938  }
939  else
940  memcpy ((byte *)SZ_GetSpace(buf, len),data,len);
941 }

Referenced by CL_ForwardToServer_f(), CL_ParseDownload(), Cmd_ForwardToServer(), and SCR_FinishCinematic().

◆ SZ_Write()

void SZ_Write ( sizebuf_t buf,
void data,
int  length 
)

◆ Z_Free()

void Z_Free ( void ptr)

Definition at line 1122 of file common.c.

1123 {
1124  zhead_t *z;
1125 
1126  z = ((zhead_t *)ptr) - 1;
1127 
1128  if (z->magic != Z_MAGIC)
1129  Com_Error (ERR_FATAL, "Z_Free: bad magic");
1130 
1131  z->prev->next = z->next;
1132  z->next->prev = z->prev;
1133 
1134  z_count--;
1135  z_bytes -= z->size;
1136  free (z);
1137 }

Referenced by Cbuf_AddLateCommands(), Cbuf_InsertText(), Cmd_Alias_f(), Cmd_Exec_f(), Cmd_RemoveCommand(), Cmd_TokenizeString(), Cvar_FullSet(), Cvar_GetLatchedVars(), Cvar_Set2(), FS_FreeFile(), FS_Link_f(), FS_SetGamedir(), Key_SetBinding(), S_EndRegistration(), S_Shutdown(), SCR_LoadPCX(), SCR_PlayCinematic(), SCR_RunCinematic(), SCR_StopCinematic(), SV_InitGameProgs(), SV_Shutdown(), and Z_FreeTags().

◆ Z_FreeTags()

void Z_FreeTags ( int  tag)

Definition at line 1155 of file common.c.

1156 {
1157  zhead_t *z, *next;
1158 
1159  for (z=z_chain.next ; z != &z_chain ; z=next)
1160  {
1161  next = z->next;
1162  if (z->tag == tag)
1163  Z_Free ((void *)(z+1));
1164  }
1165 }

Referenced by SV_InitGameProgs().

◆ Z_Malloc()

◆ Z_TagMalloc()

void* Z_TagMalloc ( int  size,
int  tag 
)

Definition at line 1172 of file common.c.

1173 {
1174  zhead_t *z;
1175 
1176  size = size + sizeof(zhead_t);
1177  z = malloc(size);
1178  if (!z)
1179  Com_Error (ERR_FATAL, "Z_Malloc: failed on allocation of %i bytes",size);
1180  memset (z, 0, size);
1181  z_count++;
1182  z_bytes += size;
1183  z->magic = Z_MAGIC;
1184  z->tag = tag;
1185  z->size = size;
1186 
1187  z->next = z_chain.next;
1188  z->prev = &z_chain;
1189  z_chain.next->prev = z;
1190  z_chain.next = z;
1191 
1192  return (void *)(z+1);
1193 }

Referenced by SV_InitGameProgs(), and Z_Malloc().

Variable Documentation

◆ bigendien

qboolean bigendien

Definition at line 934 of file q_shared.c.

Referenced by Swap_Init().

◆ bytedirs

◆ cvar_vars

◆ dedicated

cvar_t* dedicated

Definition at line 47 of file common.c.

◆ developer

cvar_t* developer

Definition at line 42 of file common.c.

Referenced by Com_DPrintf(), Qcommon_Init(), and SCR_BeginLoadingPlaque().

◆ host_speeds

cvar_t* host_speeds

Definition at line 40 of file common.c.

Referenced by CL_Frame(), Qcommon_Frame(), Qcommon_Init(), and SV_RunGameFrame().

◆ log_stats

cvar_t* log_stats

Definition at line 41 of file common.c.

Referenced by CL_Frame(), Qcommon_Frame(), Qcommon_Init(), and V_RenderView().

◆ log_stats_file

FILE* log_stats_file

Definition at line 38 of file common.c.

Referenced by CL_Frame(), Qcommon_Frame(), and V_RenderView().

◆ net_from

netadr_t net_from

Definition at line 81 of file net_chan.c.

◆ net_message

sizebuf_t net_message

Definition at line 82 of file net_chan.c.

◆ net_message_buffer

byte net_message_buffer[MAX_MSGLEN]

Definition at line 83 of file net_chan.c.

Referenced by CL_Init(), and SV_Init().

◆ pm_airaccelerate

float pm_airaccelerate

Definition at line 57 of file pmove.c.

Referenced by CL_PredictMovement(), PM_AirMove(), and SV_SpawnServer().

◆ time_after_game

int time_after_game

Definition at line 55 of file common.c.

Referenced by Qcommon_Frame(), SV_Frame(), and SV_RunGameFrame().

◆ time_after_ref

int time_after_ref

Definition at line 57 of file common.c.

Referenced by CL_Frame(), and Qcommon_Frame().

◆ time_before_game

int time_before_game

Definition at line 54 of file common.c.

Referenced by Qcommon_Frame(), SV_Frame(), and SV_RunGameFrame().

◆ time_before_ref

int time_before_ref

Definition at line 56 of file common.c.

Referenced by CL_Frame(), and Qcommon_Frame().

◆ userinfo_modified

qboolean userinfo_modified

Definition at line 485 of file cvar.c.

Referenced by CL_SendCmd(), CL_SendConnectPacket(), Cvar_FullSet(), and Cvar_Set2().

sv_airaccelerate
cvar_t * sv_airaccelerate
Definition: sv_main.c:43
cmdalias_s::next
struct cmdalias_s * next
Definition: cmd.c:30
shutdown_game
static qboolean shutdown_game
Definition: common.c:36
entity_state_s::old_origin
vec3_t old_origin
Definition: q_shared.h:1151
LUMP_VISIBILITY
#define LUMP_VISIBILITY
Definition: qfiles.h:265
LUMP_BRUSHSIDES
#define LUMP_BRUSHSIDES
Definition: qfiles.h:277
NA_IPX
@ NA_IPX
Definition: qcommon.h:547
CL_Drop
void CL_Drop(void)
Definition: cl_main.c:399
CL_InitLocal
void CL_InitLocal(void)
Definition: cl_main.c:1409
sv
server_t sv
Definition: sv_init.c:24
cplane_s::normal
vec3_t normal
Definition: q_shared.h:415
SV_FinalMessage
void SV_FinalMessage(char *message, qboolean reconnect)
Definition: sv_main.c:996
cvar_s::flags
int flags
Definition: q_shared.h:329
CDAudio_Stop
void CDAudio_Stop(void)
Definition: cd_win.c:194
CM_BoxTrace
trace_t CM_BoxTrace(vec3_t start, vec3_t end, vec3_t mins, vec3_t maxs, int headnode, int brushmask)
Definition: cmodel.c:1350
usercmd_s::lightlevel
byte lightlevel
Definition: q_shared.h:524
refdef_t::vieworg
float vieworg[3]
Definition: ref.h:106
FS_Read
void FS_Read(void *buffer, int len, FILE *f)
Definition: files.c:350
SCR_EndLoadingPlaque
void SCR_EndLoadingPlaque(void)
Definition: cl_scrn.c:590
Z_MAGIC
#define Z_MAGIC
Definition: common.c:1103
cvar_vars
cvar_t * cvar_vars
Definition: cvar.c:24
usercmd_s::impulse
byte impulse
Definition: q_shared.h:523
numvisibility
int numvisibility
Definition: cmodel.c:90
dedicated
cvar_t * dedicated
Definition: common.c:47
curtime
int curtime
Definition: q_shwin.c:119
sizebuf_s
Definition: qcommon.h:92
dheader_t
Definition: qfiles.h:283
sv_paused
cvar_t * sv_paused
Definition: sv_main.c:27
value
GLfloat value
Definition: qgl_win.c:63
svc_nop
@ svc_nop
Definition: qcommon.h:232
svc_centerprint
@ svc_centerprint
Definition: qcommon.h:241
Cmd_MacroExpandString
char * Cmd_MacroExpandString(char *text)
Definition: cmd.c:542
CM_PointLeafnum_r
int CM_PointLeafnum_r(vec3_t p, int num)
Definition: cmodel.c:800
searchpath_s::filename
char filename[MAX_OSPATH]
Definition: files.c:78
ipx_sockets
int ipx_sockets[2]
Definition: net_wins.c:48
NET_OpenIP
void NET_OpenIP(void)
Definition: net_wins.c:542
CMod_LoadEntityString
void CMod_LoadEntityString(lump_t *l)
Definition: cmodel.c:530
PM_InitialSnapPosition
void PM_InitialSnapPosition(void)
Definition: pmove.c:1168
client_state_t::servercount
int servercount
Definition: client.h:154
MAX_QPATH
#define MAX_QPATH
Definition: q_shared.h:80
entity_state_s::modelindex4
int modelindex4
Definition: q_shared.h:1153
netchan_t::sock
netsrc_t sock
Definition: qcommon.h:586
NET_Sleep
void NET_Sleep(int msec)
Definition: net_wins.c:731
CRC_INIT_VALUE
#define CRC_INIT_VALUE
Definition: crc.c:28
entity_state_s::solid
int solid
Definition: q_shared.h:1158
netchan_t::incoming_sequence
int incoming_sequence
Definition: qcommon.h:597
TRUE
#define TRUE
Definition: stb_vorbis.c:617
Z_TagMalloc
void * Z_TagMalloc(int size, int tag)
Definition: common.c:1172
U_ANGLE2
#define U_ANGLE2
Definition: qcommon.h:317
netchan_t::last_reliable_sequence
int last_reliable_sequence
Definition: qcommon.h:605
U_MOREBITS3
#define U_MOREBITS3
Definition: qcommon.h:341
pm
pmove_t * pm
Definition: pmove.c:48
netchan_t::incoming_acknowledged
int incoming_acknowledged
Definition: qcommon.h:598
z_chain
zhead_t z_chain
Definition: common.c:1114
trace_t::fraction
float fraction
Definition: q_shared.h:457
pmove_t::watertype
int watertype
Definition: q_shared.h:548
int
CONST PIXELFORMATDESCRIPTOR int
Definition: qgl_win.c:35
LUMP_AREAPORTALS
#define LUMP_AREAPORTALS
Definition: qfiles.h:280
VectorSubtract
#define VectorSubtract(a, b, c)
Definition: q_shared.h:163
U_ANGLE1
#define U_ANGLE1
Definition: qcommon.h:327
NS_SERVER
@ NS_SERVER
Definition: qcommon.h:549
CDAudio_Update
void CDAudio_Update(void)
Definition: cd_win.c:419
V_Init
void V_Init(void)
Definition: cl_view.c:579
FS_Path_f
void FS_Path_f(void)
Definition: files.c:793
cleaf_t::contents
int contents
Definition: cmodel.c:38
Swap_Init
void Swap_Init(void)
Definition: q_shared.c:1011
svc_muzzleflash
@ svc_muzzleflash
Definition: qcommon.h:225
entity_state_s::frame
int frame
Definition: q_shared.h:1154
file_from_pak
int file_from_pak
Definition: files.c:204
log_stats
cvar_t * log_stats
Definition: common.c:41
CVAR_NOSET
#define CVAR_NOSET
Definition: q_shared.h:319
client_state_t::v_forward
vec3_t v_forward
Definition: client.h:133
svc_frame
@ svc_frame
Definition: qcommon.h:246
sv_showclamp
cvar_t * sv_showclamp
Definition: sv_main.c:48
trace_start
vec3_t trace_start
Definition: cmodel.c:976
trace_t::plane
cplane_t plane
Definition: q_shared.h:459
Com_SetServerState
void Com_SetServerState(int state)
Definition: common.c:266
CM_SIDE
#define CM_SIDE
Definition: qcommon.h:293
Cvar_Command
qboolean Cvar_Command(void)
Definition: cvar.c:363
chktbl
static byte chktbl[1024]
Definition: common.c:1264
client_static_t::disable_screen
float disable_screen
Definition: client.h:212
CMod_LoadVisibility
void CMod_LoadVisibility(lump_t *l)
Definition: cmodel.c:506
EXEC_NOW
#define EXEC_NOW
Definition: qcommon.h:747
svc_bad
@ svc_bad
Definition: qcommon.h:222
showtrace
cvar_t * showtrace
Definition: common.c:46
CMod_LoadSubmodels
void CMod_LoadSubmodels(lump_t *l)
Definition: cmodel.c:137
ca_disconnected
@ ca_disconnected
Definition: client.h:186
s_win95
qboolean s_win95
Definition: sys_win.c:40
client_state_t::v_up
vec3_t v_up
Definition: client.h:133
Sys_Mkdir
void Sys_Mkdir(char *path)
Definition: q_shwin.c:135
SV_ReadPackets
void SV_ReadPackets(void)
Definition: sv_main.c:597
pmove_t::viewheight
float viewheight
Definition: q_shared.h:543
cleaf_t::cluster
int cluster
Definition: cmodel.c:39
NET_Config
void NET_Config(qboolean multiplayer)
Definition: net_wins.c:695
LUMP_MODELS
#define LUMP_MODELS
Definition: qfiles.h:275
entity_state_s::renderfx
int renderfx
Definition: q_shared.h:1157
defer_text_buf
byte defer_text_buf[8192]
Definition: cmd.c:71
MSG_ReadShort
int MSG_ReadShort(sizebuf_t *msg_read)
Definition: common.c:716
PM_FREEZE
@ PM_FREEZE
Definition: q_shared.h:477
net_message
sizebuf_t net_message
Definition: net_chan.c:82
v
GLdouble v
Definition: qgl_win.c:143
cvar_s::modified
qboolean modified
Definition: q_shared.h:330
U_ORIGIN1
#define U_ORIGIN1
Definition: qcommon.h:315
netchan_t::message
sizebuf_t message
Definition: qcommon.h:608
SV_CalcPings
void SV_CalcPings(void)
Definition: sv_main.c:521
NA_IP
@ NA_IP
Definition: qcommon.h:547
PM_CheckDuck
void PM_CheckDuck(void)
Definition: pmove.c:976
ca_uninitialized
@ ca_uninitialized
Definition: client.h:185
numplanes
int numplanes
Definition: cmodel.c:71
entity_state_s::origin
vec3_t origin
Definition: q_shared.h:1149
cmdalias_s::name
char name[MAX_ALIAS_NAME]
Definition: cmd.c:31
numclusters
int numclusters
Definition: cmodel.c:103
CM_RecursiveHullCheck
void CM_RecursiveHullCheck(int num, float p1f, float p2f, vec3_t p1, vec3_t p2)
Definition: cmodel.c:1227
fs_cddir
cvar_t * fs_cddir
Definition: files.c:63
net_from
netadr_t net_from
Definition: net_chan.c:81
Cbuf_Init
void Cbuf_Init(void)
Definition: cmd.c:78
fs_links
filelink_t * fs_links
Definition: files.c:74
ALIAS_LOOP_COUNT
#define ALIAS_LOOP_COUNT
Definition: cmd.c:39
sizebuf_s::overflowed
qboolean overflowed
Definition: qcommon.h:95
PM_SnapPosition
void PM_SnapPosition(void)
Definition: pmove.c:1081
BASEDIRNAME
#define BASEDIRNAME
Definition: qcommon.h:28
FS_SetGamedir
void FS_SetGamedir(char *dir)
Definition: files.c:595
svc_inventory
@ svc_inventory
Definition: qcommon.h:229
NET_AdrToString
char * NET_AdrToString(netadr_t a)
Definition: net_wins.c:161
U_RENDERFX8
#define U_RENDERFX8
Definition: qcommon.h:329
server_static_t::realtime
int realtime
Definition: server.h:161
Sys_Error
void Sys_Error(char *error,...)
Definition: sys_win.c:68
GetGameAPI
game_export_t * GetGameAPI(game_import_t *import)
Definition: g_main.c:111
U_OLDORIGIN
#define U_OLDORIGIN
Definition: qcommon.h:344
DVIS_PHS
#define DVIS_PHS
Definition: qfiles.h:462
box_headnode
int box_headnode
Definition: cmodel.c:692
console_text
static char console_text[256]
Definition: sys_win.c:281
com_token
char com_token[MAX_TOKEN_CHARS]
Definition: q_shared.c:1063
sv_timedemo
cvar_t * sv_timedemo
Definition: sv_main.c:28
cvar_s::string
char * string
Definition: q_shared.h:327
EXEC_INSERT
#define EXEC_INSERT
Definition: qcommon.h:748
qboolean
qboolean
Definition: q_shared.h:63
x
GLint GLenum GLint x
Definition: qgl_win.c:116
map_visibility
byte map_visibility[MAX_MAP_VISIBILITY]
Definition: cmodel.c:91
client_static_t::disable_servercount
int disable_servercount
Definition: client.h:215
trace_t
Definition: q_shared.h:453
z
GLdouble GLdouble z
Definition: qgl_win.c:283
COM_Argv
char * COM_Argv(int arg)
Definition: common.c:973
pmove_state_t::gravity
short gravity
Definition: q_shared.h:502
z_count
int z_count
Definition: common.c:1115
VectorClear
#define VectorClear(a)
Definition: q_shared.h:166
i
int i
Definition: q_shared.c:305
MSG_WriteCoord
void MSG_WriteCoord(sizebuf_t *sb, float f)
Definition: common.c:364
pml
pml_t pml
Definition: pmove.c:49
Miniaudio_Shutdown
void Miniaudio_Shutdown(void)
Definition: snd_miniaudio.c:352
host_speeds
cvar_t * host_speeds
Definition: common.c:40
fs_basedir
cvar_t * fs_basedir
Definition: files.c:62
mapsurface_s::c
csurface_t c
Definition: q_shared.h:448
Netchan_OutOfBand
void Netchan_OutOfBand(int net_socket, netadr_t adr, int length, byte *data)
Definition: net_chan.c:110
LUMP_LEAFS
#define LUMP_LEAFS
Definition: qfiles.h:270
FS_Dir_f
void FS_Dir_f(void)
Definition: files.c:740
portalopen
qboolean portalopen[MAX_MAP_AREAPORTALS]
Definition: cmodel.c:109
MAX_NUM_ARGVS
#define MAX_NUM_ARGVS
Definition: common.c:27
pmove_t::waterlevel
int waterlevel
Definition: q_shared.h:549
ca_active
@ ca_active
Definition: client.h:189
U_MODEL
#define U_MODEL
Definition: qcommon.h:328
SV_CheckTimeouts
void SV_CheckTimeouts(void)
Definition: sv_main.c:663
cmod_base
byte * cmod_base
Definition: cmodel.c:130
COM_InitArgv
void COM_InitArgv(int argc, char **argv)
Definition: common.c:993
buffer
GLenum GLfloat * buffer
Definition: qgl_win.c:151
entity_state_s::event
int event
Definition: q_shared.h:1162
netchan_t::dropped
int dropped
Definition: qcommon.h:588
MSG_WriteLong
void MSG_WriteLong(sizebuf_t *sb, int c)
Definition: common.c:330
PITCH
#define PITCH
Definition: q_shared.h:72
PM_ClampAngles
void PM_ClampAngles(void)
Definition: pmove.c:1204
client_state_t::cinematictime
int cinematictime
Definition: client.h:145
FS_NextPath
char * FS_NextPath(char *prevpath)
Definition: files.c:821
MAX_TOKEN_CHARS
#define MAX_TOKEN_CHARS
Definition: q_shared.h:78
VERSION
#define VERSION
Definition: qcommon.h:26
NET_AdrToString
char * NET_AdrToString(netadr_t a)
Definition: net_wins.c:161
CL_PredictMovement
void CL_PredictMovement(void)
Definition: cl_pred.c:199
pack_s::numfiles
int numfiles
Definition: files.c:57
argv
char * argv[MAX_NUM_ARGVS]
Definition: sys_win.c:56
CL_ReadPackets
void CL_ReadPackets(void)
Definition: cl_main.c:990
time_before_game
int time_before_game
Definition: common.c:54
CopyString
char * CopyString(char *in)
Definition: common.c:1038
SZ_Init
void SZ_Init(sizebuf_t *buf, byte *data, int length)
Definition: common.c:885
zhead_s::prev
struct zhead_s * prev
Definition: common.c:1108
svc_playerinfo
@ svc_playerinfo
Definition: qcommon.h:243
argc
int argc
Definition: sys_win.c:55
maxclients
cvar_t * maxclients
Definition: sv_main.c:47
NET_OpenIPX
void NET_OpenIPX(void)
Definition: net_wins.c:647
Sys_Init
void Sys_Init(void)
Definition: sys_win.c:238
CL_Disconnect
void CL_Disconnect(void)
Definition: cl_main.c:618
pmove_state_t::velocity
short velocity[3]
Definition: q_shared.h:499
Cmd_Args
char * Cmd_Args(void)
Definition: cmd.c:531
usercmd_s::forwardmove
short forwardmove
Definition: q_shared.h:522
sizebuf_s::data
byte * data
Definition: qcommon.h:96
client_state_t::refdef
refdef_t refdef
Definition: client.h:131
numnodes
int numnodes
Definition: cmodel.c:74
NA_BROADCAST
@ NA_BROADCAST
Definition: qcommon.h:547
map_cmodels
cmodel_t map_cmodels[MAX_MAP_MODELS]
Definition: cmodel.c:85
server_t::demofile
FILE * demofile
Definition: server.h:65
cmd_function_s::next
struct cmd_function_s * next
Definition: cmd.c:489
Sys_Quit
void Sys_Quit(void)
Definition: sys_win.c:91
Cvar_Get
cvar_t * Cvar_Get(char *var_name, char *var_value, int flags)
Definition: cvar.c:127
cvar_s::next
struct cvar_s * next
Definition: q_shared.h:332
U_MODEL2
#define U_MODEL2
Definition: qcommon.h:338
Cmd_ExecuteString
void Cmd_ExecuteString(char *text)
Definition: cmd.c:811
PM_AirMove
void PM_AirMove(void)
Definition: pmove.c:575
cmd_argv
static char * cmd_argv[MAX_STRING_TOKENS]
Definition: cmd.c:496
DVIS_PVS
#define DVIS_PVS
Definition: qfiles.h:461
net_shownet
cvar_t * net_shownet
Definition: net_wins.c:42
entity_state_s::modelindex3
int modelindex3
Definition: q_shared.h:1153
SZ_Write
void SZ_Write(sizebuf_t *buf, void *data, int length)
Definition: common.c:921
cvar_s
Definition: q_shared.h:324
packfile_t::filelen
int filelen
Definition: files.c:50
LUMP_NODES
#define LUMP_NODES
Definition: qfiles.h:266
allow_download_players
cvar_t * allow_download_players
Definition: sv_main.c:38
pml_t::frametime
float frametime
Definition: pmove.c:37
SZ_Clear
void SZ_Clear(sizebuf_t *buf)
Definition: common.c:892
trace_extents
vec3_t trace_extents
Definition: cmodel.c:978
FS_FOpenFile
int FS_FOpenFile(char *filename, FILE **file)
Definition: files.c:206
LUMP_AREAS
#define LUMP_AREAS
Definition: qfiles.h:279
entity_state_s::effects
unsigned int effects
Definition: q_shared.h:1156
CVAR_SERVERINFO
#define CVAR_SERVERINFO
Definition: q_shared.h:318
Com_Error_f
void Com_Error_f(void)
Definition: common.c:1396
CL_Init
void CL_Init(void)
Definition: cl_main.c:1785
packfile_t::name
char name[MAX_QPATH]
Definition: files.c:49
Netchan_Init
void Netchan_Init(void)
Definition: net_chan.c:91
Cmd_TokenizeString
void Cmd_TokenizeString(char *text, qboolean macroExpand)
Definition: cmd.c:620
PM_DeadMove
void PM_DeadMove(void)
Definition: pmove.c:1034
j
GLint j
Definition: qgl_win.c:150
entity_state_s::sound
int sound
Definition: q_shared.h:1161
Sys_ConsoleInput
char * Sys_ConsoleInput(void)
Definition: sys_win.c:289
Cmd_Argv
char * Cmd_Argv(int arg)
Definition: cmd.c:517
Cvar_BitInfo
char * Cvar_BitInfo(int bit)
Definition: cvar.c:488
U_ANGLE3
#define U_ANGLE3
Definition: qcommon.h:318
va
char * va(char *format,...)
Definition: q_shared.c:1050
sv_enforcetime
cvar_t * sv_enforcetime
Definition: sv_main.c:30
cnode_t::children
int children[2]
Definition: cmodel.c:27
msg
cvar_t * msg
Definition: cl_main.c:83
server_static_t::client_entities
entity_state_t * client_entities
Definition: server.h:171
winsockdata
static WSADATA winsockdata
Definition: net_wins.c:760
showdrop
cvar_t * showdrop
Definition: net_chan.c:78
cmd_alias
cmdalias_t * cmd_alias
Definition: cmd.c:35
sizebuf_s::maxsize
int maxsize
Definition: qcommon.h:97
Cmd_Argc
int Cmd_Argc(void)
Definition: cmd.c:507
DF_INSTANT_ITEMS
#define DF_INSTANT_ITEMS
Definition: q_shared.h:1028
netchan_t::fatal_error
qboolean fatal_error
Definition: qcommon.h:584
FS_Link_f
void FS_Link_f(void)
Definition: files.c:652
trace_ispoint
qboolean trace_ispoint
Definition: cmodel.c:982
game_library
static HINSTANCE game_library
Definition: sys_win.c:481
trace_end
vec3_t trace_end
Definition: cmodel.c:976
AngleVectors
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
Definition: q_shared.c:93
U_SOUND
#define U_SOUND
Definition: qcommon.h:346
server_static_t::clients
client_t * clients
Definition: server.h:168
netchan_t::incoming_reliable_acknowledged
int incoming_reliable_acknowledged
Definition: qcommon.h:599
SCR_RunConsole
void SCR_RunConsole(void)
Definition: cl_scrn.c:498
searchpath_s::next
struct searchpath_s * next
Definition: files.c:80
RF_BEAM
#define RF_BEAM
Definition: q_shared.h:606
SCR_UpdateScreen
void SCR_UpdateScreen(void)
Definition: cl_scrn.c:1215
SockadrToNetadr
void SockadrToNetadr(struct sockaddr *s, netadr_t *a)
Definition: net_wins.c:86
PM_FlyMove
void PM_FlyMove(qboolean doclip)
Definition: pmove.c:882
trace_t::allsolid
qboolean allsolid
Definition: q_shared.h:455
SZ_Print
void SZ_Print(sizebuf_t *buf, char *data)
Definition: common.c:926
Key_Init
void Key_Init(void)
Definition: keys.c:647
CM_ANGLE1
#define CM_ANGLE1
Definition: qcommon.h:289
bytedirs
vec3_t bytedirs[NUMVERTEXNORMALS]
Definition: common.c:281
cmd_text_buf
byte cmd_text_buf[8192]
Definition: cmd.c:69
PMF_TIME_TELEPORT
#define PMF_TIME_TELEPORT
Definition: q_shared.h:486
CM_TestInLeaf
void CM_TestInLeaf(int leafnum)
Definition: cmodel.c:1192
userinfo_modified
qboolean userinfo_modified
Definition: cvar.c:485
Sys_Error
void Sys_Error(char *error,...)
Definition: sys_win.c:68
CM_DecompressVis
void CM_DecompressVis(byte *in, byte *out)
Definition: cmodel.c:1530
cvar_s::latched_string
char * latched_string
Definition: q_shared.h:328
searchpath_s
Definition: files.c:76
CMod_LoadAreas
void CMod_LoadAreas(lump_t *l)
Definition: cmodel.c:444
cmdalias_s::value
char * value
Definition: cmd.c:32
cvar_s::name
char * name
Definition: q_shared.h:326
usercmd_s::sidemove
short sidemove
Definition: q_shared.h:522
EXEC_APPEND
#define EXEC_APPEND
Definition: qcommon.h:749
numleafs
int numleafs
Definition: cmodel.c:77
trace_maxs
vec3_t trace_maxs
Definition: cmodel.c:977
pml_t::velocity
vec3_t velocity
Definition: pmove.c:34
CMod_LoadBrushSides
void CMod_LoadBrushSides(lump_t *l)
Definition: cmodel.c:408
pmove_state_t::pm_type
pmtype_t pm_type
Definition: q_shared.h:496
cmd_argc
static int cmd_argc
Definition: cmd.c:495
U_EVENT
#define U_EVENT
Definition: qcommon.h:320
r
GLdouble GLdouble r
Definition: qgl_win.c:336
hinput
static HANDLE hinput
Definition: sys_win.c:46
z_bytes
int z_bytes
Definition: common.c:1115
sys_frame_time
unsigned sys_frame_time
Definition: sys_win.c:49
MAX_READ
#define MAX_READ
Definition: files.c:349
CMod_LoadLeafBrushes
void CMod_LoadLeafBrushes(lump_t *l)
Definition: cmodel.c:378
LittleLong
int LittleLong(int l)
Definition: q_shared.c:948
console_t::linewidth
int linewidth
Definition: console.h:39
COM_ClearArgv
void COM_ClearArgv(int arg)
Definition: common.c:980
CL_RunDLights
void CL_RunDLights(void)
Definition: cl_fx.c:211
Sys_FindFirst
char * Sys_FindFirst(char *path, unsigned musthave, unsigned canthave)
Definition: q_shwin.c:173
console_t::current
int current
Definition: console.h:33
_LittleFloat
float(* _LittleFloat)(float l)
Definition: q_shared.c:943
U_EFFECTS16
#define U_EFFECTS16
Definition: qcommon.h:337
CRC_Block
unsigned short CRC_Block(byte *start, int count)
Definition: crc.c:82
Qcommon_Shutdown
void Qcommon_Shutdown(void)
Definition: common.c:1600
LUMP_BRUSHES
#define LUMP_BRUSHES
Definition: qfiles.h:276
Cvar_FullSet
cvar_t * Cvar_FullSet(char *var_name, char *value, int flags)
Definition: cvar.c:288
netadrtype_t
netadrtype_t
Definition: qcommon.h:547
box_planes
cplane_t * box_planes
Definition: cmodel.c:691
NET_SendPacket
void NET_SendPacket(netsrc_t sock, int length, void *data, netadr_t to)
Definition: net_wins.c:400
U_ORIGIN2
#define U_ORIGIN2
Definition: qcommon.h:316
public_server
cvar_t * public_server
Definition: sv_main.c:51
netadr_t::ip
byte ip[4]
Definition: qcommon.h:555
cmd_text
sizebuf_t cmd_text
Definition: cmd.c:68
pmove_t::groundentity
struct edict_s * groundentity
Definition: q_shared.h:547
sv_noreload
cvar_t * sv_noreload
Definition: sv_main.c:45
com_argc
int com_argc
Definition: common.c:30
numareaportals
int numareaportals
Definition: cmodel.c:100
forward
static vec3_t forward
Definition: p_view.c:29
netchan_t::last_sent
int last_sent
Definition: qcommon.h:591
M_Init
void M_Init(void)
Definition: menu.c:3973
pml_t::origin
vec3_t origin
Definition: pmove.c:33
FS_AddGameDirectory
void FS_AddGameDirectory(char *dir)
Definition: files.c:517
IN_Frame
void IN_Frame(void)
Definition: in_win.c:413
CL_PrepRefresh
void CL_PrepRefresh(void)
Definition: cl_view.c:250
pml_t::right
vec3_t right
Definition: pmove.c:36
CL_RunLightStyles
void CL_RunLightStyles(void)
Definition: cl_fx.c:66
cmdalias_s
Definition: cmd.c:28
pack_s::handle
FILE * handle
Definition: files.c:56
Sys_SetDPIAwareness
void Sys_SetDPIAwareness(void)
Definition: sys_win.c:212
CL_Shutdown
void CL_Shutdown(void)
Definition: cl_main.c:1831
trace_trace
trace_t trace_trace
Definition: cmodel.c:980
U_EFFECTS8
#define U_EFFECTS8
Definition: qcommon.h:330
U_MOREBITS1
#define U_MOREBITS1
Definition: qcommon.h:322
cmd_args
static char cmd_args[MAX_STRING_CHARS]
Definition: cmd.c:498
CL_WriteConfiguration
void CL_WriteConfiguration(void)
Definition: cl_main.c:1560
Sys_ConsoleOutput
void Sys_ConsoleOutput(char *string)
Definition: sys_win.c:369
U_MODEL4
#define U_MODEL4
Definition: qcommon.h:340
zhead_s::next
struct zhead_s * next
Definition: common.c:1108
FS_ExecAutoexec
void FS_ExecAutoexec(void)
Definition: files.c:572
rcon_password
cvar_t * rcon_password
Definition: sv_main.c:35
Cmd_AddCommand
void Cmd_AddCommand(char *cmd_name, xcommand_t function)
Definition: cmd.c:691
client_state_t::refresh_prepped
qboolean refresh_prepped
Definition: client.h:98
pml_t::forward
vec3_t forward
Definition: pmove.c:36
netadr_t::ipx
byte ipx[10]
Definition: qcommon.h:556
map_leafs
cleaf_t map_leafs[MAX_MAP_LEAFS]
Definition: cmodel.c:78
Cvar_Set2
cvar_t * Cvar_Set2(char *var_name, char *value, qboolean force)
Definition: cvar.c:179
numareas
int numareas
Definition: cmodel.c:97
PROTOCOL_VERSION
#define PROTOCOL_VERSION
Definition: qcommon.h:197
FS_LoadFile
int FS_LoadFile(char *path, void **buffer)
Definition: files.c:398
sys_msg_time
unsigned sys_msg_time
Definition: sys_win.c:48
cmd_function_s::name
char * name
Definition: cmd.c:490
CDAudio_Shutdown
void CDAudio_Shutdown(void)
Definition: cd_win.c:487
DotProduct
#define DotProduct(x, y)
Definition: q_shared.h:162
CVAR_ARCHIVE
#define CVAR_ARCHIVE
Definition: q_shared.h:316
Cmd_ForwardToServer
void Cmd_ForwardToServer(void)
Definition: cl_main.c:286
cl_hwnd
HWND cl_hwnd
Definition: vid_dll.c:58
sv_reconnect_limit
cvar_t * sv_reconnect_limit
Definition: sv_main.c:53
Sys_Quit
void Sys_Quit(void)
Definition: sys_win.c:91
U_FRAME16
#define U_FRAME16
Definition: qcommon.h:335
S_Shutdown
void S_Shutdown(void)
Definition: snd_dma.c:164
cvar_s::value
float value
Definition: q_shared.h:331
Cbuf_AddText
void Cbuf_AddText(char *text)
Definition: cmd.c:90
cplane_s::dist
float dist
Definition: q_shared.h:416
cnode_t
Definition: cmodel.c:24
MSG_ReadByte
int MSG_ReadByte(sizebuf_t *msg_read)
Definition: common.c:703
time_before_ref
int time_before_ref
Definition: common.c:56
Con_Print
void Con_Print(char *text)
Definition: console.c:352
U_SKIN8
#define U_SKIN8
Definition: qcommon.h:334
pack_s
Definition: files.c:53
console_t::text
char text[CON_TEXTSIZE]
Definition: console.h:32
MAX_OSPATH
#define MAX_OSPATH
Definition: q_shared.h:81
svc_deltapacketentities
@ svc_deltapacketentities
Definition: qcommon.h:245
LUMP_LEAFBRUSHES
#define LUMP_LEAFBRUSHES
Definition: qfiles.h:272
error
static int error(vorb *f, enum STBVorbisError e)
Definition: stb_vorbis.c:865
U_RENDERFX16
#define U_RENDERFX16
Definition: qcommon.h:336
fs_base_searchpaths
searchpath_t * fs_base_searchpaths
Definition: files.c:84
con
console_t con
Definition: console.c:25
trace_mins
vec3_t trace_mins
Definition: cmodel.c:977
console_textlen
static int console_textlen
Definition: sys_win.c:282
key_console
@ key_console
Definition: client.h:200
CM_FORWARD
#define CM_FORWARD
Definition: qcommon.h:292
timescale
cvar_t * timescale
Definition: common.c:43
U_MOREBITS2
#define U_MOREBITS2
Definition: qcommon.h:331
entity_state_s::number
int number
Definition: q_shared.h:1147
NULL
#define NULL
Definition: q_shared.h:67
dheader_t::lumps
lump_t lumps[HEADER_LUMPS]
Definition: qfiles.h:287
FS_InitFilesystem
void FS_InitFilesystem(void)
Definition: files.c:848
SV_RunGameFrame
void SV_RunGameFrame(void)
Definition: sv_main.c:723
CVAR_LATCH
#define CVAR_LATCH
Definition: q_shared.h:321
zhead_t
struct zhead_s zhead_t
FS_filelength
int FS_filelength(FILE *f)
Definition: files.c:104
MAX_STRING_TOKENS
#define MAX_STRING_TOKENS
Definition: q_shared.h:77
MSG_WriteShort
void MSG_WriteShort(sizebuf_t *sb, int c)
Definition: common.c:316
CMod_LoadNodes
void CMod_LoadNodes(lump_t *l)
Definition: cmodel.c:209
COM_Argc
int COM_Argc(void)
Definition: common.c:968
allow_download_models
cvar_t * allow_download_models
Definition: sv_main.c:39
graphsamp_t::color
int color
Definition: cl_scrn.c:126
PM_CheckJump
void PM_CheckJump(void)
Definition: pmove.c:778
checkcount
int checkcount
Definition: cmodel.c:61
noudp
static cvar_t * noudp
Definition: net_wins.c:43
MSG_WriteByte
void MSG_WriteByte(sizebuf_t *sb, int c)
Definition: common.c:303
CM_BUTTONS
#define CM_BUTTONS
Definition: qcommon.h:295
Miniaudio_Stop
void Miniaudio_Stop(void)
Definition: snd_miniaudio.c:287
Com_Error
void Com_Error(int code, char *fmt,...)
Definition: common.c:181
svc_layout
@ svc_layout
Definition: qcommon.h:228
pmove_t::numtouch
int numtouch
Definition: q_shared.h:539
SV_Init
void SV_Init(void)
Definition: sv_main.c:948
NetadrToSockadr
void NetadrToSockadr(netadr_t *a, struct sockaddr *s)
Definition: net_wins.c:54
zombietime
cvar_t * zombietime
Definition: sv_main.c:33
rd_target
static int rd_target
Definition: common.c:67
Cmd_Alias_f
void Cmd_Alias_f(void)
Definition: cmd.c:425
map_vis
dvis_t * map_vis
Definition: cmodel.c:92
current
static int current
Definition: cl_scrn.c:129
clc_userinfo
@ clc_userinfo
Definition: qcommon.h:259
Z_Malloc
void * Z_Malloc(int size)
Definition: common.c:1200
PM_DEAD
@ PM_DEAD
Definition: q_shared.h:475
cmd_null_string
static char * cmd_null_string
Definition: cmd.c:497
client_state_t::time
int time
Definition: client.h:127
nullsurface
mapsurface_t nullsurface
Definition: cmodel.c:105
SZ_GetSpace
void * SZ_GetSpace(sizebuf_t *buf, int length)
Definition: common.c:898
map_nodes
cnode_t map_nodes[MAX_MAP_NODES+6]
Definition: cmodel.c:75
ERR_DROP
#define ERR_DROP
Definition: qcommon.h:744
svs
server_static_t svs
Definition: sv_init.c:23
PerformMD4
static void PerformMD4(const unsigned char *buf, int length, unsigned char *digest)
Definition: md4.c:105
usercmd_s::upmove
short upmove
Definition: q_shared.h:522
VID_Init
void VID_Init(void)
Definition: vid_dll.c:745
CMod_LoadPlanes
void CMod_LoadPlanes(lump_t *l)
Definition: cmodel.c:335
c_brush_traces
int c_brush_traces
Definition: cmodel.c:119
svc_disconnect
@ svc_disconnect
Definition: qcommon.h:233
svc_serverdata
@ svc_serverdata
Definition: qcommon.h:238
name
cvar_t * name
Definition: cl_main.c:79
console_t::totallines
int totallines
Definition: console.h:40
map_areas
carea_t map_areas[MAX_MAP_AREAS]
Definition: cmodel.c:98
MAX_EDICTS
#define MAX_EDICTS
Definition: q_shared.h:87
netchan_t::remote_address
netadr_t remote_address
Definition: qcommon.h:593
rd_buffersize
static int rd_buffersize
Definition: common.c:69
ERR_FATAL
#define ERR_FATAL
Definition: qcommon.h:743
SV_SendClientMessages
void SV_SendClientMessages(void)
Definition: sv_send.c:490
Cmd_Init
void Cmd_Init(void)
Definition: cmd.c:881
dvis_t::bitofs
int bitofs[8][2]
Definition: qfiles.h:466
cmd_functions
static cmd_function_t * cmd_functions
Definition: cmd.c:500
VectorAdd
#define VectorAdd(a, b, c)
Definition: q_shared.h:164
Z_Stats_f
void Z_Stats_f(void)
Definition: common.c:1145
s
static fixed16_t s
Definition: r_scan.c:30
MAX_MSGLEN
#define MAX_MSGLEN
Definition: qcommon.h:544
netchan_t::reliable_length
int reliable_length
Definition: qcommon.h:612
cleaf_t::area
int area
Definition: cmodel.c:40
netadr_t::type
netadrtype_t type
Definition: qcommon.h:553
Con_Init
void Con_Init(void)
Definition: console.c:305
y
GLint y
Definition: qgl_win.c:115
SV_Shutdown
void SV_Shutdown(char *finalmsg, qboolean reconnect)
Definition: sv_main.c:1035
svc_temp_entity
@ svc_temp_entity
Definition: qcommon.h:227
server_static_t::initialized
qboolean initialized
Definition: server.h:160
NET_Init
void NET_Init(void)
Definition: net_wins.c:767
entity_state_s::skinnum
int skinnum
Definition: q_shared.h:1155
map_noareas
cvar_t * map_noareas
Definition: cmodel.c:112
NET_SendLoopPacket
void NET_SendLoopPacket(netsrc_t sock, int length, void *data, netadr_t to)
Definition: net_wins.c:320
graphsamp_t::value
float value
Definition: cl_scrn.c:125
logfile
FILE * logfile
Definition: common.c:49
carea_t::floodnum
int floodnum
Definition: cmodel.c:57
U_SKIN16
#define U_SKIN16
Definition: qcommon.h:345
dheader_t::version
int version
Definition: qfiles.h:286
client_state_t::v_right
vec3_t v_right
Definition: client.h:133
CM_ANGLE2
#define CM_ANGLE2
Definition: qcommon.h:290
Master_Heartbeat
void Master_Heartbeat(void)
Definition: sv_main.c:827
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:165
console_t::x
int x
Definition: console.h:34
trace_contents
int trace_contents
Definition: cmodel.c:981
logfile_active
cvar_t * logfile_active
Definition: common.c:45
pack_s::filename
char filename[MAX_OSPATH]
Definition: files.c:55
qport
cvar_t * qport
Definition: net_chan.c:79
Cmd_Echo_f
void Cmd_Echo_f(void)
Definition: cmd.c:409
netchan_t::outgoing_sequence
int outgoing_sequence
Definition: qcommon.h:603
Com_BlockChecksum
unsigned Com_BlockChecksum(void *buffer, int length)
Definition: md4.c:213
Con_Linefeed
void Con_Linefeed(void)
Definition: console.c:333
PM_CheckSpecialMovement
void PM_CheckSpecialMovement(void)
Definition: pmove.c:831
PM_SPECTATOR
@ PM_SPECTATOR
Definition: q_shared.h:473
IN_Shutdown
void IN_Shutdown(void)
Definition: in_win.c:384
pml_t::up
vec3_t up
Definition: pmove.c:36
Cvar_Init
void Cvar_Init(void)
Definition: cvar.c:522
NUM_CON_TIMES
#define NUM_CON_TIMES
Definition: console.h:25
abortframe
jmp_buf abortframe
Definition: common.c:35
BSPVERSION
#define BSPVERSION
Definition: qfiles.h:222
Cmd_Wait_f
void Cmd_Wait_f(void)
Definition: cmd.c:54
Cvar_FindVar
static cvar_t * Cvar_FindVar(char *var_name)
Definition: cvar.c:47
trace_t::endpos
vec3_t endpos
Definition: q_shared.h:458
MSG_ReadLong
int MSG_ReadLong(sizebuf_t *msg_read)
Definition: common.c:731
Cvar_List_f
void Cvar_List_f(void)
Definition: cvar.c:453
Z_Free
void Z_Free(void *ptr)
Definition: common.c:1122
searchpath_s::pack
pack_t * pack
Definition: files.c:79
client_static_t::framecount
int framecount
Definition: client.h:207
server_t::time
unsigned time
Definition: server.h:50
_LittleShort
short(* _LittleShort)(short l)
Definition: q_shared.c:939
netchan_t::reliable_sequence
int reliable_sequence
Definition: qcommon.h:604
client_state_t::sound_prepped
qboolean sound_prepped
Definition: client.h:99
InitConProc
void InitConProc(int argc, char **argv)
Definition: conproc.c:84
ip_sockets
int ip_sockets[2]
Definition: net_wins.c:47
PMF_TIME_WATERJUMP
#define PMF_TIME_WATERJUMP
Definition: q_shared.h:484
MSG_WriteAngle
void MSG_WriteAngle(sizebuf_t *sb, float f)
Definition: common.c:376
up
static vec3_t up
Definition: p_view.c:29
Cbuf_InsertText
void Cbuf_InsertText(char *text)
Definition: cmd.c:114
VID_CheckChanges
void VID_CheckChanges(void)
Definition: vid_dll.c:677
CM_UP
#define CM_UP
Definition: qcommon.h:294
BUILDSTRING
#define BUILDSTRING
Definition: qcommon.h:85
fs_searchpaths
searchpath_t * fs_searchpaths
Definition: files.c:83
console_t::times
float times[NUM_CON_TIMES]
Definition: console.h:46
_BigLong
int(* _BigLong)(int l)
Definition: q_shared.c:940
SV_Frame
void SV_Frame(int msec)
Definition: sv_main.c:760
crctable
static unsigned short crctable[256]
Definition: crc.c:31
CRC_XOR_VALUE
#define CRC_XOR_VALUE
Definition: crc.c:29
SV_RecordDemoMessage
void SV_RecordDemoMessage(void)
Definition: sv_ents.c:680
client_static_t::state
connstate_t state
Definition: client.h:204
NS_CLIENT
@ NS_CLIENT
Definition: qcommon.h:549
Cvar_Set_f
void Cvar_Set_f(void)
Definition: cvar.c:391
netchan_t::last_received
int last_received
Definition: qcommon.h:590
FS_Gamedir
char * FS_Gamedir(void)
Definition: files.c:559
svc_configstring
@ svc_configstring
Definition: qcommon.h:239
SHORT2ANGLE
#define SHORT2ANGLE(x)
Definition: q_shared.h:1093
hostname
cvar_t * hostname
Definition: sv_main.c:50
cl_timedemo
cvar_t * cl_timedemo
Definition: cl_main.c:61
time_after_game
int time_after_game
Definition: common.c:55
netadr_t::port
unsigned short port
Definition: qcommon.h:558
CDAudio_Init
int CDAudio_Init(void)
Definition: cd_win.c:437
cmd_function_s
Definition: cmd.c:487
rd_buffer
static char * rd_buffer
Definition: common.c:68
usercmd_s::angles
short angles[3]
Definition: q_shared.h:521
map_entitystring
char map_entitystring[MAX_MAP_ENTSTRING]
Definition: cmodel.c:95
houtput
static HANDLE houtput
Definition: sys_win.c:46
pmove_t::s
pmove_state_t s
Definition: q_shared.h:532
client_static_t::frametime
float frametime
Definition: client.h:209
netsrc_t
netsrc_t
Definition: qcommon.h:549
Cvar_InfoValidate
static qboolean Cvar_InfoValidate(char *s)
Definition: cvar.c:31
CVAR_USERINFO
#define CVAR_USERINFO
Definition: q_shared.h:317
LUMP_TEXINFO
#define LUMP_TEXINFO
Definition: qfiles.h:267
netchan_t::reliable_buf
byte reliable_buf[MAX_MSGLEN-16]
Definition: qcommon.h:613
_BigFloat
float(* _BigFloat)(float l)
Definition: q_shared.c:942
Cbuf_Execute
void Cbuf_Execute(void)
Definition: cmd.c:194
PM_Friction
void PM_Friction(void)
Definition: pmove.c:345
pmove_t::cmd
usercmd_t cmd
Definition: q_shared.h:535
NA_BROADCAST_IPX
@ NA_BROADCAST_IPX
Definition: qcommon.h:547
log_stats_file
FILE * log_stats_file
Definition: common.c:38
qwclsemaphore
static HANDLE qwclsemaphore
Definition: sys_win.c:52
FloodAreaConnections
void FloodAreaConnections(void)
Definition: cmodel.c:1631
alias_count
int alias_count
Definition: cmd.c:40
sizebuf_s::allowoverflow
qboolean allowoverflow
Definition: qcommon.h:94
Sys_ScanForCD
char * Sys_ScanForCD(void)
Definition: sys_win.c:142
COM_Parse
char * COM_Parse(char **data_p)
Definition: q_shared.c:1072
Com_Quit
void Com_Quit(void)
Definition: common.c:235
packfile_t::filepos
int filepos
Definition: files.c:50
IN_Init
void IN_Init(void)
Definition: in_win.c:339
entity_state_s::modelindex
int modelindex
Definition: q_shared.h:1152
entity_state_s::modelindex2
int modelindex2
Definition: q_shared.h:1153
netchan_t::incoming_reliable_sequence
int incoming_reliable_sequence
Definition: qcommon.h:601
Sys_FindClose
void Sys_FindClose(void)
Definition: q_shwin.c:206
time_after_ref
int time_after_ref
Definition: common.c:57
LUMP_PLANES
#define LUMP_PLANES
Definition: qfiles.h:263
clc_bad
@ clc_bad
Definition: qcommon.h:256
server_t::state
server_state_t state
Definition: server.h:45
net_message_buffer
byte net_message_buffer[MAX_MSGLEN]
Definition: net_chan.c:83
sizebuf_s::cursize
int cursize
Definition: qcommon.h:98
numcmodels
int numcmodels
Definition: cmodel.c:84
SCR_RunCinematic
void SCR_RunCinematic(void)
Definition: cl_cin.c:490
PMF_TIME_LAND
#define PMF_TIME_LAND
Definition: q_shared.h:485
CM_ANGLE3
#define CM_ANGLE3
Definition: qcommon.h:291
Cvar_Set
cvar_t * Cvar_Set(char *var_name, char *value)
Definition: cvar.c:278
format
GLsizei GLenum format
Definition: qgl_win.c:131
Com_DPrintf
void Com_DPrintf(char *fmt,...)
Definition: common.c:157
allow_download_sounds
cvar_t * allow_download_sounds
Definition: sv_main.c:40
U_FRAME8
#define U_FRAME8
Definition: qcommon.h:319
usercmd_s::msec
byte msec
Definition: q_shared.h:519
console_t::ormask
int ormask
Definition: console.h:37
S_StopAllSounds
void S_StopAllSounds(void)
Definition: snd_dma.c:785
svc_packetentities
@ svc_packetentities
Definition: qcommon.h:244
Cbuf_AddLateCommands
qboolean Cbuf_AddLateCommands(void)
Definition: cmd.c:296
usercmd_s::buttons
byte buttons
Definition: q_shared.h:520
Miniaudio_Update
void Miniaudio_Update(void)
Definition: snd_miniaudio.c:299
PM_CatagorizePosition
void PM_CatagorizePosition(void)
Definition: pmove.c:671
values
static graphsamp_t values[1024]
Definition: cl_scrn.c:130
msg_timeout
cvar_t * msg_timeout
Definition: sv_main.c:32
FS_FreeFile
void FS_FreeFile(void *buffer)
Definition: files.c:437
client_static_t::key_dest
keydest_t key_dest
Definition: client.h:205
SCR_Init
void SCR_Init(void)
Definition: cl_scrn.c:410
trace_t::surface
csurface_t * surface
Definition: q_shared.h:460
DWORD
DWORD
Definition: qgl_win.c:49
VID_Shutdown
void VID_Shutdown(void)
Definition: vid_dll.c:774
pmove_state_t::origin
short origin[3]
Definition: q_shared.h:498
ca_connected
@ ca_connected
Definition: client.h:188
PM_StepSlideMove
void PM_StepSlideMove(void)
Definition: pmove.c:271
phsrow
byte phsrow[MAX_MAP_LEAFS/8]
Definition: cmodel.c:1573
rd_flush
static void(* rd_flush)(int target, char *buffer)
Definition: common.c:70
U_NUMBER16
#define U_NUMBER16
Definition: qcommon.h:325
SV_GiveMsec
void SV_GiveMsec(void)
Definition: sv_main.c:573
c_pointcontents
int c_pointcontents
Definition: cmodel.c:118
LUMP_ENTITIES
#define LUMP_ENTITIES
Definition: qfiles.h:262
NET_StringToSockaddr
qboolean NET_StringToSockaddr(char *s, struct sockaddr *sadr)
Definition: net_wins.c:193
svc_download
@ svc_download
Definition: qcommon.h:242
Cbuf_AddEarlyCommands
void Cbuf_AddEarlyCommands(qboolean clear)
Definition: cmd.c:263
Com_Printf
void Com_Printf(char *fmt,...)
Definition: common.c:104
map_name
char map_name[MAX_QPATH]
Definition: cmodel.c:63
right
GLdouble right
Definition: qgl_win.c:159
numentitychars
int numentitychars
Definition: cmodel.c:94
SFF_HIDDEN
#define SFF_HIDDEN
Definition: q_shared.h:287
svc_reconnect
@ svc_reconnect
Definition: qcommon.h:234
_LittleLong
int(* _LittleLong)(int l)
Definition: q_shared.c:941
ANGLE2SHORT
#define ANGLE2SHORT(x)
Definition: q_shared.h:1092
NET_ErrorString
char * NET_ErrorString(void)
Definition: net_wins.c:806
pmove_t::viewangles
vec3_t viewangles
Definition: q_shared.h:542
Cmd_Exec_f
void Cmd_Exec_f(void)
Definition: cmd.c:371
Sys_UnloadGame
void Sys_UnloadGame(void)
Definition: sys_win.c:488
svc_spawnbaseline
@ svc_spawnbaseline
Definition: qcommon.h:240
developer
cvar_t * developer
Definition: common.c:42
Sys_Milliseconds
int Sys_Milliseconds(void)
Definition: q_shwin.c:120
SV_ShutdownGameProgs
void SV_ShutdownGameProgs(void)
Definition: sv_game.c:305
Q_strcasecmp
int Q_strcasecmp(char *s1, char *s2)
Definition: q_shared.c:1216
clc_stringcmd
@ clc_stringcmd
Definition: qcommon.h:260
pack_s::files
packfile_t * files
Definition: files.c:58
Master_Shutdown
void Master_Shutdown(void)
Definition: sv_main.c:868
fixedtime
cvar_t * fixedtime
Definition: common.c:44
cls
client_static_t cls
Definition: cl_main.c:90
NUMVERTEXNORMALS
#define NUMVERTEXNORMALS
Definition: qcommon.h:792
netchan_t::message_buf
byte message_buf[MAX_MSGLEN-16]
Definition: qcommon.h:609
SV_InitOperatorCommands
void SV_InitOperatorCommands(void)
Definition: sv_ccmds.c:1025
svc_muzzleflash2
@ svc_muzzleflash2
Definition: qcommon.h:226
cmd_wait
qboolean cmd_wait
Definition: cmd.c:37
server_state
int server_state
Definition: common.c:51
MAXPRINTMSG
#define MAXPRINTMSG
Definition: common.c:25
clc_move
@ clc_move
Definition: qcommon.h:258
Cvar_VariableString
char * Cvar_VariableString(char *var_name)
Definition: cvar.c:79
SV_PrepWorldFrame
void SV_PrepWorldFrame(void)
Definition: sv_main.c:703
mask
GLint GLuint mask
Definition: qgl_win.c:317
svc_sound
@ svc_sound
Definition: qcommon.h:235
scr_draw_loading
int scr_draw_loading
Definition: cl_scrn.c:44
NET_GetLoopPacket
qboolean NET_GetLoopPacket(netsrc_t sock, netadr_t *net_from, sizebuf_t *net_message)
Definition: net_wins.c:295
showpackets
cvar_t * showpackets
Definition: net_chan.c:77
CRC_Init
void CRC_Init(unsigned short *crcvalue)
Definition: crc.c:67
Cmd_List_f
void Cmd_List_f(void)
Definition: cmd.c:865
CM_BoxLeafnums_headnode
int CM_BoxLeafnums_headnode(vec3_t mins, vec3_t maxs, int *list, int listsize, int headnode, int *topnode)
Definition: cmodel.c:885
Miniaudio_Init
void Miniaudio_Init(void)
Definition: snd_miniaudio.c:195
CMod_LoadAreaPortals
void CMod_LoadAreaPortals(lump_t *l)
Definition: cmodel.c:476
noipx
static cvar_t * noipx
Definition: net_wins.c:44
Netchan_NeedReliable
qboolean Netchan_NeedReliable(netchan_t *chan)
Definition: net_chan.c:183
svc_stufftext
@ svc_stufftext
Definition: qcommon.h:237
entity_state_s::angles
vec3_t angles
Definition: q_shared.h:1150
cl
client_state_t cl
Definition: cl_main.c:91
MSG_ReadChar
int MSG_ReadChar(sizebuf_t *msg_read)
Definition: common.c:690
U_ORIGIN3
#define U_ORIGIN3
Definition: qcommon.h:326
fs_gamedir
char fs_gamedir[MAX_OSPATH]
Definition: files.c:61
CPUSTRING
#define CPUSTRING
Definition: qcommon.h:86
CM_IMPULSE
#define CM_IMPULSE
Definition: qcommon.h:296
CM_HeadnodeVisible
qboolean CM_HeadnodeVisible(int nodenum, byte *visbits)
Definition: cmodel.c:1748
pmove_state_t::pm_flags
byte pm_flags
Definition: q_shared.h:500
MSG_BeginReading
void MSG_BeginReading(sizebuf_t *msg)
Definition: common.c:684
U_SOLID
#define U_SOLID
Definition: qcommon.h:347
pvsrow
byte pvsrow[MAX_MAP_LEAFS/8]
Definition: cmodel.c:1572
ERR_DISCONNECT
#define ERR_DISCONNECT
Definition: q_shared.h:106
U_MODEL3
#define U_MODEL3
Definition: qcommon.h:339
SFF_SUBDIR
#define SFF_SUBDIR
Definition: q_shared.h:289
allow_download_maps
cvar_t * allow_download_maps
Definition: sv_main.c:41
_BigShort
short(* _BigShort)(short l)
Definition: q_shared.c:938
CMod_LoadBrushes
void CMod_LoadBrushes(lump_t *l)
Definition: cmodel.c:248
pmove_t::snapinitial
qboolean snapinitial
Definition: q_shared.h:536
clc_nop
@ clc_nop
Definition: qcommon.h:257
CL_SendCommand
void CL_SendCommand(void)
Definition: cl_main.c:1653
vec3_t
vec_t vec3_t[3]
Definition: q_shared.h:134
S_Init
void S_Init(void)
Definition: snd_dma.c:116
Com_sprintf
void Com_sprintf(char *dest, int size, char *fmt,...)
Definition: q_shared.c:1223
fs_gamedirvar
cvar_t * fs_gamedirvar
Definition: files.c:64
S_Update
void S_Update(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up)
Definition: snd_dma.c:1009
NA_LOOPBACK
@ NA_LOOPBACK
Definition: qcommon.h:547
svc_print
@ svc_print
Definition: qcommon.h:236
CMod_LoadSurfaces
void CMod_LoadSurfaces(lump_t *l)
Definition: cmodel.c:175
zhead_s
Definition: common.c:1106
pml_t::previous_origin
vec3_t previous_origin
Definition: pmove.c:44
CL_Frame
void CL_Frame(int msec)
Definition: cl_main.c:1681
VectorNegate
#define VectorNegate(a, b)
Definition: q_shared.h:167
pmove_state_t::pm_time
byte pm_time
Definition: q_shared.h:501
c_traces
int c_traces
Definition: cmodel.c:119
SFF_SYSTEM
#define SFF_SYSTEM
Definition: q_shared.h:290
CMod_LoadLeafs
void CMod_LoadLeafs(lump_t *l)
Definition: cmodel.c:280
server_static_t::demofile
FILE * demofile
Definition: server.h:178
com_argv
char * com_argv[MAX_NUM_ARGVS+1]
Definition: common.c:31
count
GLint GLsizei count
Definition: qgl_win.c:128
DeinitConProc
void DeinitConProc(void)
Definition: conproc.c:153
allow_download
cvar_t * allow_download
Definition: sv_main.c:37
console_t::initialized
qboolean initialized
Definition: console.h:30
cmd_function_s::function
xcommand_t function
Definition: cmd.c:491
PM_WaterMove
void PM_WaterMove(void)
Definition: pmove.c:533
netchan_t::qport
int qport
Definition: qcommon.h:594
client_static_t::netchan
netchan_t netchan
Definition: client.h:224
client_static_t::realtime
int realtime
Definition: client.h:208
Cvar_VariableValue
float Cvar_VariableValue(char *var_name)
Definition: cvar.c:63
CM_InitBoxHull
void CM_InitBoxHull(void)
Definition: cmodel.c:704