icculus quake2 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_MDPrintf (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_tmodder
 
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 68 of file qcommon.h.

◆ CM_ANGLE1

#define CM_ANGLE1   (1<<0)

Definition at line 272 of file qcommon.h.

◆ CM_ANGLE2

#define CM_ANGLE2   (1<<1)

Definition at line 273 of file qcommon.h.

◆ CM_ANGLE3

#define CM_ANGLE3   (1<<2)

Definition at line 274 of file qcommon.h.

◆ CM_BUTTONS

#define CM_BUTTONS   (1<<6)

Definition at line 278 of file qcommon.h.

◆ CM_FORWARD

#define CM_FORWARD   (1<<3)

Definition at line 275 of file qcommon.h.

◆ CM_IMPULSE

#define CM_IMPULSE   (1<<7)

Definition at line 279 of file qcommon.h.

◆ CM_SIDE

#define CM_SIDE   (1<<4)

Definition at line 276 of file qcommon.h.

◆ CM_UP

#define CM_UP   (1<<5)

Definition at line 277 of file qcommon.h.

◆ CPUSTRING

#define CPUSTRING   "NON-WIN32"

Definition at line 69 of file qcommon.h.

◆ DEFAULT_SOUND_PACKET_ATTENUATION

#define DEFAULT_SOUND_PACKET_ATTENUATION   1.0

Definition at line 291 of file qcommon.h.

◆ DEFAULT_SOUND_PACKET_VOLUME

#define DEFAULT_SOUND_PACKET_VOLUME   1.0

Definition at line 290 of file qcommon.h.

◆ ERR_DROP

#define ERR_DROP   1

Definition at line 736 of file qcommon.h.

◆ ERR_FATAL

#define ERR_FATAL   0

Definition at line 735 of file qcommon.h.

◆ ERR_QUIT

#define ERR_QUIT   2

Definition at line 737 of file qcommon.h.

◆ EXEC_APPEND [1/2]

#define EXEC_APPEND   2

Definition at line 741 of file qcommon.h.

◆ EXEC_APPEND [2/2]

#define EXEC_APPEND   2

Definition at line 741 of file qcommon.h.

◆ EXEC_INSERT [1/2]

#define EXEC_INSERT   1

Definition at line 740 of file qcommon.h.

◆ EXEC_INSERT [2/2]

#define EXEC_INSERT   1

Definition at line 740 of file qcommon.h.

◆ EXEC_NOW [1/2]

#define EXEC_NOW   0

Definition at line 739 of file qcommon.h.

◆ EXEC_NOW [2/2]

#define EXEC_NOW   0

Definition at line 739 of file qcommon.h.

◆ MAX_LATENT

#define MAX_LATENT   32

Definition at line 572 of file qcommon.h.

◆ MAX_MSGLEN

#define MAX_MSGLEN   1400

Definition at line 527 of file qcommon.h.

◆ NUMVERTEXNORMALS

#define NUMVERTEXNORMALS   162

Definition at line 786 of file qcommon.h.

◆ OLD_AVG

#define OLD_AVG   0.99

Definition at line 570 of file qcommon.h.

◆ PACKET_HEADER

#define PACKET_HEADER   10

Definition at line 528 of file qcommon.h.

◆ PORT_ANY

#define PORT_ANY   -1

Definition at line 525 of file qcommon.h.

◆ PORT_CLIENT

#define PORT_CLIENT   27901

Definition at line 185 of file qcommon.h.

◆ PORT_MASTER

#define PORT_MASTER   27900

Definition at line 184 of file qcommon.h.

◆ PORT_SERVER

#define PORT_SERVER   27910

Definition at line 186 of file qcommon.h.

◆ PRINT_ALL

#define PRINT_ALL   0

Definition at line 743 of file qcommon.h.

◆ PRINT_DEVELOPER

#define PRINT_DEVELOPER   1

Definition at line 744 of file qcommon.h.

◆ PROTOCOL_VERSION

#define PROTOCOL_VERSION   34

Definition at line 180 of file qcommon.h.

◆ PS_BLEND

#define PS_BLEND   (1<<10)

Definition at line 261 of file qcommon.h.

◆ PS_FOV

#define PS_FOV   (1<<11)

Definition at line 262 of file qcommon.h.

◆ PS_KICKANGLES

#define PS_KICKANGLES   (1<<9)

Definition at line 260 of file qcommon.h.

◆ PS_M_DELTA_ANGLES

#define PS_M_DELTA_ANGLES   (1<<6)

Definition at line 256 of file qcommon.h.

◆ PS_M_FLAGS

#define PS_M_FLAGS   (1<<4)

Definition at line 254 of file qcommon.h.

◆ PS_M_GRAVITY

#define PS_M_GRAVITY   (1<<5)

Definition at line 255 of file qcommon.h.

◆ PS_M_ORIGIN

#define PS_M_ORIGIN   (1<<1)

Definition at line 251 of file qcommon.h.

◆ PS_M_TIME

#define PS_M_TIME   (1<<3)

Definition at line 253 of file qcommon.h.

◆ PS_M_TYPE

#define PS_M_TYPE   (1<<0)

Definition at line 250 of file qcommon.h.

◆ PS_M_VELOCITY

#define PS_M_VELOCITY   (1<<2)

Definition at line 252 of file qcommon.h.

◆ PS_RDFLAGS

#define PS_RDFLAGS   (1<<14)

Definition at line 265 of file qcommon.h.

◆ PS_VIEWANGLES

#define PS_VIEWANGLES   (1<<8)

Definition at line 259 of file qcommon.h.

◆ PS_VIEWOFFSET

#define PS_VIEWOFFSET   (1<<7)

Definition at line 258 of file qcommon.h.

◆ PS_WEAPONFRAME

#define PS_WEAPONFRAME   (1<<13)

Definition at line 264 of file qcommon.h.

◆ PS_WEAPONINDEX

#define PS_WEAPONINDEX   (1<<12)

Definition at line 263 of file qcommon.h.

◆ SND_ATTENUATION

#define SND_ATTENUATION   (1<<1)

Definition at line 285 of file qcommon.h.

◆ SND_ENT

#define SND_ENT   (1<<3)

Definition at line 287 of file qcommon.h.

◆ SND_OFFSET

#define SND_OFFSET   (1<<4)

Definition at line 288 of file qcommon.h.

◆ SND_POS

#define SND_POS   (1<<2)

Definition at line 286 of file qcommon.h.

◆ SND_VOLUME

#define SND_VOLUME   (1<<0)

Definition at line 284 of file qcommon.h.

◆ U_ANGLE1

#define U_ANGLE1   (1<<10)

Definition at line 310 of file qcommon.h.

◆ U_ANGLE2

#define U_ANGLE2   (1<<2)

Definition at line 300 of file qcommon.h.

◆ U_ANGLE3

#define U_ANGLE3   (1<<3)

Definition at line 301 of file qcommon.h.

◆ U_EFFECTS16

#define U_EFFECTS16   (1<<19)

Definition at line 320 of file qcommon.h.

◆ U_EFFECTS8

#define U_EFFECTS8   (1<<14)

Definition at line 313 of file qcommon.h.

◆ U_EVENT

#define U_EVENT   (1<<5)

Definition at line 303 of file qcommon.h.

◆ U_FRAME16

#define U_FRAME16   (1<<17)

Definition at line 318 of file qcommon.h.

◆ U_FRAME8

#define U_FRAME8   (1<<4)

Definition at line 302 of file qcommon.h.

◆ U_MODEL

#define U_MODEL   (1<<11)

Definition at line 311 of file qcommon.h.

◆ U_MODEL2

#define U_MODEL2   (1<<20)

Definition at line 321 of file qcommon.h.

◆ U_MODEL3

#define U_MODEL3   (1<<21)

Definition at line 322 of file qcommon.h.

◆ U_MODEL4

#define U_MODEL4   (1<<22)

Definition at line 323 of file qcommon.h.

◆ U_MOREBITS1

#define U_MOREBITS1   (1<<7)

Definition at line 305 of file qcommon.h.

◆ U_MOREBITS2

#define U_MOREBITS2   (1<<15)

Definition at line 314 of file qcommon.h.

◆ U_MOREBITS3

#define U_MOREBITS3   (1<<23)

Definition at line 324 of file qcommon.h.

◆ U_NUMBER16

#define U_NUMBER16   (1<<8)

Definition at line 308 of file qcommon.h.

◆ U_OLDORIGIN

#define U_OLDORIGIN   (1<<24)

Definition at line 327 of file qcommon.h.

◆ U_ORIGIN1

#define U_ORIGIN1   (1<<0)

Definition at line 298 of file qcommon.h.

◆ U_ORIGIN2

#define U_ORIGIN2   (1<<1)

Definition at line 299 of file qcommon.h.

◆ U_ORIGIN3

#define U_ORIGIN3   (1<<9)

Definition at line 309 of file qcommon.h.

◆ U_REMOVE

#define U_REMOVE   (1<<6)

Definition at line 304 of file qcommon.h.

◆ U_RENDERFX16

#define U_RENDERFX16   (1<<18)

Definition at line 319 of file qcommon.h.

◆ U_RENDERFX8

#define U_RENDERFX8   (1<<12)

Definition at line 312 of file qcommon.h.

◆ U_SKIN16

#define U_SKIN16   (1<<25)

Definition at line 328 of file qcommon.h.

◆ U_SKIN8

#define U_SKIN8   (1<<16)

Definition at line 317 of file qcommon.h.

◆ U_SOLID

#define U_SOLID   (1<<27)

Definition at line 330 of file qcommon.h.

◆ U_SOUND

#define U_SOUND   (1<<26)

Definition at line 329 of file qcommon.h.

◆ UPDATE_BACKUP

#define UPDATE_BACKUP   16

Definition at line 190 of file qcommon.h.

◆ UPDATE_MASK

#define UPDATE_MASK   (UPDATE_BACKUP-1)

Definition at line 192 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 402 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 237 of file qcommon.h.

238 {
239  clc_bad,
240  clc_nop,
241  clc_move, // [[usercmd_t]
242  clc_userinfo, // [[userinfo string]
243  clc_stringcmd // [string] message
244 };

◆ netadrtype_t

Enumerator
NA_LOOPBACK 
NA_BROADCAST 
NA_IP 
NA_IPX 
NA_BROADCAST_IPX 

Definition at line 533 of file qcommon.h.

◆ netsrc_t

enum netsrc_t
Enumerator
NS_CLIENT 
NS_SERVER 

Definition at line 536 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 203 of file qcommon.h.

204 {
205  svc_bad,
206 
207  // these ops are known to the game dll
211  svc_layout,
213 
214  // the rest are private to the client and server
215  svc_nop,
218  svc_sound, // <see code>
219  svc_print, // [byte] id [string] null terminated string
220  svc_stufftext, // [string] stuffed into client's console buffer, should be \n terminated
221  svc_serverdata, // [long] protocol ...
222  svc_configstring, // [short] [string]
224  svc_centerprint, // [string] to put in center of the screen
225  svc_download, // [short] size [size bytes]
226  svc_playerinfo, // variable
227  svc_packetentities, // [...]
228  svc_deltapacketentities, // [...]
229  svc_frame
230 };

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 += 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 412 of file cl_main.c.

413 {
414  if (cls.state == ca_uninitialized)
415  return;
416  if (cls.state == ca_disconnected)
417  return;
418 
419  CL_Disconnect ();
420 
421  // drop loading plaque unless this is the initial game start
422  if (cls.disable_servercount != -1)
423  SCR_EndLoadingPlaque (); // get rid of loading plaque
424 }

Referenced by Com_Error(), and SV_InitGame().

◆ CL_Frame()

void CL_Frame ( int  msec)

Definition at line 1720 of file cl_main.c.

1721 {
1722  static int extratime;
1723  static int lasttimecalled;
1724 
1725  if (dedicated->value)
1726  return;
1727 
1728  extratime += msec;
1729 
1730  if (!cl_timedemo->value)
1731  {
1732  if (cls.state == ca_connected && extratime < 100)
1733  return; // don't flood packets out while connecting
1734  if (extratime < 1000/cl_maxfps->value)
1735  return; // framerate is too high
1736  }
1737 
1738  // let the mouse activate or deactivate
1739  IN_Frame ();
1740 
1741  // decide the simulation time
1742  cls.frametime = extratime/1000.0;
1743  cl.time += extratime;
1744  cls.realtime = curtime;
1745 
1746  extratime = 0;
1747 #if 0
1748  if (cls.frametime > (1.0 / cl_minfps->value))
1749  cls.frametime = (1.0 / cl_minfps->value);
1750 #else
1751  if (cls.frametime > (1.0 / 5))
1752  cls.frametime = (1.0 / 5);
1753 #endif
1754 
1755  // if in the debugger last frame, don't timeout
1756  if (msec > 5000)
1758 
1759  // fetch results from server
1760  CL_ReadPackets ();
1761 
1762  // send a new command message to the server
1763  CL_SendCommand ();
1764 
1765  // predict all unacknowledged movements
1766  CL_PredictMovement ();
1767 
1768  // allow rendering DLL change
1769  VID_CheckChanges ();
1770  if (!cl.refresh_prepped && cls.state == ca_active)
1771  CL_PrepRefresh ();
1772 
1773  // update the screen
1774  if (host_speeds->value)
1776  SCR_UpdateScreen ();
1777  if (host_speeds->value)
1779 
1780  // update audio
1782 
1783  CDAudio_Update();
1784 
1785  // advance local effects for next frame
1786  CL_RunDLights ();
1787  CL_RunLightStyles ();
1788  SCR_RunCinematic ();
1789  SCR_RunConsole ();
1790 
1791  cls.framecount++;
1792 
1793  if ( log_stats->value )
1794  {
1795  if ( cls.state == ca_active )
1796  {
1797  if ( !lasttimecalled )
1798  {
1799  lasttimecalled = Sys_Milliseconds();
1800  if ( log_stats_file )
1801  fprintf( log_stats_file, "0\n" );
1802  }
1803  else
1804  {
1805  int now = Sys_Milliseconds();
1806 
1807  if ( log_stats_file )
1808  fprintf( log_stats_file, "%d\n", now - lasttimecalled );
1809  lasttimecalled = now;
1810  }
1811  }
1812  }
1813 }

Referenced by Qcommon_Frame().

◆ CL_Init()

void CL_Init ( void  )

Definition at line 1823 of file cl_main.c.

1824 {
1825  if (dedicated->value)
1826  return; // nothing running on the client
1827 
1828  // all archived variables will now be loaded
1829 
1830  Con_Init ();
1831 #if defined __linux__ || defined __FreeBSD__ || defined __sgi
1832  S_Init ();
1833  VID_Init ();
1834 #else
1835  VID_Init ();
1836  S_Init (); // sound must be initialized after window is created
1837 #endif
1838 
1839  V_Init ();
1840 
1843 
1844  M_Init ();
1845 
1846  SCR_Init ();
1847  cls.disable_screen = true; // don't draw yet
1848 
1849  CDAudio_Init ();
1850  CL_InitLocal ();
1851  IN_Init ();
1852 
1853 // Cbuf_AddText ("exec autoexec.cfg\n");
1854  FS_ExecAutoexec ();
1855  Cbuf_Execute ();
1856 
1857 }

Referenced by Qcommon_Init().

◆ CL_Shutdown()

void CL_Shutdown ( void  )

Definition at line 1868 of file cl_main.c.

1869 {
1870  static qboolean isdown = false;
1871 
1872  if (isdown)
1873  {
1874  printf ("recursive shutdown\n");
1875  return;
1876  }
1877  isdown = true;
1878 
1880 
1881  CDAudio_Shutdown ();
1882  S_Shutdown();
1883  IN_Shutdown ();
1884  VID_Shutdown();
1885 }

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_RandomPlay(), CL_InitInput(), CL_InitLocal(), Cmd_Init(), Con_Init(), Cvar_Init(), FS_InitFilesystem(), IN_Init(), Key_Init(), M_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 = 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 299 of file cl_main.c.

300 {
301  char *cmd;
302 
303  cmd = Cmd_Argv(0);
304  if (cls.state <= ca_connected || *cmd == '-' || *cmd == '+')
305  {
306  Com_Printf ("Unknown command \"%s\"\n", cmd);
307  return;
308  }
309 
311  SZ_Print (&cls.netchan.message, cmd);
312  if (Cmd_Argc() > 1)
313  {
314  SZ_Print (&cls.netchan.message, " ");
316  }
317 }

◆ 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 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 = 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 (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 1035 of file common.c.

1036 {
1037  if (com_argc == MAX_NUM_ARGVS)
1038  Com_Error (ERR_FATAL, "COM_AddParm: MAX_NUM)ARGS");
1039  com_argv[com_argc++] = parm;
1040 }

◆ COM_Argc()

int COM_Argc ( void  )

Definition at line 987 of file common.c.

988 {
989  return com_argc;
990 }

Referenced by Cbuf_AddEarlyCommands(), and Cbuf_AddLateCommands().

◆ COM_Argv()

char* COM_Argv ( int  arg)

Definition at line 992 of file common.c.

993 {
994  if (arg < 0 || arg >= com_argc || !com_argv[arg])
995  return "";
996  return com_argv[arg];
997 }

Referenced by Cbuf_AddEarlyCommands(), and Cbuf_AddLateCommands().

◆ Com_BeginRedirect()

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

Definition at line 72 of file common.c.

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

Referenced by SVC_RemoteCommand(), and SVC_Status().

◆ Com_BlockChecksum()

unsigned Com_BlockChecksum ( void buffer,
int  length 
)

Definition at line 165 of file md4.c.

166 {
167  uint32_t digest[4];
168  unsigned val;
169 
170  PerformMD4((unsigned char *)buffer, length, (unsigned char *)digest);
171 
172  val = digest[0] ^ digest[1] ^ digest[2] ^ digest[3];
173 
174  return val;
175 }

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

◆ COM_BlockSequenceCRCByte()

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

Definition at line 1361 of file common.c.

1362 {
1363  int n;
1364  byte *p;
1365  int x;
1366  byte chkb[60 + 4];
1367  unsigned short crc;
1368 
1369 
1370  if (sequence < 0)
1371  Sys_Error("sequence < 0, this shouldn't happen\n");
1372 
1373  p = chktbl + (sequence % (sizeof(chktbl) - 4));
1374 
1375  if (length > 60)
1376  length = 60;
1377  memcpy (chkb, base, length);
1378 
1379  chkb[length] = p[0];
1380  chkb[length+1] = p[1];
1381  chkb[length+2] = p[2];
1382  chkb[length+3] = p[3];
1383 
1384  length += 4;
1385 
1386  crc = CRC_Block(chkb, length);
1387 
1388  for (x=0, n=0; n<length; n++)
1389  x += chkb[n];
1390 
1391  crc = (crc ^ x) & 0xff;
1392 
1393  return crc;
1394 }

Referenced by CL_SendCmd(), and SV_ExecuteClientMessage().

◆ COM_CheckParm()

int COM_CheckParm ( char *  parm)

Definition at line 974 of file common.c.

975 {
976  int i;
977 
978  for (i=1 ; i<com_argc ; i++)
979  {
980  if (!strcmp (parm,com_argv[i]))
981  return i;
982  }
983 
984  return 0;
985 }

◆ COM_ClearArgv()

void COM_ClearArgv ( int  arg)

Definition at line 999 of file common.c.

1000 {
1001  if (arg < 0 || arg >= com_argc || !com_argv[arg])
1002  return;
1003  com_argv[arg] = "";
1004 }

Referenced by Cbuf_AddEarlyCommands().

◆ Com_DPrintf()

◆ Com_EndRedirect()

void Com_EndRedirect ( void  )

Definition at line 84 of file common.c.

85 {
87 
88  rd_target = 0;
89  rd_buffer = NULL;
90  rd_buffersize = 0;
91  rd_flush = NULL;
92 }

Referenced by SVC_RemoteCommand(), and SVC_Status().

◆ Com_Error()

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

Definition at line 203 of file common.c.

204 {
205  va_list argptr;
206  static char msg[MAXPRINTMSG];
207  static qboolean recursive;
208 
209  if (recursive)
210  Sys_Error ("recursive error after: %s", msg);
211  recursive = true;
212 
213  va_start (argptr,fmt);
214  vsnprintf (msg,MAXPRINTMSG,fmt,argptr);
215  va_end (argptr);
216 
217  if (code == ERR_DISCONNECT)
218  {
219  CL_Drop ();
220  recursive = false;
221  longjmp (abortframe, -1);
222  }
223  else if (code == ERR_DROP)
224  {
225  Com_Printf ("********************\nERROR: %s\n********************\n", msg);
226  SV_Shutdown (va("Server crashed: %s\n", msg), false);
227  CL_Drop ();
228  recursive = false;
229  longjmp (abortframe, -1);
230  }
231  else
232  {
233  SV_Shutdown (va("Server fatal crashed: %s\n", msg), false);
234  CL_Shutdown ();
235  }
236 
237  if (logfile)
238  {
239  fclose (logfile);
240  logfile = NULL;
241  }
242 
243  Sys_Error ("%s", msg);
244 }

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 1012 of file common.c.

1013 {
1014  int i;
1015 
1016  if (argc > MAX_NUM_ARGVS)
1017  Com_Error (ERR_FATAL, "argc > MAX_NUM_ARGVS");
1018  com_argc = argc;
1019  for (i=0 ; i<argc ; i++)
1020  {
1021  if (!argv[i] || strlen(argv[i]) >= MAX_TOKEN_CHARS )
1022  com_argv[i] = "";
1023  else
1024  com_argv[i] = argv[i];
1025  }
1026 }

Referenced by Qcommon_Init().

◆ Com_MDPrintf()

void Com_MDPrintf ( char *  fmt,
  ... 
)

Definition at line 179 of file common.c.

180 {
181  va_list argptr;
182  char msg[MAXPRINTMSG];
183 
184  if((!modder || !modder->value) && (!developer || !developer->value))
185  return;
186 
187  va_start (argptr,fmt);
188  vsnprintf (msg,MAXPRINTMSG,fmt,argptr);
189  va_end (argptr);
190 
191  Com_Printf("%s", msg);
192 }

◆ Com_Printf()

void Com_Printf ( char *  fmt,
  ... 
)

Definition at line 102 of file common.c.

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

◆ Com_Quit()

void Com_Quit ( void  )

Definition at line 255 of file common.c.

256 {
257  SV_Shutdown ("Server quit\n", false);
258  CL_Shutdown ();
259 
260  if (logfile)
261  {
262  fclose (logfile);
263  logfile = NULL;
264  }
265 
266  Sys_Quit ();
267 }

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

◆ Com_ServerState()

◆ Com_SetServerState()

void Com_SetServerState ( int  state)

Definition at line 285 of file common.c.

286 {
287  server_state = state;
288 }

Referenced by SV_Shutdown(), and SV_SpawnServer().

◆ Con_Print()

void Con_Print ( char *  text)

Definition at line 359 of file console.c.

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

Referenced by Com_Printf().

◆ CopyString()

char* CopyString ( char *  in)

Definition at line 1057 of file common.c.

1058 {
1059  char *out;
1060 
1061  out = Z_Malloc (strlen(in)+1);
1062  strcpy (out, in);
1063  return out;
1064 }

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 = 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_RandomPlay(), 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(), 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(), 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(), FS_AddHomeAsGameDirectory(), SV_CopySaveGame(), SV_GameMap_f(), and SV_ServerRecord_f().

◆ FS_ExecAutoexec()

void FS_ExecAutoexec ( void  )

Definition at line 600 of file files.c.

601 {
602  char name [MAX_QPATH];
603  searchpath_t *s, *end;
604 
605  // don't look in baseq2 if gamedir is set
607  end = NULL;
608  else
609  end = fs_base_searchpaths;
610 
611  // search through all the paths for an autoexec.cfg file
612  for (s = fs_searchpaths ; s != end ; s = s->next)
613  {
614  if (s->pack)
615  continue;
616 
617  Com_sprintf(name, sizeof(name), "%s/autoexec.cfg", s->filename);
618 
620  {
621  Cbuf_AddText ("exec autoexec.cfg\n");
622  Sys_FindClose();
623  break;
624  }
625  Sys_FindClose();
626  }
627 }

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 
261  *file = fopen (netpath, "rb");
262  if (!*file)
263  continue;
264 
265  Com_DPrintf ("FindFile: %s\n",netpath);
266 
267  return FS_filelength (*file);
268  }
269 
270  }
271 
272  Com_DPrintf ("FindFile: can't find %s\n", filename);
273 
274  *file = NULL;
275  return -1;
276 }

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

