DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
 
protocol.h File Reference
#include <stddef.h>
#include "qtypes.h"
#include "qdefs.h"
#include "qstats.h"
+ Include dependency graph for protocol.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  entity_database4_commit_t
 
struct  entity_frame_t
 
struct  entity_frameinfo_t
 
struct  entity_state_t
 
struct  entityframe4_database_t
 
struct  entityframe5_changestate_t
 
struct  entityframe5_database_t
 
struct  entityframe5_packetlog_t
 
struct  entityframe_database_t
 
struct  entityframeqw_database_t
 
struct  entityframeqw_snapshot_t
 
struct  framegroupblend_t
 
struct  skeleton_t
 
struct  usercmd_t
 

Macros

#define clc_ackdownloaddata   51
 
#define clc_ackframe   50
 
#define clc_bad   0
 
#define clc_disconnect   2
 
#define clc_move   3
 
#define clc_nop   1
 
#define clc_stringcmd   4
 
#define clc_unusedlh2   52
 
#define clc_unusedlh3   53
 
#define clc_unusedlh4   54
 
#define clc_unusedlh5   55
 
#define clc_unusedlh6   56
 
#define clc_unusedlh7   57
 
#define clc_unusedlh8   58
 
#define clc_unusedlh9   59
 
#define DEFAULT_VIEWHEIGHT   22
 
#define E5_ALPHA   (1u<<9)
 byte = bound(0, s->alpha * 255, 255)
 
#define E5_ANGLES   (1u<<2)
 E5_ANGLES16=0: byte[3] = s->angle[0] * 256 / 360, s->angle[1] * 256 / 360, s->angle[2] * 256 / 360 E5_ANGLES16=1: short[3] = s->angle[0] * 65536 / 360, s->angle[1] * 65536 / 360, s->angle[2] * 65536 / 360.
 
#define E5_ANGLES16   (1u<<12)
 flag
 
#define E5_ATTACHMENT   (1u<<16)
 short = s->tagentity byte = s->tagindex
 
#define E5_COLORMAP   (1u<<14)
 byte = s->colormap
 
#define E5_COLORMOD   (1u<<22)
 byte[3] = s->colormod[0], s->colormod[1], s->colormod[2]
 
#define E5_COMPLEXANIMATION   (1u<<25)
 byte type=0 short frames[1] short times[1] byte type=1 short frames[2] short times[2] byte lerps[2] byte type=2 short frames[3] short times[3] byte lerps[3] byte type=3 short frames[4] short times[4] byte lerps[4] byte type=4 short modelindex byte numbones {short pose7s[7]} see also RENDER_COMPLEXANIMATION
 
#define E5_EFFECTS   (1u<<6)
 E5_EFFECTS16=0 && E5_EFFECTS32=0: byte = s->effects E5_EFFECTS16=1 && E5_EFFECTS32=0: short = s->effects E5_EFFECTS16=0 && E5_EFFECTS32=1: int = s->effects E5_EFFECTS16=1 && E5_EFFECTS32=1: int = s->effects.
 
#define E5_EFFECTS16   (1u<<19)
 short = s->effects
 
#define E5_EFFECTS32   (1u<<20)
 int = s->effects
 
#define E5_EXTEND1   (1u<<7)
 bits >= (1<<8)
 
#define E5_EXTEND2   (1u<<15)
 bits >= (1<<16)
 
#define E5_EXTEND3   (1u<<23)
 bits >= (1<<24)
 
#define E5_EXTEND4   (1u<<31)
 bits2 > 0
 
#define E5_FLAGS   (1u<<8)
 byte = s->renderflags
 
#define E5_FRAME   (1u<<4)
 E5_FRAME16=0: byte = s->frame E5_FRAME16=1: short = s->frame.
 
#define E5_FRAME16   (1u<<21)
 flag
 
#define E5_FULLUPDATE   (1u<<0)
 reset all entity fields (typically used if status changed)
 
#define E5_GLOW   (1u<<18)
 byte = s->glowsize byte = s->glowcolor
 
#define E5_GLOWMOD   (1u<<24)
 byte[3] = s->glowmod[0], s->glowmod[1], s->glowmod[2]
 
#define E5_LIGHT   (1u<<17)
 short[4] = s->light[0], s->light[1], s->light[2], s->light[3] byte = s->lightstyle byte = s->lightpflags
 
#define E5_MODEL   (1u<<3)
 E5_MODEL16=0: byte = s->modelindex E5_MODEL16=1: short = s->modelindex.
 
#define E5_MODEL16   (1u<<13)
 flag
 
#define E5_ORIGIN   (1u<<1)
 E5_ORIGIN32=0: short[3] = s->origin[0] * 8, s->origin[1] * 8, s->origin[2] * 8 E5_ORIGIN32=1: float[3] = s->origin[0], s->origin[1], s->origin[2].
 
#define E5_ORIGIN32   (1u<<11)
 flag
 
#define E5_SCALE   (1u<<10)
 byte = bound(0, s->scale * 16, 255)
 
#define E5_SKIN   (1u<<5)
 byte = s->skin
 
#define E5_TRAILEFFECTNUM   (1u<<26)
 ushort traileffectnum
 
#define E5_UNUSED27   (1u<<27)
 unused
 
#define E5_UNUSED28   (1u<<28)
 unused
 
#define E5_UNUSED29   (1u<<29)
 unused
 
#define E5_UNUSED30   (1u<<30)
 unused
 
#define E_ALPHA   (1u<<10)
 
#define E_ANGLE1   (1u<<3)
 
#define E_ANGLE2   (1u<<4)
 
#define E_ANGLE3   (1u<<5)
 
#define E_COLORMAP   (1u<<12)
 
#define E_EFFECTS1   (1u<<9)
 
#define E_EFFECTS2   (1u<<18)
 
#define E_EXTEND1   (1u<<7)
 
#define E_EXTEND2   (1u<<15)
 
#define E_EXTEND3   (1u<<23)
 
#define E_EXTEND4   (1u<<31)
 
#define E_FLAGS   (1u<<14)
 
#define E_FRAME1   (1u<<8)
 
#define E_FRAME2   (1u<<16)
 
#define E_GLOWCOLOR   (1u<<20)
 
#define E_GLOWSIZE   (1u<<19)
 
#define E_LIGHT   (1u<<21)
 
#define E_LIGHTPFLAGS   (1u<<22)
 
#define E_LIGHTSTYLE   (1u<<28)
 
#define E_MODEL1   (1u<<6)
 
#define E_MODEL2   (1u<<17)
 
#define E_ORIGIN1   (1u<<0)
 
#define E_ORIGIN2   (1u<<1)
 
#define E_ORIGIN3   (1u<<2)
 
#define E_SCALE   (1u<<11)
 
#define E_SKIN   (1u<<13)
 
#define E_SOUND1   (1u<<24)
 
#define E_SOUNDATTEN   (1u<<26)
 
#define E_SOUNDVOL   (1u<<25)
 
#define E_TAGATTACHMENT   (1u<<27)
 
#define E_UNUSED6   (1u<<29)
 
#define E_UNUSED7   (1u<<30)
 
#define EF_ADDITIVE   32
 
#define EF_BLUE   64
 
#define EF_BRIGHTFIELD   1
 
#define EF_BRIGHTLIGHT   4
 
#define EF_DIMLIGHT   8
 
#define EF_DOUBLESIDED   32768
 
#define EF_DYNAMICMODELLIGHT   131072
 
#define EF_FLAME   1024
 
#define EF_FULLBRIGHT   512
 
#define EF_GIB   67108864
 
#define EF_GRENADE   33554432
 
#define EF_LOWPRECISION   4194304
 
#define EF_MUZZLEFLASH   2
 
#define EF_NODEPTHTEST   8192
 
#define EF_NODRAW   16
 
#define EF_NOGUNBOB   256
 
#define EF_NOMODELFLAGS   8388608
 
#define EF_NOSELFSHADOW   65536
 
#define EF_NOSHADOW   4096
 
#define EF_RED   128
 
#define EF_RESTARTANIM_BIT   1048576
 
#define EF_ROCKET   16777216
 
#define EF_ROTATE   134217728
 
#define EF_SELECTABLE   16384
 
#define EF_STARDUST   2048
 
#define EF_TELEPORT_BIT   2097152
 
#define EF_TRACER   268435456
 
#define EF_TRACER2   1073741824
 
#define EF_TRACER3   0x80000000
 
#define EF_UNUSED18   262144
 
#define EF_UNUSED19   524288
 
#define EF_ZOMGIB   536870912
 
#define ENTITYFRAME5_MAXPACKETLOGS   64
 
#define ENTITYFRAME5_MAXSTATES   1024
 
#define ENTITYFRAME5_PRIORITYLEVELS   32
 
#define ENTITYSIZEPROFILING_END(msg, num, flags)
 
#define ENTITYSIZEPROFILING_START(msg, num, flags)
 
#define GAME_COOP   0
 
#define GAME_DEATHMATCH   1
 
#define INTEF_FLAG1QW   1
 
#define INTEF_FLAG2QW   2
 
#define MAX_ENTITY_DATABASE   (MAX_EDICTS * 2)
 
#define MAX_ENTITY_HISTORY   64
 
#define MAX_FRAMEGROUPBLENDS   4
 
#define MF_GIB   4
 
#define MF_GRENADE   2
 
#define MF_ROCKET   1
 
#define MF_ROTATE   8
 
#define MF_TRACER   16
 
#define MF_TRACER2   64
 
#define MF_TRACER3   128
 
#define MF_ZOMGIB   32
 
#define PFLAGS_CORONA   2
 
#define PFLAGS_FULLDYNAMIC   128
 
#define PFLAGS_NOSHADOW   1
 
#define qw_clc_bad   0
 
#define qw_clc_delta   5
 
#define qw_clc_move   3
 
#define qw_clc_nop   1
 
#define qw_clc_stringcmd   4
 
#define qw_clc_tmove   6
 
#define qw_clc_upload   7
 
#define QW_CM_ANGLE1   (1<<0)
 
#define QW_CM_ANGLE2   (1<<7)
 
#define QW_CM_ANGLE3   (1<<1)
 
#define QW_CM_BUTTONS   (1<<5)
 
#define QW_CM_FORWARD   (1<<2)
 
#define QW_CM_IMPULSE   (1<<6)
 
#define QW_CM_SIDE   (1<<3)
 
#define QW_CM_UP   (1<<4)
 
#define QW_EF_BLUE   64
 
#define QW_EF_BRIGHTFIELD   1
 
#define QW_EF_BRIGHTLIGHT   4
 
#define QW_EF_DIMLIGHT   8
 
#define QW_EF_FLAG1   16
 
#define QW_EF_FLAG2   32
 
#define QW_EF_MUZZLEFLASH   2
 
#define QW_EF_RED   128
 
#define QW_MAX_PACKET_ENTITIES   64
 
#define QW_PF_COMMAND   (1<<1)
 
#define QW_PF_DEAD   (1<<9)
 
#define QW_PF_EFFECTS   (1<<7)
 
#define QW_PF_GIB   (1<<10)
 
#define QW_PF_MODEL   (1<<5)
 
#define QW_PF_MSEC   (1<<0)
 
#define QW_PF_NOGRAV   (1<<11)
 
#define QW_PF_SKINNUM   (1<<6)
 
#define QW_PF_VELOCITY1   (1<<2)
 
#define QW_PF_VELOCITY2   (1<<3)
 
#define QW_PF_VELOCITY3   (1<<4)
 
#define QW_PF_WEAPONFRAME   (1<<8)
 
#define QW_STAT_ACTIVEWEAPON   10
 
#define QW_STAT_AMMO   3
 
#define QW_STAT_ARMOR   4
 
#define QW_STAT_CELLS   9
 
#define QW_STAT_HEALTH   0
 
#define QW_STAT_ITEMS   15
 
#define QW_STAT_MONSTERS   14
 
#define QW_STAT_NAILS   7
 
#define QW_STAT_ROCKETS   8
 
#define QW_STAT_SECRETS   13
 
#define QW_STAT_SHELLS   6
 
#define QW_STAT_TOTALMONSTERS   12
 
#define QW_STAT_TOTALSECRETS   11
 
#define QW_STAT_WEAPON   2
 
#define qw_svc_bad   0
 
#define qw_svc_bigkick   35
 
#define qw_svc_cdtrack   32
 
#define qw_svc_centerprint   26
 
#define qw_svc_chokecount   44
 
#define qw_svc_damage   19
 
#define qw_svc_deltapacketentities   48
 
#define qw_svc_disconnect   2
 
#define qw_svc_download   41
 
#define qw_svc_entgravity   50
 
#define qw_svc_finale   31
 
#define qw_svc_foundsecret   28
 
#define qw_svc_intermission   30
 
#define qw_svc_killedmonster   27
 
#define qw_svc_lightstyle   12
 
#define qw_svc_maxspeed   49
 
#define qw_svc_modellist   45
 
#define qw_svc_muzzleflash   39
 
#define qw_svc_nails   43
 
#define qw_svc_nop   1
 
#define qw_svc_packetentities   47
 
#define qw_svc_playerinfo   42
 
#define qw_svc_print   8
 
#define qw_svc_sellscreen   33
 
#define qw_svc_serverdata   11
 
#define qw_svc_serverinfo   52
 
#define qw_svc_setangle   10
 
#define qw_svc_setinfo   51
 
#define qw_svc_setpause   24
 
#define qw_svc_setview   5
 
#define qw_svc_smallkick   34
 
#define qw_svc_sound   6
 
#define qw_svc_soundlist   46
 
#define qw_svc_spawnbaseline   22
 
#define qw_svc_spawnstatic   20
 
#define qw_svc_spawnstaticsound   29
 
#define qw_svc_stopsound   16
 
#define qw_svc_stufftext   9
 
#define qw_svc_temp_entity   23
 
#define qw_svc_updateentertime   37
 
#define qw_svc_updatefrags   14
 
#define qw_svc_updateping   36
 
#define qw_svc_updatepl   53
 
#define qw_svc_updatestat   3
 
#define qw_svc_updatestatlong   38
 
#define qw_svc_updateuserinfo   40
 
#define QW_TE_BLOOD   12
 
#define QW_TE_EXPLOSION   3
 
#define QW_TE_GUNSHOT   2
 
#define QW_TE_KNIGHTSPIKE   8
 
#define QW_TE_LAVASPLASH   10
 
#define QW_TE_LIGHTNING1   5
 
#define QW_TE_LIGHTNING2   6
 
#define QW_TE_LIGHTNING3   9
 
#define QW_TE_LIGHTNINGBLOOD   13
 
#define QW_TE_SPIKE   0
 
#define QW_TE_SUPERSPIKE   1
 
#define QW_TE_TAREXPLOSION   4
 
#define QW_TE_TELEPORT   11
 
#define QW_TE_WIZSPIKE   7
 
#define QW_U_ANGLE1   (1<<0)
 
#define QW_U_ANGLE2   (1<<12)
 
#define QW_U_ANGLE3   (1<<1)
 
#define QW_U_COLORMAP   (1<<3)
 
#define QW_U_EFFECTS   (1<<5)
 
#define QW_U_FRAME   (1<<13)
 
#define QW_U_MODEL   (1<<2)
 
#define QW_U_MOREBITS   (1<<15)
 
#define QW_U_ORIGIN1   (1<<9)
 
#define QW_U_ORIGIN2   (1<<10)
 
#define QW_U_ORIGIN3   (1<<11)
 
#define QW_U_REMOVE   (1<<14)
 
#define QW_U_SKIN   (1<<4)
 
#define QW_U_SOLID   (1<<6)
 
#define QW_UPDATE_BACKUP   64
 
#define QW_UPDATE_MASK   (QW_UPDATE_BACKUP - 1)
 
#define RENDER_ADDITIVE   2097152
 
#define RENDER_COLORMAPPED   32
 
#define RENDER_COMPLEXANIMATION   128
 
#define RENDER_CUSTOMIZEDMODELLIGHT   4096
 
#define RENDER_DOUBLESIDED   4194304
 
#define RENDER_DYNAMICMODELLIGHT   8388608
 
#define RENDER_EXTERIORMODEL   8
 
#define RENDER_GLOWTRAIL   2
 
#define RENDER_LIGHT   131072
 
#define RENDER_LOWPRECISION   16
 
#define RENDER_NODEPTHTEST   1048576
 
#define RENDER_NOSELFSHADOW   262144
 
#define RENDER_SHADOW   65536
 
#define RENDER_STEP   1
 
#define RENDER_VIEWMODEL   4
 
#define RENDER_WORLDOBJECT   64
 
#define SCOPE_ASSUMED_EXISTING   8
 
#define SCOPE_EXISTED_ONCE   4
 
#define SCOPE_WANTREMOVE   1
 
#define SCOPE_WANTSEND   (SCOPE_WANTREMOVE | SCOPE_WANTUPDATE)
 
#define SCOPE_WANTUPDATE   2
 
#define SND_ATTENUATION   (1<<1)
 
#define SND_LARGEENTITY   (1<<3)
 
#define SND_LARGESOUND   (1<<4)
 
#define SND_LOOPING   (1<<2)
 
#define SND_SPEEDUSHORT4000   (1<<5)
 
#define SND_VOLUME   (1<<0)
 
#define SU_ARMOR   (1u<<13)
 
#define SU_EXTEND1   (1u<<15)
 
#define SU_EXTEND2   (1u<<23)
 another byte to follow, future expansion
 
#define SU_EXTEND3   (1u<<31)
 another byte to follow, future expansion
 
#define SU_IDEALPITCH   (1u<<1)
 
#define SU_INWATER   (1u<<11)
 no data follows, the bit is it
 
#define SU_ITEMS   (1u<<9)
 
#define SU_ONGROUND   (1u<<10)
 no data follows, the bit is it
 
#define SU_PUNCH1   (1u<<2)
 
#define SU_PUNCH2   (1u<<3)
 
#define SU_PUNCH3   (1u<<4)
 
#define SU_PUNCHVEC1   (1u<<16)
 
#define SU_PUNCHVEC2   (1u<<17)
 
#define SU_PUNCHVEC3   (1u<<18)
 
#define SU_UNUSED20   (1u<<20)
 
#define SU_UNUSED21   (1u<<21)
 
#define SU_UNUSED22   (1u<<22)
 
#define SU_UNUSED24   (1u<<24)
 
#define SU_UNUSED25   (1u<<25)
 
#define SU_UNUSED26   (1u<<26)
 
#define SU_UNUSED27   (1u<<27)
 
#define SU_UNUSED28   (1u<<28)
 
#define SU_UNUSED29   (1u<<29)
 
#define SU_UNUSED30   (1u<<30)
 
#define SU_VELOCITY1   (1u<<5)
 
#define SU_VELOCITY2   (1u<<6)
 
#define SU_VELOCITY3   (1u<<7)
 
#define SU_VIEWHEIGHT   (1u<<0)
 
#define SU_VIEWZOOM   (1u<<19)
 byte factor (0 = 0.0 (not valid), 255 = 1.0)
 
#define SU_WEAPON   (1u<<14)
 
#define SU_WEAPONFRAME   (1u<<12)
 
#define svc_bad   0
 
#define svc_cdtrack   32
 
#define svc_centerprint   26
 
#define svc_clientdata   15
 
#define svc_csqcentities   58
 
#define svc_cutscene   34
 
#define svc_damage   19
 
#define svc_disconnect   2
 
#define svc_downloaddata   50
 
#define svc_effect   52
 
#define svc_effect2   53
 
#define svc_entities   57
 
#define svc_finale   31
 
#define svc_foundsecret   28
 
#define svc_hidelmp   36
 
#define svc_intermission   30
 
#define svc_killedmonster   27
 
#define svc_lightstyle   12
 
#define svc_nop   1
 
#define svc_particle   18
 
#define svc_pointparticles   61
 
#define svc_pointparticles1   62
 
#define svc_precache   54
 
#define svc_print   8
 
#define svc_sellscreen   33
 
#define svc_serverinfo   11
 
#define svc_setangle   10
 
#define svc_setpause   24
 
#define svc_setview   5
 
#define svc_showlmp   35
 
#define svc_signonnum   25
 
#define svc_skybox   37
 
#define svc_sound   6
 
#define svc_sound2   54
 
#define svc_spawnbaseline   22
 
#define svc_spawnbaseline2   55
 
#define svc_spawnstatic   20
 
#define svc_spawnstatic2   56
 
#define svc_spawnstaticsound   29
 
#define svc_spawnstaticsound2   59
 
#define svc_stopsound   16
 
#define svc_stufftext   9
 
#define svc_temp_entity   23
 
#define svc_time   7
 
#define svc_trailparticles   60
 
#define svc_updatecolors   17
 
#define svc_updatefrags   14
 
#define svc_updatename   13
 
#define svc_updatestat   3
 
#define svc_updatestatubyte   51
 
#define svc_version   4
 
#define TE_BEAM   13
 
#define TE_BLOOD   50
 
#define TE_BLOODSHOWER   52
 
#define TE_CUSTOMFLASH   73
 
#define TE_EXPLOSION   3
 
#define TE_EXPLOSION2   12
 
#define TE_EXPLOSION3   16
 
#define TE_EXPLOSIONQUAD   70
 
#define TE_EXPLOSIONRGB   53
 
#define TE_FLAMEJET   74
 
#define TE_GUNSHOT   2
 
#define TE_GUNSHOTQUAD   57
 
#define TE_KNIGHTSPIKE   8
 
#define TE_LAVASPLASH   10
 
#define TE_LIGHTNING1   5
 
#define TE_LIGHTNING2   6
 
#define TE_LIGHTNING3   9
 
#define TE_LIGHTNING4NEH   17
 
#define TE_PARTICLECUBE   54
 
#define TE_PARTICLERAIN   55
 
#define TE_PARTICLESNOW   56
 
#define TE_PLASMABURN   75
 
#define TE_SMALLFLASH   72
 
#define TE_SPARK   51
 
#define TE_SPIKE   0
 
#define TE_SPIKEQUAD   58
 
#define TE_SUPERSPIKE   1
 
#define TE_SUPERSPIKEQUAD   59
 
#define TE_TAREXPLOSION   4
 
#define TE_TEI_BIGEXPLOSION   78
 
#define TE_TEI_G3   76
 
#define TE_TEI_PLASMAHIT   79
 
#define TE_TEI_SMOKE   77
 
#define TE_TELEPORT   11
 
#define TE_UNUSED1   71
 
#define TE_WIZSPIKE   7
 
#define U_ALPHA   (1u<<17)
 1 byte, 0.0-1.0 maps to 0-255, not sent if exactly 1, and the entity is not sent if <=0 unless it has effects (model effects are checked as well)
 
#define U_ANGLE1   (1u<<8)
 
#define U_ANGLE2   (1u<<4)
 
#define U_ANGLE3   (1u<<9)
 
#define U_COLORMAP   (1u<<11)
 
#define U_COLORMOD   (1u<<22)
 1 byte, 3 bit red, 3 bit green, 2 bit blue, this lets you tint an object artifically, so you could make a red rocket, or a blue fiend...
 
#define U_DELTA   (1u<<16)
 no data, while this is set the entity is delta compressed (uses previous frame as a baseline, meaning only things that have changed from the previous frame are sent, except for the forced full update every half second)
 
