Quake II RTX doxygen
1.0 dev
|
|
Go to the source code of this file.
◆ CL_CheckForIP()
static void CL_CheckForIP |
( |
const char * |
s | ) |
|
|
static |
Definition at line 900 of file parse.c.
902 unsigned b1, b2, b3, b4, port;
907 if (sscanf(s,
"%3u.%3u.%3u.%3u", &b1, &b2, &b3, &b4) == 4 &&
908 b1 < 256 && b2 < 256 && b3 < 256 && b4 < 256) {
911 port = strtoul(p + 1, NULL, 10);
912 if (port < 1024 || port > 65535) {
925 a->port = BigShort(port);
Referenced by CL_ParsePrint().
◆ CL_ParseBaseline()
static void CL_ParseBaseline |
( |
int |
index, |
|
|
int |
bits |
|
) |
| |
|
static |
◆ CL_ParseCenterPrint()
static void CL_ParseCenterPrint |
( |
void |
| ) |
|
|
static |
◆ CL_ParseConfigstring()
static void CL_ParseConfigstring |
( |
int |
index | ) |
|
|
static |
Definition at line 408 of file parse.c.
413 if (index < 0 || index >= MAX_CONFIGSTRINGS) {
414 Com_Error(ERR_DROP,
"%s: bad index: %d", __func__, index);
418 maxlen = CS_SIZE(index);
421 SHOWNET(2,
" %d \"%s\"\n", index, s);
425 "%s: index %d overflowed: %"PRIz
" > %"PRIz
"\n",
426 __func__, index, len, maxlen - 1);
430 Q_SetBit(
cl.
dcs, index);
435 Q_SetBit(
cl.
dcs, index);
Referenced by CL_ParseGamestate(), CL_ParseServerMessage(), and CL_SeekDemoMessage().
◆ CL_ParseDeltaEntity()
Definition at line 30 of file parse.c.
35 entity_state_t *state;
39 Com_Error(ERR_DROP,
"%s: MAX_EDICTS exceeded", __func__);
47 if (cl_shownet->integer > 2 && bits) {
48 MSG_ShowDeltaEntityBits(bits);
53 MSG_ParseDeltaEntity(old, state, newnum, bits,
cl.
esFlags);
56 if (!(bits & U_OLDORIGIN) && !(state->renderfx & RF_BEAM))
57 VectorCopy(old->origin, state->old_origin);
Referenced by CL_ParsePacketEntities().
◆ CL_ParseDownload()
static void CL_ParseDownload |
( |
int |
cmd | ) |
|
|
static |
Definition at line 1033 of file parse.c.
1035 int size, percent, compressed;
1039 Com_Error(ERR_DROP,
"%s: no download requested", __func__);
1051 if (cmd == svc_zdownload) {
1062 Com_Error(ERR_DROP,
"%s: bad size: %d", __func__, size);
1066 Com_Error(ERR_DROP,
"%s: read past end of message", __func__);
Referenced by CL_ParseServerMessage().
◆ CL_ParseFrame()
static void CL_ParseFrame |
( |
int |
extrabits | ) |
|
|
static |
Definition at line 189 of file parse.c.
191 uint32_t bits, extraflags;
192 int currentframe, deltaframe,
195 player_state_t *from;
198 memset(&frame, 0,
sizeof(frame));
206 currentframe = bits & FRAMENUM_MASK;
207 delta = bits >> FRAMENUM_BITS;
212 deltaframe = currentframe - delta;
217 suppressed = bits & SUPPRESSCOUNT_MASK;
219 if (suppressed & FF_CLIENTPRED) {
221 suppressed &= ~FF_CLIENTDROP;
224 }
else if (suppressed) {
227 extraflags = (extrabits << 4) | (bits >> SUPPRESSCOUNT_BITS);
241 frame.
number = currentframe;
242 frame.
delta = deltaframe;
251 if (deltaframe > 0) {
252 oldframe = &
cl.
frames[deltaframe & UPDATE_MASK];
253 from = &oldframe->
ps;
254 if (deltaframe == currentframe) {
256 Com_DPrintf(
"%s: delta from current frame\n", __func__);
258 }
else if (oldframe->
number != deltaframe) {
261 Com_DPrintf(
"%s: delta frame was never received or too old\n", __func__);
263 }
else if (!oldframe->
valid) {
265 Com_DPrintf(
"%s: delta from invalid frame\n", __func__);
268 MAX_PARSE_ENTITIES - MAX_PACKET_ENTITIES) {
269 Com_DPrintf(
"%s: delta entities too old\n", __func__);
275 Com_DPrintf(
"%s: recovering broken demo\n", __func__);
277 from = &oldframe->
ps;
290 if (length < 0 || msg_read.readcount + length >
msg_read.cursize) {
291 Com_Error(ERR_DROP,
"%s: read past end of message", __func__);
293 if (length >
sizeof(frame.
areabits)) {
294 Com_Error(ERR_DROP,
"%s: invalid areabits length", __func__);
305 Com_Error(ERR_DROP,
"%s: not playerinfo", __func__);
314 MSG_ParseDeltaPlayerstate_Enhanced(from, &frame.
ps, bits, extraflags);
316 if (cl_shownet->integer > 2 && (bits || extraflags)) {
317 MSG_ShowDeltaPlayerstateBits_Enhanced(bits, extraflags);
323 if (extraflags & EPS_CLIENTNUM) {
325 }
else if (oldframe) {
332 MSG_ParseDeltaPlayerstate_Default(from, &frame.
ps, bits);
334 if (cl_shownet->integer > 2 && bits) {
335 MSG_ShowDeltaPlayerstateBits_Default(bits);
345 Com_Error(ERR_DROP,
"%s: not packetentities", __func__);
354 cl.
frames[currentframe & UPDATE_MASK] = frame;
357 if (cl_shownet->integer > 2) {
360 int seq =
cls.
netchan->incoming_acknowledged & CMD_MASK;
363 Com_LPrintf(PRINT_DEVELOPER,
"%3"PRIz
":frame:%d delta:%d rtt:%d\n",
371 cl.keyframe.valid = qfalse;
378 Com_Error(ERR_DROP,
"%s: bad fov", __func__);
389 cl.oldkeyframe =
cl.keyframe;
Referenced by CL_ParseServerMessage(), and CL_SeekDemoMessage().
◆ CL_ParseGamestate()
◆ CL_ParseInventory()
◆ CL_ParseLayout()
◆ CL_ParseMuzzleFlashPacket()
static void CL_ParseMuzzleFlashPacket |
( |
int |
mask | ) |
|
|
static |
◆ CL_ParsePacketEntities()
Definition at line 60 of file parse.c.
65 entity_state_t *oldstate;
83 oldnum = oldstate->number;
88 newnum = MSG_ParseEntityBits(&bits);
89 if (newnum < 0 || newnum >= MAX_EDICTS) {
90 Com_Error(ERR_DROP,
"%s: bad number: %d", __func__, newnum);
94 Com_Error(ERR_DROP,
"%s: read past end of message", __func__);
101 while (oldnum < newnum) {
103 SHOWNET(3,
" unchanged: %i\n", oldnum);
113 oldnum = oldstate->number;
117 if (bits & U_REMOVE) {
119 SHOWNET(2,
" remove: %i\n", newnum);
120 if (oldnum != newnum) {
121 Com_DPrintf(
"U_REMOVE: oldnum != newnum\n");
124 Com_Error(ERR_DROP,
"%s: U_REMOVE with NULL oldframe", __func__);
134 oldnum = oldstate->number;
139 if (oldnum == newnum) {
141 SHOWNET(2,
" delta: %i ", newnum);
154 oldnum = oldstate->number;
159 if (oldnum > newnum) {
161 SHOWNET(2,
" baseline: %i ", newnum);
172 while (oldnum != 99999) {
174 SHOWNET(3,
" unchanged: %i\n", oldnum);
184 oldnum = oldstate->number;
Referenced by CL_ParseFrame().
◆ CL_ParsePrint()
◆ CL_ParseReconnect()
◆ CL_ParseServerData()
Definition at line 479 of file parse.c.
481 char levelname[MAX_QPATH];
482 int i, protocol, attractloop q_unused;
495 Com_DPrintf(
"Serverdata packet received "
496 "(protocol=%d, servercount=%d, attractloop=%d)\n",
502 Com_Error(ERR_DROP,
"Requested protocol version %d, but server returned %d.",
506 if (protocol < PROTOCOL_VERSION_OLD || protocol > PROTOCOL_VERSION_Q2PRO) {
507 Com_Error(ERR_DROP,
"Demo uses unsupported protocol version %d.", protocol);
515 Com_Error(ERR_DROP,
"Oversize gamedir string");
542 cl.frametime = BASE_FRAMETIME;
543 cl.frametime_inv = BASE_1_FRAMETIME;
553 Com_Error(ERR_DROP,
"'Enhanced' R1Q2 servers are not supported");
559 if (!R1Q2_SUPPORTED(i)) {
561 "R1Q2 server reports unsupported protocol version %d.\n"
562 "Assuming it really uses our current client version %d.\n"
563 "Things will break if it does not!\n", i, PROTOCOL_VERSION_R1Q2_CURRENT);
564 clamp(i, PROTOCOL_VERSION_R1Q2_MINIMUM, PROTOCOL_VERSION_R1Q2_CURRENT);
566 Com_DPrintf(
"Using minor R1Q2 protocol version %d\n", i);
571 Com_DPrintf(
"R1Q2 strafejump hack enabled\n");
572 cl.
pmp.strafehack = qtrue;
578 cl.
pmp.speedmult = 2;
581 if (!Q2PRO_SUPPORTED(i)) {
583 "Q2PRO server reports unsupported protocol version %d.\n"
584 "Current client version is %d.", i, PROTOCOL_VERSION_Q2PRO_CURRENT);
586 Com_DPrintf(
"Using minor Q2PRO protocol version %d\n", i);
590 Com_DPrintf(
"Q2PRO server state %d\n", i);
595 Com_DPrintf(
"Q2PRO strafejump hack enabled\n");
596 cl.
pmp.strafehack = qtrue;
600 Com_DPrintf(
"Q2PRO QW mode enabled\n");
616 Com_DPrintf(
"Q2PRO waterjump hack enabled\n");
617 cl.
pmp.waterhack = qtrue;
620 cl.
pmp.speedmult = 2;
621 cl.
pmp.flyhack = qtrue;
622 cl.
pmp.flyfriction = 4;
631 "\35\36\36\36\36\36\36\36\36\36\36\36"
632 "\36\36\36\36\36\36\36\36\36\36\36\36"
633 "\36\36\36\36\36\36\36\36\36\36\36\37"
637 Com_Printf(
"%s\n", levelname);
Referenced by CL_ParseServerMessage().
◆ CL_ParseServerMessage()
Definition at line 1168 of file parse.c.
1175 if (cl_shownet->integer == 1) {
1177 }
else if (cl_shownet->integer > 1) {
1178 Com_LPrintf(PRINT_DEVELOPER,
"------------------\n");
1187 Com_Error(ERR_DROP,
"%s: read past end of server message", __func__);
1197 extrabits = cmd >> SVCMD_BITS;
1201 if (cl_shownet->integer > 1) {
1210 Com_Error(ERR_DROP,
"%s: illegible server message: %d", __func__, cmd);
1216 case svc_disconnect:
1217 Com_Error(ERR_DISCONNECT,
"Server disconnected");
1228 case svc_centerprint:
1236 case svc_serverdata:
1240 case svc_configstring:
1250 case svc_spawnbaseline:
1251 index = MSG_ParseEntityBits(&bits);
1317 size_t len =
msg_read.readcount - readcount;
Referenced by CL_PacketEvent(), CL_ParseZPacket(), CL_PlayDemo_f(), and parse_next_message().
◆ CL_ParseSetting()
◆ CL_ParseStartSoundPacket()
static void CL_ParseStartSoundPacket |
( |
void |
| ) |
|
|
static |
Definition at line 802 of file parse.c.
804 int flags, channel, entity;
807 if ((flags & (SND_ENT | SND_POS)) == 0)
808 Com_Error(ERR_DROP,
"%s: neither SND_ENT nor SND_POS set", __func__);
812 Com_Error(ERR_DROP,
"%s: read past end of message", __func__);
814 if (flags & SND_VOLUME)
817 snd.
volume = DEFAULT_SOUND_PACKET_VOLUME;
819 if (flags & SND_ATTENUATION)
824 if (flags & SND_OFFSET)
829 if (flags & SND_ENT) {
832 entity = channel >> 3;
833 if (entity < 0 || entity >= MAX_EDICTS)
834 Com_Error(ERR_DROP,
"%s: bad entity: %d", __func__, entity);
Referenced by CL_ParseServerMessage(), and CL_SeekDemoMessage().
◆ CL_ParseStuffText()
◆ CL_ParseTEntPacket()
Definition at line 659 of file parse.c.
667 case TE_BULLET_SPARKS:
668 case TE_SCREEN_SPARKS:
669 case TE_SHIELD_SPARKS:
675 case TE_HEATBEAM_SPARKS:
676 case TE_HEATBEAM_STEAM:
678 case TE_ELECTRIC_SPARKS:
684 case TE_LASER_SPARKS:
685 case TE_WELDING_SPARKS:
686 case TE_TUNNEL_SPARKS:
693 case TE_BLUEHYPERBLASTER:
697 case TE_BUBBLETRAIL2:
703 case TE_GRENADE_EXPLOSION:
704 case TE_GRENADE_EXPLOSION_WATER:
706 case TE_PLASMA_EXPLOSION:
707 case TE_ROCKET_EXPLOSION:
708 case TE_ROCKET_EXPLOSION_WATER:
710 case TE_EXPLOSION1_NP:
711 case TE_EXPLOSION1_BIG:
712 case TE_BFG_EXPLOSION:
713 case TE_BFG_BIGEXPLOSION:
715 case TE_PLAIN_EXPLOSION:
716 case TE_CHAINFIST_SMOKE:
717 case TE_TRACKER_EXPLOSION:
718 case TE_TELEPORT_EFFECT:
725 case TE_PARASITE_ATTACK:
726 case TE_MEDIC_CABLE_ATTACK:
728 case TE_MONSTER_HEATBEAM:
734 case TE_GRAPPLE_CABLE:
771 case TE_WIDOWBEAMOUT:
784 Com_Error(ERR_DROP,
"%s: bad type", __func__);
Referenced by CL_ParseServerMessage(), and CL_SeekDemoMessage().
◆ CL_ParseZPacket()
Definition at line 1075 of file parse.c.
1079 byte buffer[MAX_MSGLEN];
1083 Com_Error(ERR_DROP,
"%s: recursively entered", __func__);
1089 if (inlen == -1 || outlen == -1 ||
msg_read.readcount + inlen >
msg_read.cursize) {
1090 Com_Error(ERR_DROP,
"%s: read past end of message", __func__);
1093 if (outlen > MAX_MSGLEN) {
1094 Com_Error(ERR_DROP,
"%s: invalid output length", __func__);
1097 inflateReset(&
cls.z);
1100 cls.z.avail_in = (uInt)inlen;
1101 cls.z.next_out = buffer;
1102 cls.z.avail_out = (uInt)outlen;
1103 if (inflate(&
cls.z, Z_FINISH) != Z_STREAM_END) {
1104 Com_Error(ERR_DROP,
"%s: inflate() failed: %s", __func__,
cls.z.msg);
1117 Com_Error(ERR_DROP,
"Compressed server packet received, "
1118 "but no zlib support linked in.");
Referenced by CL_ParseServerMessage().
◆ CL_SeekDemoMessage()
Definition at line 1343 of file parse.c.
1349 if (cl_shownet->integer == 1) {
1351 }
else if (cl_shownet->integer > 1) {
1352 Com_LPrintf(PRINT_DEVELOPER,
"------------------\n");
1361 Com_Error(ERR_DROP,
"%s: read past end of server message", __func__);
1369 extrabits = cmd >> SVCMD_BITS;
1373 if (cl_shownet->integer > 1) {
1381 Com_Error(ERR_DROP,
"%s: illegible server message: %d", __func__, cmd);
1387 case svc_disconnect:
1389 Com_Error(ERR_DISCONNECT,
"Server disconnected");
1396 case svc_centerprint:
1401 case svc_configstring:
Referenced by CL_Seek_f().
◆ mz
◆ snd
◆ te
Definition at line 655 of file parse.c.
Referenced by CL_OldRailTrail(), CL_ParseBeam(), CL_ParseLaser(), CL_ParseNuke(), CL_ParsePlayerBeam(), CL_ParseSteam(), CL_ParseTEnt(), CL_ParseTEntPacket(), CL_ParseWidow(), CL_PlainExplosion(), CL_RailCore(), CL_RailLights(), CL_RailSpiral(), CL_WidowSplash(), and dirtoangles().
char configstrings[MAX_CONFIGSTRINGS][MAX_QPATH]
static void CL_ParseServerData(void)
void PmoveEnableQW(pmoveParams_t *pmp)
void CL_MuzzleFlash2(void)
entity_state_t entityStates[MAX_PARSE_ENTITIES]
static void CL_ParseReconnect(void)
byte msg_read_buffer[MAX_MSGLEN]
static void CL_ParseZPacket(void)
static void CL_ParsePrint(void)
struct client_static_s::@3 demo
static void CL_ParseBaseline(int index, int bits)
void Con_SkipNotify(qboolean skip)
void CL_GTV_WriteMessage(byte *data, size_t len)
void Cmd_ExecTrigger(const char *string)
void Con_Printf(const char *fmt,...)
void CL_HandleDownload(byte *data, int size, int percent, int compressed)
byte dcs[CS_BITMAP_BYTES]
void CL_MuzzleFlash(void)
void MSG_ReadPos(vec3_t pos)
void SZ_Init(sizebuf_t *buf, void *data, size_t size)
void CL_Disconnect(error_type_t type)
void Com_Error(error_type_t type, const char *fmt,...)
entity_state_t baselines[MAX_EDICTS]
static void CL_ParseGamestate(void)
void Cbuf_AddText(cmdbuf_t *buf, const char *text)
static void CL_ParseCenterPrint(void)
char layout[MAX_NET_STRING]
byte areabits[MAX_MAP_AREA_BYTES]
static void CL_ParseTEntPacket(void)
void S_StartLocalSound_(const char *sound)
static void CL_ParseMuzzleFlashPacket(int mask)
void Com_LPrintf(print_type_t type, const char *fmt,...)
static void CL_ParseDeltaEntity(server_frame_t *frame, int newnum, entity_state_t *old, int bits)
void S_ParseStartSound(void)
void SCR_CenterPrint(const char *str)
cvar_t * Cvar_UserSet(const char *var_name, const char *value)
void CL_UpdateConfigstring(int index)
void CL_ParseServerMessage(void)
static void CL_ParseInventory(void)
server_frame_t frames[UPDATE_BACKUP]
static void CL_ParseFrame(int extrabits)
void SCR_PlayCinematic(const char *name)
netadr_t recent_addr[RECENT_ADDR]
static void CL_ParsePacketEntities(server_frame_t *oldframe, server_frame_t *frame)
struct client_static_s::@2 download
size_t MSG_ReadString(char *dest, size_t size)
void PmoveInit(pmoveParams_t *pmp)
static void CL_ParseConfigstring(int index)
void Com_SetColor(color_index_t color)
void CL_CheckForResend(void)
void Cbuf_Execute(cmdbuf_t *buf)
static void CL_ParseStuffText(void)
qboolean CL_CheckForIgnore(const char *s)
static void CL_ParseStartSoundPacket(void)
client_history_t history[CMD_BACKUP]
void Netchan_Close(netchan_t *netchan)
void MSG_ReadDir(vec3_t dir)
static void CL_ParseDownload(int cmd)
void SCR_AddToChatHUD(const char *text)
static void CL_ParseSetting(void)
static void CL_CheckForIP(const char *s)
static void CL_ParseLayout(void)
size_t COM_strclr(char *s)