◆ FS_FreeFile()

◆ FS_Gamedir()

◆ FS_InitFilesystem()

void FS_InitFilesystem ( void  )

Definition at line 891 of file files.c.

892 {
893  Cmd_AddCommand ("path", FS_Path_f);
894  Cmd_AddCommand ("link", FS_Link_f);
895  Cmd_AddCommand ("dir", FS_Dir_f );
896 
897  //
898  // basedir <path>
899  // allows the game to run from outside the data tree
900  //
901  fs_basedir = Cvar_Get ("basedir", ".", CVAR_NOSET);
902 
903  //
904  // cddir <path>
905  // Logically concatenates the cddir after the basedir for
906  // allows the game to run from outside the data tree
907  //
908  fs_cddir = Cvar_Get ("cddir", "", CVAR_NOSET);
909  if (fs_cddir->string[0])
911 
912  //
913  // add baseq2 to search path
914  //
916 
917  //
918  // then add a '.quake2/baseq2' directory in home directory by default
919  //
921 
922  // any set gamedirs will be freed up to here
924 
925  // check for game override
927  if (fs_gamedirvar->string[0])
929 }

Referenced by Qcommon_Init().

◆ FS_LoadFile()

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

Definition at line 394 of file files.c.

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

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 865 of file files.c.