#define U_EFFECTS   (1u<<13)
 
#define U_EFFECTS2   (1u<<19)
 1 byte, this is .effects & 0xFF00 (second byte)
 
#define U_EXTEND1   (1u<<15)
 
#define U_EXTEND2   (1u<<23)
 another byte to follow
 
#define U_EXTEND3   (1u<<31)
 another byte to follow, future expansion
 
#define U_EXTERIORMODEL   (1u<<28)
 causes this model to not be drawn when using a first person view (third person will draw it, first person will not)
 
#define U_FRAME   (1u<<6)
 
#define U_FRAME2   (1u<<26)
 1 byte, this is .frame & 0xFF00 (second byte)
 
#define U_GLOWCOLOR   (1u<<21)
 1 byte, palette index, default is 254 (white), this IS used for darklight (allowing colored darklight), however the particles from a darklight are always black, not sent if default value (even if glowsize or glowtrail is set)
 
#define U_GLOWSIZE   (1u<<20)
 1 byte, encoding is float/4.0, unsigned, not sent if 0
 
#define U_GLOWTRAIL   (1u<<24)
 leaves a trail of particles (of color .glowcolor, or black if it is a negative glowsize)
 
#define U_LONGENTITY   (1u<<14)
 
#define U_MODEL   (1u<<10)
 
#define U_MODEL2   (1u<<27)
 1 byte, this is .modelindex & 0xFF00 (second byte)
 
#define U_MOREBITS   (1u<<0)
 
#define U_ORIGIN1   (1u<<1)
 
#define U_ORIGIN2   (1u<<2)
 
#define U_ORIGIN3   (1u<<3)
 
#define U_SCALE   (1u<<18)
 1 byte, scale / 16 positive, not sent if 1.0
 
#define U_SIGNAL   (1u<<7)
 
#define U_SKIN   (1u<<12)
 
#define U_STEP   (1u<<5)
 
#define U_UNUSED29   (1u<<29)
 future expansion
 
#define U_UNUSED30   (1u<<30)
 future expansion
 
#define U_VIEWMODEL   (1u<<25)
 attachs the model to the view (origin and angles become relative to it), only shown to owner, a more powerful alternative to .weaponmodel and such
 

Enumerations

enum  entity_state_active_t { ACTIVE_NOT = 0 , ACTIVE_NETWORK = 1 , ACTIVE_SHARED = 2 }
 

Functions

int EntityFrame4_AckFrame (entityframe4_database_t *d, int framenum, int servermode)
 
void EntityFrame4_AddCommitEntity (entityframe4_database_t *d, const entity_state_t *s)
 
entityframe4_database_tEntityFrame4_AllocDatabase (struct mempool_s *pool)
 
void EntityFrame4_CL_ReadFrame (void)
 
void EntityFrame4_FreeDatabase (entityframe4_database_t *d)
 
entity_state_tEntityFrame4_GetReferenceEntity (entityframe4_database_t *d, int number)
 
void EntityFrame4_ResetDatabase (entityframe4_database_t *d)
 
qbool EntityFrame4_WriteFrame (struct sizebuf_s *msg, int maxsize, entityframe4_database_t *d, int numstates, const entity_state_t **states)
 
void EntityFrame5_AckFrame (entityframe5_database_t *d, int framenum)
 
entityframe5_database_tEntityFrame5_AllocDatabase (struct mempool_s *pool)
 
void EntityFrame5_CL_ReadFrame (void)
 
void EntityFrame5_FreeDatabase (entityframe5_database_t *d)
 
void EntityFrame5_LostFrame (entityframe5_database_t *d, int framenum)
 
qbool EntityFrame5_WriteFrame (struct sizebuf_s *msg, int maxsize, entityframe5_database_t *d, int numstates, const entity_state_t **states, int viewentnum, unsigned int movesequence, qbool need_empty)
 
void EntityFrame_AckFrame (entityframe_database_t *d, int frame)
 
void EntityFrame_AddFrame_Client (entityframe_database_t *d, vec3_t eye, int framenum, int numentities, const entity_state_t *entitydata)
 
void EntityFrame_AddFrame_Server (entityframe_database_t *d, vec3_t eye, int framenum, int numentities, const entity_state_t **entitydata)
 
entityframe_database_tEntityFrame_AllocDatabase (struct mempool_s *mempool)
 
void EntityFrame_CL_ReadFrame (void)
 
void EntityFrame_Clear (entity_frame_t *f, vec3_t eye, int framenum)
 
void EntityFrame_ClearDatabase (entityframe_database_t *d)
 
void EntityFrame_FetchFrame (entityframe_database_t *d, int framenum, entity_frame_t *f)
 
void EntityFrame_FreeDatabase (entityframe_database_t *d)
 
int EntityFrame_MostRecentlyRecievedFrameNum (entityframe_database_t *d)
 
qbool EntityFrame_WriteFrame (struct sizebuf_s *msg, int maxsize, entityframe_database_t *d, int numstates, const entity_state_t **states, int viewentnum)
 
void EntityFrameCSQC_LostFrame (struct client_s *client, int framenum)
 
qbool EntityFrameCSQC_WriteFrame (struct sizebuf_s *msg, int maxsize, int numnumbers, const unsigned short *numbers, int framenum)
 
void EntityFrameQuake_ISeeDeadEntities (void)
 
void EntityFrameQuake_ReadEntity (int bits)
 
qbool EntityFrameQuake_WriteFrame (struct sizebuf_s *msg, int maxsize, int numstates, const entity_state_t **states)
 
entityframeqw_database_tEntityFrameQW_AllocDatabase (struct mempool_s *pool)
 
void EntityFrameQW_CL_ReadFrame (qbool delta)
 
void EntityFrameQW_FreeDatabase (entityframeqw_database_t *d)
 
int EntityState5_DeltaBitsForState (entity_state_t *o, entity_state_t *n)
 
void EntityState5_WriteUpdate (int number, const entity_state_t *s, int changedbits, struct sizebuf_s *msg)
 
int EntityState_DeltaBits (const entity_state_t *o, const entity_state_t *n)
 
int EntityState_ReadExtendBits (void)
 
void EntityState_ReadFields (entity_state_t *e, unsigned int bits)
 
void EntityState_WriteExtendBits (struct sizebuf_s *msg, unsigned int bits)
 
void EntityState_WriteFields (const entity_state_t *ent, struct sizebuf_s *msg, unsigned int bits)
 
void EntityState_WriteUpdate (const entity_state_t *ent, struct sizebuf_s *msg, const entity_state_t *delta)
 
void EntityStateQW_ReadPlayerUpdate (void)
 
enum protocolversion_e Protocol_EnumForName (const char *s)
 
enum protocolversion_e Protocol_EnumForNumber (int n)
 
const char * Protocol_NameForEnum (enum protocolversion_e p)
 
void Protocol_Names (char *buffer, size_t buffersize)
 
int Protocol_NumberForEnum (enum protocolversion_e p)
 
void Protocol_UpdateClientStats (const int *stats)
 
void Protocol_WriteStatsReliable (void)
 

Variables

entity_state_t defaultstate
 
struct cvar_s developer_networkentities
 

Macro Definition Documentation

◆ clc_ackdownloaddata

#define clc_ackdownloaddata   51

Definition at line 295 of file protocol.h.

Referenced by CL_SendMove(), and SV_ReadClientMessage().

◆ clc_ackframe

#define clc_ackframe   50

Definition at line 294 of file protocol.h.

Referenced by CL_SendMove(), and SV_ReadClientMessage().

◆ clc_bad

#define clc_bad   0

Definition at line 287 of file protocol.h.

◆ clc_disconnect

#define clc_disconnect   2

Definition at line 289 of file protocol.h.

Referenced by CL_DisconnectEx(), and SV_ReadClientMessage().

◆ clc_move

#define clc_move   3

Definition at line 290 of file protocol.h.

Referenced by CL_SendMove(), and SV_ReadClientMessage().

◆ clc_nop

#define clc_nop   1

◆ clc_stringcmd

#define clc_stringcmd   4

◆ clc_unusedlh2

#define clc_unusedlh2   52

Definition at line 296 of file protocol.h.

◆ clc_unusedlh3

#define clc_unusedlh3   53

Definition at line 297 of file protocol.h.

◆ clc_unusedlh4

#define clc_unusedlh4   54

Definition at line 298 of file protocol.h.

◆ clc_unusedlh5

#define clc_unusedlh5   55

Definition at line 299 of file protocol.h.

◆ clc_unusedlh6

#define clc_unusedlh6   56

Definition at line 300 of file protocol.h.

◆ clc_unusedlh7

#define clc_unusedlh7   57

Definition at line 301 of file protocol.h.

◆ clc_unusedlh8

#define clc_unusedlh8   58

Definition at line 302 of file protocol.h.

◆ clc_unusedlh9

#define clc_unusedlh9   59

Definition at line 303 of file protocol.h.

◆ DEFAULT_VIEWHEIGHT

#define DEFAULT_VIEWHEIGHT   22

Definition at line 198 of file protocol.h.

Referenced by CL_ParseClientdata(), and SV_WriteClientdataToMessage().

◆ E5_ALPHA

#define E5_ALPHA   (1u<<9)

byte = bound(0, s->alpha * 255, 255)

Definition at line 768 of file protocol.h.

Referenced by EntityState5_DeltaBits(), EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_ANGLES

#define E5_ANGLES   (1u<<2)

E5_ANGLES16=0: byte[3] = s->angle[0] * 256 / 360, s->angle[1] * 256 / 360, s->angle[2] * 256 / 360 E5_ANGLES16=1: short[3] = s->angle[0] * 65536 / 360, s->angle[1] * 65536 / 360, s->angle[2] * 65536 / 360.

Definition at line 748 of file protocol.h.

Referenced by EntityState5_DeltaBits(), EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_ANGLES16

#define E5_ANGLES16   (1u<<12)

flag

Definition at line 774 of file protocol.h.

Referenced by EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_ATTACHMENT

#define E5_ATTACHMENT   (1u<<16)

short = s->tagentity byte = s->tagindex

Definition at line 784 of file protocol.h.

Referenced by EntityFrame5_LostFrame(), EntityState5_DeltaBits(), EntityState5_Priority(), EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_COLORMAP

#define E5_COLORMAP   (1u<<14)

◆ E5_COLORMOD

#define E5_COLORMOD   (1u<<22)

byte[3] = s->colormod[0], s->colormod[1], s->colormod[2]

Definition at line 799 of file protocol.h.

Referenced by EntityState5_DeltaBits(), EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_COMPLEXANIMATION

#define E5_COMPLEXANIMATION   (1u<<25)

byte type=0 short frames[1] short times[1] byte type=1 short frames[2] short times[2] byte lerps[2] byte type=2 short frames[3] short times[3] byte lerps[3] byte type=3 short frames[4] short times[4] byte lerps[4] byte type=4 short modelindex byte numbones {short pose7s[7]} see also RENDER_COMPLEXANIMATION

Definition at line 811 of file protocol.h.

Referenced by EntityState5_DeltaBits(), EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_EFFECTS

#define E5_EFFECTS   (1u<<6)

E5_EFFECTS16=0 && E5_EFFECTS32=0: byte = s->effects E5_EFFECTS16=1 && E5_EFFECTS32=0: short = s->effects E5_EFFECTS16=0 && E5_EFFECTS32=1: int = s->effects E5_EFFECTS16=1 && E5_EFFECTS32=1: int = s->effects.

Definition at line 761 of file protocol.h.

Referenced by EntityState5_DeltaBits(), EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_EFFECTS16

#define E5_EFFECTS16   (1u<<19)

short = s->effects

Definition at line 793 of file protocol.h.

Referenced by EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_EFFECTS32

#define E5_EFFECTS32   (1u<<20)

int = s->effects

Definition at line 795 of file protocol.h.

Referenced by EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_EXTEND1

#define E5_EXTEND1   (1u<<7)

bits >= (1<<8)

Definition at line 763 of file protocol.h.

Referenced by EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_EXTEND2

#define E5_EXTEND2   (1u<<15)

bits >= (1<<16)

Definition at line 780 of file protocol.h.

Referenced by EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_EXTEND3

#define E5_EXTEND3   (1u<<23)

bits >= (1<<24)

Definition at line 801 of file protocol.h.

Referenced by EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_EXTEND4

#define E5_EXTEND4   (1u<<31)

bits2 > 0

Definition at line 823 of file protocol.h.

◆ E5_FLAGS

#define E5_FLAGS   (1u<<8)

byte = s->renderflags

Definition at line 766 of file protocol.h.

Referenced by EntityState5_DeltaBits(), EntityState5_Priority(), EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_FRAME

#define E5_FRAME   (1u<<4)

E5_FRAME16=0: byte = s->frame E5_FRAME16=1: short = s->frame.

Definition at line 754 of file protocol.h.

Referenced by EntityState5_DeltaBits(), EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_FRAME16

#define E5_FRAME16   (1u<<21)

flag

Definition at line 797 of file protocol.h.

Referenced by EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_FULLUPDATE

#define E5_FULLUPDATE   (1u<<0)

reset all entity fields (typically used if status changed)

Definition at line 742 of file protocol.h.

Referenced by EntityFrame5_LostFrame(), EntityFrame5_WriteFrame(), EntityState5_DeltaBits(), EntityState5_Priority(), and EntityState5_ReadUpdate().

◆ E5_GLOW

#define E5_GLOW   (1u<<18)

byte = s->glowsize byte = s->glowcolor

Definition at line 791 of file protocol.h.

Referenced by EntityState5_DeltaBits(), EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_GLOWMOD

#define E5_GLOWMOD   (1u<<24)

byte[3] = s->glowmod[0], s->glowmod[1], s->glowmod[2]

Definition at line 804 of file protocol.h.

Referenced by EntityState5_DeltaBits(), EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_LIGHT

#define E5_LIGHT   (1u<<17)

short[4] = s->light[0], s->light[1], s->light[2], s->light[3] byte = s->lightstyle byte = s->lightpflags

Definition at line 788 of file protocol.h.

Referenced by EntityState5_DeltaBits(), EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_MODEL

#define E5_MODEL   (1u<<3)

E5_MODEL16=0: byte = s->modelindex E5_MODEL16=1: short = s->modelindex.

Definition at line 751 of file protocol.h.

Referenced by EntityFrame5_LostFrame(), EntityState5_DeltaBits(), EntityState5_Priority(), EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_MODEL16

#define E5_MODEL16   (1u<<13)

flag

Definition at line 776 of file protocol.h.

Referenced by EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_ORIGIN

#define E5_ORIGIN   (1u<<1)

E5_ORIGIN32=0: short[3] = s->origin[0] * 8, s->origin[1] * 8, s->origin[2] * 8 E5_ORIGIN32=1: float[3] = s->origin[0], s->origin[1], s->origin[2].

Definition at line 745 of file protocol.h.

Referenced by EntityState5_DeltaBits(), EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_ORIGIN32

#define E5_ORIGIN32   (1u<<11)

flag

Definition at line 772 of file protocol.h.

Referenced by EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_SCALE

#define E5_SCALE   (1u<<10)

byte = bound(0, s->scale * 16, 255)

Definition at line 770 of file protocol.h.

Referenced by EntityState5_DeltaBits(), EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_SKIN

#define E5_SKIN   (1u<<5)

byte = s->skin

Definition at line 756 of file protocol.h.

Referenced by EntityState5_DeltaBits(), EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_TRAILEFFECTNUM

#define E5_TRAILEFFECTNUM   (1u<<26)

ushort traileffectnum

Definition at line 813 of file protocol.h.

Referenced by EntityState5_DeltaBits(), EntityState5_ReadUpdate(), and EntityState5_WriteUpdate().

◆ E5_UNUSED27

#define E5_UNUSED27   (1u<<27)

unused

Definition at line 815 of file protocol.h.

◆ E5_UNUSED28

#define E5_UNUSED28   (1u<<28)

unused

Definition at line 817 of file protocol.h.

◆ E5_UNUSED29

#define E5_UNUSED29   (1u<<29)

unused

Definition at line 819 of file protocol.h.

◆ E5_UNUSED30

#define E5_UNUSED30   (1u<<30)

unused

Definition at line 821 of file protocol.h.

◆ E_ALPHA

#define E_ALPHA   (1u<<10)

◆ E_ANGLE1

#define E_ANGLE1   (1u<<3)

◆ E_ANGLE2

#define E_ANGLE2   (1u<<4)

◆ E_ANGLE3

#define E_ANGLE3   (1u<<5)

◆ E_COLORMAP

#define E_COLORMAP   (1u<<12)

◆ E_EFFECTS1

#define E_EFFECTS1   (1u<<9)

◆ E_EFFECTS2

#define E_EFFECTS2   (1u<<18)

◆ E_EXTEND1

#define E_EXTEND1   (1u<<7)

Definition at line 620 of file protocol.h.

◆ E_EXTEND2

#define E_EXTEND2   (1u<<15)

Definition at line 630 of file protocol.h.

◆ E_EXTEND3

#define E_EXTEND3   (1u<<23)

Definition at line 640 of file protocol.h.

◆ E_EXTEND4

#define E_EXTEND4   (1u<<31)

Definition at line 649 of file protocol.h.

◆ E_FLAGS

#define E_FLAGS   (1u<<14)

◆ E_FRAME1

#define E_FRAME1   (1u<<8)

◆ E_FRAME2

#define E_FRAME2   (1u<<16)

◆ E_GLOWCOLOR

#define E_GLOWCOLOR   (1u<<20)

◆ E_GLOWSIZE

#define E_GLOWSIZE   (1u<<19)

◆ E_LIGHT

#define E_LIGHT   (1u<<21)

◆ E_LIGHTPFLAGS

#define E_LIGHTPFLAGS   (1u<<22)

◆ E_LIGHTSTYLE

#define E_LIGHTSTYLE   (1u<<28)

◆ E_MODEL1

#define E_MODEL1   (1u<<6)

◆ E_MODEL2

#define E_MODEL2   (1u<<17)

◆ E_ORIGIN1

#define E_ORIGIN1   (1u<<0)

◆ E_ORIGIN2

#define E_ORIGIN2   (1u<<1)

◆ E_ORIGIN3

#define E_ORIGIN3   (1u<<2)

◆ E_SCALE

#define E_SCALE   (1u<<11)

◆ E_SKIN

#define E_SKIN   (1u<<13)

◆ E_SOUND1

#define E_SOUND1   (1u<<24)

Definition at line 642 of file protocol.h.

◆ E_SOUNDATTEN

#define E_SOUNDATTEN   (1u<<26)

Definition at line 644 of file protocol.h.

◆ E_SOUNDVOL

#define E_SOUNDVOL   (1u<<25)

Definition at line 643 of file protocol.h.

◆ E_TAGATTACHMENT

#define E_TAGATTACHMENT   (1u<<27)

◆ E_UNUSED6

#define E_UNUSED6   (1u<<29)

Definition at line 647 of file protocol.h.

◆ E_UNUSED7

#define E_UNUSED7   (1u<<30)

Definition at line 648 of file protocol.h.

◆ EF_ADDITIVE

◆ EF_BLUE

#define EF_BLUE   64

◆ EF_BRIGHTFIELD

#define EF_BRIGHTFIELD   1

◆ EF_BRIGHTLIGHT

#define EF_BRIGHTLIGHT   4

◆ EF_DIMLIGHT

#define EF_DIMLIGHT   8

◆ EF_DOUBLESIDED

#define EF_DOUBLESIDED   32768

Definition at line 83 of file protocol.h.

Referenced by CL_UpdateNetworkEntity(), CSQC_AddRenderEdict(), and VM_CL_makestatic().

◆ EF_DYNAMICMODELLIGHT

#define EF_DYNAMICMODELLIGHT   131072

Definition at line 85 of file protocol.h.

Referenced by CL_UpdateNetworkEntity(), and CSQC_AddRenderEdict().

◆ EF_FLAME

#define EF_FLAME   1024

◆ EF_FULLBRIGHT

◆ EF_GIB

#define EF_GIB   67108864

Definition at line 94 of file protocol.h.

Referenced by CL_LinkNetworkEntity(), and CL_UpdateNetworkEntityTrail().

◆ EF_GRENADE

#define EF_GRENADE   33554432

Definition at line 93 of file protocol.h.

Referenced by CL_LinkNetworkEntity(), and CL_UpdateNetworkEntityTrail().

◆ EF_LOWPRECISION

#define EF_LOWPRECISION   4194304

Definition at line 90 of file protocol.h.

Referenced by SV_PrepareEntityForSending().

◆ EF_MUZZLEFLASH

#define EF_MUZZLEFLASH   2

◆ EF_NODEPTHTEST

◆ EF_NODRAW

#define EF_NODRAW   16

◆ EF_NOGUNBOB

#define EF_NOGUNBOB   256

Definition at line 76 of file protocol.h.

Referenced by CL_UpdateNetworkEntity(), and CL_UpdateViewModel().

◆ EF_NOMODELFLAGS

#define EF_NOMODELFLAGS   8388608

Definition at line 91 of file protocol.h.

◆ EF_NOSELFSHADOW

#define EF_NOSELFSHADOW   65536

Definition at line 84 of file protocol.h.

Referenced by CL_UpdateNetworkEntity(), and CSQC_AddRenderEdict().

◆ EF_NOSHADOW

#define EF_NOSHADOW   4096

◆ EF_RED

#define EF_RED   128

◆ EF_RESTARTANIM_BIT

#define EF_RESTARTANIM_BIT   1048576

Definition at line 88 of file protocol.h.

Referenced by CL_MoveLerpEntityStates().

◆ EF_ROCKET

#define EF_ROCKET   16777216

Definition at line 92 of file protocol.h.

Referenced by CL_LinkNetworkEntity(), and CL_UpdateNetworkEntityTrail().

◆ EF_ROTATE

#define EF_ROTATE   134217728

Definition at line 95 of file protocol.h.

Referenced by CL_UpdateNetworkEntity(), and SV_PrepareEntityForSending().

◆ EF_SELECTABLE

#define EF_SELECTABLE   16384

Definition at line 82 of file protocol.h.

Referenced by CL_SelectTraceLine(), and CL_UpdateNetworkEntity().

◆ EF_STARDUST

#define EF_STARDUST   2048

◆ EF_TELEPORT_BIT

#define EF_TELEPORT_BIT   2097152

Definition at line 89 of file protocol.h.

Referenced by CL_MoveLerpEntityStates().

◆ EF_TRACER

#define EF_TRACER   268435456

Definition at line 96 of file protocol.h.

Referenced by CL_LinkNetworkEntity(), and CL_UpdateNetworkEntityTrail().

◆ EF_TRACER2

#define EF_TRACER2   1073741824

Definition at line 98 of file protocol.h.

Referenced by CL_LinkNetworkEntity(), and CL_UpdateNetworkEntityTrail().

◆ EF_TRACER3

#define EF_TRACER3   0x80000000

Definition at line 99 of file protocol.h.

Referenced by CL_LinkNetworkEntity(), and CL_UpdateNetworkEntityTrail().

◆ EF_UNUSED18

#define EF_UNUSED18   262144

Definition at line 86 of file protocol.h.