866 {
867  searchpath_t *s;
868  char *prev;
869 
870  prev = NULL; /* fs_gamedir is the first directory in the searchpath */
871  for (s=fs_searchpaths ; s ; s=s->next)
872  {
873  if (s->pack)
874  continue;
875  if (prevpath == NULL)
876  return s->filename;
877  if (prevpath == prev)
878  return s->filename;
879  prev = s->filename;
880  }
881 
882  return NULL;
883 }

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

◆ FS_Read()

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

Definition at line 346 of file files.c.

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

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 638 of file files.c.

639 {
640  searchpath_t *next;
641 
642  if (strstr(dir, "..") || strstr(dir, "/")
643  || strstr(dir, "\\") || strstr(dir, ":") )
644  {
645  Com_Printf ("Gamedir should be a single filename, not a path\n");
646  return;
647  }
648 
649  //
650  // free up any current game dir info
651  //
653  {
654  if (fs_searchpaths->pack)
655  {
656  fclose (fs_searchpaths->pack->handle);
659  }
660  next = fs_searchpaths->next;
662  fs_searchpaths = next;
663  }
664 
665  //
666  // flush all data, so it will be forced to reload
667  //
668  if (dedicated && !dedicated->value)
669  Cbuf_AddText ("vid_restart\nsnd_restart\n");
670 
671 
672  // now add new entries for
673  if (!strcmp(dir,BASEDIRNAME) || (*dir == 0))
674  {
675  Cvar_FullSet ("gamedir", "", CVAR_SERVERINFO|CVAR_NOSET);
677  }
678  else
679  {
680  Cvar_FullSet ("gamedir", dir, CVAR_SERVERINFO|CVAR_NOSET);
681  if (fs_cddir->string[0])
682  FS_AddGameDirectory (va("%s/%s", fs_cddir->string, dir) );
683  FS_AddGameDirectory (va("%s/%s", fs_basedir->string, dir) );
685  }
686 }

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

◆ Info_Print()

void Info_Print ( char *  s)

Definition at line 1068 of file common.c.

1069 {
1070  char key[512];
1071  char value[512];
1072  char *o;
1073  int l;
1074 
1075  if (*s == '\\')
1076  s++;
1077  while (*s)
1078  {
1079  o = key;
1080  while (*s && *s != '\\')
1081  *o++ = *s++;
1082 
1083  l = o - key;
1084  if (l < 20)
1085  {
1086  memset (o, ' ', 20-l);
1087  key[20] = 0;
1088  }
1089  else
1090  *o = 0;
1091  Com_Printf ("%s", key);
1092 
1093  if (!*s)
1094  {
1095  Com_Printf ("MISSING VALUE\n");
1096  return;
1097  }
1098 
1099  o = value;
1100  s++;
1101  while (*s && *s != '\\')
1102  *o++ = *s++;
1103  *o = 0;
1104 
1105  if (*s)
1106  s++;
1107  Com_Printf ("%s\n", value);
1108  }
1109 }

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 703 of file common.c.

704 {
705  msg->readcount = 0;
706 }

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

◆ MSG_ReadAngle()

float MSG_ReadAngle ( sizebuf_t sb)

Definition at line 844 of file common.c.

845 {
846  return MSG_ReadChar(msg_read) * (360.0/256);
847 }

Referenced by CL_ParseDelta().

◆ MSG_ReadAngle16()

float MSG_ReadAngle16 ( sizebuf_t sb)

Definition at line 849 of file common.c.

850 {
851  return SHORT2ANGLE(MSG_ReadShort(msg_read));
852 }

Referenced by CL_ParsePlayerstate().

◆ MSG_ReadByte()

int MSG_ReadByte ( sizebuf_t sb)

Definition at line 722 of file common.c.

723 {
724  int c;
725 
726  if (msg_read->readcount+1 > msg_read->cursize)
727  c = -1;
728  else
729  c = (unsigned char)msg_read->data[msg_read->readcount];
730  msg_read->readcount++;
731 
732  return c;
733 }

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 709 of file common.c.

710 {
711  int c;
712 
713  if (msg_read->readcount+1 > msg_read->cursize)
714  c = -1;
715  else
716  c = (signed char)msg_read->data[msg_read->readcount];
717  msg_read->readcount++;
718 
719  return c;
720 }

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

◆ MSG_ReadCoord()

float MSG_ReadCoord ( sizebuf_t sb)

Definition at line 832 of file common.c.

833 {
834  return MSG_ReadShort(msg_read) * (1.0/8);
835 }

Referenced by CL_ParseDelta().

◆ MSG_ReadData()

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

Definition at line 893 of file common.c.

894 {
895  int i;
896 
897  for (i=0 ; i<len ; i++)
898  ((byte *)data)[i] = MSG_ReadByte (msg_read);
899 }

Referenced by CL_ParseFrame().

◆ MSG_ReadDeltaUsercmd()

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

Definition at line 854 of file common.c.

855 {
856  int bits;
857 
858  memcpy (move, from, sizeof(*move));
859 
860  bits = MSG_ReadByte (msg_read);
861 
862 // read current angles
863  if (bits & CM_ANGLE1)
864  move->angles[0] = MSG_ReadShort (msg_read);
865  if (bits & CM_ANGLE2)
866  move->angles[1] = MSG_ReadShort (msg_read);
867  if (bits & CM_ANGLE3)
868  move->angles[2] = MSG_ReadShort (msg_read);
869 
870 // read movement
871  if (bits & CM_FORWARD)
872  move->forwardmove = MSG_ReadShort (msg_read);
873  if (bits & CM_SIDE)
874  move->sidemove = MSG_ReadShort (msg_read);
875  if (bits & CM_UP)
876  move->upmove = MSG_ReadShort (msg_read);
877 
878 // read buttons
879  if (bits & CM_BUTTONS)
880  move->buttons = MSG_ReadByte (msg_read);
881 
882  if (bits & CM_IMPULSE)
883  move->impulse = MSG_ReadByte (msg_read);
884 
885 // read time to run command
886  move->msec = MSG_ReadByte (msg_read);
887 
888 // read the light level
889  move->lightlevel = MSG_ReadByte (msg_read);
890 }

Referenced by SV_ExecuteClientMessage().

◆ MSG_ReadDir()

void MSG_ReadDir ( sizebuf_t sb,
vec3_t  vector 
)

Definition at line 483 of file common.c.

484 {
485  int b;
486 
487  b = MSG_ReadByte (sb);
488  if (b >= NUMVERTEXNORMALS)
489  Com_Error (ERR_DROP, "MSF_ReadDir: out of range");
490  VectorCopy (bytedirs[b], dir);
491 }

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

◆ MSG_ReadFloat()

float MSG_ReadFloat ( sizebuf_t sb)

Definition at line 767 of file common.c.

768 {
769  union
770  {
771  byte b[4];
772  float f;
773  int l;
774  } dat;
775 
776  if (msg_read->readcount+4 > msg_read->cursize)
777  dat.f = -1;
778  else
779  {
780  dat.b[0] = msg_read->data[msg_read->readcount];
781  dat.b[1] = msg_read->data[msg_read->readcount+1];
782  dat.b[2] = msg_read->data[msg_read->readcount+2];
783  dat.b[3] = msg_read->data[msg_read->readcount+3];
784  }
785  msg_read->readcount += 4;
786 
787  dat.l = LittleLong (dat.l);
788 
789  return dat.f;
790 }

Referenced by CL_ParseTEnt().

◆ MSG_ReadLong()

int MSG_ReadLong ( sizebuf_t sb)

Definition at line 750 of file common.c.

751 {
752  int c;
753 
754  if (msg_read->readcount+4 > msg_read->cursize)
755  c = -1;
756  else
757  c = msg_read->data[msg_read->readcount]
758  + (msg_read->data[msg_read->readcount+1]<<8)
759  + (msg_read->data[msg_read->readcount+2]<<16)
760  + (msg_read->data[msg_read->readcount+3]<<24);
761 
762  msg_read->readcount += 4;
763 
764  return c;
765 }

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 837 of file common.c.

838 {
839  pos[0] = MSG_ReadShort(msg_read) * (1.0/8);
840  pos[1] = MSG_ReadShort(msg_read) * (1.0/8);
841  pos[2] = MSG_ReadShort(msg_read) * (1.0/8);
842 }

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 735 of file common.c.

736 {
737  int c;
738 
739  if (msg_read->readcount+2 > msg_read->cursize)
740  c = -1;
741  else
742  c = (short)(msg_read->data[msg_read->readcount]
743  + (msg_read->data[msg_read->readcount+1]<<8));
744 
745  msg_read->readcount += 2;
746 
747  return c;
748 }

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 792 of file common.c.

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

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 812 of file common.c.

813 {
814  static char string[2048];
815  int l,c;
816 
817  l = 0;
818  do
819  {
820  c = MSG_ReadChar (msg_read);
821  if (c == -1 || c == 0 || c == '\n')
822  break;
823  string[l] = c;
824  l++;
825  } while (l < sizeof(string)-1);
826 
827  string[l] = 0;
828 
829  return string;
830 }

Referenced by CL_ConnectionlessPacket(), and SV_ConnectionlessPacket().

◆ MSG_WriteAngle()

void MSG_WriteAngle ( sizebuf_t sb,
float  f 
)

Definition at line 395 of file common.c.

396 {
397  MSG_WriteByte (sb, (int)(f*256/360) & 255);
398 }

Referenced by MSG_WriteDeltaEntity(), and PF_WriteAngle().

◆ MSG_WriteAngle16()

void MSG_WriteAngle16 ( sizebuf_t sb,
float  f 
)

Definition at line 400 of file common.c.

401 {
402  MSG_WriteShort (sb, ANGLE2SHORT(f));
403 }

Referenced by SV_WritePlayerstateToClient().

◆ MSG_WriteByte()

◆ MSG_WriteChar()

void MSG_WriteChar ( sizebuf_t sb,
int  c 
)