◆ EF_UNUSED19

#define EF_UNUSED19   524288

Definition at line 87 of file protocol.h.

◆ EF_ZOMGIB

#define EF_ZOMGIB   536870912

Definition at line 97 of file protocol.h.

Referenced by CL_LinkNetworkEntity(), and CL_UpdateNetworkEntityTrail().

◆ ENTITYFRAME5_MAXPACKETLOGS

#define ENTITYFRAME5_MAXPACKETLOGS   64

◆ ENTITYFRAME5_MAXSTATES

#define ENTITYFRAME5_MAXSTATES   1024

Definition at line 827 of file protocol.h.

Referenced by EntityFrame5_WriteFrame().

◆ ENTITYFRAME5_PRIORITYLEVELS

#define ENTITYFRAME5_PRIORITYLEVELS   32

Definition at line 828 of file protocol.h.

Referenced by EntityFrame5_WriteFrame(), and EntityState5_Priority().

◆ ENTITYSIZEPROFILING_END

#define ENTITYSIZEPROFILING_END ( msg,
num,
flags )
Value:
if(developer_networkentities.integer >= 2) \
{ \
prvm_edict_t *edict = prog->edicts + num; \
Con_Printf("sent entity update of size %u for %d classname %s flags %d\n", (msg->cursize - entityprofiling_startsize), num, PRVM_serveredictstring(edict, classname) ? PRVM_GetString(prog, PRVM_serveredictstring(edict, classname)) : "(no classname)", flags); \
}
string classname
float flags
const char * PRVM_GetString(prvm_prog_t *prog, int num)
#define PRVM_serveredictstring(ed, fieldname)
Definition progsvm.h:174
struct cvar_s developer_networkentities
Definition cl_parse.c:173

Definition at line 42 of file protocol.h.

42#define ENTITYSIZEPROFILING_END(msg, num, flags) \
43 if(developer_networkentities.integer >= 2) \
44 { \
45 prvm_edict_t *edict = prog->edicts + num; \
46 Con_Printf("sent entity update of size %u for %d classname %s flags %d\n", (msg->cursize - entityprofiling_startsize), num, PRVM_serveredictstring(edict, classname) ? PRVM_GetString(prog, PRVM_serveredictstring(edict, classname)) : "(no classname)", flags); \
47 }

Referenced by EntityFrameCSQC_WriteFrame(), EntityFrameQuake_WriteFrame(), EntityState5_WriteUpdate(), and EntityState_WriteUpdate().

◆ ENTITYSIZEPROFILING_START

#define ENTITYSIZEPROFILING_START ( msg,
num,
flags )
Value:
int entityprofiling_startsize = msg->cursize

Definition at line 39 of file protocol.h.

39#define ENTITYSIZEPROFILING_START(msg, num, flags) \
40 int entityprofiling_startsize = msg->cursize

Referenced by EntityFrameCSQC_WriteFrame(), EntityFrameQuake_WriteFrame(), EntityState5_WriteUpdate(), and EntityState_WriteUpdate().

◆ GAME_COOP

#define GAME_COOP   0

◆ GAME_DEATHMATCH

#define GAME_DEATHMATCH   1

◆ INTEF_FLAG1QW

#define INTEF_FLAG1QW   1

Definition at line 102 of file protocol.h.

Referenced by CL_UpdateNetworkEntityTrail(), and QW_TranslateEffects().

◆ INTEF_FLAG2QW

#define INTEF_FLAG2QW   2

Definition at line 103 of file protocol.h.

Referenced by CL_UpdateNetworkEntityTrail(), and QW_TranslateEffects().

◆ MAX_ENTITY_DATABASE

#define MAX_ENTITY_DATABASE   (MAX_EDICTS * 2)

◆ MAX_ENTITY_HISTORY

◆ MAX_FRAMEGROUPBLENDS

#define MAX_FRAMEGROUPBLENDS   4

◆ MF_GIB

#define MF_GIB   4

Definition at line 60 of file protocol.h.

◆ MF_GRENADE

#define MF_GRENADE   2

Definition at line 59 of file protocol.h.

◆ MF_ROCKET

#define MF_ROCKET   1

Definition at line 58 of file protocol.h.

◆ MF_ROTATE

#define MF_ROTATE   8

Definition at line 61 of file protocol.h.

◆ MF_TRACER

#define MF_TRACER   16

Definition at line 62 of file protocol.h.

◆ MF_TRACER2

#define MF_TRACER2   64

Definition at line 64 of file protocol.h.

◆ MF_TRACER3

#define MF_TRACER3   128

Definition at line 65 of file protocol.h.

◆ MF_ZOMGIB

#define MF_ZOMGIB   32

Definition at line 63 of file protocol.h.

◆ PFLAGS_CORONA

#define PFLAGS_CORONA   2

◆ PFLAGS_FULLDYNAMIC

◆ PFLAGS_NOSHADOW

#define PFLAGS_NOSHADOW   1

◆ qw_clc_bad

#define qw_clc_bad   0

Definition at line 954 of file protocol.h.

◆ qw_clc_delta

#define qw_clc_delta   5

Definition at line 958 of file protocol.h.

Referenced by CL_SendMove().

◆ qw_clc_move

#define qw_clc_move   3

Definition at line 956 of file protocol.h.

Referenced by CL_SendMove().

◆ qw_clc_nop

#define qw_clc_nop   1

Definition at line 955 of file protocol.h.

◆ qw_clc_stringcmd

◆ qw_clc_tmove

#define qw_clc_tmove   6

Definition at line 959 of file protocol.h.

◆ qw_clc_upload

#define qw_clc_upload   7

Definition at line 960 of file protocol.h.

Referenced by QW_CL_NextUpload_f().

◆ QW_CM_ANGLE1

#define QW_CM_ANGLE1   (1<<0)

Definition at line 980 of file protocol.h.

Referenced by EntityStateQW_ReadPlayerUpdate(), and QW_MSG_WriteDeltaUsercmd().

◆ QW_CM_ANGLE2

#define QW_CM_ANGLE2   (1<<7)

Definition at line 987 of file protocol.h.

Referenced by EntityStateQW_ReadPlayerUpdate(), and QW_MSG_WriteDeltaUsercmd().

◆ QW_CM_ANGLE3

#define QW_CM_ANGLE3   (1<<1)

Definition at line 981 of file protocol.h.

Referenced by EntityStateQW_ReadPlayerUpdate(), and QW_MSG_WriteDeltaUsercmd().

◆ QW_CM_BUTTONS

#define QW_CM_BUTTONS   (1<<5)

Definition at line 985 of file protocol.h.

Referenced by EntityStateQW_ReadPlayerUpdate(), and QW_MSG_WriteDeltaUsercmd().

◆ QW_CM_FORWARD

#define QW_CM_FORWARD   (1<<2)

Definition at line 982 of file protocol.h.

Referenced by EntityStateQW_ReadPlayerUpdate(), and QW_MSG_WriteDeltaUsercmd().

◆ QW_CM_IMPULSE

#define QW_CM_IMPULSE   (1<<6)

Definition at line 986 of file protocol.h.

Referenced by EntityStateQW_ReadPlayerUpdate(), and QW_MSG_WriteDeltaUsercmd().

◆ QW_CM_SIDE

#define QW_CM_SIDE   (1<<3)

Definition at line 983 of file protocol.h.

Referenced by EntityStateQW_ReadPlayerUpdate(), and QW_MSG_WriteDeltaUsercmd().

◆ QW_CM_UP

#define QW_CM_UP   (1<<4)

Definition at line 984 of file protocol.h.

Referenced by EntityStateQW_ReadPlayerUpdate(), and QW_MSG_WriteDeltaUsercmd().

◆ QW_EF_BLUE

#define QW_EF_BLUE   64

Definition at line 1030 of file protocol.h.

Referenced by QW_TranslateEffects().

◆ QW_EF_BRIGHTFIELD

#define QW_EF_BRIGHTFIELD   1

Definition at line 1024 of file protocol.h.

Referenced by QW_TranslateEffects().

◆ QW_EF_BRIGHTLIGHT

#define QW_EF_BRIGHTLIGHT   4

Definition at line 1026 of file protocol.h.

Referenced by QW_TranslateEffects().

◆ QW_EF_DIMLIGHT

#define QW_EF_DIMLIGHT   8

Definition at line 1027 of file protocol.h.

Referenced by QW_TranslateEffects().

◆ QW_EF_FLAG1

#define QW_EF_FLAG1   16

Definition at line 1028 of file protocol.h.

Referenced by QW_TranslateEffects().

◆ QW_EF_FLAG2

#define QW_EF_FLAG2   32

Definition at line 1029 of file protocol.h.

Referenced by QW_TranslateEffects().

◆ QW_EF_MUZZLEFLASH

#define QW_EF_MUZZLEFLASH   2

Definition at line 1025 of file protocol.h.

Referenced by QW_TranslateEffects().

◆ QW_EF_RED

#define QW_EF_RED   128

Definition at line 1031 of file protocol.h.

Referenced by QW_TranslateEffects().

◆ QW_MAX_PACKET_ENTITIES

#define QW_MAX_PACKET_ENTITIES   64

Definition at line 1035 of file protocol.h.

Referenced by EntityFrameQW_CL_ReadFrame().

◆ QW_PF_COMMAND

#define QW_PF_COMMAND   (1<<1)

Definition at line 965 of file protocol.h.

Referenced by EntityStateQW_ReadPlayerUpdate().

◆ QW_PF_DEAD

#define QW_PF_DEAD   (1<<9)

Definition at line 973 of file protocol.h.

Referenced by EntityStateQW_ReadPlayerUpdate().

◆ QW_PF_EFFECTS

#define QW_PF_EFFECTS   (1<<7)

Definition at line 971 of file protocol.h.

Referenced by EntityStateQW_ReadPlayerUpdate().

◆ QW_PF_GIB

#define QW_PF_GIB   (1<<10)

Definition at line 974 of file protocol.h.

Referenced by EntityStateQW_ReadPlayerUpdate().

◆ QW_PF_MODEL

#define QW_PF_MODEL   (1<<5)

Definition at line 969 of file protocol.h.

Referenced by EntityStateQW_ReadPlayerUpdate().

◆ QW_PF_MSEC

#define QW_PF_MSEC   (1<<0)

Definition at line 964 of file protocol.h.

Referenced by EntityStateQW_ReadPlayerUpdate().

◆ QW_PF_NOGRAV

#define QW_PF_NOGRAV   (1<<11)

Definition at line 975 of file protocol.h.

◆ QW_PF_SKINNUM

#define QW_PF_SKINNUM   (1<<6)

Definition at line 970 of file protocol.h.

Referenced by EntityStateQW_ReadPlayerUpdate().

◆ QW_PF_VELOCITY1

#define QW_PF_VELOCITY1   (1<<2)

Definition at line 966 of file protocol.h.

Referenced by EntityStateQW_ReadPlayerUpdate().

◆ QW_PF_VELOCITY2

#define QW_PF_VELOCITY2   (1<<3)

Definition at line 967 of file protocol.h.

Referenced by EntityStateQW_ReadPlayerUpdate().

◆ QW_PF_VELOCITY3

#define QW_PF_VELOCITY3   (1<<4)

Definition at line 968 of file protocol.h.

Referenced by EntityStateQW_ReadPlayerUpdate().

◆ QW_PF_WEAPONFRAME

#define QW_PF_WEAPONFRAME   (1<<8)

Definition at line 972 of file protocol.h.

Referenced by EntityStateQW_ReadPlayerUpdate().

◆ QW_STAT_ACTIVEWEAPON

#define QW_STAT_ACTIVEWEAPON   10

Definition at line 1050 of file protocol.h.

◆ QW_STAT_AMMO

#define QW_STAT_AMMO   3

Definition at line 1043 of file protocol.h.

◆ QW_STAT_ARMOR

#define QW_STAT_ARMOR   4

Definition at line 1044 of file protocol.h.

◆ QW_STAT_CELLS

#define QW_STAT_CELLS   9

Definition at line 1049 of file protocol.h.

◆ QW_STAT_HEALTH

#define QW_STAT_HEALTH   0

Definition at line 1040 of file protocol.h.

◆ QW_STAT_ITEMS

#define QW_STAT_ITEMS   15

Definition at line 1055 of file protocol.h.

◆ QW_STAT_MONSTERS

#define QW_STAT_MONSTERS   14

Definition at line 1054 of file protocol.h.

◆ QW_STAT_NAILS

#define QW_STAT_NAILS   7

Definition at line 1047 of file protocol.h.

◆ QW_STAT_ROCKETS

#define QW_STAT_ROCKETS   8

Definition at line 1048 of file protocol.h.

◆ QW_STAT_SECRETS

#define QW_STAT_SECRETS   13

Definition at line 1053 of file protocol.h.

◆ QW_STAT_SHELLS

#define QW_STAT_SHELLS   6

Definition at line 1046 of file protocol.h.

◆ QW_STAT_TOTALMONSTERS

#define QW_STAT_TOTALMONSTERS   12

Definition at line 1052 of file protocol.h.

◆ QW_STAT_TOTALSECRETS

#define QW_STAT_TOTALSECRETS   11

Definition at line 1051 of file protocol.h.

◆ QW_STAT_WEAPON

#define QW_STAT_WEAPON   2

Definition at line 1042 of file protocol.h.

◆ qw_svc_bad

#define qw_svc_bad   0

Definition at line 906 of file protocol.h.

◆ qw_svc_bigkick

#define qw_svc_bigkick   35

Definition at line 933 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_cdtrack

#define qw_svc_cdtrack   32

Definition at line 930 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_centerprint

#define qw_svc_centerprint   26

Definition at line 924 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_chokecount

#define qw_svc_chokecount   44

Definition at line 942 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_damage

#define qw_svc_damage   19

Definition at line 919 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_deltapacketentities

#define qw_svc_deltapacketentities   48

Definition at line 946 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_disconnect

#define qw_svc_disconnect   2

Definition at line 908 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_download

#define qw_svc_download   41

Definition at line 939 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_entgravity

#define qw_svc_entgravity   50

Definition at line 948 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_finale

#define qw_svc_finale   31

Definition at line 929 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_foundsecret

#define qw_svc_foundsecret   28

Definition at line 926 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_intermission

#define qw_svc_intermission   30

Definition at line 928 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_killedmonster

#define qw_svc_killedmonster   27

Definition at line 925 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_lightstyle

#define qw_svc_lightstyle   12

Definition at line 916 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_maxspeed

#define qw_svc_maxspeed   49

Definition at line 947 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_modellist

#define qw_svc_modellist   45

Definition at line 943 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_muzzleflash

#define qw_svc_muzzleflash   39

Definition at line 937 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_nails

#define qw_svc_nails   43

Definition at line 941 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_nop

#define qw_svc_nop   1

Definition at line 907 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_packetentities

#define qw_svc_packetentities   47

Definition at line 945 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_playerinfo

#define qw_svc_playerinfo   42

Definition at line 940 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_print

#define qw_svc_print   8

Definition at line 912 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_sellscreen

#define qw_svc_sellscreen   33

Definition at line 931 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_serverdata

#define qw_svc_serverdata   11

Definition at line 915 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_serverinfo

#define qw_svc_serverinfo   52

Definition at line 950 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_setangle

#define qw_svc_setangle   10

Definition at line 914 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_setinfo

#define qw_svc_setinfo   51

Definition at line 949 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_setpause

#define qw_svc_setpause   24

Definition at line 923 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_setview

#define qw_svc_setview   5

Definition at line 910 of file protocol.h.

◆ qw_svc_smallkick

#define qw_svc_smallkick   34

Definition at line 932 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_sound

#define qw_svc_sound   6

Definition at line 911 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_soundlist

#define qw_svc_soundlist   46

Definition at line 944 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_spawnbaseline

#define qw_svc_spawnbaseline   22

Definition at line 921 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_spawnstatic

#define qw_svc_spawnstatic   20

Definition at line 920 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_spawnstaticsound

#define qw_svc_spawnstaticsound   29

Definition at line 927 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_stopsound

#define qw_svc_stopsound   16

Definition at line 918 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_stufftext

#define qw_svc_stufftext   9

Definition at line 913 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_temp_entity

#define qw_svc_temp_entity   23

Definition at line 922 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_updateentertime

#define qw_svc_updateentertime   37

Definition at line 935 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_updatefrags

#define qw_svc_updatefrags   14

Definition at line 917 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ qw_svc_updateping

#define qw_svc_updateping   36

Definition at line 934 of file protocol.h.

Referenced by CL_ParseServerMessage(), and SV_Pings_f().

◆ qw_svc_updatepl

#define qw_svc_updatepl   53

Definition at line 951 of file protocol.h.

Referenced by CL_ParseServerMessage(), and SV_Pings_f().

◆ qw_svc_updatestat

#define qw_svc_updatestat   3

Definition at line 909 of file protocol.h.

Referenced by CL_ParseServerMessage(), and Protocol_WriteStatsReliable().

◆ qw_svc_updatestatlong

#define qw_svc_updatestatlong   38

Definition at line 936 of file protocol.h.

Referenced by CL_ParseServerMessage(), and Protocol_WriteStatsReliable().

◆ qw_svc_updateuserinfo

#define qw_svc_updateuserinfo   40

Definition at line 938 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ QW_TE_BLOOD

#define QW_TE_BLOOD   12

Definition at line 1020 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ QW_TE_EXPLOSION

#define QW_TE_EXPLOSION   3

Definition at line 1011 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ QW_TE_GUNSHOT

#define QW_TE_GUNSHOT   2

Definition at line 1010 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ QW_TE_KNIGHTSPIKE

#define QW_TE_KNIGHTSPIKE   8

Definition at line 1016 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ QW_TE_LAVASPLASH

#define QW_TE_LAVASPLASH   10

Definition at line 1018 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ QW_TE_LIGHTNING1

#define QW_TE_LIGHTNING1   5

Definition at line 1013 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ QW_TE_LIGHTNING2

#define QW_TE_LIGHTNING2   6

Definition at line 1014 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ QW_TE_LIGHTNING3

#define QW_TE_LIGHTNING3   9

Definition at line 1017 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ QW_TE_LIGHTNINGBLOOD

#define QW_TE_LIGHTNINGBLOOD   13

Definition at line 1021 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ QW_TE_SPIKE

#define QW_TE_SPIKE   0

Definition at line 1008 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ QW_TE_SUPERSPIKE

#define QW_TE_SUPERSPIKE   1

Definition at line 1009 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ QW_TE_TAREXPLOSION

#define QW_TE_TAREXPLOSION   4

Definition at line 1012 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ QW_TE_TELEPORT

#define QW_TE_TELEPORT   11

Definition at line 1019 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ QW_TE_WIZSPIKE

#define QW_TE_WIZSPIKE   7

Definition at line 1015 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ QW_U_ANGLE1

#define QW_U_ANGLE1   (1<<0)

Definition at line 999 of file protocol.h.

Referenced by EntityStateQW_ReadEntityUpdate().

◆ QW_U_ANGLE2

#define QW_U_ANGLE2   (1<<12)

Definition at line 994 of file protocol.h.

Referenced by EntityStateQW_ReadEntityUpdate().

◆ QW_U_ANGLE3

#define QW_U_ANGLE3   (1<<1)

Definition at line 1000 of file protocol.h.

Referenced by EntityStateQW_ReadEntityUpdate().

◆ QW_U_COLORMAP

#define QW_U_COLORMAP   (1<<3)

Definition at line 1002 of file protocol.h.

Referenced by EntityStateQW_ReadEntityUpdate().

◆ QW_U_EFFECTS

#define QW_U_EFFECTS   (1<<5)

Definition at line 1004 of file protocol.h.

Referenced by EntityStateQW_ReadEntityUpdate().

◆ QW_U_FRAME

#define QW_U_FRAME   (1<<13)

Definition at line 995 of file protocol.h.

Referenced by EntityStateQW_ReadEntityUpdate().

◆ QW_U_MODEL

#define QW_U_MODEL   (1<<2)

Definition at line 1001 of file protocol.h.

Referenced by EntityStateQW_ReadEntityUpdate().

◆ QW_U_MOREBITS

#define QW_U_MOREBITS   (1<<15)

Definition at line 997 of file protocol.h.

Referenced by EntityStateQW_ReadEntityUpdate().

◆ QW_U_ORIGIN1

#define QW_U_ORIGIN1   (1<<9)

Definition at line 991 of file protocol.h.

Referenced by EntityStateQW_ReadEntityUpdate().

◆ QW_U_ORIGIN2

#define QW_U_ORIGIN2   (1<<10)

Definition at line 992 of file protocol.h.

Referenced by EntityStateQW_ReadEntityUpdate().

◆ QW_U_ORIGIN3

#define QW_U_ORIGIN3   (1<<11)

Definition at line 993 of file protocol.h.

Referenced by EntityStateQW_ReadEntityUpdate().

◆ QW_U_REMOVE

#define QW_U_REMOVE   (1<<14)

Definition at line 996 of file protocol.h.

Referenced by EntityFrameQW_CL_ReadFrame().

◆ QW_U_SKIN

#define QW_U_SKIN   (1<<4)

Definition at line 1003 of file protocol.h.

Referenced by EntityStateQW_ReadEntityUpdate().

◆ QW_U_SOLID

#define QW_U_SOLID   (1<<6)

Definition at line 1005 of file protocol.h.

Referenced by EntityStateQW_ReadEntityUpdate().

◆ QW_UPDATE_BACKUP

#define QW_UPDATE_BACKUP   64

Definition at line 1033 of file protocol.h.

Referenced by CL_SendMove(), and EntityFrameQW_CL_ReadFrame().

◆ QW_UPDATE_MASK

#define QW_UPDATE_MASK   (QW_UPDATE_BACKUP - 1)

Definition at line 1034 of file protocol.h.

Referenced by CL_SendMove(), and EntityFrameQW_CL_ReadFrame().

◆ RENDER_ADDITIVE

◆ RENDER_COLORMAPPED

#define RENDER_COLORMAPPED   32

◆ RENDER_COMPLEXANIMATION

#define RENDER_COMPLEXANIMATION   128

◆ RENDER_CUSTOMIZEDMODELLIGHT

#define RENDER_CUSTOMIZEDMODELLIGHT   4096

◆ RENDER_DOUBLESIDED

#define RENDER_DOUBLESIDED   4194304

◆ RENDER_DYNAMICMODELLIGHT

#define RENDER_DYNAMICMODELLIGHT   8388608

◆ RENDER_EXTERIORMODEL

◆ RENDER_GLOWTRAIL

◆ RENDER_LIGHT

◆ RENDER_LOWPRECISION

#define RENDER_LOWPRECISION   16

◆ RENDER_NODEPTHTEST

◆ RENDER_NOSELFSHADOW

◆ RENDER_SHADOW

◆ RENDER_STEP

◆ RENDER_VIEWMODEL

◆ RENDER_WORLDOBJECT

#define RENDER_WORLDOBJECT   64

◆ SCOPE_ASSUMED_EXISTING

#define SCOPE_ASSUMED_EXISTING   8

◆ SCOPE_EXISTED_ONCE

#define SCOPE_EXISTED_ONCE   4

Definition at line 53 of file protocol.h.

Referenced by EntityFrameCSQC_LostAllFrames(), and EntityFrameCSQC_WriteFrame().

◆ SCOPE_WANTREMOVE

#define SCOPE_WANTREMOVE   1

Definition at line 50 of file protocol.h.

Referenced by EntityFrameCSQC_WriteFrame().

◆ SCOPE_WANTSEND

#define SCOPE_WANTSEND   (SCOPE_WANTREMOVE | SCOPE_WANTUPDATE)

Definition at line 52 of file protocol.h.

Referenced by EntityFrameCSQC_WriteFrame().

◆ SCOPE_WANTUPDATE

#define SCOPE_WANTUPDATE   2

Definition at line 51 of file protocol.h.

Referenced by EntityFrameCSQC_WriteFrame().

◆ SND_ATTENUATION

#define SND_ATTENUATION   (1<<1)

Definition at line 190 of file protocol.h.

Referenced by CL_ParseStartSoundPacket(), SV_StartPointSound(), and SV_StartSound().

◆ SND_LARGEENTITY

#define SND_LARGEENTITY   (1<<3)

Definition at line 192 of file protocol.h.

Referenced by CL_ParseStartSoundPacket(), and SV_StartSound().

◆ SND_LARGESOUND

#define SND_LARGESOUND   (1<<4)

Definition at line 193 of file protocol.h.

Referenced by CL_ParseStartSoundPacket(), SV_StartPointSound(), and SV_StartSound().

◆ SND_LOOPING

#define SND_LOOPING   (1<<2)

Definition at line 191 of file protocol.h.

◆ SND_SPEEDUSHORT4000

#define SND_SPEEDUSHORT4000   (1<<5)

Definition at line 194 of file protocol.h.

Referenced by CL_ParseStartSoundPacket(), SV_StartPointSound(), and SV_StartSound().

◆ SND_VOLUME

#define SND_VOLUME   (1<<0)

Definition at line 189 of file protocol.h.

Referenced by CL_ParseStartSoundPacket(), SV_StartPointSound(), and SV_StartSound().

◆ SU_ARMOR

#define SU_ARMOR   (1u<<13)

Definition at line 165 of file protocol.h.

Referenced by CL_ParseClientdata(), and SV_WriteClientdataToMessage().

◆ SU_EXTEND1

#define SU_EXTEND1   (1u<<15)

Definition at line 167 of file protocol.h.

Referenced by CL_ParseClientdata(), and SV_WriteClientdataToMessage().

◆ SU_EXTEND2

#define SU_EXTEND2   (1u<<23)

another byte to follow, future expansion

Definition at line 176 of file protocol.h.

Referenced by CL_ParseClientdata(), and SV_WriteClientdataToMessage().

◆ SU_EXTEND3

#define SU_EXTEND3   (1u<<31)

another byte to follow, future expansion

Definition at line 185 of file protocol.h.

◆ SU_IDEALPITCH

#define SU_IDEALPITCH   (1u<<1)

Definition at line 153 of file protocol.h.

Referenced by CL_ParseClientdata(), and SV_WriteClientdataToMessage().

◆ SU_INWATER

#define SU_INWATER   (1u<<11)

no data follows, the bit is it

Definition at line 163 of file protocol.h.

Referenced by CL_ParseClientdata(), and SV_WriteClientdataToMessage().

◆ SU_ITEMS

#define SU_ITEMS   (1u<<9)

Definition at line 161 of file protocol.h.

Referenced by CL_ParseClientdata(), and SV_WriteClientdataToMessage().

◆ SU_ONGROUND

#define SU_ONGROUND   (1u<<10)

no data follows, the bit is it

Definition at line 162 of file protocol.h.

Referenced by CL_ParseClientdata(), and SV_WriteClientdataToMessage().

◆ SU_PUNCH1

#define SU_PUNCH1   (1u<<2)

Definition at line 154 of file protocol.h.

Referenced by CL_ParseClientdata(), and SV_WriteClientdataToMessage().

◆ SU_PUNCH2

#define SU_PUNCH2   (1u<<3)

Definition at line 155 of file protocol.h.

◆ SU_PUNCH3

#define SU_PUNCH3   (1u<<4)

Definition at line 156 of file protocol.h.

◆ SU_PUNCHVEC1

#define SU_PUNCHVEC1   (1u<<16)

Definition at line 169 of file protocol.h.

Referenced by CL_ParseClientdata(), and SV_WriteClientdataToMessage().

◆ SU_PUNCHVEC2

#define SU_PUNCHVEC2   (1u<<17)

Definition at line 170 of file protocol.h.

◆ SU_PUNCHVEC3

#define SU_PUNCHVEC3   (1u<<18)

Definition at line 171 of file protocol.h.

◆ SU_UNUSED20

#define SU_UNUSED20   (1u<<20)

Definition at line 173 of file protocol.h.

◆ SU_UNUSED21

#define SU_UNUSED21   (1u<<21)

Definition at line 174 of file protocol.h.

◆ SU_UNUSED22

#define SU_UNUSED22   (1u<<22)

Definition at line 175 of file protocol.h.

◆ SU_UNUSED24

#define SU_UNUSED24   (1u<<24)

Definition at line 178 of file protocol.h.

◆ SU_UNUSED25

#define SU_UNUSED25   (1u<<25)

Definition at line 179 of file protocol.h.

◆ SU_UNUSED26

#define SU_UNUSED26   (1u<<26)

Definition at line 180 of file protocol.h.

◆ SU_UNUSED27

#define SU_UNUSED27   (1u<<27)

Definition at line 181 of file protocol.h.

◆ SU_UNUSED28

#define SU_UNUSED28   (1u<<28)

Definition at line 182 of file protocol.h.

◆ SU_UNUSED29

#define SU_UNUSED29   (1u<<29)

Definition at line 183 of file protocol.h.

◆ SU_UNUSED30

#define SU_UNUSED30   (1u<<30)

Definition at line 184 of file protocol.h.

◆ SU_VELOCITY1

#define SU_VELOCITY1   (1u<<5)

Definition at line 157 of file protocol.h.

Referenced by CL_ParseClientdata(), and SV_WriteClientdataToMessage().

◆ SU_VELOCITY2

#define SU_VELOCITY2   (1u<<6)

Definition at line 158 of file protocol.h.

◆ SU_VELOCITY3

#define SU_VELOCITY3   (1u<<7)

Definition at line 159 of file protocol.h.

◆ SU_VIEWHEIGHT

#define SU_VIEWHEIGHT   (1u<<0)

Definition at line 152 of file protocol.h.

Referenced by CL_ParseClientdata(), and SV_WriteClientdataToMessage().

◆ SU_VIEWZOOM

#define SU_VIEWZOOM   (1u<<19)

byte factor (0 = 0.0 (not valid), 255 = 1.0)

Definition at line 172 of file protocol.h.

Referenced by CL_ParseClientdata(), and SV_WriteClientdataToMessage().

◆ SU_WEAPON

#define SU_WEAPON   (1u<<14)

Definition at line 166 of file protocol.h.

Referenced by CL_ParseClientdata(), and SV_WriteClientdataToMessage().

◆ SU_WEAPONFRAME

#define SU_WEAPONFRAME   (1u<<12)

Definition at line 164 of file protocol.h.

Referenced by CL_ParseClientdata(), and SV_WriteClientdataToMessage().

◆ svc_bad

#define svc_bad   0

Definition at line 214 of file protocol.h.

◆ svc_cdtrack

#define svc_cdtrack   32

Definition at line 259 of file protocol.h.

Referenced by CL_ParseServerMessage(), and SV_SendServerinfo().

◆ svc_centerprint

#define svc_centerprint   26

Definition at line 249 of file protocol.h.

Referenced by CL_ParseServerMessage(), and VM_SV_centerprint().

◆ svc_clientdata

#define svc_clientdata   15

Definition at line 234 of file protocol.h.

Referenced by CL_ParseServerMessage(), and SV_WriteClientdataToMessage().

◆ svc_csqcentities

#define svc_csqcentities   58

Definition at line 278 of file protocol.h.

Referenced by CL_ParseServerMessage(), and EntityFrameCSQC_WriteFrame().

◆ svc_cutscene

#define svc_cutscene   34

Definition at line 262 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ svc_damage

#define svc_damage   19

Definition at line 238 of file protocol.h.

Referenced by CL_ParseServerMessage(), and SV_WriteClientdataToMessage().

◆ svc_disconnect

#define svc_disconnect   2

Definition at line 216 of file protocol.h.

Referenced by CL_ParseServerMessage(), CL_Stop_f(), SV_DropClient(), and SV_StopDemoRecording().

◆ svc_downloaddata

#define svc_downloaddata   50

Definition at line 269 of file protocol.h.

Referenced by CL_ParseServerMessage(), MakeDownloadPacket(), and SV_SendClientDatagram().

◆ svc_effect

#define svc_effect   52

Definition at line 271 of file protocol.h.

Referenced by CL_ParseServerMessage(), and SV_StartEffect().

◆ svc_effect2

#define svc_effect2   53

Definition at line 272 of file protocol.h.

Referenced by CL_ParseServerMessage(), and SV_StartEffect().

◆ svc_entities

#define svc_entities   57

◆ svc_finale

#define svc_finale   31

Definition at line 257 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ svc_foundsecret

#define svc_foundsecret   28

Definition at line 252 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ svc_hidelmp

#define svc_hidelmp   36

Definition at line 265 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ svc_intermission

#define svc_intermission   30

Definition at line 256 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ svc_killedmonster

#define svc_killedmonster   27

Definition at line 251 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ svc_lightstyle

#define svc_lightstyle   12

Definition at line 231 of file protocol.h.

Referenced by CL_ParseServerMessage(), SV_Spawn_f(), and VM_SV_lightstyle().

◆ svc_nop

#define svc_nop   1

Definition at line 215 of file protocol.h.

Referenced by CL_ParseServerMessage(), and SV_SendClientDatagram().

◆ svc_particle

#define svc_particle   18

Definition at line 237 of file protocol.h.

Referenced by CL_ParseServerMessage(), and SV_StartParticle().

◆ svc_pointparticles

#define svc_pointparticles   61

Definition at line 281 of file protocol.h.

Referenced by CL_ParseServerMessage(), and VM_SV_pointparticles().

◆ svc_pointparticles1

#define svc_pointparticles1   62

Definition at line 282 of file protocol.h.

Referenced by CL_ParseServerMessage(), and VM_SV_pointparticles().

◆ svc_precache

#define svc_precache   54

Definition at line 274 of file protocol.h.

Referenced by CL_ParseServerMessage(), SV_ModelIndex(), and SV_SoundIndex().

◆ svc_print

#define svc_print   8

◆ svc_sellscreen

#define svc_sellscreen   33

Definition at line 260 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ svc_serverinfo

#define svc_serverinfo   11

Definition at line 227 of file protocol.h.

Referenced by CL_ParseServerMessage(), and SV_SendServerinfo().

◆ svc_setangle

#define svc_setangle   10

Definition at line 225 of file protocol.h.

Referenced by CL_ParseServerMessage(), SV_Spawn_f(), and SV_WriteClientdataToMessage().

◆ svc_setpause

#define svc_setpause   24

Definition at line 246 of file protocol.h.

Referenced by CL_ParseServerMessage(), SV_Pause_f(), and VM_SV_setpause().

◆ svc_setview

#define svc_setview   5

◆ svc_showlmp

#define svc_showlmp   35

Definition at line 264 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ svc_signonnum

#define svc_signonnum   25

Definition at line 247 of file protocol.h.

Referenced by CL_ParseServerMessage(), SV_PreSpawn_f(), SV_SendServerinfo(), and SV_Spawn_f().

◆ svc_skybox

#define svc_skybox   37

Definition at line 266 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ svc_sound

#define svc_sound   6

Definition at line 220 of file protocol.h.

Referenced by CL_ParseServerMessage(), SV_StartPointSound(), and SV_StartSound().

◆ svc_sound2

#define svc_sound2   54

Definition at line 273 of file protocol.h.

◆ svc_spawnbaseline

#define svc_spawnbaseline   22

Definition at line 242 of file protocol.h.

Referenced by CL_ParseServerMessage(), and SV_CreateBaseline().

◆ svc_spawnbaseline2

#define svc_spawnbaseline2   55

Definition at line 275 of file protocol.h.

Referenced by CL_ParseServerMessage(), and SV_CreateBaseline().

◆ svc_spawnstatic

#define svc_spawnstatic   20

Definition at line 240 of file protocol.h.

Referenced by CL_ParseServerMessage(), and VM_SV_makestatic().

◆ svc_spawnstatic2

#define svc_spawnstatic2   56

Definition at line 276 of file protocol.h.

Referenced by CL_ParseServerMessage(), and VM_SV_makestatic().

◆ svc_spawnstaticsound

#define svc_spawnstaticsound   29

Definition at line 254 of file protocol.h.

Referenced by CL_ParseServerMessage(), and VM_SV_ambientsound().

◆ svc_spawnstaticsound2

#define svc_spawnstaticsound2   59

Definition at line 279 of file protocol.h.

Referenced by CL_ParseServerMessage(), and VM_SV_ambientsound().

◆ svc_stopsound

#define svc_stopsound   16

Definition at line 235 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ svc_stufftext

◆ svc_temp_entity

◆ svc_time

#define svc_time   7

Definition at line 221 of file protocol.h.

Referenced by CL_ParseServerMessage(), SV_SendClientDatagram(), and SV_Spawn_f().

◆ svc_trailparticles

#define svc_trailparticles   60

Definition at line 280 of file protocol.h.

Referenced by CL_ParseServerMessage(), and VM_SV_trailparticles().

◆ svc_updatecolors

#define svc_updatecolors   17

◆ svc_updatefrags

#define svc_updatefrags   14

◆ svc_updatename

#define svc_updatename   13

Definition at line 232 of file protocol.h.

Referenced by CL_ParseServerMessage(), SV_DropClient(), SV_Name(), and SV_Spawn_f().

◆ svc_updatestat

#define svc_updatestat   3

◆ svc_updatestatubyte

#define svc_updatestatubyte   51

Definition at line 270 of file protocol.h.

Referenced by CL_ParseServerMessage(), and EntityFrame5_WriteFrame().

◆ svc_version

#define svc_version   4

Definition at line 218 of file protocol.h.

Referenced by CL_ParseServerMessage().

◆ TE_BEAM

#define TE_BEAM   13

Definition at line 323 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_beam().

◆ TE_BLOOD

#define TE_BLOOD   50

Definition at line 331 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_blood().

◆ TE_BLOODSHOWER

#define TE_BLOODSHOWER   52

Definition at line 333 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_bloodshower().

◆ TE_CUSTOMFLASH

#define TE_CUSTOMFLASH   73

Definition at line 345 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_customflash().

◆ TE_EXPLOSION

#define TE_EXPLOSION   3

Definition at line 311 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_explosion().

◆ TE_EXPLOSION2

#define TE_EXPLOSION2   12

Definition at line 320 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_explosion2().

◆ TE_EXPLOSION3

#define TE_EXPLOSION3   16

Definition at line 327 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ TE_EXPLOSIONQUAD

#define TE_EXPLOSIONQUAD   70

Definition at line 342 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_explosionquad().

◆ TE_EXPLOSIONRGB

#define TE_EXPLOSIONRGB   53

Definition at line 334 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_explosionrgb().

◆ TE_FLAMEJET

#define TE_FLAMEJET   74

Definition at line 346 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_flamejet().

◆ TE_GUNSHOT

#define TE_GUNSHOT   2

Definition at line 310 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_gunshot().

◆ TE_GUNSHOTQUAD

#define TE_GUNSHOTQUAD   57

Definition at line 338 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_gunshotquad().

◆ TE_KNIGHTSPIKE

#define TE_KNIGHTSPIKE   8

Definition at line 316 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_knightspike().

◆ TE_LAVASPLASH

#define TE_LAVASPLASH   10

Definition at line 318 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_lavasplash().

◆ TE_LIGHTNING1

#define TE_LIGHTNING1   5

Definition at line 313 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_lightning1().

◆ TE_LIGHTNING2

#define TE_LIGHTNING2   6

Definition at line 314 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_lightning2().

◆ TE_LIGHTNING3

#define TE_LIGHTNING3   9

Definition at line 317 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_lightning3().

◆ TE_LIGHTNING4NEH

#define TE_LIGHTNING4NEH   17

Definition at line 328 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ TE_PARTICLECUBE

#define TE_PARTICLECUBE   54

Definition at line 335 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_particlecube().

◆ TE_PARTICLERAIN

#define TE_PARTICLERAIN   55

Definition at line 336 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_particlerain().

◆ TE_PARTICLESNOW

#define TE_PARTICLESNOW   56

Definition at line 337 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_particlesnow().

◆ TE_PLASMABURN

#define TE_PLASMABURN   75

Definition at line 347 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_plasmaburn().

◆ TE_SMALLFLASH

#define TE_SMALLFLASH   72

Definition at line 344 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_smallflash().

◆ TE_SPARK

#define TE_SPARK   51

Definition at line 332 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_spark().

◆ TE_SPIKE

#define TE_SPIKE   0

Definition at line 308 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_spike().

◆ TE_SPIKEQUAD

#define TE_SPIKEQUAD   58

Definition at line 339 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_spikequad().

◆ TE_SUPERSPIKE

#define TE_SUPERSPIKE   1

Definition at line 309 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_superspike().

◆ TE_SUPERSPIKEQUAD

#define TE_SUPERSPIKEQUAD   59

Definition at line 340 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_superspikequad().

◆ TE_TAREXPLOSION

#define TE_TAREXPLOSION   4

Definition at line 312 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_tarexplosion().

◆ TE_TEI_BIGEXPLOSION

#define TE_TEI_BIGEXPLOSION   78

Definition at line 351 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ TE_TEI_G3

#define TE_TEI_G3   76

Definition at line 349 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ TE_TEI_PLASMAHIT

#define TE_TEI_PLASMAHIT   79

Definition at line 352 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ TE_TEI_SMOKE

#define TE_TEI_SMOKE   77

Definition at line 350 of file protocol.h.

Referenced by CL_ParseTempEntity().

◆ TE_TELEPORT

#define TE_TELEPORT   11

Definition at line 319 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_teleport().

◆ TE_UNUSED1

#define TE_UNUSED1   71

Definition at line 343 of file protocol.h.

◆ TE_WIZSPIKE

#define TE_WIZSPIKE   7

Definition at line 315 of file protocol.h.

Referenced by CL_ParseTempEntity(), and VM_SV_te_wizspike().

◆ U_ALPHA

#define U_ALPHA   (1u<<17)

1 byte, 0.0-1.0 maps to 0-255, not sent if exactly 1, and the entity is not sent if <=0 unless it has effects (model effects are checked as well)

Definition at line 134 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_ANGLE1

#define U_ANGLE1   (1u<<8)

Definition at line 122 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_ANGLE2

#define U_ANGLE2   (1u<<4)

Definition at line 115 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_ANGLE3

#define U_ANGLE3   (1u<<9)

Definition at line 123 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_COLORMAP

#define U_COLORMAP   (1u<<11)

Definition at line 125 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_COLORMOD

#define U_COLORMOD   (1u<<22)

1 byte, 3 bit red, 3 bit green, 2 bit blue, this lets you tint an object artifically, so you could make a red rocket, or a blue fiend...

Definition at line 139 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_DELTA

#define U_DELTA   (1u<<16)

no data, while this is set the entity is delta compressed (uses previous frame as a baseline, meaning only things that have changed from the previous frame are sent, except for the forced full update every half second)

Definition at line 133 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity().

◆ U_EFFECTS

#define U_EFFECTS   (1u<<13)

Definition at line 127 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_EFFECTS2

#define U_EFFECTS2   (1u<<19)

1 byte, this is .effects & 0xFF00 (second byte)

Definition at line 136 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_EXTEND1

#define U_EXTEND1   (1u<<15)

Definition at line 131 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_EXTEND2

#define U_EXTEND2   (1u<<23)

another byte to follow

Definition at line 140 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_EXTEND3

#define U_EXTEND3   (1u<<31)

another byte to follow, future expansion

Definition at line 149 of file protocol.h.

◆ U_EXTERIORMODEL

#define U_EXTERIORMODEL   (1u<<28)

causes this model to not be drawn when using a first person view (third person will draw it, first person will not)

Definition at line 146 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_FRAME

#define U_FRAME   (1u<<6)

Definition at line 118 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_FRAME2

#define U_FRAME2   (1u<<26)

1 byte, this is .frame & 0xFF00 (second byte)

Definition at line 144 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_GLOWCOLOR

#define U_GLOWCOLOR   (1u<<21)

1 byte, palette index, default is 254 (white), this IS used for darklight (allowing colored darklight), however the particles from a darklight are always black, not sent if default value (even if glowsize or glowtrail is set)

Definition at line 138 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_GLOWSIZE

#define U_GLOWSIZE   (1u<<20)

1 byte, encoding is float/4.0, unsigned, not sent if 0

Definition at line 137 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_GLOWTRAIL

#define U_GLOWTRAIL   (1u<<24)

leaves a trail of particles (of color .glowcolor, or black if it is a negative glowsize)

Definition at line 142 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_LONGENTITY

#define U_LONGENTITY   (1u<<14)

Definition at line 128 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_MODEL

#define U_MODEL   (1u<<10)

Definition at line 124 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_MODEL2

#define U_MODEL2   (1u<<27)

1 byte, this is .modelindex & 0xFF00 (second byte)

Definition at line 145 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_MOREBITS

#define U_MOREBITS   (1u<<0)

Definition at line 111 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_ORIGIN1

#define U_ORIGIN1   (1u<<1)

Definition at line 112 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_ORIGIN2

#define U_ORIGIN2   (1u<<2)

Definition at line 113 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_ORIGIN3

#define U_ORIGIN3   (1u<<3)

Definition at line 114 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_SCALE

#define U_SCALE   (1u<<18)

1 byte, scale / 16 positive, not sent if 1.0

Definition at line 135 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_SIGNAL

#define U_SIGNAL   (1u<<7)

Definition at line 120 of file protocol.h.

Referenced by EntityFrameQuake_WriteFrame().

◆ U_SKIN

#define U_SKIN   (1u<<12)

Definition at line 126 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_STEP

#define U_STEP   (1u<<5)

Definition at line 117 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

◆ U_UNUSED29

#define U_UNUSED29   (1u<<29)

future expansion

Definition at line 147 of file protocol.h.

◆ U_UNUSED30

#define U_UNUSED30   (1u<<30)

future expansion

Definition at line 148 of file protocol.h.

◆ U_VIEWMODEL

#define U_VIEWMODEL   (1u<<25)

attachs the model to the view (origin and angles become relative to it), only shown to owner, a more powerful alternative to .weaponmodel and such

Definition at line 143 of file protocol.h.

Referenced by EntityFrameQuake_ReadEntity(), and EntityFrameQuake_WriteFrame().

Enumeration Type Documentation

◆ entity_state_active_t

Enumerator
ACTIVE_NOT 
ACTIVE_NETWORK 
ACTIVE_SHARED 

Definition at line 430 of file protocol.h.