Definition at line 309 of file common.c.

310 {
311  byte *buf;
312 
313 #ifdef PARANOID
314  if (c < -128 || c > 127)
315  Com_Error (ERR_FATAL, "MSG_WriteChar: range error");
316 #endif
317 
318  buf = SZ_GetSpace (sb, 1);
319  buf[0] = c;
320 }

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 383 of file common.c.

384 {
385  MSG_WriteShort (sb, (int)(f*8));
386 }

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 502 of file common.c.

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

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 406 of file common.c.

407 {
408  int bits;
409 
410 //
411 // send the movement message
412 //
413  bits = 0;
414  if (cmd->angles[0] != from->angles[0])
415  bits |= CM_ANGLE1;
416  if (cmd->angles[1] != from->angles[1])
417  bits |= CM_ANGLE2;
418  if (cmd->angles[2] != from->angles[2])
419  bits |= CM_ANGLE3;
420  if (cmd->forwardmove != from->forwardmove)
421  bits |= CM_FORWARD;
422  if (cmd->sidemove != from->sidemove)
423  bits |= CM_SIDE;
424  if (cmd->upmove != from->upmove)
425  bits |= CM_UP;
426  if (cmd->buttons != from->buttons)
427  bits |= CM_BUTTONS;
428  if (cmd->impulse != from->impulse)
429  bits |= CM_IMPULSE;
430 
431  MSG_WriteByte (buf, bits);
432 
433  if (bits & CM_ANGLE1)
434  MSG_WriteShort (buf, cmd->angles[0]);
435  if (bits & CM_ANGLE2)
436  MSG_WriteShort (buf, cmd->angles[1]);
437  if (bits & CM_ANGLE3)
438  MSG_WriteShort (buf, cmd->angles[2]);
439 
440  if (bits & CM_FORWARD)
441  MSG_WriteShort (buf, cmd->forwardmove);
442  if (bits & CM_SIDE)
443  MSG_WriteShort (buf, cmd->sidemove);
444  if (bits & CM_UP)
445  MSG_WriteShort (buf, cmd->upmove);
446 
447  if (bits & CM_BUTTONS)
448  MSG_WriteByte (buf, cmd->buttons);
449  if (bits & CM_IMPULSE)
450  MSG_WriteByte (buf, cmd->impulse);
451 
452  MSG_WriteByte (buf, cmd->msec);
453  MSG_WriteByte (buf, cmd->lightlevel);
454 }

Referenced by CL_SendCmd().

◆ MSG_WriteDir()

void MSG_WriteDir ( sizebuf_t sb,
vec3_t  vector 
)

Definition at line 457 of file common.c.

458 {
459  int i, best;
460  float d, bestd;
461 
462  if (!dir)
463  {
464  MSG_WriteByte (sb, 0);
465  return;
466  }
467 
468  bestd = 0;
469  best = 0;
470  for (i=0 ; i<NUMVERTEXNORMALS ; i++)
471  {
472  d = DotProduct (dir, bytedirs[i]);
473  if (d > bestd)
474  {
475  bestd = d;
476  best = i;
477  }
478  }
479  MSG_WriteByte (sb, best);
480 }

Referenced by PF_WriteDir().

◆ MSG_WriteFloat()

void MSG_WriteFloat ( sizebuf_t sb,
float  f 
)

Definition at line 360 of file common.c.

361 {
362  union
363  {
364  float f;
365  int l;
366  } dat;
367 
368 
369  dat.f = f;
370  dat.l = LittleLong (dat.l);
371 
372  SZ_Write (sb, &dat.l, 4);
373 }

Referenced by PF_WriteFloat().

◆ MSG_WriteLong()

void MSG_WriteLong ( sizebuf_t sb,
int  c 
)

Definition at line 349 of file common.c.

350 {
351  byte *buf;
352 
353  buf = SZ_GetSpace (sb, 4);
354  buf[0] = c&0xff;
355  buf[1] = (c>>8)&0xff;
356  buf[2] = (c>>16)&0xff;
357  buf[3] = c>>24;
358 }

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 388 of file common.c.

389 {
390  MSG_WriteShort (sb, (int)(pos[0]*8));
391  MSG_WriteShort (sb, (int)(pos[1]*8));
392  MSG_WriteShort (sb, (int)(pos[2]*8));
393 }

Referenced by PF_WritePos(), and SV_StartSound().

◆ MSG_WriteShort()

void MSG_WriteShort ( sizebuf_t sb,
int  c 
)

Definition at line 335 of file common.c.

336 {
337  byte *buf;
338 
339 #ifdef PARANOID
340  if (c < ((short)0x8000) || c > (short)0x7fff)
341  Com_Error (ERR_FATAL, "MSG_WriteShort: range error");
342 #endif
343 
344  buf = SZ_GetSpace (sb, 2);
345  buf[0] = c&0xff;
346  buf[1] = c>>8;
347 }

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 156 of file net_wins.c.

157 {
158  static char s[64];
159 
160  if (a.type == NA_LOOPBACK)
161  Com_sprintf (s, sizeof(s), "loopback");
162  else if (a.type == NA_IP)
163  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));
164  else
165  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));
166 
167  return s;
168 }

Referenced by CL_ConnectionlessPacket(), CL_ReadPackets(), JoinServerFunc(), M_AddToServerList(), 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 103 of file net_wins.c.

104 {
105  if (a.type != b.type)
106  return false;
107 
108  if (a.type == NA_LOOPBACK)
109  return TRUE;
110 
111  if (a.type == NA_IP)
112  {
113  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)
114  return true;
115  return false;
116  }
117 
118  if (a.type == NA_IPX)
119  {
120  if ((memcmp(a.ipx, b.ipx, 10) == 0) && a.port == b.port)
121  return true;
122  return false;
123  }
124 }

Referenced by CL_ReadPackets().

◆ NET_CompareBaseAdr()

qboolean NET_CompareBaseAdr ( netadr_t  a,
netadr_t  b 
)

Definition at line 133 of file net_wins.c.

134 {
135  if (a.type != b.type)
136  return false;
137 
138  if (a.type == NA_LOOPBACK)
139  return TRUE;
140 
141  if (a.type == NA_IP)
142  {
143  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])
144  return true;
145  return false;
146  }
147 
148  if (a.type == NA_IPX)
149  {
150  if ((memcmp(a.ipx, b.ipx, 10) == 0))
151  return true;
152  return false;
153  }
154 }

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

◆ NET_Config()

void NET_Config ( qboolean  multiplayer)

Definition at line 690 of file net_wins.c.

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

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 331 of file net_wins.c.

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

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

◆ NET_Init()

void NET_Init ( void  )

Definition at line 762 of file net_wins.c.

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

Referenced by Qcommon_Init().

◆ NET_IsLocalAddress()

qboolean NET_IsLocalAddress ( netadr_t  adr)

Definition at line 277 of file net_wins.c.

278 {
279  return adr.type == NA_LOOPBACK;
280 }

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 395 of file net_wins.c.

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

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

◆ NET_Shutdown()

void NET_Shutdown ( void  )

Definition at line 788 of file net_wins.c.

789 {
790  NET_Config (false); // close sockets
791 
792  WSACleanup ();
793 }

◆ NET_Sleep()

void NET_Sleep ( int  msec)

Definition at line 726 of file net_wins.c.

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

Referenced by SV_Frame().

◆ NET_StringToAdr()

qboolean NET_StringToAdr ( char *  s,
netadr_t a 
)

Definition at line 257 of file net_wins.c.

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

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, 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 1524 of file common.c.

1525 {
1526  char *s;
1527  int time_before, time_between, time_after;
1528 
1529  if (setjmp (abortframe) )
1530  return; // an ERR_DROP was thrown
1531 
1532  if ( log_stats->modified )
1533  {
1534  log_stats->modified = false;
1535  if ( log_stats->value )
1536  {
1537  if ( log_stats_file )
1538  {
1539  fclose( log_stats_file );
1540  log_stats_file = 0;
1541  }
1542  log_stats_file = fopen( "stats.log", "w" );
1543  if ( log_stats_file )
1544  fprintf( log_stats_file, "entities,dlights,parts,frame time\n" );
1545  }
1546  else
1547  {
1548  if ( log_stats_file )
1549  {
1550  fclose( log_stats_file );
1551  log_stats_file = 0;
1552  }
1553  }
1554  }
1555 
1556  if (fixedtime->value)
1557  msec = fixedtime->value;
1558  else if (timescale->value)
1559  {
1560  msec *= timescale->value;
1561  if (msec < 1)
1562  msec = 1;
1563  }
1564 
1565  if (showtrace->value)
1566  {
1567  extern int c_traces, c_brush_traces;
1568  extern int c_pointcontents;
1569 
1570  Com_Printf ("%4i traces %4i points\n", c_traces, c_pointcontents);
1571  c_traces = 0;
1572  c_brush_traces = 0;
1573  c_pointcontents = 0;
1574  }
1575 
1576  do
1577  {
1578  s = Sys_ConsoleInput ();
1579  if (s)
1580  Cbuf_AddText (va("%s\n",s));
1581  } while (s);
1582  Cbuf_Execute ();
1583 
1584  if (host_speeds->value)
1585  time_before = Sys_Milliseconds ();
1586 
1587  SV_Frame (msec);
1588 
1589  if (host_speeds->value)
1590  time_between = Sys_Milliseconds ();
1591 
1592  CL_Frame (msec);
1593 
1594  if (host_speeds->value)
1595  time_after = Sys_Milliseconds ();
1596 
1597 
1598  if (host_speeds->value)
1599  {
1600  int all, sv, gm, cl, rf;
1601 
1602  all = time_after - time_before;
1603  sv = time_between - time_before;
1604  cl = time_after - time_between;
1607  sv -= gm;
1608  cl -= rf;
1609  Com_Printf ("all:%3i sv:%3i gm:%3i cl:%3i rf:%3i\n",
1610  all, sv, gm, cl, rf);
1611  }
1612 }

Referenced by WinMain().

◆ Qcommon_Init()

void Qcommon_Init ( int  argc,
char **  argv 
)

Definition at line 1430 of file common.c.

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

Referenced by WinMain().

◆ Qcommon_Shutdown()

void Qcommon_Shutdown ( void  )

Definition at line 1619 of file common.c.

1620 {
1621 }

Referenced by Sys_Error(), and Sys_Quit().

◆ SCR_BeginLoadingPlaque()

void SCR_BeginLoadingPlaque ( void  )

Definition at line 571 of file cl_scrn.c.

572 {
573  S_StopAllSounds ();
574  cl.sound_prepped = false; // don't play ambients
575  CDAudio_Stop ();
576  if (cls.disable_screen)
577  return;
578  if (developer->value)
579  return;
580  if (cls.state == ca_disconnected)
581  return; // if at console, don't bring up the plaque
582  if (cls.key_dest == key_console)
583  return;
584  if (cl.cinematictime > 0)
585  scr_draw_loading = 2; // clear to balack first
586  else
587  scr_draw_loading = 1;
588  SCR_UpdateScreen ();
591 }

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

◆ SCR_DebugGraph()

void SCR_DebugGraph ( float  value,
int  color 
)

Definition at line 139 of file cl_scrn.c.

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

◆ 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  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 ();
1042 
1043  // free current level
1044  if (sv.demofile)
1045  fclose (sv.demofile);
1046  memset (&sv, 0, sizeof(sv));
1048 
1049  // free server static data
1050  if (svs.clients)
1051  Z_Free (svs.clients);
1052  if (svs.client_entities)
1054  if (svs.demofile)
1055  fclose (svs.demofile);
1056  memset (&svs, 0, sizeof(svs));
1057 }

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

◆ Sys_AppActivate()

void Sys_AppActivate ( void  )

Definition at line 437 of file sys_win.c.

438 {
439  ShowWindow ( cl_hwnd, SW_RESTORE);
440  SetForegroundWindow ( cl_hwnd );
441 }

Referenced by CL_ConnectionlessPacket().

◆ Sys_ConsoleInput()