431{
432 ACTIVE_NOT = 0,
433 ACTIVE_NETWORK = 1,
434 ACTIVE_SHARED = 2
435}
@ ACTIVE_SHARED
Definition protocol.h:434
@ ACTIVE_NETWORK
Definition protocol.h:433
@ ACTIVE_NOT
Definition protocol.h:432

Function Documentation

◆ EntityFrame4_AckFrame()

int EntityFrame4_AckFrame ( entityframe4_database_t * d,
int framenum,
int servermode )

Definition at line 74 of file com_ents4.c.

75{
76 int i, j, found;
78 if (framenum == -1)
79 {
80 // reset reference, but leave commits alone
81 d->referenceframenum = -1;
82 for (i = 0;i < d->maxreferenceentities;i++)
84 // if this is the server, remove commits
85 for (i = 0, commit = d->commit;i < MAX_ENTITY_HISTORY;i++, commit++)
86 commit->numentities = 0;
87 found = true;
88 }
89 else if (d->referenceframenum == framenum)
90 found = true;
91 else
92 {
93 found = false;
94 for (i = 0, commit = d->commit;i < MAX_ENTITY_HISTORY;i++, commit++)
95 {
96 if (commit->numentities && commit->framenum <= framenum)
97 {
98 if (commit->framenum == framenum)
99 {
100 found = true;
101 d->referenceframenum = framenum;
103 {
104 for (j = 0;j < commit->numentities;j++)
105 {
107 if (commit->entity[j].active != s->active)
108 {
109 if (commit->entity[j].active == ACTIVE_NETWORK)
110 Con_Printf("commit entity %i has become active (modelindex %i)\n", commit->entity[j].number, commit->entity[j].modelindex);
111 else
112 Con_Printf("commit entity %i has become inactive (modelindex %i)\n", commit->entity[j].number, commit->entity[j].modelindex);
113 }
114 *s = commit->entity[j];
115 }
116 }
117 else
118 for (j = 0;j < commit->numentities;j++)
119 *EntityFrame4_GetReferenceEntity(d, commit->entity[j].number) = commit->entity[j];
120 }
121 commit->numentities = 0;
122 }
123 }
124 }
126 {
127 Con_Printf("ack ref:%i database updated to: ref:%i commits:", framenum, d->referenceframenum);
128 for (i = 0;i < MAX_ENTITY_HISTORY;i++)
129 if (d->commit[i].numentities)
130 Con_Printf(" %i", d->commit[i].framenum);
131 Con_Print("\n");
132 }
133 return found;
134}
cvar_t developer_networkentities
Definition cl_parse.c:173
entity_state_t * EntityFrame4_GetReferenceEntity(entityframe4_database_t *d, int number)
Definition com_ents4.c:34
void Con_Print(const char *msg)
Prints to all appropriate console targets, and adds timestamps.
Definition console.c:1504
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
Definition console.c:1514
entity_state_t defaultstate
Definition protocol.c:4
#define MAX_ENTITY_HISTORY
Definition protocol.h:553
int i
int integer
Definition cvar.h:73
entity_state_t * entity
Definition protocol.h:697
unsigned short modelindex
Definition protocol.h:449
unsigned char active
Definition protocol.h:459
unsigned short number
Definition protocol.h:448
entity_database4_commit_t commit[MAX_ENTITY_HISTORY]
Definition protocol.h:713
entity_state_t * referenceentity
Definition protocol.h:710

References entity_state_t::active, ACTIVE_NETWORK, entityframe4_database_t::commit, Con_Print(), Con_Printf(), defaultstate, developer_networkentities, entity_database4_commit_t::entity, EntityFrame4_GetReferenceEntity(), entity_database4_commit_t::framenum, i, cvar_t::integer, MAX_ENTITY_HISTORY, entityframe4_database_t::maxreferenceentities, entity_state_t::modelindex, entity_state_t::number, entity_database4_commit_t::numentities, entityframe4_database_t::referenceentity, and entityframe4_database_t::referenceframenum.

Referenced by EntityFrame4_CL_ReadFrame(), and SV_FrameAck().

◆ EntityFrame4_AddCommitEntity()

void EntityFrame4_AddCommitEntity ( entityframe4_database_t * d,
const entity_state_t * s )

Definition at line 57 of file com_ents4.c.

58{
59 // resize commit's entity list if full
61 {
62 entity_state_t *oldentity = d->currentcommit->entity;
65 if (oldentity)
66 {
67 memcpy(d->currentcommit->entity, oldentity, d->currentcommit->numentities * sizeof(*d->currentcommit->entity));
68 Mem_Free(oldentity);
69 }
70 }
72}
entity_database4_commit_t * currentcommit
Definition protocol.h:715
struct mempool_s * mempool
Definition protocol.h:704
#define Mem_Free(mem)
Definition zone.h:96
#define Mem_Alloc(pool, size)
Definition zone.h:92

References entityframe4_database_t::currentcommit, entity_database4_commit_t::entity, entity_database4_commit_t::maxentities, Mem_Alloc, Mem_Free, entityframe4_database_t::mempool, and entity_database4_commit_t::numentities.

Referenced by EntityFrame4_CL_ReadFrame(), and EntityFrame4_WriteFrame().

◆ EntityFrame4_AllocDatabase()

entityframe4_database_t * EntityFrame4_AllocDatabase ( struct mempool_s * pool)

◆ EntityFrame4_CL_ReadFrame()

void EntityFrame4_CL_ReadFrame ( void )

Definition at line 4 of file cl_ents4.c.

5{
6 int i, n, cnumber, referenceframenum, framenum, enumber, done, stopnumber, skip = false;
12 // read the number of the frame this refers to
13 referenceframenum = MSG_ReadLong(&cl_message);
14 // read the number of this frame
15 framenum = MSG_ReadLong(&cl_message);
16 CL_NewFrameReceived(framenum);
17 // read the start number
18 enumber = (unsigned short) MSG_ReadShort(&cl_message);
20 {
21 Con_Printf("recv svc_entities num:%i ref:%i database: ref:%i commits:", framenum, referenceframenum, d->referenceframenum);
22 for (i = 0;i < MAX_ENTITY_HISTORY;i++)
23 if (d->commit[i].numentities)
24 Con_Printf(" %i", d->commit[i].framenum);
25 Con_Print("\n");
26 }
27 if (!EntityFrame4_AckFrame(d, referenceframenum, false))
28 {
29 Con_Print("EntityFrame4_CL_ReadFrame: reference frame invalid (VERY BAD ERROR), this update will be skipped\n");
30 skip = true;
31 }
33 for (i = 0;i < MAX_ENTITY_HISTORY;i++)
34 {
35 if (!d->commit[i].numentities)
36 {
37 d->currentcommit = d->commit + i;
38 d->currentcommit->framenum = framenum;
40 }
41 }
42 if (d->currentcommit == NULL)
43 {
44 Con_Printf("EntityFrame4_CL_ReadFrame: error while decoding frame %i: database full, reading but not storing this update\n", framenum);
45 skip = true;
46 }
47 done = false;
48 while (!done && !cl_message.badread)
49 {
50 // read the number of the modified entity
51 // (gaps will be copied unmodified)
52 n = (unsigned short)MSG_ReadShort(&cl_message);
53 if (n == 0x8000)
54 {
55 // no more entities in this update, but we still need to copy the
56 // rest of the reference entities (final gap)
57 done = true;
58 // read end of range number, then process normally
59 n = (unsigned short)MSG_ReadShort(&cl_message);
60 }
61 // high bit means it's a remove message
62 cnumber = n & 0x7FFF;
63 // if this is a live entity we may need to expand the array
64 if (cl.num_entities <= cnumber && !(n & 0x8000))
65 {
66 cl.num_entities = cnumber + 1;
67 if (cnumber >= cl.max_entities)
68 CL_ExpandEntities(cnumber);
69 }
70 // add one (the changed one) if not done
71 stopnumber = cnumber + !done;
72 // process entities in range from the last one to the changed one
73 for (;enumber < stopnumber;enumber++)
74 {
75 if (skip || enumber >= cl.num_entities)
76 {
77 if (enumber == cnumber && (n & 0x8000) == 0)
78 {
79 entity_state_t tempstate;
81 }
82 continue;
83 }
84 // slide the current into the previous slot
86 // copy a new current from reference database
88 s = &cl.entities[enumber].state_current;
89 // if this is the one to modify, read more data...
90 if (enumber == cnumber)
91 {
92 if (n & 0x8000)
93 {
94 // simply removed
96 Con_Printf("entity %i: remove\n", enumber);
97 *s = defaultstate;
98 }
99 else
100 {
101 // read the changes
103 Con_Printf("entity %i: update\n", enumber);
106 }
107 }
109 Con_Printf("entity %i: copy\n", enumber);
110 // set the cl.entities_active flag
111 cl.entities_active[enumber] = (s->active == ACTIVE_NETWORK);
112 // set the update time
113 s->time = cl.mtime[0];
114 // fix the number (it gets wiped occasionally by copying from defaultstate)
115 s->number = enumber;
116 // check if we need to update the lerp stuff
117 if (s->active == ACTIVE_NETWORK)
119 // add this to the commit entry whether it is modified or not
120 if (d->currentcommit)
122 // print extra messages if desired
124 {
126 Con_Printf("entity #%i has become active\n", enumber);
127 else if (cl.entities[enumber].state_previous.active)
128 Con_Printf("entity #%i has become inactive\n", enumber);
129 }
130 }
131 }
132 d->currentcommit = NULL;
133 if (skip)
135}
void EntityState_ReadFields(entity_state_t *e, unsigned int bits)
Definition cl_ents.c:21
int EntityState_ReadExtendBits(void)
Definition cl_ents.c:4
void CL_NewFrameReceived(int num)
Definition cl_input.c:1737
client_state_t cl
Definition cl_main.c:117
client_static_t cls
Definition cl_main.c:116
void CL_ExpandEntities(int num)
Definition cl_main.c:300
void CL_MoveLerpEntityStates(entity_t *ent)
Definition cl_parse.c:1991
int EntityFrame4_AckFrame(entityframe4_database_t *d, int framenum, int servermode)
Definition com_ents4.c:74
entityframe4_database_t * EntityFrame4_AllocDatabase(mempool_t *pool)
Definition com_ents4.c:4
void EntityFrame4_ResetDatabase(entityframe4_database_t *d)
Definition com_ents4.c:24
void EntityFrame4_AddCommitEntity(entityframe4_database_t *d, const entity_state_t *s)
Definition com_ents4.c:57
#define MSG_ReadShort
Definition common.h:191
#define MSG_ReadLong
Definition common.h:192
#define n(x, y)
sizebuf_t cl_message
Definition netconn.c:71
#define NULL
Definition qtypes.h:12
unsigned char * entities_active
Definition client.h:993
entity_t * entities
Definition client.h:991
int max_entities
Definition client.h:980
double mtime[2]
Definition client.h:861
entityframe4_database_t * entitydatabase4
Definition client.h:964
mempool_t * levelmempool
Definition client.h:571
entity_state_t state_current
Definition client.h:471
entity_state_t state_previous
Definition client.h:469
qbool badread
Definition common.h:56

References entity_state_t::active, ACTIVE_NETWORK, sizebuf_t::badread, cl, CL_ExpandEntities(), cl_message, CL_MoveLerpEntityStates(), CL_NewFrameReceived(), cls, entityframe4_database_t::commit, Con_Print(), Con_Printf(), entityframe4_database_t::currentcommit, defaultstate, developer_networkentities, client_state_t::entities, client_state_t::entities_active, client_state_t::entitydatabase4, EntityFrame4_AckFrame(), EntityFrame4_AddCommitEntity(), EntityFrame4_AllocDatabase(), EntityFrame4_GetReferenceEntity(), EntityFrame4_ResetDatabase(), EntityState_ReadExtendBits(), EntityState_ReadFields(), entity_database4_commit_t::framenum, i, cvar_t::integer, client_static_t::levelmempool, client_state_t::max_entities, MAX_ENTITY_HISTORY, MSG_ReadLong, MSG_ReadShort, client_state_t::mtime, n, NULL, client_state_t::num_entities, entity_state_t::number, entity_database4_commit_t::numentities, entityframe4_database_t::referenceframenum, entity_t::state_current, entity_t::state_previous, and entity_state_t::time.

Referenced by CL_ParseServerMessage().

◆ EntityFrame4_FreeDatabase()

void EntityFrame4_FreeDatabase ( entityframe4_database_t * d)

◆ EntityFrame4_GetReferenceEntity()

entity_state_t * EntityFrame4_GetReferenceEntity ( entityframe4_database_t * d,
int number )

Definition at line 34 of file com_ents4.c.

35{
36 if (d->maxreferenceentities <= number)
37 {
38 int oldmax = d->maxreferenceentities;
39 entity_state_t *oldentity = d->referenceentity;
40 d->maxreferenceentities = (number + 15) & ~7;
42 if (oldentity)
43 {
44 memcpy(d->referenceentity, oldentity, oldmax * sizeof(*d->referenceentity));
45 Mem_Free(oldentity);
46 }
47 // clear the newly created entities
48 for (;oldmax < d->maxreferenceentities;oldmax++)
49 {
50 d->referenceentity[oldmax] = defaultstate;
51 d->referenceentity[oldmax].number = oldmax;
52 }
53 }
54 return d->referenceentity + number;
55}

References defaultstate, entityframe4_database_t::maxreferenceentities, Mem_Alloc, Mem_Free, entityframe4_database_t::mempool, entity_state_t::number, and entityframe4_database_t::referenceentity.

Referenced by EntityFrame4_AckFrame(), EntityFrame4_CL_ReadFrame(), and EntityFrame4_WriteFrame().

◆ EntityFrame4_ResetDatabase()

◆ EntityFrame4_WriteFrame()

qbool EntityFrame4_WriteFrame ( struct sizebuf_s * msg,
int maxsize,
entityframe4_database_t * d,
int numstates,
const entity_state_t ** states )

◆ EntityFrame5_AckFrame()

void EntityFrame5_AckFrame ( entityframe5_database_t * d,
int framenum )

Definition at line 684 of file sv_ents5.c.

685{
686 int i;
687 // scan for packets made obsolete by this ack and delete them
688 for (i = 0;i < ENTITYFRAME5_MAXPACKETLOGS;i++)
689 if (d->packetlog[i].packetnumber <= framenum)
690 d->packetlog[i].packetnumber = 0;
691}
#define ENTITYFRAME5_MAXPACKETLOGS
Definition protocol.h:826
entityframe5_packetlog_t packetlog[ENTITYFRAME5_MAXPACKETLOGS]
Definition protocol.h:854

References ENTITYFRAME5_MAXPACKETLOGS, i, entityframe5_database_t::packetlog, and entityframe5_packetlog_t::packetnumber.

Referenced by SV_FrameAck().

◆ EntityFrame5_AllocDatabase()

entityframe5_database_t * EntityFrame5_AllocDatabase ( struct mempool_s * pool)

Referenced by SV_SendServerinfo().

◆ EntityFrame5_CL_ReadFrame()

void EntityFrame5_CL_ReadFrame ( void )

Definition at line 289 of file cl_ents5.c.