char* Sys_ConsoleInput ( void  )

Definition at line 265 of file sys_win.c.

266 {
267  INPUT_RECORD recs[1024];
268  int dummy;
269  int ch, numread, numevents;
270 
271  if (!dedicated || !dedicated->value)
272  return NULL;
273 
274 
275  for ( ;; )
276  {
277  if (!GetNumberOfConsoleInputEvents (hinput, &numevents))
278  Sys_Error ("Error getting # of console events");
279 
280  if (numevents <= 0)
281  break;
282 
283  if (!ReadConsoleInput(hinput, recs, 1, &numread))
284  Sys_Error ("Error reading console input");
285 
286  if (numread != 1)
287  Sys_Error ("Couldn't read console input");
288 
289  if (recs[0].EventType == KEY_EVENT)
290  {
291  if (!recs[0].Event.KeyEvent.bKeyDown)
292  {
293  ch = recs[0].Event.KeyEvent.uChar.AsciiChar;
294 
295  switch (ch)
296  {
297  case '\r':
298  WriteFile(houtput, "\r\n", 2, &dummy, NULL);
299 
300  if (console_textlen)
301  {
303  console_textlen = 0;
304  return console_text;
305  }
306  break;
307 
308  case '\b':
309  if (console_textlen)
310  {
311  console_textlen--;
312  WriteFile(houtput, "\b \b", 3, &dummy, NULL);
313  }
314  break;
315 
316  default:
317  if (ch >= ' ')
318  {
319  if (console_textlen < sizeof(console_text)-2)
320  {
321  WriteFile(houtput, &ch, 1, &dummy, NULL);
323  console_textlen++;
324  }
325  }
326 
327  break;
328 
329  }
330  }
331  }
332  }
333 
334  return NULL;
335 }

Referenced by Qcommon_Frame().

◆ Sys_ConsoleOutput()

void Sys_ConsoleOutput ( char *  string)

Definition at line 345 of file sys_win.c.

346 {
347  int dummy;
348  char text[256];
349 
350  if (!dedicated || !dedicated->value)
351  return;
352 
353  if (console_textlen)
354  {
355  text[0] = '\r';
356  memset(&text[1], ' ', console_textlen);
357  text[console_textlen+1] = '\r';
358  text[console_textlen+2] = 0;
359  WriteFile(houtput, text, console_textlen+2, &dummy, NULL);
360  }
361 
362  WriteFile(houtput, string, strlen(string), &dummy, NULL);
363 
364  if (console_textlen)
365  WriteFile(houtput, console_text, console_textlen, &dummy, NULL);
366 }

Referenced by Com_Printf().

◆ Sys_CopyProtect()

void Sys_CopyProtect ( void  )

Definition at line 186 of file sys_win.c.

187 {
188 #ifndef DEMO
189  char *cddir;
190 
191  cddir = Sys_ScanForCD();
192  if (!cddir[0])
193  Com_Error (ERR_FATAL, "You must have the Quake2 CD in the drive to play.");
194 #endif
195 }

Referenced by SV_InitGame().

◆ Sys_Error()

void Sys_Error ( char *  error,
  ... 
)

Definition at line 67 of file sys_win.c.

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

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

◆ Sys_GetClipboardData()

char* Sys_GetClipboardData ( void  )

Definition at line 401 of file sys_win.c.

402 {
403  char *data = NULL;
404  char *cliptext;
405 
406  if ( OpenClipboard( NULL ) != 0 )
407  {
408  HANDLE hClipboardData;
409 
410  if ( ( hClipboardData = GetClipboardData( CF_TEXT ) ) != 0 )
411  {
412  if ( ( cliptext = GlobalLock( hClipboardData ) ) != 0 )
413  {
414  data = malloc( GlobalSize( hClipboardData ) + 1 );
415  strcpy( data, cliptext );
416  GlobalUnlock( hClipboardData );
417  }
418  }
419  CloseClipboard();
420  }
421  return data;
422 }

Referenced by Field_Key(), and Key_Console().

◆ Sys_GetGameAPI()

void* Sys_GetGameAPI ( void parms)

Definition at line 472 of file sys_win.c.

473 {
474  void *(*GetGameAPI) (void *);
475  char name[MAX_OSPATH];
476  char *path;
477  char cwd[MAX_OSPATH];
478 #if defined _M_IX86
479  const char *gamename = "gamex86.dll";
480 
481 #ifdef NDEBUG
482  const char *debugdir = "release";
483 #else
484  const char *debugdir = "debug";
485 #endif
486 
487 #elif defined _M_ALPHA
488  const char *gamename = "gameaxp.dll";
489 
490 #ifdef NDEBUG
491  const char *debugdir = "releaseaxp";
492 #else
493  const char *debugdir = "debugaxp";
494 #endif
495 
496 #endif
497 
498  if (game_library)
499  Com_Error (ERR_FATAL, "Sys_GetGameAPI without Sys_UnloadingGame");
500 
501  // check the current debug directory first for development purposes
502  _getcwd (cwd, sizeof(cwd));
503  Com_sprintf (name, sizeof(name), "%s/%s/%s", cwd, debugdir, gamename);
504  game_library = LoadLibrary ( name );
505  if (game_library)
506  {
507  Com_DPrintf ("LoadLibrary (%s)\n", name);
508  }
509  else
510  {
511 #ifdef DEBUG
512  // check the current directory for other development purposes
513  Com_sprintf (name, sizeof(name), "%s/%s", cwd, gamename);
514  game_library = LoadLibrary ( name );
515  if (game_library)
516  {
517  Com_DPrintf ("LoadLibrary (%s)\n", name);
518  }
519  else
520 #endif
521  {
522  // now run through the search paths
523  path = NULL;
524  while (1)
525  {
526  path = FS_NextPath (path);
527  if (!path)
528  return NULL; // couldn't find one anywhere
529  Com_sprintf (name, sizeof(name), "%s/%s", path, gamename);
530  game_library = LoadLibrary (name);
531  if (game_library)
532  {
533  Com_DPrintf ("LoadLibrary (%s)\n",name);
534  break;
535  }
536  }
537  }
538  }
539 
540  GetGameAPI = (void *)GetProcAddress (game_library, "GetGameAPI");
541  if (!GetGameAPI)
542  {
543  Sys_UnloadGame ();
544  return NULL;
545  }
546 
547  return GetGameAPI (parms);
548 }

Referenced by SV_InitGameProgs().

◆ Sys_Init()

void Sys_Init ( void  )

Definition at line 206 of file sys_win.c.

207 {
208  OSVERSIONINFO vinfo;
209 
210 #if 0
211  // allocate a named semaphore on the client so the
212  // front end can tell if it is alive
213 
214  // mutex will fail if semephore already exists
215  qwclsemaphore = CreateMutex(
216  NULL, /* Security attributes */
217  0, /* owner */
218  "qwcl"); /* Semaphore name */
219  if (!qwclsemaphore)
220  Sys_Error ("QWCL is already running on this system");
221  CloseHandle (qwclsemaphore);
222 
223  qwclsemaphore = CreateSemaphore(
224  NULL, /* Security attributes */
225  0, /* Initial count */
226  1, /* Maximum count */
227  "qwcl"); /* Semaphore name */
228 #endif
229 
230  timeBeginPeriod( 1 );
231 
232  vinfo.dwOSVersionInfoSize = sizeof(vinfo);
233 
234  if (!GetVersionEx (&vinfo))
235  Sys_Error ("Couldn't get OS info");
236 
237  if (vinfo.dwMajorVersion < 4)
238  Sys_Error ("Quake2 requires windows version 4 or greater");
239  if (vinfo.dwPlatformId == VER_PLATFORM_WIN32s)
240  Sys_Error ("Quake2 doesn't run on Win32s");
241  else if ( vinfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS )
242  s_win95 = true;
243 
244  if (dedicated->value)
245  {
246  if (!AllocConsole ())
247  Sys_Error ("Couldn't create dedicated server console");
248  hinput = GetStdHandle (STD_INPUT_HANDLE);
249  houtput = GetStdHandle (STD_OUTPUT_HANDLE);
250 
251  // let QHOST hook in
252  InitConProc (argc, argv);
253  }
254 }

Referenced by Qcommon_Init().

◆ Sys_Quit()

void Sys_Quit ( void  )

Definition at line 90 of file sys_win.c.

91 {
92  timeEndPeriod( 1 );
93 
94  CL_Shutdown();
96  CloseHandle (qwclsemaphore);
97  if (dedicated && dedicated->value)
98  FreeConsole ();
99 
100 // shut down QHOST hooks if necessary
101  DeinitConProc ();
102 
103  exit (0);
104 }

Referenced by Com_Quit(), and Sys_SendKeyEvents().

◆ Sys_SendKeyEvents()

void Sys_SendKeyEvents ( void  )

Definition at line 376 of file sys_win.c.

377 {
378  MSG msg;
379 
380  while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE))
381  {
382  if (!GetMessage (&msg, NULL, 0, 0))
383  Sys_Quit ();
384  sys_msg_time = msg.time;
385  TranslateMessage (&msg);
386  DispatchMessage (&msg);
387  }
388 
389  // grab frame time
390  sys_frame_time = timeGetTime(); // FIXME: should this be at start?
391 }

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

◆ Sys_UnloadGame()

void Sys_UnloadGame ( void  )

Definition at line 458 of file sys_win.c.

459 {
460  if (!FreeLibrary (game_library))
461  Com_Error (ERR_FATAL, "FreeLibrary failed for game library");
462  game_library = NULL;
463 }

Referenced by SV_ShutdownGameProgs(), and Sys_GetGameAPI().

◆ SZ_Clear()

◆ SZ_GetSpace()

void* SZ_GetSpace ( sizebuf_t buf,
int  length 
)

Definition at line 917 of file common.c.

918 {
919  void *data;
920 
921  if (buf->cursize + length > buf->maxsize)
922  {
923  if (!buf->allowoverflow)
924  Com_Error (ERR_FATAL, "SZ_GetSpace: overflow without allowoverflow set");
925 
926  if (length > buf->maxsize)
927  Com_Error (ERR_FATAL, "SZ_GetSpace: %i is > full buffer size", length);
928 
929  Com_Printf ("SZ_GetSpace: overflow\n");
930  SZ_Clear (buf);
931  buf->overflowed = true;
932  }
933 
934  data = buf->data + buf->cursize;
935  buf->cursize += length;
936 
937  return data;
938 }

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 904 of file common.c.

905 {
906  memset (buf, 0, sizeof(*buf));
907  buf->data = data;
908  buf->maxsize = length;
909 }

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 945 of file common.c.

946 {
947  int len;
948 
949  len = strlen(data)+1;
950 
951  if (buf->cursize)
952  {
953  if (buf->data[buf->cursize-1])
954  memcpy ((byte *)SZ_GetSpace(buf, len),data,len); // no trailing 0
955  else
956  memcpy ((byte *)SZ_GetSpace(buf, len-1)-1,data,len); // write over trailing 0
957  }
958  else
959  memcpy ((byte *)SZ_GetSpace(buf, len),data,len);
960 }

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 1141 of file common.c.

1142 {
1143  zhead_t *z;
1144 
1145  z = ((zhead_t *)ptr) - 1;
1146 
1147  if (z->magic != Z_MAGIC) {
1148  printf( "free: %p failed\n", ptr );
1149  abort();
1150  Com_Error (ERR_FATAL, "Z_Free: bad magic");
1151  }
1152 
1153  z->prev->next = z->next;
1154  z->next->prev = z->prev;
1155 
1156  z_count--;
1157  z_bytes -= z->size;
1158  free (z);
1159 }

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 1177 of file common.c.

1178 {
1179  zhead_t *z, *next;
1180 
1181  for (z=z_chain.next ; z != &z_chain ; z=next)
1182  {
1183  next = z->next;
1184  if (z->tag == tag)
1185  Z_Free ((void *)(z+1));
1186  }
1187 }

Referenced by SV_InitGameProgs().

◆ Z_Malloc()