290{
291 int n, enumber, framenum;
292 entity_t *ent;
294 // read the number of this frame to echo back in next input packet
295 framenum = MSG_ReadLong(&cl_message);
296 CL_NewFrameReceived(framenum);
299 // read entity numbers until we find a 0x8000
300 // (which would be remove world entity, but is actually a terminator)
301 while ((n = (unsigned short)MSG_ReadShort(&cl_message)) != 0x8000 && !cl_message.badread)
302 {
303 // get the entity number
304 enumber = n & 0x7FFF;
305 // we may need to expand the array
306 if (cl.num_entities <= enumber)
307 {
308 cl.num_entities = enumber + 1;
309 if (enumber >= cl.max_entities)
310 CL_ExpandEntities(enumber);
311 }
312 // look up the entity
313 ent = cl.entities + enumber;
314 // slide the current into the previous slot
315 ent->state_previous = ent->state_current;
316 // read the update
317 s = &ent->state_current;
318 if (n & 0x8000)
319 {
320 // remove entity
321 *s = defaultstate;
322 }
323 else
324 {
325 // update entity
326 EntityState5_ReadUpdate(s, enumber);
327 }
328 // set the cl.entities_active flag
329 cl.entities_active[enumber] = (s->active == ACTIVE_NETWORK);
330 // set the update time
331 s->time = cl.mtime[0];
332 // fix the number (it gets wiped occasionally by copying from defaultstate)
333 s->number = enumber;
334 // check if we need to update the lerp stuff
335 if (s->active == ACTIVE_NETWORK)
337 // print extra messages if desired
339 {
341 Con_Printf("entity #%i has become active\n", enumber);
342 else if (cl.entities[enumber].state_previous.active)
343 Con_Printf("entity #%i has become inactive\n", enumber);
344 }
345 }
346}
static void EntityState5_ReadUpdate(entity_state_t *s, int number)
Definition cl_ents5.c:4
@ PROTOCOL_DARKPLACES2
various changes
Definition common.h:140
@ PROTOCOL_DARKPLACES4
various changes
Definition common.h:138
@ PROTOCOL_DARKPLACES3
uses EntityFrame4 entity snapshot encoder/decoder which is broken, this attempted to do partial snaps...
Definition common.h:139
@ PROTOCOL_DARKPLACES5
uses EntityFrame5 entity snapshot encoder/decoder which is based on a Tribes networking article at ht...
Definition common.h:137
@ PROTOCOL_QUAKEDP
darkplaces extended quake protocol (used by TomazQuake and others), backwards compatible as long as n...
Definition common.h:142
@ PROTOCOL_DARKPLACES6
various changes
Definition common.h:136
@ PROTOCOL_QUAKE
quake (aka netquake/normalquake/nq) protocol
Definition common.h:144
@ PROTOCOL_NEHAHRAMOVIE
Nehahra movie protocol, a big nasty hack dating back to early days of the Quake Standards Group (but ...
Definition common.h:143
@ PROTOCOL_DARKPLACES1
uses EntityFrame entity snapshot encoder/decoder which is a QuakeWorld-like entity snapshot delta com...
Definition common.h:141
unsigned int servermovesequence
Definition client.h:637
protocolversion_t protocol
Definition client.h:617

References entity_state_t::active, ACTIVE_NETWORK, sizebuf_t::badread, cl, CL_ExpandEntities(), cl_message, CL_MoveLerpEntityStates(), CL_NewFrameReceived(), cls, Con_Printf(), defaultstate, developer_networkentities, client_state_t::entities, client_state_t::entities_active, EntityState5_ReadUpdate(), cvar_t::integer, client_state_t::max_entities, MSG_ReadLong, MSG_ReadShort, client_state_t::mtime, n, client_state_t::num_entities, entity_state_t::number, client_static_t::protocol, PROTOCOL_DARKPLACES1, PROTOCOL_DARKPLACES2, PROTOCOL_DARKPLACES3, PROTOCOL_DARKPLACES4, PROTOCOL_DARKPLACES5, PROTOCOL_DARKPLACES6, PROTOCOL_NEHAHRAMOVIE, PROTOCOL_QUAKE, PROTOCOL_QUAKEDP, client_static_t::servermovesequence, entity_t::state_current, entity_t::state_previous, and entity_state_t::time.

Referenced by CL_ParseServerMessage().

◆ EntityFrame5_FreeDatabase()

void EntityFrame5_FreeDatabase ( entityframe5_database_t * d)

Definition at line 29 of file sv_ents5.c.

30{
31 // all the [maxedicts] memory is allocated at once, so there's only one
32 // thing to free
33 if (d->maxedicts)
35 Mem_Free(d);
36}

References entityframe5_database_t::deltabits, entityframe5_database_t::maxedicts, and Mem_Free.

Referenced by SV_DropClient(), and SV_SendServerinfo().

◆ EntityFrame5_LostFrame()

void EntityFrame5_LostFrame ( entityframe5_database_t * d,
int framenum )

Definition at line 623 of file sv_ents5.c.

624{
625 int i, j, l, bits;
628 static unsigned char statsdeltabits[(MAX_CL_STATS+7)/8];
629 static int deltabits[MAX_EDICTS];
631
632 for (i = 0, p = d->packetlog;i < ENTITYFRAME5_MAXPACKETLOGS;i++, p++)
633 packetlogs[i] = p;
634 qsort(packetlogs, sizeof(*packetlogs), ENTITYFRAME5_MAXPACKETLOGS, packetlog5cmp);
635
636 memset(deltabits, 0, sizeof(deltabits));
637 memset(statsdeltabits, 0, sizeof(statsdeltabits));
638 for (i = 0; i < ENTITYFRAME5_MAXPACKETLOGS; i++)
639 {
640 p = packetlogs[i];
641
642 if (!p->packetnumber)
643 continue;
644
645 if (p->packetnumber <= framenum)
646 {
647 for (j = 0, s = p->states;j < p->numstates;j++, s++)
648 deltabits[s->number] |= s->bits;
649
650 for (l = 0;l < (MAX_CL_STATS+7)/8;l++)
651 statsdeltabits[l] |= p->statsdeltabits[l];
652
653 p->packetnumber = 0;
654 }
655 else
656 {
657 for (j = 0, s = p->states;j < p->numstates;j++, s++)
658 deltabits[s->number] &= ~s->bits;
659 for (l = 0;l < (MAX_CL_STATS+7)/8;l++)
660 statsdeltabits[l] &= ~p->statsdeltabits[l];
661 }
662 }
663
664 for(i = 0; i < d->maxedicts; ++i)
665 {
666 bits = deltabits[i] & ~d->deltabits[i];
667 if(bits)
668 {
669 d->deltabits[i] |= bits;
670 // if it was a very important update, set priority higher
672 d->priorities[i] = max(d->priorities[i], 4);
673 else
674 d->priorities[i] = max(d->priorities[i], 1);
675 }
676 }
677
678 for (l = 0;l < (MAX_CL_STATS+7)/8;l++)
679 host_client->statsdeltabits[l] |= statsdeltabits[l];
680 // no need to mask out the already-set bits here, as we do not
681 // do that priorities stuff
682}
#define max(A, B)
Definition mathlib.h:38
#define E5_ATTACHMENT
short = s->tagentity byte = s->tagindex
Definition protocol.h:784
#define E5_MODEL
E5_MODEL16=0: byte = s->modelindex E5_MODEL16=1: short = s->modelindex.
Definition protocol.h:751
#define E5_COLORMAP
byte = s->colormap
Definition protocol.h:778
#define E5_FULLUPDATE
reset all entity fields (typically used if status changed)
Definition protocol.h:742
#define MAX_EDICTS
max number of objects in game world at once (32768 protocol limit)
Definition qdefs.h:105
#define MAX_CL_STATS
Definition qstats.h:7
client_t * host_client
Definition sv_main.c:29
unsigned char statsdeltabits[(MAX_CL_STATS+7)/8]
Definition server.h:277
unsigned char * priorities
Definition protocol.h:863
unsigned char statsdeltabits[(MAX_CL_STATS+7)/8]
Definition protocol.h:842
entityframe5_changestate_t states[ENTITYFRAME5_MAXSTATES]
Definition protocol.h:841
static int packetlog5cmp(const void *a_, const void *b_)
Definition sv_ents5.c:616

References entityframe5_changestate_t::bits, entityframe5_database_t::deltabits, E5_ATTACHMENT, E5_COLORMAP, E5_FULLUPDATE, E5_MODEL, ENTITYFRAME5_MAXPACKETLOGS, host_client, i, max, MAX_CL_STATS, MAX_EDICTS, entityframe5_database_t::maxedicts, entityframe5_changestate_t::number, entityframe5_database_t::packetlog, packetlog5cmp(), entityframe5_packetlog_t::packetnumber, entityframe5_database_t::priorities, entityframe5_packetlog_t::states, client_t::statsdeltabits, and entityframe5_packetlog_t::statsdeltabits.

Referenced by EntityFrame5_WriteFrame(), and SV_FrameLost().

◆ EntityFrame5_WriteFrame()

qbool EntityFrame5_WriteFrame ( struct sizebuf_s * msg,
int maxsize,
entityframe5_database_t * d,
int numstates,
const entity_state_t ** states,
int viewentnum,
unsigned int movesequence,
qbool need_empty )

◆ EntityFrame_AckFrame()

void EntityFrame_AckFrame ( entityframe_database_t * d,
int frame )

Definition at line 35 of file com_ents.c.

36{
37 int i;
38 d->ackframenum = frame;
39 for (i = 0;i < d->numframes && d->frames[i].framenum < frame;i++);
40 // ignore outdated frame acks (out of order packets)
41 if (i == 0)
42 return;
43 d->numframes -= i;
44 // if some queue is left, slide it down to beginning of array
45 if (d->numframes)
46 memmove(&d->frames[0], &d->frames[i], sizeof(d->frames[0]) * d->numframes);
47}
float frame
entity_frameinfo_t frames[MAX_ENTITY_HISTORY]
Definition protocol.h:596

References entityframe_database_t::ackframenum, frame, entity_frameinfo_t::framenum, entityframe_database_t::frames, i, and entityframe_database_t::numframes.

Referenced by EntityFrame_CL_ReadFrame(), and SV_FrameAck().

◆ EntityFrame_AddFrame_Client()

void EntityFrame_AddFrame_Client ( entityframe_database_t * d,
vec3_t eye,
int framenum,
int numentities,
const entity_state_t * entitydata )

Definition at line 168 of file cl_ents.c.

169{
170 int n, e;
171 entity_frameinfo_t *info;
172
173 VectorCopy(eye, d->eye);
174
175 // figure out how many entity slots are used already
176 if (d->numframes)
177 {
178 n = d->frames[d->numframes - 1].endentity - d->frames[0].firstentity;
179 if (n + numentities > MAX_ENTITY_DATABASE || d->numframes >= MAX_ENTITY_HISTORY)
180 {
181 // ran out of room, dump database
183 }
184 }
185
186 info = &d->frames[d->numframes];
187 info->framenum = framenum;
188 e = -1000;
189 // make sure we check the newly added frame as well, but we haven't incremented numframes yet
190 for (n = 0;n <= d->numframes;n++)
191 {
192 if (e >= d->frames[n].framenum)
193 {
194 if (e == framenum)
195 Con_Print("EntityFrame_AddFrame: tried to add out of sequence frame to database\n");
196 else
197 Con_Print("EntityFrame_AddFrame: out of sequence frames in database\n");
198 return;
199 }
200 e = d->frames[n].framenum;
201 }
202 // if database still has frames after that...
203 if (d->numframes)
204 info->firstentity = d->frames[d->numframes - 1].endentity;
205 else
206 info->firstentity = 0;
207 info->endentity = info->firstentity + numentities;
208 d->numframes++;
209
212 if (e > numentities)
213 e = numentities;
214 memcpy(d->entitydata + n, entitydata, sizeof(entity_state_t) * e);
215 if (numentities > e)
216 memcpy(d->entitydata, entitydata + e, sizeof(entity_state_t) * (numentities - e));
217}
void EntityFrame_ClearDatabase(entityframe_database_t *d)
Definition com_ents.c:17
#define VectorCopy(in, out)
Definition mathlib.h:101
#define MAX_ENTITY_DATABASE
Definition protocol.h:554
entity_state_t entitydata[MAX_ENTITY_DATABASE]
Definition protocol.h:598

References Con_Print(), entity_frameinfo_t::endentity, entityframe_database_t::entitydata, EntityFrame_ClearDatabase(), entityframe_database_t::eye, entity_frameinfo_t::firstentity, entity_frameinfo_t::framenum, entityframe_database_t::frames, MAX_ENTITY_DATABASE, MAX_ENTITY_HISTORY, n, entityframe_database_t::numframes, and VectorCopy.

Referenced by EntityFrame_CL_ReadFrame().

◆ EntityFrame_AddFrame_Server()

void EntityFrame_AddFrame_Server ( entityframe_database_t * d,
vec3_t eye,
int framenum,
int numentities,
const entity_state_t ** entitydata )

Definition at line 216 of file sv_ents.c.

217{
218 int n, e;
219 entity_frameinfo_t *info;
220
221 VectorCopy(eye, d->eye);
222
223 // figure out how many entity slots are used already
224 if (d->numframes)
225 {
226 n = d->frames[d->numframes - 1].endentity - d->frames[0].firstentity;
227 if (n + numentities > MAX_ENTITY_DATABASE || d->numframes >= MAX_ENTITY_HISTORY)
228 {
229 // ran out of room, dump database
231 }
232 }
233
234 info = &d->frames[d->numframes];
235 info->framenum = framenum;
236 e = -1000;
237 // make sure we check the newly added frame as well, but we haven't incremented numframes yet
238 for (n = 0;n <= d->numframes;n++)
239 {
240 if (e >= d->frames[n].framenum)
241 {
242 if (e == framenum)
243 Con_Print("EntityFrame_AddFrame: tried to add out of sequence frame to database\n");
244 else
245 Con_Print("EntityFrame_AddFrame: out of sequence frames in database\n");
246 return;
247 }
248 e = d->frames[n].framenum;
249 }
250 // if database still has frames after that...
251 if (d->numframes)
252 info->firstentity = d->frames[d->numframes - 1].endentity;
253 else
254 info->firstentity = 0;
255 info->endentity = info->firstentity + numentities;
256 d->numframes++;
257
260 if (e > numentities)
261 e = numentities;
262 memcpy(d->entitydata + n, entitydata, sizeof(entity_state_t) * e);
263 if (numentities > e)
264 memcpy(d->entitydata, entitydata + e, sizeof(entity_state_t) * (numentities - e));
265}

References Con_Print(), entity_frameinfo_t::endentity, entityframe_database_t::entitydata, EntityFrame_ClearDatabase(), entityframe_database_t::eye, entity_frameinfo_t::firstentity, entity_frameinfo_t::framenum, entityframe_database_t::frames, MAX_ENTITY_DATABASE, MAX_ENTITY_HISTORY, n, entityframe_database_t::numframes, and VectorCopy.

Referenced by EntityFrame_WriteFrame().

◆ EntityFrame_AllocDatabase()

entityframe_database_t * EntityFrame_AllocDatabase ( struct mempool_s * mempool)

◆ EntityFrame_CL_ReadFrame()

void EntityFrame_CL_ReadFrame ( void )

Definition at line 220 of file cl_ents.c.

221{
222 int i, number, removed;
223 entity_frame_t *f, *delta;
224 entity_state_t *e, *old, *oldend;
225 entity_t *ent;
227 if (!cl.entitydatabase)
229 d = cl.entitydatabase;
230 f = &d->framedata;
231 delta = &d->deltaframe;
232
234
235 // read the frame header info
236 f->time = cl.mtime[0];
237 number = MSG_ReadLong(&cl_message);
238 f->framenum = MSG_ReadLong(&cl_message);
239 CL_NewFrameReceived(f->framenum);
240 f->eye[0] = MSG_ReadFloat(&cl_message);
241 f->eye[1] = MSG_ReadFloat(&cl_message);
242 f->eye[2] = MSG_ReadFloat(&cl_message);
243 EntityFrame_AckFrame(d, number);
244 EntityFrame_FetchFrame(d, number, delta);
245 old = delta->entitydata;
246 oldend = old + delta->numentities;
247 // read entities until we hit the magic 0xFFFF end tag
248 while ((number = (unsigned short) MSG_ReadShort(&cl_message)) != 0xFFFF && !cl_message.badread)
249 {
251 Host_Error("EntityFrame_Read: read error");
252 removed = number & 0x8000;
253 number &= 0x7FFF;
254 if (number >= MAX_EDICTS)
255 Host_Error("EntityFrame_Read: number (%i) >= MAX_EDICTS (%i)", number, MAX_EDICTS);
256
257 // seek to entity, while copying any skipped entities (assume unchanged)
258 while (old < oldend && old->number < number)
259 {
260 if (f->numentities >= MAX_ENTITY_DATABASE)
261 Host_Error("EntityFrame_Read: entity list too big");
262 f->entitydata[f->numentities] = *old++;
263 f->entitydata[f->numentities++].time = cl.mtime[0];
264 }
265 if (removed)
266 {
267 if (old < oldend && old->number == number)
268 old++;
269 else
270 Con_Printf("EntityFrame_Read: REMOVE on unused entity %i\n", number);
271 }
272 else
273 {
274 if (f->numentities >= MAX_ENTITY_DATABASE)
275 Host_Error("EntityFrame_Read: entity list too big");
276
277 // reserve this slot
278 e = f->entitydata + f->numentities++;
279
280 if (old < oldend && old->number == number)
281 {
282 // delta from old entity
283 *e = *old++;
284 }
285 else
286 {
287 // delta from defaults
288 *e = defaultstate;
289 }
290
291 if (cl.num_entities <= number)
292 {
293 cl.num_entities = number + 1;
294 if (number >= cl.max_entities)
295 CL_ExpandEntities(number);
296 }
297 cl.entities_active[number] = true;
299 e->time = cl.mtime[0];
300 e->number = number;
302 }
303 }
304 while (old < oldend)
305 {
306 if (f->numentities >= MAX_ENTITY_DATABASE)
307 Host_Error("EntityFrame_Read: entity list too big");
308 f->entitydata[f->numentities] = *old++;
309 f->entitydata[f->numentities++].time = cl.mtime[0];
310 }
311 EntityFrame_AddFrame_Client(d, f->eye, f->framenum, f->numentities, f->entitydata);
312
313 memset(cl.entities_active, 0, cl.num_entities * sizeof(unsigned char));
314 number = 1;
315 for (i = 0;i < f->numentities;i++)
316 {
317 for (;number < f->entitydata[i].number && number < cl.num_entities;number++)
318 {
319 if (cl.entities_active[number])
320 {
321 cl.entities_active[number] = false;
323 }
324 }
325 if (number >= cl.num_entities)
326 break;
327 // update the entity
328 ent = &cl.entities[number];
329 ent->state_previous = ent->state_current;
330 ent->state_current = f->entitydata[i];
332 // the entity lives again...
333 cl.entities_active[number] = true;
334 number++;
335 }
336 for (;number < cl.num_entities;number++)
337 {
338 if (cl.entities_active[number])
339 {
340 cl.entities_active[number] = false;
342 }
343 }
344}
void EntityFrame_AddFrame_Client(entityframe_database_t *d, vec3_t eye, int framenum, int numentities, const entity_state_t *entitydata)
Definition cl_ents.c:168
void EntityFrame_Clear(entity_frame_t *f, vec3_t eye, int framenum)
Definition com_ents.c:23
void EntityFrame_FetchFrame(entityframe_database_t *d, int framenum, entity_frame_t *f)
Definition com_ents.c:50
entityframe_database_t * EntityFrame_AllocDatabase(mempool_t *mempool)
Definition com_ents.c:5
void EntityFrame_AckFrame(entityframe_database_t *d, int frame)
Definition com_ents.c:35
#define MSG_ReadFloat
Definition common.h:193
void Host_Error(const char *error,...)
Definition host.c:85
float f
entityframe_database_t * entitydatabase
Definition client.h:963
entity_state_t entitydata[MAX_ENTITY_DATABASE]
Definition protocol.h:565
entity_frame_t framedata
Definition protocol.h:602
entity_frame_t deltaframe
Definition protocol.h:601

References entity_state_t::active, ACTIVE_NETWORK, ACTIVE_NOT, sizebuf_t::badread, cl, CL_ExpandEntities(), cl_message, CL_MoveLerpEntityStates(), CL_NewFrameReceived(), cls, Con_Printf(), defaultstate, entityframe_database_t::deltaframe, client_state_t::entities, client_state_t::entities_active, entity_frame_t::entitydata, client_state_t::entitydatabase, EntityFrame_AckFrame(), EntityFrame_AddFrame_Client(), EntityFrame_AllocDatabase(), EntityFrame_Clear(), EntityFrame_FetchFrame(), EntityState_ReadExtendBits(), EntityState_ReadFields(), f, entityframe_database_t::framedata, Host_Error(), i, client_static_t::levelmempool, MAX_EDICTS, client_state_t::max_entities, MAX_ENTITY_DATABASE, MSG_ReadFloat, MSG_ReadLong, MSG_ReadShort, client_state_t::mtime, NULL, client_state_t::num_entities, entity_state_t::number, entity_frame_t::numentities, entity_t::state_current, entity_t::state_previous, and entity_state_t::time.

Referenced by CL_ParseServerMessage().

◆ EntityFrame_Clear()

void EntityFrame_Clear ( entity_frame_t * f,
vec3_t eye,
int framenum )

Definition at line 23 of file com_ents.c.

24{
25 f->time = 0;
26 f->framenum = framenum;
27 f->numentities = 0;
28 if (eye == NULL)
29 VectorClear(f->eye);
30 else
31 VectorCopy(eye, f->eye);
32}
#define VectorClear(a)
Definition mathlib.h:97

References f, NULL, VectorClear, and VectorCopy.

Referenced by EntityFrame_CL_ReadFrame(), and EntityFrame_FetchFrame().

◆ EntityFrame_ClearDatabase()

void EntityFrame_ClearDatabase ( entityframe_database_t * d)

Definition at line 17 of file com_ents.c.

18{
19 memset(d, 0, sizeof(*d));
20}

Referenced by EntityFrame_AddFrame_Client(), and EntityFrame_AddFrame_Server().

◆ EntityFrame_FetchFrame()

void EntityFrame_FetchFrame ( entityframe_database_t * d,
int framenum,
entity_frame_t * f )

Definition at line 50 of file com_ents.c.

51{
52 int i, n;
54 for (i = 0;i < d->numframes && d->frames[i].framenum < framenum;i++);
55 if (i < d->numframes && framenum == d->frames[i].framenum)
56 {
57 f->framenum = framenum;
58 f->numentities = d->frames[i].endentity - d->frames[i].firstentity;
60 if (n > f->numentities)
61 n = f->numentities;
62 memcpy(f->entitydata, d->entitydata + d->frames[i].firstentity % MAX_ENTITY_DATABASE, sizeof(*f->entitydata) * n);
63 if (f->numentities > n)
64 memcpy(f->entitydata + n, d->entitydata, sizeof(*f->entitydata) * (f->numentities - n));
65 VectorCopy(d->eye, f->eye);
66 }
67}

References entity_frameinfo_t::endentity, entityframe_database_t::entitydata, EntityFrame_Clear(), entityframe_database_t::eye, f, entity_frameinfo_t::firstentity, entity_frameinfo_t::framenum, entityframe_database_t::frames, i, MAX_ENTITY_DATABASE, n, NULL, entityframe_database_t::numframes, and VectorCopy.

Referenced by EntityFrame_CL_ReadFrame(), and EntityFrame_WriteFrame().

◆ EntityFrame_FreeDatabase()

void EntityFrame_FreeDatabase ( entityframe_database_t * d)

Definition at line 11 of file com_ents.c.

12{
13 Mem_Free(d);
14}

References Mem_Free.

Referenced by SV_DropClient(), and SV_SendServerinfo().

◆ EntityFrame_MostRecentlyRecievedFrameNum()

int EntityFrame_MostRecentlyRecievedFrameNum ( entityframe_database_t * d)

Definition at line 348 of file cl_ents.c.

349{
350 if (d->numframes)
351 return d->frames[d->numframes - 1].framenum;
352 else
353 return -1;
354}

References entity_frameinfo_t::framenum, entityframe_database_t::frames, and entityframe_database_t::numframes.

◆ EntityFrame_WriteFrame()

qbool EntityFrame_WriteFrame ( struct sizebuf_s * msg,
int maxsize,
entityframe_database_t * d,
int numstates,
const entity_state_t ** states,
int viewentnum )

◆ EntityFrameCSQC_LostFrame()

void EntityFrameCSQC_LostFrame ( struct client_s * client,
int framenum )

Referenced by SV_FrameLost().

◆ EntityFrameCSQC_WriteFrame()

qbool EntityFrameCSQC_WriteFrame ( struct sizebuf_s * msg,
int maxsize,
int numnumbers,
const unsigned short * numbers,
int framenum )

◆ EntityFrameQuake_ISeeDeadEntities()

void EntityFrameQuake_ISeeDeadEntities ( void )

Definition at line 117 of file cl_ents_nq.c.

118{
119 int num, lastentity;
120 if (cl.lastquakeentity == 0)
121 return;
122 lastentity = cl.lastquakeentity;
124 for (num = 0;num <= lastentity;num++)
125 {
126 if (cl.isquakeentity[num])
127 {
128 if (cl.entities_active[num] && cl.entities[num].state_current.time == cl.mtime[0])
129 {
130 cl.isquakeentity[num] = true;
131 cl.lastquakeentity = num;
132 }
133 else
134 {
135 cl.isquakeentity[num] = false;
138 cl.entities[num].state_current.number = num;
139 }
140 }
141 }
142}
unsigned char isquakeentity[MAX_EDICTS]
Definition client.h:969
int lastquakeentity
Definition client.h:968

References ACTIVE_NOT, cl, defaultstate, client_state_t::entities, client_state_t::entities_active, client_state_t::isquakeentity, client_state_t::lastquakeentity, client_state_t::mtime, entity_state_t::number, entity_t::state_current, and entity_state_t::time.

Referenced by CL_ParseServerMessage().

◆ EntityFrameQuake_ReadEntity()

void EntityFrameQuake_ReadEntity ( int bits)

Definition at line 4 of file cl_ents_nq.c.

5{
6 int num;
7 entity_t *ent;
9
10 if (bits & U_MOREBITS)
11 bits |= (MSG_ReadByte(&cl_message)<<8);
13 {
14 bits |= MSG_ReadByte(&cl_message) << 16;
15 if (bits & U_EXTEND2)
16 bits |= MSG_ReadByte(&cl_message) << 24;
17 }
18
19 if (bits & U_LONGENTITY)
20 num = (unsigned short) MSG_ReadShort(&cl_message);
21 else
23
24 if (num >= MAX_EDICTS)
25 Host_Error("EntityFrameQuake_ReadEntity: entity number (%i) >= MAX_EDICTS (%i)", num, MAX_EDICTS);
26 if (num < 1)
27 Host_Error("EntityFrameQuake_ReadEntity: invalid entity number (%i)", num);
28
29 if (cl.num_entities <= num)
30 {
31 cl.num_entities = num + 1;
32 if (num >= cl.max_entities)
34 }
35
36 ent = cl.entities + num;
37
38 // note: this inherits the 'active' state of the baseline chosen
39 // (state_baseline is always active, state_current may not be active if
40 // the entity was missing in the last frame)
41 if (bits & U_DELTA)
42 s = ent->state_current;
43 else
44 {
45 s = ent->state_baseline;
47 }
48
49 cl.isquakeentity[num] = true;
50 if (cl.lastquakeentity < num)
51 cl.lastquakeentity = num;
52 s.number = num;
53 s.time = cl.mtime[0];
54 s.flags = 0;
55 if (bits & U_MODEL)
56 {
58 s.modelindex = (unsigned short) MSG_ReadShort(&cl_message);
59 else
60 s.modelindex = (s.modelindex & 0xFF00) | MSG_ReadByte(&cl_message);
61 }
62 if (bits & U_FRAME) s.frame = (s.frame & 0xFF00) | MSG_ReadByte(&cl_message);
64 if (bits & U_SKIN) s.skin = MSG_ReadByte(&cl_message);
65 if (bits & U_EFFECTS) s.effects = (s.effects & 0xFF00) | MSG_ReadByte(&cl_message);
67 if (bits & U_ANGLE1) s.angles[0] = MSG_ReadAngle(&cl_message, cls.protocol);
69 if (bits & U_ANGLE2) s.angles[1] = MSG_ReadAngle(&cl_message, cls.protocol);
71 if (bits & U_ANGLE3) s.angles[2] = MSG_ReadAngle(&cl_message, cls.protocol);
72 if (bits & U_STEP) s.flags |= RENDER_STEP;
73 if (bits & U_ALPHA) s.alpha = MSG_ReadByte(&cl_message);
74 if (bits & U_SCALE) s.scale = MSG_ReadByte(&cl_message);
75 if (bits & U_EFFECTS2) s.effects = (s.effects & 0x00FF) | (MSG_ReadByte(&cl_message) << 8);
78 if (bits & U_COLORMOD) {int c = MSG_ReadByte(&cl_message);s.colormod[0] = (unsigned char)(((c >> 5) & 7) * (32.0f / 7.0f));s.colormod[1] = (unsigned char)(((c >> 2) & 7) * (32.0f / 7.0f));s.colormod[2] = (unsigned char)((c & 3) * (32.0f / 3.0f));}
79 if (bits & U_GLOWTRAIL) s.flags |= RENDER_GLOWTRAIL;
80 if (bits & U_FRAME2) s.frame = (s.frame & 0x00FF) | (MSG_ReadByte(&cl_message) << 8);
81 if (bits & U_MODEL2) s.modelindex = (s.modelindex & 0x00FF) | (MSG_ReadByte(&cl_message) << 8);
82 if (bits & U_VIEWMODEL) s.flags |= RENDER_VIEWMODEL;
84
85 // LadyHavoc: to allow playback of the Nehahra movie
87 {
88 // LadyHavoc: evil format
90 int j = (int)(MSG_ReadFloat(&cl_message) * 255.0f);
91 if (i == 2)
92 {
94 if (i)
96 }
97 if (j < 0)
98 s.alpha = 0;
99 else if (j == 0 || j >= 255)
100 s.alpha = 255;
101 else
102 s.alpha = j;
103 }
104
105 ent->state_previous = ent->state_current;
106 ent->state_current = s;
108 {
111 }
112
114 Host_Error("EntityFrameQuake_ReadEntity: read error");
115}
float MSG_ReadAngle(sizebuf_t *sb, protocolversion_t protocol)
Definition com_msg.c:424
float MSG_ReadCoord(sizebuf_t *sb, protocolversion_t protocol)
Definition com_msg.c:389
@ PROTOCOL_NEHAHRABJP2
same as NEHAHRABJP but with 16bit soundindex
Definition common.h:147
@ PROTOCOL_NEHAHRABJP
same as QUAKEDP but with 16bit modelindex
Definition common.h:146
@ PROTOCOL_NEHAHRABJP3
same as NEHAHRABJP2 but with some changes
Definition common.h:148
#define MSG_ReadByte(sb)
Definition common.h:188
static int(ZEXPORT *qz_inflate)(z_stream *strm
#define RENDER_EXTERIORMODEL
Definition protocol.h:359
#define EF_FULLBRIGHT
Definition protocol.h:77
#define U_ANGLE2
Definition protocol.h:115
#define U_COLORMOD
1 byte, 3 bit red, 3 bit green, 2 bit blue, this lets you tint an object artifically,...
Definition protocol.h:139
#define U_ANGLE3
Definition protocol.h:123
#define U_SCALE
1 byte, scale / 16 positive, not sent if 1.0
Definition protocol.h:135
#define U_EFFECTS2
1 byte, this is .effects & 0xFF00 (second byte)
Definition protocol.h:136
#define U_STEP
Definition protocol.h:117
#define U_EXTEND1
Definition protocol.h:131
#define U_GLOWCOLOR
1 byte, palette index, default is 254 (white), this IS used for darklight (allowing colored darklight...
Definition protocol.h:138
#define U_DELTA
no data, while this is set the entity is delta compressed (uses previous frame as a baseline,...
Definition protocol.h:133
#define U_ORIGIN2
Definition protocol.h:113
#define U_ORIGIN1
Definition protocol.h:112
#define U_MODEL
Definition protocol.h:124
#define RENDER_VIEWMODEL
Definition protocol.h:358
#define U_ORIGIN3
Definition protocol.h:114
#define U_COLORMAP
Definition protocol.h:125
#define U_FRAME2
1 byte, this is .frame & 0xFF00 (second byte)
Definition protocol.h:144
#define RENDER_GLOWTRAIL
Definition protocol.h:357
#define U_EFFECTS
Definition protocol.h:127
#define U_GLOWTRAIL
leaves a trail of particles (of color .glowcolor, or black if it is a negative glowsize)
Definition protocol.h:142
#define U_EXTEND2
another byte to follow
Definition protocol.h:140
#define U_VIEWMODEL
attachs the model to the view (origin and angles become relative to it), only shown to owner,...
Definition protocol.h:143
#define U_SKIN
Definition protocol.h:126
#define RENDER_STEP
Definition protocol.h:356
#define U_LONGENTITY
Definition protocol.h:128
#define U_FRAME
Definition protocol.h:118
#define U_ALPHA
1 byte, 0.0-1.0 maps to 0-255, not sent if exactly 1, and the entity is not sent if <=0 unless it has...
Definition protocol.h:134
#define U_MOREBITS
Definition protocol.h:111
#define U_MODEL2
1 byte, this is .modelindex & 0xFF00 (second byte)
Definition protocol.h:145
#define U_ANGLE1
Definition protocol.h:122
#define U_GLOWSIZE
1 byte, encoding is float/4.0, unsigned, not sent if 0
Definition protocol.h:137
#define U_EXTERIORMODEL
causes this model to not be drawn when using a first person view (third person will draw it,...
Definition protocol.h:146
unsigned char flags
Definition protocol.h:468
unsigned char skin
Definition protocol.h:463
unsigned char glowcolor
Definition protocol.h:467
unsigned char glowsize
Definition protocol.h:466
float origin[3]
Definition protocol.h:444
unsigned char colormap
Definition protocol.h:462
unsigned char colormod[3]
Definition protocol.h:471
unsigned char alpha
Definition protocol.h:464
float angles[3]
Definition protocol.h:445
unsigned short frame
Definition protocol.h:450
unsigned char scale
Definition protocol.h:465
entity_state_t state_baseline
Definition client.h:467

References entity_state_t::active, ACTIVE_NETWORK, entity_state_t::alpha, entity_state_t::angles, sizebuf_t::badread, cl, CL_ExpandEntities(), cl_message, CL_MoveLerpEntityStates(), cls, entity_state_t::colormap, entity_state_t::colormod, EF_FULLBRIGHT, entity_state_t::effects, client_state_t::entities, client_state_t::entities_active, entity_state_t::flags, entity_state_t::frame, entity_state_t::glowcolor, entity_state_t::glowsize, Host_Error(), i, int(), client_state_t::isquakeentity, client_state_t::lastquakeentity, MAX_EDICTS, client_state_t::max_entities, entity_state_t::modelindex, MSG_ReadAngle(), MSG_ReadByte, MSG_ReadCoord(), MSG_ReadFloat, MSG_ReadShort, client_state_t::mtime, client_state_t::num_entities, entity_state_t::number, entity_state_t::origin, client_static_t::protocol, PROTOCOL_NEHAHRABJP, PROTOCOL_NEHAHRABJP2, PROTOCOL_NEHAHRABJP3, PROTOCOL_NEHAHRAMOVIE, RENDER_EXTERIORMODEL, RENDER_GLOWTRAIL, RENDER_STEP, RENDER_VIEWMODEL, entity_state_t::scale, entity_state_t::skin, entity_t::state_baseline, entity_t::state_current, entity_t::state_previous, entity_state_t::time, U_ALPHA, U_ANGLE1, U_ANGLE2, U_ANGLE3, U_COLORMAP, U_COLORMOD, U_DELTA, U_EFFECTS, U_EFFECTS2, U_EXTEND1, U_EXTEND2, U_EXTERIORMODEL, U_FRAME, U_FRAME2, U_GLOWCOLOR, U_GLOWSIZE, U_GLOWTRAIL, U_LONGENTITY, U_MODEL, U_MODEL2, U_MOREBITS, U_ORIGIN1, U_ORIGIN2, U_ORIGIN3, U_SCALE, U_SKIN, U_STEP, and U_VIEWMODEL.

Referenced by CL_ParseServerMessage().

◆ EntityFrameQuake_WriteFrame()

qbool EntityFrameQuake_WriteFrame ( struct sizebuf_s * msg,
int maxsize,
int numstates,
const entity_state_t ** states )

◆ EntityFrameQW_AllocDatabase()

entityframeqw_database_t * EntityFrameQW_AllocDatabase ( struct mempool_s * pool)

◆ EntityFrameQW_CL_ReadFrame()

void EntityFrameQW_CL_ReadFrame ( qbool delta)

Definition at line 254 of file cl_ents_qw.c.

255{
256 qbool invalid = false;
257 int number, oldsnapindex, newsnapindex, oldindex, newindex, oldnum, newnum;
258 entity_t *ent;
260 entityframeqw_snapshot_t *oldsnap, *newsnap;
261
262 if (!cl.entitydatabaseqw)
265
266 // there is no cls.netcon in demos, so this reading code can't access
267 // cls.netcon-> at all... so cls.qw_incoming_sequence and
268 // cls.qw_outgoing_sequence are updated every time the corresponding
269 // cls.netcon->qw. variables are updated
270 // read the number of this frame to echo back in next input packet
272 newsnapindex = cl.qw_validsequence & QW_UPDATE_MASK;
273 newsnap = d->snapshot + newsnapindex;
274 memset(newsnap, 0, sizeof(*newsnap));
275 oldsnap = NULL;
276 if (delta)
277 {
278 number = MSG_ReadByte(&cl_message);
279 oldsnapindex = cl.qw_deltasequence[newsnapindex];
280 if ((number & QW_UPDATE_MASK) != (oldsnapindex & QW_UPDATE_MASK))
281 Con_DPrintf("WARNING: from mismatch\n");
282 if (oldsnapindex != -1)
283 {
284 if (cls.qw_outgoing_sequence - oldsnapindex >= QW_UPDATE_BACKUP-1)
285 {
286 Con_DPrintf("delta update too old\n");
287 newsnap->invalid = invalid = true; // too old
288 delta = false;
289 }
290 oldsnap = d->snapshot + (oldsnapindex & QW_UPDATE_MASK);
291 }
292 else
293 delta = false;
294 }
295
296 // if we can't decode this frame properly, report that to the server
297 if (invalid)
299
300 // read entity numbers until we find a 0x0000
301 // (which would be an empty update on world entity, but is actually a terminator)
302 newsnap->num_entities = 0;
303 oldindex = 0;
304 for (;;)
305 {
306 int word = (unsigned short)MSG_ReadShort(&cl_message);
308 return; // just return, the main parser will print an error
309 newnum = word == 0 ? 512 : (word & 511);
310 oldnum = delta ? (oldindex >= oldsnap->num_entities ? 9999 : oldsnap->entities[oldindex].number) : 9999;
311
312 // copy unmodified oldsnap entities
313 while (newnum > oldnum) // delta only
314 {
316 Con_Printf("copy %i\n", oldnum);
317 // copy one of the old entities
318 if (newsnap->num_entities >= QW_MAX_PACKET_ENTITIES)
319 Host_Error("EntityFrameQW_CL_ReadFrame: newsnap->num_entities == MAX_PACKETENTITIES");
320 newsnap->entities[newsnap->num_entities] = oldsnap->entities[oldindex++];
321 newsnap->num_entities++;
322 oldnum = oldindex >= oldsnap->num_entities ? 9999 : oldsnap->entities[oldindex].number;
323 }
324
325 if (word == 0)
326 break;
327
329 {
330 if (word & QW_U_REMOVE)
331 Con_Printf("remove %i\n", newnum);
332 else if (newnum == oldnum)
333 Con_Printf("delta %i\n", newnum);
334 else
335 Con_Printf("baseline %i\n", newnum);
336 }
337
338 if (word & QW_U_REMOVE)
339 {
340 if (newnum != oldnum && !delta && !invalid)
341 {
343 Con_Printf(CON_WARN "WARNING: U_REMOVE %i on full update\n", newnum);
344 }
345 }
346 else
347 {
348 if (newsnap->num_entities >= QW_MAX_PACKET_ENTITIES)
349 Host_Error("EntityFrameQW_CL_ReadFrame: newsnap->num_entities == MAX_PACKETENTITIES");
350 newsnap->entities[newsnap->num_entities] = (newnum == oldnum) ? oldsnap->entities[oldindex] : cl.entities[newnum].state_baseline;
351 EntityStateQW_ReadEntityUpdate(newsnap->entities + newsnap->num_entities, word);
352 newsnap->num_entities++;
353 }
354
355 if (newnum == oldnum)
356 oldindex++;
357 }
358
359 // expand cl.num_entities to include every entity we've seen this game
360 newnum = newsnap->num_entities ? newsnap->entities[newsnap->num_entities - 1].number : 1;
361 if (cl.num_entities <= newnum)
362 {
363 cl.num_entities = newnum + 1;
364 if (cl.max_entities < newnum + 1)
365 CL_ExpandEntities(newnum);
366 }
367
368 // now update the non-player entities from the snapshot states
369 number = cl.maxclients + 1;
370 for (newindex = 0;;newindex++)
371 {
372 newnum = newindex >= newsnap->num_entities ? cl.num_entities : newsnap->entities[newindex].number;
373 // kill any missing entities
374 for (;number < newnum;number++)
375 {
376 if (cl.entities_active[number])
377 {
378 cl.entities_active[number] = false;
380 }
381 }
382 if (number >= cl.num_entities)
383 break;
384 // update the entity
385 ent = &cl.entities[number];
386 ent->state_previous = ent->state_current;
387 ent->state_current = newsnap->entities[newindex];
388 ent->state_current.time = cl.mtime[0];
390 // the entity lives again...
391 cl.entities_active[number] = true;
392 number++;
393 }
394}
entityframeqw_database_t * EntityFrameQW_AllocDatabase(mempool_t *pool)
Definition cl_ents_qw.c:242
static void EntityStateQW_ReadEntityUpdate(entity_state_t *s, int bits)
Definition cl_ents_qw.c:177
void Con_DPrintf(const char *fmt,...)
A Con_Printf that only shows up if the "developer" cvar is set.
Definition console.c:1544
#define CON_WARN
Definition console.h:101
#define QW_U_REMOVE
Definition protocol.h:996
#define QW_UPDATE_BACKUP
Definition protocol.h:1033
#define QW_UPDATE_MASK
Definition protocol.h:1034
#define QW_MAX_PACKET_ENTITIES
Definition protocol.h:1035
bool qbool
Definition qtypes.h:9
entityframeqw_database_t * entitydatabaseqw
Definition client.h:965
unsigned int qw_validsequence
Definition client.h:1104
unsigned int qw_deltasequence[QW_UPDATE_BACKUP]
Definition client.h:1106
unsigned int qw_outgoing_sequence
Definition client.h:645
unsigned int qw_incoming_sequence
Definition client.h:644
entityframeqw_snapshot_t snapshot[QW_UPDATE_BACKUP]
Definition protocol.h:1070
entity_state_t entities[QW_MAX_PACKET_ENTITIES]
Definition protocol.h:1064

References entity_state_t::active, ACTIVE_NOT, sizebuf_t::badread, cl, CL_ExpandEntities(), cl_message, CL_MoveLerpEntityStates(), cls, Con_DPrintf(), Con_Printf(), CON_WARN, developer_networkentities, client_state_t::entities, entityframeqw_snapshot_t::entities, client_state_t::entities_active, client_state_t::entitydatabaseqw, EntityFrameQW_AllocDatabase(), EntityStateQW_ReadEntityUpdate(), Host_Error(), cvar_t::integer, entityframeqw_snapshot_t::invalid, client_static_t::levelmempool, client_state_t::max_entities, client_state_t::maxclients, MSG_ReadByte, MSG_ReadShort, client_state_t::mtime, NULL, client_state_t::num_entities, entityframeqw_snapshot_t::num_entities, entity_state_t::number, client_state_t::qw_deltasequence, client_static_t::qw_incoming_sequence, QW_MAX_PACKET_ENTITIES, client_static_t::qw_outgoing_sequence, QW_U_REMOVE, QW_UPDATE_BACKUP, QW_UPDATE_MASK, client_state_t::qw_validsequence, entityframeqw_database_t::snapshot, entity_t::state_baseline, entity_t::state_current, entity_t::state_previous, and entity_state_t::time.

Referenced by CL_ParseServerMessage().

◆ EntityFrameQW_FreeDatabase()

void EntityFrameQW_FreeDatabase ( entityframeqw_database_t * d)

Definition at line 249 of file cl_ents_qw.c.

250{
251 Mem_Free(d);
252}

References Mem_Free.

◆ EntityState5_DeltaBitsForState()

int EntityState5_DeltaBitsForState ( entity_state_t * o,
entity_state_t * n )

◆ EntityState5_WriteUpdate()

void EntityState5_WriteUpdate ( int number,
const entity_state_t * s,
int changedbits,
struct sizebuf_s * msg )

◆ EntityState_DeltaBits()

int EntityState_DeltaBits ( const entity_state_t * o,
const entity_state_t * n )

Definition at line 6 of file sv_ents.c.

7{
8 unsigned int bits;
9 // if o is not active, delta from default
10 if (o->active != ACTIVE_NETWORK)
11 o = &defaultstate;
12 bits = 0;
13 if (fabs(n->origin[0] - o->origin[0]) > (1.0f / 256.0f))
14 bits |= E_ORIGIN1;
15 if (fabs(n->origin[1] - o->origin[1]) > (1.0f / 256.0f))
16 bits |= E_ORIGIN2;
17 if (fabs(n->origin[2] - o->origin[2]) > (1.0f / 256.0f))
18 bits |= E_ORIGIN3;
19 if ((unsigned char) (n->angles[0] * (256.0f / 360.0f)) != (unsigned char) (o->angles[0] * (256.0f / 360.0f)))
20 bits |= E_ANGLE1;
21 if ((unsigned char) (n->angles[1] * (256.0f / 360.0f)) != (unsigned char) (o->angles[1] * (256.0f / 360.0f)))
22 bits |= E_ANGLE2;
23 if ((unsigned char) (n->angles[2] * (256.0f / 360.0f)) != (unsigned char) (o->angles[2] * (256.0f / 360.0f)))
24 bits |= E_ANGLE3;
25 if ((n->modelindex ^ o->modelindex) & 0x00FF)
26 bits |= E_MODEL1;
27 if ((n->modelindex ^ o->modelindex) & 0xFF00)
28 bits |= E_MODEL2;
29 if ((n->frame ^ o->frame) & 0x00FF)
30 bits |= E_FRAME1;
31 if ((n->frame ^ o->frame) & 0xFF00)
32 bits |= E_FRAME2;
33 if ((n->effects ^ o->effects) & 0x00FF)
34 bits |= E_EFFECTS1;
35 if ((n->effects ^ o->effects) & 0xFF00)
36 bits |= E_EFFECTS2;
37 if (n->colormap != o->colormap)
38 bits |= E_COLORMAP;
39 if (n->skin != o->skin)
40 bits |= E_SKIN;
41 if (n->alpha != o->alpha)
42 bits |= E_ALPHA;
43 if (n->scale != o->scale)
44 bits |= E_SCALE;
45 if (n->glowsize != o->glowsize)
46 bits |= E_GLOWSIZE;
47 if (n->glowcolor != o->glowcolor)
48 bits |= E_GLOWCOLOR;
49 if (n->flags != o->flags)
50 bits |= E_FLAGS;
51 if (n->tagindex != o->tagindex || n->tagentity != o->tagentity)
52 bits |= E_TAGATTACHMENT;
53 if (n->light[0] != o->light[0] || n->light[1] != o->light[1] || n->light[2] != o->light[2] || n->light[3] != o->light[3])
54 bits |= E_LIGHT;
55 if (n->lightstyle != o->lightstyle)
56 bits |= E_LIGHTSTYLE;
57 if (n->lightpflags != o->lightpflags)
58 bits |= E_LIGHTPFLAGS;
59
60 if (bits)
61 {
62 if (bits & 0xFF000000)
63 bits |= 0x00800000;
64 if (bits & 0x00FF0000)
65 bits |= 0x00008000;
66 if (bits & 0x0000FF00)
67 bits |= 0x00000080;
68 }
69 return bits;
70}
float fabs(float f)
#define E_TAGATTACHMENT
Definition protocol.h:645
#define E_ANGLE2
Definition protocol.h:617
#define E_ORIGIN2
Definition protocol.h:614
#define E_ORIGIN3
Definition protocol.h:615
#define E_LIGHTSTYLE
Definition protocol.h:646
#define E_SCALE
Definition protocol.h:626
#define E_EFFECTS1
Definition protocol.h:624
#define E_FLAGS
Definition protocol.h:629
#define E_COLORMAP
Definition protocol.h:627
#define E_MODEL2
Definition protocol.h:634
#define E_SKIN
Definition protocol.h:628
#define E_FRAME2
Definition protocol.h:633
#define E_LIGHT
Definition protocol.h:638
#define E_GLOWSIZE
Definition protocol.h:636
#define E_EFFECTS2
Definition protocol.h:635
#define E_GLOWCOLOR
Definition protocol.h:637
#define E_MODEL1
Definition protocol.h:619
#define E_LIGHTPFLAGS
Definition protocol.h:639
#define E_ANGLE1
Definition protocol.h:616
#define E_ORIGIN1
Definition protocol.h:613
#define E_FRAME1
Definition protocol.h:623
#define E_ALPHA
Definition protocol.h:625
#define E_ANGLE3
Definition protocol.h:618
unsigned short tagentity
Definition protocol.h:451
unsigned char lightstyle
Definition protocol.h:460
unsigned short light[4]
Definition protocol.h:458
unsigned char tagindex
Definition protocol.h:470
unsigned char lightpflags
Definition protocol.h:461

References entity_state_t::active, ACTIVE_NETWORK, entity_state_t::alpha, entity_state_t::angles, entity_state_t::colormap, defaultstate, E_ALPHA, E_ANGLE1, E_ANGLE2, E_ANGLE3, E_COLORMAP, E_EFFECTS1, E_EFFECTS2, E_FLAGS, E_FRAME1, E_FRAME2, E_GLOWCOLOR, E_GLOWSIZE, E_LIGHT, E_LIGHTPFLAGS, E_LIGHTSTYLE, E_MODEL1, E_MODEL2, E_ORIGIN1, E_ORIGIN2, E_ORIGIN3, E_SCALE, E_SKIN, E_TAGATTACHMENT, entity_state_t::effects, fabs(), entity_state_t::flags, entity_state_t::frame, entity_state_t::glowcolor, entity_state_t::glowsize, entity_state_t::light, entity_state_t::lightpflags, entity_state_t::lightstyle, entity_state_t::modelindex, n, entity_state_t::origin, entity_state_t::scale, entity_state_t::skin, entity_state_t::tagentity, and entity_state_t::tagindex.

Referenced by EntityState_WriteUpdate().

◆ EntityState_ReadExtendBits()

int EntityState_ReadExtendBits ( void )

Definition at line 4 of file cl_ents.c.

5{
6 unsigned int bits;
8 if (bits & 0x00000080)
9 {
10 bits |= MSG_ReadByte(&cl_message) << 8;
11 if (bits & 0x00008000)
12 {
13 bits |= MSG_ReadByte(&cl_message) << 16;
14 if (bits & 0x00800000)
15 bits |= MSG_ReadByte(&cl_message) << 24;
16 }
17 }
18 return bits;
19}

References cl_message, and MSG_ReadByte.

Referenced by EntityFrame4_CL_ReadFrame(), and EntityFrame_CL_ReadFrame().

◆ EntityState_ReadFields()

void EntityState_ReadFields ( entity_state_t * e,
unsigned int bits )

Definition at line 21 of file cl_ents.c.

22{
24 {
25 if (bits & E_ORIGIN1)
27 if (bits & E_ORIGIN2)
29 if (bits & E_ORIGIN3)
31 }
32 else
33 {
34 if (bits & E_FLAGS)
37 {
38 if (bits & E_ORIGIN1)
40 if (bits & E_ORIGIN2)
42 if (bits & E_ORIGIN3)
44 }
45 else
46 {
47 if (bits & E_ORIGIN1)
49 if (bits & E_ORIGIN2)
51 if (bits & E_ORIGIN3)
53 }
54 }
56 {
57 if (bits & E_ANGLE1)
59 if (bits & E_ANGLE2)
61 if (bits & E_ANGLE3)
63 }
64 else
65 {
66 if (bits & E_ANGLE1)
68 if (bits & E_ANGLE2)
70 if (bits & E_ANGLE3)
72 }
73 if (bits & E_MODEL1)
74 e->modelindex = (e->modelindex & 0xFF00) | (unsigned int) MSG_ReadByte(&cl_message);
75 if (bits & E_MODEL2)
76 e->modelindex = (e->modelindex & 0x00FF) | ((unsigned int) MSG_ReadByte(&cl_message) << 8);
77 if (bits & E_FRAME1)
78 e->frame = (e->frame & 0xFF00) | (unsigned int) MSG_ReadByte(&cl_message);
79 if (bits & E_FRAME2)
80 e->frame = (e->frame & 0x00FF) | ((unsigned int) MSG_ReadByte(&cl_message) << 8);
81 if (bits & E_EFFECTS1)
82 e->effects = (e->effects & 0xFF00) | (unsigned int) MSG_ReadByte(&cl_message);
83 if (bits & E_EFFECTS2)
84 e->effects = (e->effects & 0x00FF) | ((unsigned int) MSG_ReadByte(&cl_message) << 8);
85 if (bits & E_COLORMAP)
87 if (bits & E_SKIN)
89 if (bits & E_ALPHA)
91 if (bits & E_SCALE)
93 if (bits & E_GLOWSIZE)
95 if (bits & E_GLOWCOLOR)
98 if (bits & E_FLAGS)
100 if (bits & E_TAGATTACHMENT)
101 {
102 e->tagentity = (unsigned short) MSG_ReadShort(&cl_message);
104 }
105 if (bits & E_LIGHT)
106 {
107 e->light[0] = (unsigned short) MSG_ReadShort(&cl_message);
108 e->light[1] = (unsigned short) MSG_ReadShort(&cl_message);
109 e->light[2] = (unsigned short) MSG_ReadShort(&cl_message);
110 e->light[3] = (unsigned short) MSG_ReadShort(&cl_message);
111 }
112 if (bits & E_LIGHTSTYLE)
114 if (bits & E_LIGHTPFLAGS)
116
118 {
119 Con_Printf("ReadFields e%i", e->number);
120
121 if (bits & E_ORIGIN1)
122 Con_Printf(" E_ORIGIN1 %f", e->origin[0]);
123 if (bits & E_ORIGIN2)
124 Con_Printf(" E_ORIGIN2 %f", e->origin[1]);
125 if (bits & E_ORIGIN3)
126 Con_Printf(" E_ORIGIN3 %f", e->origin[2]);
127 if (bits & E_ANGLE1)
128 Con_Printf(" E_ANGLE1 %f", e->angles[0]);
129 if (bits & E_ANGLE2)
130 Con_Printf(" E_ANGLE2 %f", e->angles[1]);
131 if (bits & E_ANGLE3)
132 Con_Printf(" E_ANGLE3 %f", e->angles[2]);
133 if (bits & (E_MODEL1 | E_MODEL2))
134 Con_Printf(" E_MODEL %i", e->modelindex);
135
136 if (bits & (E_FRAME1 | E_FRAME2))
137 Con_Printf(" E_FRAME %i", e->frame);
138 if (bits & (E_EFFECTS1 | E_EFFECTS2))
139 Con_Printf(" E_EFFECTS %i", e->effects);
140 if (bits & E_ALPHA)
141 Con_Printf(" E_ALPHA %f", e->alpha / 255.0f);
142 if (bits & E_SCALE)
143 Con_Printf(" E_SCALE %f", e->scale / 16.0f);
144 if (bits & E_COLORMAP)
145 Con_Printf(" E_COLORMAP %i", e->colormap);
146 if (bits & E_SKIN)
147 Con_Printf(" E_SKIN %i", e->skin);
148
149 if (bits & E_GLOWSIZE)
150 Con_Printf(" E_GLOWSIZE %i", e->glowsize * 4);
151 if (bits & E_GLOWCOLOR)
152 Con_Printf(" E_GLOWCOLOR %i", e->glowcolor);
153
154 if (bits & E_LIGHT)
155 Con_Printf(" E_LIGHT %i:%i:%i:%i", e->light[0], e->light[1], e->light[2], e->light[3]);
156 if (bits & E_LIGHTPFLAGS)
157 Con_Printf(" E_LIGHTPFLAGS %i", e->lightpflags);
158
159 if (bits & E_TAGATTACHMENT)
160 Con_Printf(" E_TAGATTACHMENT e%i:%i", e->tagentity, e->tagindex);
161 if (bits & E_LIGHTSTYLE)
162 Con_Printf(" E_LIGHTSTYLE %i", e->lightstyle);
163 Con_Print("\n");
164 }
165}
float MSG_ReadCoord32f(sizebuf_t *sb)
Definition com_msg.c:384
float MSG_ReadAngle8i(sizebuf_t *sb)
Definition com_msg.c:409
float MSG_ReadAngle16i(sizebuf_t *sb)
Definition com_msg.c:414
float MSG_ReadCoord16i(sizebuf_t *sb)
Definition com_msg.c:379
#define RENDER_LOWPRECISION
Definition protocol.h:360

References entity_state_t::alpha, entity_state_t::angles, cl_message, cls, entity_state_t::colormap, Con_Print(), Con_Printf(), developer_networkentities, E_ALPHA, E_ANGLE1, E_ANGLE2, E_ANGLE3, E_COLORMAP, E_EFFECTS1, E_EFFECTS2, E_FLAGS, E_FRAME1, E_FRAME2, E_GLOWCOLOR, E_GLOWSIZE, E_LIGHT, E_LIGHTPFLAGS, E_LIGHTSTYLE, E_MODEL1, E_MODEL2, E_ORIGIN1, E_ORIGIN2, E_ORIGIN3, E_SCALE, E_SKIN, E_TAGATTACHMENT, entity_state_t::effects, entity_state_t::flags, entity_state_t::frame, entity_state_t::glowcolor, entity_state_t::glowsize, cvar_t::integer, entity_state_t::light, entity_state_t::lightpflags, entity_state_t::lightstyle, entity_state_t::modelindex, MSG_ReadAngle16i(), MSG_ReadAngle8i(), MSG_ReadByte, MSG_ReadCoord16i(), MSG_ReadCoord32f(), MSG_ReadShort, entity_state_t::number, entity_state_t::origin, client_static_t::protocol, PROTOCOL_DARKPLACES2, PROTOCOL_DARKPLACES5, PROTOCOL_DARKPLACES6, RENDER_LOWPRECISION, entity_state_t::scale, entity_state_t::skin, entity_state_t::tagentity, and entity_state_t::tagindex.

Referenced by EntityFrame4_CL_ReadFrame(), and EntityFrame_CL_ReadFrame().

◆ EntityState_WriteExtendBits()

void EntityState_WriteExtendBits ( struct sizebuf_s * msg,
unsigned int bits )

◆ EntityState_WriteFields()

void EntityState_WriteFields ( const entity_state_t * ent,
struct sizebuf_s * msg,
unsigned int bits )

◆ EntityState_WriteUpdate()

void EntityState_WriteUpdate ( const entity_state_t * ent,
struct sizebuf_s * msg,
const entity_state_t * delta )

Referenced by EntityFrame4_WriteFrame().

◆ EntityStateQW_ReadPlayerUpdate()

void EntityStateQW_ReadPlayerUpdate ( void )

Definition at line 46 of file cl_ents_qw.c.

47{
48 int slot = MSG_ReadByte(&cl_message);
49 int enumber = slot + 1;
50 int weaponframe;
51 int msec;
52 int playerflags;
53 int bits;
55 // look up the entity
56 entity_t *ent = cl.entities + enumber;
57 vec3_t viewangles;
59
60 // slide the current state into the previous
61 ent->state_previous = ent->state_current;
62
63 // read the update
64 s = &ent->state_current;
65 *s = defaultstate;
67 s->number = enumber;
68 s->colormap = enumber;
69 playerflags = MSG_ReadShort(&cl_message);
72
73 VectorClear(viewangles);
75
76 if (playerflags & QW_PF_MSEC)
77 {
78 // time difference between last update this player sent to the server,
79 // and last input we sent to the server (this packet is in response to
80 // our input, so msec is how long ago the last update of this player
81 // entity occurred, compared to our input being received)
82 msec = MSG_ReadByte(&cl_message);
83 }
84 else
85 msec = 0;
86 if (playerflags & QW_PF_COMMAND)
87 {
88 bits = MSG_ReadByte(&cl_message);
89 if (bits & QW_CM_ANGLE1)
90 viewangles[0] = MSG_ReadAngle16i(&cl_message); // cmd->angles[0]
91 if (bits & QW_CM_ANGLE2)
92 viewangles[1] = MSG_ReadAngle16i(&cl_message); // cmd->angles[1]
93 if (bits & QW_CM_ANGLE3)
94 viewangles[2] = MSG_ReadAngle16i(&cl_message); // cmd->angles[2]
95 if (bits & QW_CM_FORWARD)
96 MSG_ReadShort(&cl_message); // cmd->forwardmove
97 if (bits & QW_CM_SIDE)
98 MSG_ReadShort(&cl_message); // cmd->sidemove
99 if (bits & QW_CM_UP)
100 MSG_ReadShort(&cl_message); // cmd->upmove
101 if (bits & QW_CM_BUTTONS)
102 (void) MSG_ReadByte(&cl_message); // cmd->buttons
103 if (bits & QW_CM_IMPULSE)
104 (void) MSG_ReadByte(&cl_message); // cmd->impulse
105 (void) MSG_ReadByte(&cl_message); // cmd->msec
106 }
107 if (playerflags & QW_PF_VELOCITY1)
109 if (playerflags & QW_PF_VELOCITY2)
111 if (playerflags & QW_PF_VELOCITY3)
113 if (playerflags & QW_PF_MODEL)
115 else
117 if (playerflags & QW_PF_SKINNUM)
119 if (playerflags & QW_PF_EFFECTS)
121 if (playerflags & QW_PF_WEAPONFRAME)
123 else
124 weaponframe = 0;
125
126 if (enumber == cl.playerentity)
127 {
128 // if this is an update on our player, update the angles
129 VectorCopy(cl.viewangles, viewangles);
130 }
131
132 // calculate the entity angles from the viewangles
133 s->angles[0] = viewangles[0] * -0.0333;
134 s->angles[1] = viewangles[1];
135 s->angles[2] = 0;
137
138 // if this is an update on our player, update interpolation state
139 if (enumber == cl.playerentity)
140 {
144 cl.mviewzoom[1] = cl.mviewzoom[0];
145
146 cl.idealpitch = 0;
147 cl.mpunchangle[0][0] = 0;
148 cl.mpunchangle[0][1] = 0;
149 cl.mpunchangle[0][2] = 0;
150 cl.mpunchvector[0][0] = 0;
151 cl.mpunchvector[0][1] = 0;
152 cl.mpunchvector[0][2] = 0;
153 cl.mvelocity[0][0] = 0;
154 cl.mvelocity[0][1] = 0;
155 cl.mvelocity[0][2] = 0;
156 cl.mviewzoom[0] = 1;
157
160 if (playerflags & QW_PF_GIB)
162 else if (playerflags & QW_PF_DEAD)
163 cl.stats[STAT_VIEWHEIGHT] = -16;
164 else
166 }
167
168 // set the cl.entities_active flag
169 cl.entities_active[enumber] = (s->active == ACTIVE_NETWORK);
170 // set the update time
171 s->time = cl.mtime[0] - msec * 0.001; // qw has no clock
172 // check if we need to update the lerp stuff
173 if (s->active == ACTIVE_NETWORK)
175}
cvar_t cl_rollangle
Definition view.c:36
cvar_t cl_rollspeed
Definition view.c:35
static void QW_TranslateEffects(entity_state_t *s, int qweffects)
Definition cl_ents_qw.c:4
void MSG_ReadVector(sizebuf_t *sb, vec3_t v, protocolversion_t protocol)
Definition com_msg.c:401
float Com_CalcRoll(const vec3_t angles, const vec3_t velocity, const vec_t angleval, const vec_t velocityval)
Definition common.c:890
vector velocity
void() predraw
float weaponframe
Definition progsdefs.qc:141
#define QW_PF_WEAPONFRAME
Definition protocol.h:972
#define QW_PF_VELOCITY1
Definition protocol.h:966
#define QW_CM_UP
Definition protocol.h:984
#define QW_PF_GIB
Definition protocol.h:974
#define QW_CM_FORWARD
Definition protocol.h:982
#define QW_CM_ANGLE1
Definition protocol.h:980
#define QW_CM_BUTTONS
Definition protocol.h:985
#define QW_PF_MSEC
Definition protocol.h:964
#define QW_PF_SKINNUM
Definition protocol.h:970
#define QW_CM_ANGLE2
Definition protocol.h:987
#define QW_PF_VELOCITY3
Definition protocol.h:968
#define QW_PF_VELOCITY2
Definition protocol.h:967
#define QW_CM_ANGLE3
Definition protocol.h:981
#define QW_CM_IMPULSE
Definition protocol.h:986
#define QW_PF_EFFECTS
Definition protocol.h:971
#define QW_PF_DEAD
Definition protocol.h:973
#define QW_PF_COMMAND
Definition protocol.h:965
#define QW_CM_SIDE
Definition protocol.h:983
#define QW_PF_MODEL
Definition protocol.h:969
#define STAT_WEAPONFRAME
Definition qstats.h:13
#define STAT_VIEWHEIGHT
FTE, DP.
Definition qstats.h:24
vec_t vec3_t[3]
Definition qtypes.h:71
float idealpitch
Definition client.h:826
vec3_t viewangles
Definition client.h:786
int qw_modelindex_player
Definition client.h:1091
vec3_t mpunchvector[2]
Definition client.h:790
vec3_t mvelocity[2]
Definition client.h:792
int playerentity
Definition client.h:910
int stats[MAX_CL_STATS]
Definition client.h:758
vec3_t mpunchangle[2]
Definition client.h:788
vec_t mviewzoom[2]
Definition client.h:794
float value
Definition cvar.h:74

References entity_state_t::active, ACTIVE_NETWORK, entity_state_t::angles, cl, cl_message, CL_MoveLerpEntityStates(), cl_rollangle, cl_rollspeed, cls, entity_state_t::colormap, Com_CalcRoll(), defaultstate, client_state_t::entities, client_state_t::entities_active, entity_state_t::frame, client_state_t::idealpitch, entity_state_t::modelindex, client_state_t::mpunchangle, client_state_t::mpunchvector, MSG_ReadAngle16i(), MSG_ReadByte, MSG_ReadShort, MSG_ReadVector(), client_state_t::mtime, client_state_t::mvelocity, client_state_t::mviewzoom, entity_state_t::number, entity_state_t::origin, client_state_t::playerentity, client_static_t::protocol, QW_CM_ANGLE1, QW_CM_ANGLE2, QW_CM_ANGLE3, QW_CM_BUTTONS, QW_CM_FORWARD, QW_CM_IMPULSE, QW_CM_SIDE, QW_CM_UP, client_state_t::qw_modelindex_player, QW_PF_COMMAND, QW_PF_DEAD, QW_PF_EFFECTS, QW_PF_GIB, QW_PF_MODEL, QW_PF_MSEC, QW_PF_SKINNUM, QW_PF_VELOCITY1, QW_PF_VELOCITY2, QW_PF_VELOCITY3, QW_PF_WEAPONFRAME, QW_TranslateEffects(), entity_state_t::skin, STAT_VIEWHEIGHT, STAT_WEAPONFRAME, entity_t::state_current, entity_t::state_previous, client_state_t::stats, entity_state_t::time, cvar_t::value, VectorClear, VectorCopy, velocity, client_state_t::viewangles, void(), and weaponframe.

Referenced by CL_ParseServerMessage().

◆ Protocol_EnumForName()

enum protocolversion_e Protocol_EnumForName ( const char * s)

Definition at line 68 of file protocol.c.

69{
70 int i;
71 for (i = 0;protocolversioninfo[i].name;i++)
72 if (!strcasecmp(s, protocolversioninfo[i].name))
74 return PROTOCOL_UNKNOWN;
75}
@ PROTOCOL_UNKNOWN
Definition common.h:133
const GLchar * name
Definition glquake.h:601
struct protocolversioninfo_s protocolversioninfo[]
protocolversion_t version
Definition protocol.c:45
const char * name
Definition protocol.c:46

References i, name, protocolversioninfo_s::name, PROTOCOL_UNKNOWN, protocolversioninfo, and protocolversioninfo_s::version.

Referenced by SV_SpawnServer().

◆ Protocol_EnumForNumber()

enum protocolversion_e Protocol_EnumForNumber ( int n)

Definition at line 86 of file protocol.c.

87{
88 int i;
89 for (i = 0;protocolversioninfo[i].name;i++)
90 if (protocolversioninfo[i].number == n)
92 return PROTOCOL_UNKNOWN;
93}

References i, n, protocolversioninfo_s::name, PROTOCOL_UNKNOWN, protocolversioninfo, and protocolversioninfo_s::version.

Referenced by CL_ParseServerInfo(), and CL_ParseServerMessage().

◆ Protocol_NameForEnum()

const char * Protocol_NameForEnum ( enum protocolversion_e p)

◆ Protocol_Names()

void Protocol_Names ( char * buffer,
size_t buffersize )

Definition at line 104 of file protocol.c.

105{
106 int i;
107 if (buffersize < 1)
108 return;
109 buffer[0] = 0;
110 for (i = 0;protocolversioninfo[i].name;i++)
111 {
112 if (i > 0)
113 dp_strlcat(buffer, " ", buffersize);
115 }
116}
#define dp_strlcat(dst, src, dsize)
Definition common.h:304
GLuint buffer
Definition glquake.h:630

References buffer, dp_strlcat, i, name, protocolversioninfo_s::name, and protocolversioninfo.

Referenced by NetConn_ClientParsePacket(), and SV_SpawnServer().

◆ Protocol_NumberForEnum()

int Protocol_NumberForEnum ( enum protocolversion_e p)

◆ Protocol_UpdateClientStats()

void Protocol_UpdateClientStats ( const int * stats)

Definition at line 118 of file protocol.c.

119{
120 int i;
121 // update the stats array and set deltabits for any changed stats
122 for (i = 0;i < MAX_CL_STATS;i++)
123 {
124 if (host_client->stats[i] != stats[i])
125 {
126 host_client->statsdeltabits[i >> 3] |= 1 << (i & 7);
127 host_client->stats[i] = stats[i];
128 }
129 }
130}
int stats[MAX_CL_STATS]
Definition server.h:278

References host_client, i, MAX_CL_STATS, client_t::stats, and client_t::statsdeltabits.

Referenced by SV_SendClientDatagram().

◆ Protocol_WriteStatsReliable()

void Protocol_WriteStatsReliable ( void )

Definition at line 151 of file protocol.c.

152{
153 int i, j;
155 return;
156 // detect changes in stats and write reliable messages
157 // this only deals with 32 stats because the older protocols which use
158 // this function can only cope with 32 stats,
159 // they also do not support svc_updatestatubyte which was introduced in
160 // DP6 protocol (except for QW)
161 for (j = 0;sendquakestats[j] >= 0;j++)
162 {
163 i = sendquakestats[j];
164 // check if this bit is set
165 if (host_client->statsdeltabits[i >> 3] & (1 << (i & 7)))
166 {
167 host_client->statsdeltabits[i >> 3] -= (1 << (i & 7));
168 // send the stat as a byte if possible
170 {
171 if (host_client->stats[i] >= 0 && host_client->stats[i] < 256)
172 {
176 }
177 else
178 {
182 }
183 }
184 else
185 {
186 // this could make use of svc_updatestatubyte in DP6 and later
187 // protocols but those protocols do not use this function
191 }
192 }
193 }
194}
void MSG_WriteLong(sizebuf_t *sb, int c)
Definition com_msg.c:147
void MSG_WriteByte(sizebuf_t *sb, int c)
Definition com_msg.c:130
@ PROTOCOL_QUAKEWORLD
quakeworld protocol
Definition common.h:145
static const int sendquakestats[]
Definition protocol.c:135
#define qw_svc_updatestat
Definition protocol.h:909
#define svc_updatestat
Definition protocol.h:217
#define qw_svc_updatestatlong
Definition protocol.h:936
server_t sv
local server
Definition sv_main.c:223
netconn_t * netconnection
communications handle
Definition server.h:210
sizebuf_t message
writing buffer to send to peer as the next reliable message can be added to at any time,...
Definition netconn.h:161
protocolversion_t protocol
one of the PROTOCOL_ values
Definition server.h:74

References host_client, i, netconn_t::message, MSG_WriteByte(), MSG_WriteLong(), client_t::netconnection, server_t::protocol, PROTOCOL_QUAKEWORLD, qw_svc_updatestat, qw_svc_updatestatlong, sendquakestats, client_t::stats, client_t::statsdeltabits, sv, and svc_updatestat.

Referenced by SV_WriteEntitiesToClient().

Variable Documentation

◆ defaultstate

entity_state_t defaultstate
extern

Definition at line 4 of file protocol.c.

5{
6 // ! means this is not sent to client
7 0,//double time; // ! time this state was built (used on client for interpolation)
8 {0,0,0},//float netcenter[3]; // ! for network prioritization, this is the center of the bounding box (which may differ from the origin)
9 {0,0,0},//float origin[3];
10 {0,0,0},//float angles[3];
11 0,//int effects;
12 0,//unsigned int customizeentityforclient; // !
13 0,//unsigned short number; // entity number this state is for
14 0,//unsigned short modelindex;
15 0,//unsigned short frame;
16 0,//unsigned short tagentity;
17 0,//unsigned short specialvisibilityradius; // ! larger if it has effects/light
18 0,//unsigned short viewmodelforclient; // !
19 0,//unsigned short exteriormodelforclient; // ! not shown if first person viewing from this entity, shown in all other cases
20 0,//unsigned short nodrawtoclient; // !
21 0,//unsigned short drawonlytoclient; // !
22 0,//unsigned short traileffectnum;
23 {0,0,0,0},//unsigned short light[4]; // color*256 (0.00 to 255.996), and radius*1
24 ACTIVE_NOT,//unsigned char active; // true if a valid state
25 0,//unsigned char lightstyle;
26 0,//unsigned char lightpflags;
27 0,//unsigned char colormap;
28 0,//unsigned char skin; // also chooses cubemap for rtlights if lightpflags & LIGHTPFLAGS_FULLDYNAMIC
29 255,//unsigned char alpha;
30 16,//unsigned char scale;
31 0,//unsigned char glowsize;
32 254,//unsigned char glowcolor;
33 0,//unsigned char flags;
34 0,//unsigned char internaleffects; // INTEF_FLAG1QW and so on
35 0,//unsigned char tagindex;
36 {32, 32, 32},//unsigned char colormod[3];
37 {32, 32, 32},//unsigned char glowmod[3];
38};

Referenced by CL_ClearState(), CL_ExpandEntities(), CL_ParseBaseline(), CL_UpdateViewModel(), EntityFrame4_AckFrame(), EntityFrame4_CL_ReadFrame(), EntityFrame4_GetReferenceEntity(), EntityFrame4_ResetDatabase(), EntityFrame4_WriteFrame(), EntityFrame5_AllocDatabase(), EntityFrame5_CL_ReadFrame(), EntityFrame5_WriteFrame(), EntityFrame_CL_ReadFrame(), EntityFrame_WriteFrame(), EntityFrameQuake_ISeeDeadEntities(), EntityState5_ReadUpdate(), EntityState_DeltaBits(), EntityStateQW_ReadPlayerUpdate(), SV_CreateBaseline(), and SV_PrepareEntityForSending().

◆ developer_networkentities

struct cvar_s developer_networkentities
extern

Definition at line 173 of file cl_parse.c.

173{CF_CLIENT, "developer_networkentities", "0", "prints received entities, value is 0-10 (higher for more info, 10 being the most verbose)"};
#define CF_CLIENT
cvar/command that only the client can change/execute
Definition cmd.h:48

Referenced by CL_NewFrameReceived(), CL_Parse_Init(), CL_SendMove(), EntityFrame4_AckFrame(), EntityFrame4_CL_ReadFrame(), EntityFrame4_WriteFrame(), EntityFrame5_CL_ReadFrame(), EntityFrame5_WriteFrame(), EntityFrameQW_CL_ReadFrame(), EntityState5_ReadUpdate(), EntityState_ReadFields(), EntityStateQW_ReadEntityUpdate(), and SV_ReadClientMessage().