◆ Z_TagMalloc()

void* Z_TagMalloc ( int  size,
int  tag 
)

Definition at line 1194 of file common.c.

1195 {
1196  zhead_t *z;
1197 
1198  size = size + sizeof(zhead_t);
1199  z = malloc(size);
1200  if (!z)
1201  Com_Error (ERR_FATAL, "Z_Malloc: failed on allocation of %i bytes",size);
1202  memset (z, 0, size);
1203  z_count++;
1204  z_bytes += size;
1205  z->magic = Z_MAGIC;
1206  z->tag = tag;
1207  z->size = size;
1208 
1209  z->next = z_chain.next;
1210  z->prev = &z_chain;
1211  z_chain.next->prev = z;
1212  z_chain.next = z;
1213 
1214  /* printf( "returning pointer: %p\n", (z+1) );*/
1215  return (void *)(z+1);
1216 }

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 41 of file common.c.

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

◆ host_speeds

cvar_t* host_speeds

Definition at line 39 of file common.c.

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

◆ log_stats

cvar_t* log_stats

Definition at line 40 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 37 of file common.c.

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

◆ modder

cvar_t* modder

Definition at line 42 of file common.c.

Referenced by Com_MDPrintf(), and Qcommon_Init().

◆ 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
entity_state_s::old_origin
vec3_t old_origin
Definition: q_shared.h:1175
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:533
CL_Drop
void CL_Drop(void)
Definition: cl_main.c:412
CL_InitLocal
void CL_InitLocal(void)
Definition: cl_main.c:1430
sv
server_t sv
Definition: sv_init.c:24
cplane_s::normal
vec3_t normal
Definition: q_shared.h:411
SV_FinalMessage
void SV_FinalMessage(char *message, qboolean reconnect)
Definition: sv_main.c:996
cvar_s::flags
int flags
Definition: q_shared.h:322
defer_text_buf
char defer_text_buf[8192]
Definition: cmd.c:71
CDAudio_Stop
void CDAudio_Stop(void)
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:520
refdef_t::vieworg
float vieworg[3]
Definition: ref.h:124
FS_Read
void FS_Read(void *buffer, int len, FILE *f)
Definition: files.c:346
SCR_EndLoadingPlaque
void SCR_EndLoadingPlaque(void)
Definition: cl_scrn.c:598
Z_MAGIC
#define Z_MAGIC
Definition: common.c:1122
cvar_vars
cvar_t * cvar_vars
Definition: cvar.c:24
usercmd_s::impulse
byte impulse
Definition: q_shared.h:519
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:75
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:215
svc_centerprint
@ svc_centerprint
Definition: qcommon.h:224
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:47
NET_OpenIP
void NET_OpenIP(void)
Definition: net_wins.c:537
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:174
MAX_QPATH
#define MAX_QPATH
Definition: q_shared.h:73
entity_state_s::modelindex4
int modelindex4
Definition: q_shared.h:1177
netchan_t::sock
netsrc_t sock
Definition: qcommon.h:578
NET_Sleep
void NET_Sleep(int msec)
Definition: net_wins.c:726
CRC_INIT_VALUE
#define CRC_INIT_VALUE
Definition: crc.c:28
entity_state_s::solid
int solid
Definition: q_shared.h:1182
netchan_t::incoming_sequence
int incoming_sequence
Definition: qcommon.h:589
Z_TagMalloc
void * Z_TagMalloc(int size, int tag)
Definition: common.c:1194
U_ANGLE2
#define U_ANGLE2
Definition: qcommon.h:300
netchan_t::last_reliable_sequence
int last_reliable_sequence
Definition: qcommon.h:597
U_MOREBITS3
#define U_MOREBITS3
Definition: qcommon.h:324
pm
pmove_t * pm
Definition: pmove.c:48
netchan_t::incoming_acknowledged
int incoming_acknowledged
Definition: qcommon.h:590
z_chain
zhead_t z_chain
Definition: common.c:1133
trace_t::fraction
float fraction
Definition: q_shared.h:453
pmove_t::watertype
int watertype
Definition: q_shared.h:544
LUMP_AREAPORTALS
#define LUMP_AREAPORTALS
Definition: qfiles.h:280
VectorSubtract
#define VectorSubtract(a, b, c)
Definition: q_shared.h:156
U_ANGLE1
#define U_ANGLE1
Definition: qcommon.h:310
NS_SERVER
@ NS_SERVER
Definition: qcommon.h:536
V_Init
void V_Init(void)
Definition: cl_view.c:642
FS_Path_f
void FS_Path_f(void)
Definition: files.c:837
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:208
entity_state_s::frame
int frame
Definition: q_shared.h:1178
file_from_pak
int file_from_pak
Definition: files.c:204
log_stats
cvar_t * log_stats
Definition: common.c:40
CVAR_NOSET
#define CVAR_NOSET
Definition: q_shared.h:312
client_state_t::v_forward
vec3_t v_forward
Definition: client.h:153
svc_frame
@ svc_frame
Definition: qcommon.h:229
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:455
Com_SetServerState
void Com_SetServerState(int state)
Definition: common.c:285
CM_SIDE
#define CM_SIDE
Definition: qcommon.h:276
Cvar_Command
qboolean Cvar_Command(void)
Definition: cvar.c:363
chktbl
static byte chktbl[1024]
Definition: common.c:1287
client_static_t::disable_screen
float disable_screen
Definition: client.h:232
CMod_LoadVisibility
void CMod_LoadVisibility(lump_t *l)
Definition: cmodel.c:506
EXEC_NOW
#define EXEC_NOW
Definition: qcommon.h:739
svc_bad
@ svc_bad
Definition: qcommon.h:205
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:206
s_win95
qboolean s_win95
Definition: sys_win.c:39
client_state_t::v_up
vec3_t v_up
Definition: client.h:153
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:539
cleaf_t::cluster
int cluster
Definition: cmodel.c:39
NET_Config
void NET_Config(qboolean multiplayer)
Definition: net_wins.c:690
LUMP_MODELS
#define LUMP_MODELS
Definition: qfiles.h:275
entity_state_s::renderfx
int renderfx
Definition: q_shared.h:1181
MSG_ReadShort
int MSG_ReadShort(sizebuf_t *msg_read)
Definition: common.c:735
PM_FREEZE
@ PM_FREEZE
Definition: q_shared.h:473
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:323
U_ORIGIN1
#define U_ORIGIN1
Definition: qcommon.h:298
netchan_t::message
sizebuf_t message
Definition: qcommon.h:600
SV_CalcPings
void SV_CalcPings(void)
Definition: sv_main.c:521
NA_IP
@ NA_IP
Definition: qcommon.h:533
PM_CheckDuck
void PM_CheckDuck(void)
Definition: pmove.c:976
ca_uninitialized
@ ca_uninitialized
Definition: client.h:205
numplanes
int numplanes
Definition: cmodel.c:71
entity_state_s::origin
vec3_t origin
Definition: q_shared.h:1173
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:78
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:638
svc_inventory
@ svc_inventory
Definition: qcommon.h:212
NET_AdrToString
char * NET_AdrToString(netadr_t a)
Definition: net_wins.c:156
U_RENDERFX8
#define U_RENDERFX8
Definition: qcommon.h:312
server_static_t::realtime
int realtime
Definition: server.h:161
Sys_Error
void Sys_Error(char *error,...)
Definition: sys_win.c:67
GetGameAPI
game_export_t * GetGameAPI(game_import_t *import)
Definition: g_main.c:113
U_OLDORIGIN
#define U_OLDORIGIN
Definition: qcommon.h:327
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:257
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:320
EXEC_INSERT
#define EXEC_INSERT
Definition: qcommon.h:740
qboolean
qboolean
Definition: q_shared.h:56
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:235
trace_t
Definition: q_shared.h:449
z
GLdouble GLdouble z
Definition: qgl_win.c:283
COM_Argv
char * COM_Argv(int arg)
Definition: common.c:992
pmove_state_t::gravity
short gravity
Definition: q_shared.h:498
z_count
int z_count
Definition: common.c:1134
VectorClear
#define VectorClear(a)
Definition: q_shared.h:159
i
int i
Definition: q_shared.c:305
MSG_WriteCoord
void MSG_WriteCoord(sizebuf_t *sb, float f)
Definition: common.c:383
pml
pml_t pml
Definition: pmove.c:49
host_speeds
cvar_t * host_speeds
Definition: common.c:39
fs_basedir
cvar_t * fs_basedir
Definition: files.c:62
mapsurface_s::c
csurface_t c
Definition: q_shared.h:444
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:784
portalopen
qboolean portalopen[MAX_MAP_AREAPORTALS]
Definition: cmodel.c:109
MAX_NUM_ARGVS
#define MAX_NUM_ARGVS
Definition: common.c:26
pmove_t::waterlevel
int waterlevel
Definition: q_shared.h:545
ca_active
@ ca_active
Definition: client.h:209
U_MODEL
#define U_MODEL
Definition: qcommon.h:311
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:1012
buffer
GLenum GLfloat * buffer
Definition: qgl_win.c:151
entity_state_s::event
int event
Definition: q_shared.h:1186
netchan_t::dropped
int dropped
Definition: qcommon.h:580
MSG_WriteLong
void MSG_WriteLong(sizebuf_t *sb, int c)
Definition: common.c:349
PITCH
#define PITCH
Definition: q_shared.h:65
PM_ClampAngles
void PM_ClampAngles(void)
Definition: pmove.c:1204
client_state_t::cinematictime
int cinematictime
Definition: client.h:165
FS_NextPath
char * FS_NextPath(char *prevpath)
Definition: files.c:865
MAX_TOKEN_CHARS
#define MAX_TOKEN_CHARS
Definition: q_shared.h:71
VERSION
#define VERSION
Definition: qcommon.h:26
NET_AdrToString
char * NET_AdrToString(netadr_t a)
Definition: net_wins.c:156
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:55
CL_ReadPackets
void CL_ReadPackets(void)
Definition: cl_main.c:1011
time_before_game
int time_before_game
Definition: common.c:54
CopyString
char * CopyString(char *in)
Definition: common.c:1057
SZ_Init
void SZ_Init(sizebuf_t *buf, byte *data, int length)
Definition: common.c:904
zhead_s::prev
struct zhead_s * prev
Definition: common.c:1127
svc_playerinfo
@ svc_playerinfo
Definition: qcommon.h:226
argc
int argc
Definition: sys_win.c:54
maxclients
cvar_t * maxclients
Definition: sv_main.c:47
NET_OpenIPX
void NET_OpenIPX(void)
Definition: net_wins.c:642
Sys_Init
void Sys_Init(void)
Definition: sys_win.c:206
CL_Disconnect
void CL_Disconnect(void)
Definition: cl_main.c:633
pmove_state_t::velocity
short velocity[3]
Definition: q_shared.h:495
Cmd_Args
char * Cmd_Args(void)
Definition: cmd.c:531
usercmd_s::forwardmove
short forwardmove
Definition: q_shared.h:518
sizebuf_s::data
byte * data
Definition: qcommon.h:79
client_state_t::refdef
refdef_t refdef
Definition: client.h:151
numnodes
int numnodes
Definition: cmodel.c:74
NA_BROADCAST
@ NA_BROADCAST
Definition: qcommon.h:533
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:90
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:325
U_MODEL2
#define U_MODEL2
Definition: qcommon.h:321
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:41
entity_state_s::modelindex3
int modelindex3
Definition: q_shared.h:1177
SZ_Write
void SZ_Write(sizebuf_t *buf, void *data, int length)
Definition: common.c:940
cvar_s
Definition: q_shared.h:317
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:911
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:1180
CVAR_SERVERINFO
#define CVAR_SERVERINFO
Definition: q_shared.h:311
Com_Error_f
void Com_Error_f(void)
Definition: common.c:1419
CL_Init
void CL_Init(void)
Definition: cl_main.c:1823
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:1185
Sys_ConsoleInput
char * Sys_ConsoleInput(void)
Definition: sys_win.c:265
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:301
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:98
server_static_t::client_entities
entity_state_t * client_entities
Definition: server.h:171
winsockdata
static WSADATA winsockdata
Definition: net_wins.c:755
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:80
Cmd_Argc
int Cmd_Argc(void)
Definition: cmd.c:507
DF_INSTANT_ITEMS
#define DF_INSTANT_ITEMS
Definition: q_shared.h:1052
netchan_t::fatal_error
qboolean fatal_error
Definition: qcommon.h:576
FS_Link_f
void FS_Link_f(void)
Definition: files.c:696
trace_ispoint
qboolean trace_ispoint
Definition: cmodel.c:982
game_library
static HINSTANCE game_library
Definition: sys_win.c:451
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:329
server_static_t::clients
client_t * clients
Definition: server.h:168
netchan_t::incoming_reliable_acknowledged
int incoming_reliable_acknowledged
Definition: qcommon.h:591
SCR_RunConsole
void SCR_RunConsole(void)
Definition: cl_scrn.c:507
searchpath_s::next
struct searchpath_s * next
Definition: files.c:80
RF_BEAM
#define RF_BEAM
Definition: q_shared.h:620
SCR_UpdateScreen
void SCR_UpdateScreen(void)
Definition: cl_scrn.c:1285
modder
cvar_t * modder
Definition: common.c:42
SockadrToNetadr
void SockadrToNetadr(struct sockaddr *s, netadr_t *a)
Definition: net_wins.c:85
PM_FlyMove
void PM_FlyMove(qboolean doclip)
Definition: pmove.c:882
trace_t::allsolid
qboolean allsolid
Definition: q_shared.h:451
SZ_Print
void SZ_Print(sizebuf_t *buf, char *data)
Definition: common.c:945
Key_Init
void Key_Init(void)
Definition: keys.c:650
CM_ANGLE1
#define CM_ANGLE1
Definition: qcommon.h:272
bytedirs
vec3_t bytedirs[NUMVERTEXNORMALS]
Definition: common.c:300
cmd_text_buf
byte cmd_text_buf[8192]
Definition: cmd.c:69
PMF_TIME_TELEPORT
#define PMF_TIME_TELEPORT
Definition: q_shared.h:482
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:67
CM_DecompressVis
void CM_DecompressVis(byte *in, byte *out)
Definition: cmodel.c:1530
cvar_s::latched_string
char * latched_string
Definition: q_shared.h:321
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:319
usercmd_s::sidemove
short sidemove
Definition: q_shared.h:518
EXEC_APPEND
#define EXEC_APPEND
Definition: qcommon.h:741
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:492
cmd_argc
static int cmd_argc
Definition: cmd.c:495
U_EVENT
#define U_EVENT
Definition: qcommon.h:303
r
GLdouble GLdouble r
Definition: qgl_win.c:336
hinput
static HANDLE hinput
Definition: sys_win.c:45
z_bytes
int z_bytes
Definition: common.c:1134
sys_frame_time
unsigned sys_frame_time
Definition: sys_win.c:48
MAX_READ
#define MAX_READ
Definition: files.c:345
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:999
CL_RunDLights
void CL_RunDLights(void)
Definition: cl_fx.c:311
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:320
CRC_Block
unsigned short CRC_Block(byte *start, int count)
Definition: crc.c:82
Qcommon_Shutdown
void Qcommon_Shutdown(void)
Definition: common.c:1619
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:533
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:395
U_ORIGIN2
#define U_ORIGIN2
Definition: qcommon.h:299
public_server
cvar_t * public_server
Definition: sv_main.c:51
netadr_t::ip
byte ip[4]
Definition: qcommon.h:546
cmd_text
sizebuf_t cmd_text
Definition: cmd.c:68
pmove_t::groundentity
struct edict_s * groundentity
Definition: q_shared.h:543
sv_noreload
cvar_t * sv_noreload
Definition: sv_main.c:45
com_argc
int com_argc
Definition: common.c:29
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:583
M_Init
void M_Init(void)
Definition: menu.c:4019
pml_t::origin
vec3_t origin
Definition: pmove.c:33
FS_AddGameDirectory
void FS_AddGameDirectory(char *dir)
Definition: files.c:513
IN_Frame
void IN_Frame(void)
Definition: in_win.c:420
CL_PrepRefresh
void CL_PrepRefresh(void)
Definition: cl_view.c:296
pml_t::right
vec3_t right
Definition: pmove.c:36
CL_RunLightStyles
void CL_RunLightStyles(void)
Definition: cl_fx.c:166
cmdalias_s
Definition: cmd.c:28
pack_s::handle
FILE * handle
Definition: files.c:56
CL_Shutdown
void CL_Shutdown(void)
Definition: cl_main.c:1868
trace_trace
trace_t trace_trace
Definition: cmodel.c:980
U_EFFECTS8
#define U_EFFECTS8
Definition: qcommon.h:313
U_MOREBITS1
#define U_MOREBITS1
Definition: qcommon.h:305
cmd_args
static char cmd_args[MAX_STRING_CHARS]
Definition: cmd.c:498
CL_WriteConfiguration
void CL_WriteConfiguration(void)
Definition: cl_main.c:1599
Sys_ConsoleOutput
void Sys_ConsoleOutput(char *string)
Definition: sys_win.c:345
U_MODEL4
#define U_MODEL4
Definition: qcommon.h:323
zhead_s::next
struct zhead_s * next
Definition: common.c:1127
FS_ExecAutoexec
void FS_ExecAutoexec(void)
Definition: files.c:600
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:118
pml_t::forward
vec3_t forward
Definition: pmove.c:36
netadr_t::ipx
byte ipx[10]
Definition: qcommon.h:548
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:180
FS_LoadFile
int FS_LoadFile(char *path, void **buffer)
Definition: files.c:394
sys_msg_time
unsigned sys_msg_time
Definition: sys_win.c:47
cmd_function_s::name
char * name
Definition: cmd.c:490
DotProduct
#define DotProduct(x, y)
Definition: q_shared.h:155
CVAR_ARCHIVE
#define CVAR_ARCHIVE
Definition: q_shared.h:309
Cmd_ForwardToServer
void Cmd_ForwardToServer(void)
Definition: cl_main.c:299
cl_hwnd
HWND cl_hwnd
Definition: vid_dll.c:53
sv_reconnect_limit
cvar_t * sv_reconnect_limit
Definition: sv_main.c:53
Sys_Quit
void Sys_Quit(void)
Definition: sys_win.c:90
U_FRAME16
#define U_FRAME16
Definition: qcommon.h:318
S_Shutdown
void S_Shutdown(void)
Definition: snd_dma.c:164
vsnprintf
#define vsnprintf
Definition: q_shared.h:32
cvar_s::value
float value
Definition: q_shared.h:324
Cbuf_AddText
void Cbuf_AddText(char *text)
Definition: cmd.c:90
cplane_s::dist
float dist
Definition: q_shared.h:412
cnode_t
Definition: cmodel.c:24
MSG_ReadByte
int MSG_ReadByte(sizebuf_t *msg_read)
Definition: common.c:722
time_before_ref
int time_before_ref
Definition: common.c:56
Con_Print
void Con_Print(char *text)
Definition: console.c:359
U_SKIN8
#define U_SKIN8
Definition: qcommon.h:317
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:74
svc_deltapacketentities
@ svc_deltapacketentities
Definition: qcommon.h:228
LUMP_LEAFBRUSHES
#define LUMP_LEAFBRUSHES
Definition: qfiles.h:272
U_RENDERFX16
#define U_RENDERFX16
Definition: qcommon.h:319
fs_base_searchpaths
searchpath_t * fs_base_searchpaths
Definition: files.c:84
con
console_t con
Definition: console.c:24
trace_mins
vec3_t trace_mins
Definition: cmodel.c:977
console_textlen
static int console_textlen
Definition: sys_win.c:258
key_console
@ key_console
Definition: client.h:220
CM_FORWARD
#define CM_FORWARD
Definition: qcommon.h:275
timescale
cvar_t * timescale
Definition: common.c:43
U_MOREBITS2
#define U_MOREBITS2
Definition: qcommon.h:314
entity_state_s::number
int number
Definition: q_shared.h:1171
NULL
#define NULL
Definition: q_shared.h:60
dheader_t::lumps
lump_t lumps[HEADER_LUMPS]
Definition: qfiles.h:287
FS_InitFilesystem
void FS_InitFilesystem(void)
Definition: files.c:891
SV_RunGameFrame
void SV_RunGameFrame(void)
Definition: sv_main.c:723
CVAR_LATCH
#define CVAR_LATCH
Definition: q_shared.h:314
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:70
MSG_WriteShort
void MSG_WriteShort(sizebuf_t *sb, int c)
Definition: common.c:335
CMod_LoadNodes
void CMod_LoadNodes(lump_t *l)
Definition: cmodel.c:209
COM_Argc
int COM_Argc(void)
Definition: common.c:987
allow_download_models
cvar_t * allow_download_models
Definition: sv_main.c:39
graphsamp_t::color
int color
Definition: cl_scrn.c:128
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:42
MSG_WriteByte
void MSG_WriteByte(sizebuf_t *sb, int c)
Definition: common.c:322
CM_BUTTONS
#define CM_BUTTONS
Definition: qcommon.h:278
Com_Error
void Com_Error(int code, char *fmt,...)
Definition: common.c:203
svc_layout
@ svc_layout
Definition: qcommon.h:211
pmove_t::numtouch
int numtouch
Definition: q_shared.h:535
SV_Init
void SV_Init(void)
Definition: sv_main.c:948
NetadrToSockadr
void NetadrToSockadr(netadr_t *a, struct sockaddr *s)
Definition: net_wins.c:53
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:131
clc_userinfo
@ clc_userinfo
Definition: qcommon.h:242
Z_Malloc
void * Z_Malloc(int size)
Definition: common.c:1223
PM_DEAD
@ PM_DEAD
Definition: q_shared.h:471
cmd_null_string
static char * cmd_null_string
Definition: cmd.c:497
client_state_t::time
int time
Definition: client.h:147
nullsurface
mapsurface_t nullsurface
Definition: cmodel.c:105
SZ_GetSpace
void * SZ_GetSpace(sizebuf_t *buf, int length)
Definition: common.c:917
map_nodes
cnode_t map_nodes[MAX_MAP_NODES+6]
Definition: cmodel.c:75
ERR_DROP
#define ERR_DROP
Definition: qcommon.h:736
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:65
usercmd_s::upmove
short upmove
Definition: q_shared.h:518
VID_Init
void VID_Init(void)
Definition: vid_dll.c:709
CDAudio_Init
int CDAudio_Init(void)
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:216
svc_serverdata
@ svc_serverdata
Definition: qcommon.h:221
name
cvar_t * name
Definition: cl_main.c:94
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:80
netchan_t::remote_address
netadr_t remote_address
Definition: qcommon.h:585
rd_buffersize
static int rd_buffersize
Definition: common.c:69
ERR_FATAL
#define ERR_FATAL
Definition: qcommon.h:735
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:157
Z_Stats_f
void Z_Stats_f(void)
Definition: common.c:1167
MAX_MSGLEN
#define MAX_MSGLEN
Definition: qcommon.h:527
netchan_t::reliable_length
int reliable_length
Definition: qcommon.h:604
cleaf_t::area
int area
Definition: cmodel.c:40
netadr_t::type
netadrtype_t type
Definition: qcommon.h:540
Con_Init
void Con_Init(void)
Definition: console.c:312
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:210
server_static_t::initialized
qboolean initialized
Definition: server.h:160
NET_Init
void NET_Init(void)
Definition: net_wins.c:762
entity_state_s::skinnum
int skinnum
Definition: q_shared.h:1179
CDAudio_Update
void CDAudio_Update(void)
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:315
graphsamp_t::value
float value
Definition: cl_scrn.c:127
logfile
FILE * logfile
Definition: common.c:49
carea_t::floodnum
int floodnum
Definition: cmodel.c:57
U_SKIN16
#define U_SKIN16
Definition: qcommon.h:328
dheader_t::version
int version
Definition: qfiles.h:286
client_state_t::v_right
vec3_t v_right
Definition: client.h:153
CM_ANGLE2
#define CM_ANGLE2
Definition: qcommon.h:273
Master_Heartbeat
void Master_Heartbeat(void)
Definition: sv_main.c:827
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:158
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:595
Com_BlockChecksum
unsigned Com_BlockChecksum(void *buffer, int length)
Definition: md4.c:165
Con_Linefeed
void Con_Linefeed(void)
Definition: console.c:340
PM_CheckSpecialMovement
void PM_CheckSpecialMovement(void)
Definition: pmove.c:831
PM_SPECTATOR
@ PM_SPECTATOR
Definition: q_shared.h:469
IN_Shutdown
void IN_Shutdown(void)
Definition: in_win.c:391
pml_t::up
vec3_t up
Definition: pmove.c:36
Cvar_Init
void Cvar_Init(void)
Definition: cvar.c:522
timeout
cvar_t * timeout
Definition: sv_main.c:32
NUM_CON_TIMES
#define NUM_CON_TIMES
Definition: console.h:25
abortframe
jmp_buf abortframe
Definition: common.c:34
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:454
MSG_ReadLong
int MSG_ReadLong(sizebuf_t *msg_read)
Definition: common.c:750
Cvar_List_f
void Cvar_List_f(void)
Definition: cvar.c:453
Z_Free
void Z_Free(void *ptr)
Definition: common.c:1141
searchpath_s::pack
pack_t * pack
Definition: files.c:79
client_static_t::framecount
int framecount
Definition: client.h:227
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:596
client_state_t::sound_prepped
qboolean sound_prepped
Definition: client.h:119
InitConProc
void InitConProc(int argc, char **argv)
Definition: conproc.c:84
ip_sockets
int ip_sockets[2]
Definition: net_wins.c:46
PMF_TIME_WATERJUMP
#define PMF_TIME_WATERJUMP
Definition: q_shared.h:480
MSG_WriteAngle
void MSG_WriteAngle(sizebuf_t *sb, float f)
Definition: common.c:395
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:641
CM_UP
#define CM_UP
Definition: qcommon.h:277
BUILDSTRING
#define BUILDSTRING
Definition: qcommon.h:68
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:682
client_static_t::state
connstate_t state
Definition: client.h:224
NS_CLIENT
@ NS_CLIENT
Definition: qcommon.h:536
SV_ShutdownGameProgs
void SV_ShutdownGameProgs(void)
Definition: sv_game.c:307
Cvar_Set_f
void Cvar_Set_f(void)
Definition: cvar.c:391
netchan_t::last_received
int last_received
Definition: qcommon.h:582
FS_Gamedir
char * FS_Gamedir(void)
Definition: files.c:590
svc_configstring
@ svc_configstring
Definition: qcommon.h:222
SHORT2ANGLE
#define SHORT2ANGLE(x)
Definition: q_shared.h:1117
hostname
cvar_t * hostname
Definition: sv_main.c:50
cl_timedemo
cvar_t * cl_timedemo
Definition: cl_main.c:76
time_after_game
int time_after_game
Definition: common.c:55
netadr_t::port
unsigned short port
Definition: qcommon.h:550
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:517
map_entitystring
char map_entitystring[MAX_MAP_ENTSTRING]
Definition: cmodel.c:95
houtput
static HANDLE houtput
Definition: sys_win.c:45
pmove_t::s
pmove_state_t s
Definition: q_shared.h:528
client_static_t::frametime
float frametime
Definition: client.h:229
netsrc_t
netsrc_t
Definition: qcommon.h:536
Cvar_InfoValidate
static qboolean Cvar_InfoValidate(char *s)
Definition: cvar.c:31
CVAR_USERINFO
#define CVAR_USERINFO
Definition: q_shared.h:310
LUMP_TEXINFO
#define LUMP_TEXINFO
Definition: qfiles.h:267
netchan_t::reliable_buf
byte reliable_buf[MAX_MSGLEN-16]
Definition: qcommon.h:605
_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:531
NA_BROADCAST_IPX
@ NA_BROADCAST_IPX
Definition: qcommon.h:533
log_stats_file
FILE * log_stats_file
Definition: common.c:37
qwclsemaphore
static HANDLE qwclsemaphore
Definition: sys_win.c:51
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:77
Sys_ScanForCD
char * Sys_ScanForCD(void)
Definition: sys_win.c:137
COM_Parse
char * COM_Parse(char **data_p)
Definition: q_shared.c:1072
Com_Quit
void Com_Quit(void)
Definition: common.c:255
packfile_t::filepos
int filepos
Definition: files.c:50
IN_Init
void IN_Init(void)
Definition: in_win.c:346
entity_state_s::modelindex
int modelindex
Definition: q_shared.h:1176
entity_state_s::modelindex2
int modelindex2
Definition: q_shared.h:1177
netchan_t::incoming_reliable_sequence
int incoming_reliable_sequence
Definition: qcommon.h:593
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:239
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:81
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:481
CM_ANGLE3
#define CM_ANGLE3
Definition: qcommon.h:274
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:155
allow_download_sounds
cvar_t * allow_download_sounds
Definition: sv_main.c:40
U_FRAME8
#define U_FRAME8
Definition: qcommon.h:302
usercmd_s::msec
byte msec
Definition: q_shared.h:515
console_t::ormask
int ormask
Definition: console.h:37
S_StopAllSounds
void S_StopAllSounds(void)
Definition: snd_dma.c:795
svc_packetentities
@ svc_packetentities
Definition: qcommon.h:227
Cbuf_AddLateCommands
qboolean Cbuf_AddLateCommands(void)
Definition: cmd.c:296
usercmd_s::buttons
byte buttons
Definition: q_shared.h:516
PM_CatagorizePosition
void PM_CatagorizePosition(void)
Definition: pmove.c:671
values
static graphsamp_t values[1024]
Definition: cl_scrn.c:132
FS_FreeFile
void FS_FreeFile(void *buffer)
Definition: files.c:433
client_static_t::key_dest
keydest_t key_dest
Definition: client.h:225
SCR_Init
void SCR_Init(void)
Definition: cl_scrn.c:419
trace_t::surface
csurface_t * surface
Definition: q_shared.h:456
VID_Shutdown
void VID_Shutdown(void)
Definition: vid_dll.c:752
pmove_state_t::origin
short origin[3]
Definition: q_shared.h:494
ca_connected
@ ca_connected
Definition: client.h:208
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:308
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:188
svc_download
@ svc_download
Definition: qcommon.h:225
Cbuf_AddEarlyCommands
void Cbuf_AddEarlyCommands(qboolean clear)
Definition: cmd.c:263
Com_Printf
void Com_Printf(char *fmt,...)
Definition: common.c:102
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:280
svc_reconnect
@ svc_reconnect
Definition: qcommon.h:217
_LittleLong
int(* _LittleLong)(int l)
Definition: q_shared.c:941
ANGLE2SHORT
#define ANGLE2SHORT(x)
Definition: q_shared.h:1116
NET_ErrorString
char * NET_ErrorString(void)
Definition: net_wins.c:801
pmove_t::viewangles
vec3_t viewangles
Definition: q_shared.h:538
Cmd_Exec_f
void Cmd_Exec_f(void)
Definition: cmd.c:371
Sys_UnloadGame
void Sys_UnloadGame(void)
Definition: sys_win.c:458
svc_spawnbaseline
@ svc_spawnbaseline
Definition: qcommon.h:223
developer
cvar_t * developer
Definition: common.c:41
Sys_Milliseconds
int Sys_Milliseconds(void)
Definition: q_shwin.c:120
Q_strcasecmp
int Q_strcasecmp(char *s1, char *s2)
Definition: q_shared.c:1229
clc_stringcmd
@ clc_stringcmd
Definition: qcommon.h:243
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:105
NUMVERTEXNORMALS
#define NUMVERTEXNORMALS
Definition: qcommon.h:786
netchan_t::message_buf
byte message_buf[MAX_MSGLEN-16]
Definition: qcommon.h:601
SV_InitOperatorCommands
void SV_InitOperatorCommands(void)
Definition: sv_ccmds.c:1024
svc_muzzleflash2
@ svc_muzzleflash2
Definition: qcommon.h:209
cmd_wait
qboolean cmd_wait
Definition: cmd.c:37
server_state
int server_state
Definition: common.c:51
MAXPRINTMSG
#define MAXPRINTMSG
Definition: common.c:24
clc_move
@ clc_move
Definition: qcommon.h:241
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:218
scr_draw_loading
int scr_draw_loading
Definition: cl_scrn.c:42
NET_GetLoopPacket
qboolean NET_GetLoopPacket(netsrc_t sock, netadr_t *net_from, sizebuf_t *net_message)
Definition: net_wins.c:290
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
CMod_LoadAreaPortals
void CMod_LoadAreaPortals(lump_t *l)
Definition: cmodel.c:476
noipx
static cvar_t * noipx
Definition: net_wins.c:43
Netchan_NeedReliable
qboolean Netchan_NeedReliable(netchan_t *chan)
Definition: net_chan.c:183
svc_stufftext
@ svc_stufftext
Definition: qcommon.h:220
entity_state_s::angles
vec3_t angles
Definition: q_shared.h:1174
FS_AddHomeAsGameDirectory
void FS_AddHomeAsGameDirectory(char *dir)
Definition: files.c:561
cl
client_state_t cl
Definition: cl_main.c:106
MSG_ReadChar
int MSG_ReadChar(sizebuf_t *msg_read)
Definition: common.c:709
U_ORIGIN3
#define U_ORIGIN3
Definition: qcommon.h:309
fs_gamedir
char fs_gamedir[MAX_OSPATH]
Definition: files.c:61
CPUSTRING
#define CPUSTRING
Definition: qcommon.h:69
CM_IMPULSE
#define CM_IMPULSE
Definition: qcommon.h:279
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:496
MSG_BeginReading
void MSG_BeginReading(sizebuf_t *msg)
Definition: common.c:703
U_SOLID
#define U_SOLID
Definition: qcommon.h:330
pvsrow
byte pvsrow[MAX_MAP_LEAFS/8]
Definition: cmodel.c:1572
ERR_DISCONNECT
#define ERR_DISCONNECT
Definition: q_shared.h:99
U_MODEL3
#define U_MODEL3
Definition: qcommon.h:322
SFF_SUBDIR
#define SFF_SUBDIR
Definition: q_shared.h:282
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:532
clc_nop
@ clc_nop
Definition: qcommon.h:240
CL_SendCommand
void CL_SendCommand(void)
Definition: cl_main.c:1692
vec3_t
vec_t vec3_t[3]
Definition: q_shared.h:127
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:1236
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:1037
NA_LOOPBACK
@ NA_LOOPBACK
Definition: qcommon.h:533
svc_print
@ svc_print
Definition: qcommon.h:219
CMod_LoadSurfaces
void CMod_LoadSurfaces(lump_t *l)
Definition: cmodel.c:175
zhead_s
Definition: common.c:1125
pml_t::previous_origin
vec3_t previous_origin
Definition: pmove.c:44
CL_Frame
void CL_Frame(int msec)
Definition: cl_main.c:1720
VectorNegate
#define VectorNegate(a, b)
Definition: q_shared.h:160
pmove_state_t::pm_time
byte pm_time
Definition: q_shared.h:497
CDAudio_Shutdown
void CDAudio_Shutdown(void)
c_traces
int c_traces
Definition: cmodel.c:119
SFF_SYSTEM
#define SFF_SYSTEM
Definition: q_shared.h:283
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:30
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:586
client_static_t::netchan
netchan_t netchan
Definition: client.h:244
client_static_t::realtime
int realtime
Definition: client.h:228
Cvar_VariableValue
float Cvar_VariableValue(char *var_name)
Definition: cvar.c:63
CM_InitBoxHull
void CM_InitBoxHull(void)
Definition: cmodel.c:704