DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
 
cl_parse.c File Reference
#include "quakedef.h"
#include "cdaudio.h"
#include "cl_collision.h"
#include "csprogs.h"
#include "libcurl.h"
#include "utf8lib.h"
#include "cl_video.h"
#include "float.h"
+ Include dependency graph for cl_parse.c:

Go to the source code of this file.

Data Structures

struct  cl_iplog_item_t
 

Macros

#define LOADPROGRESSWEIGHT_MODEL   4.0
 
#define LOADPROGRESSWEIGHT_SOUND   1.0
 
#define LOADPROGRESSWEIGHT_WORLDMODEL   30.0
 
#define LOADPROGRESSWEIGHT_WORLDMODEL_INIT   2.0
 
#define RIC_GUNSHOT   1
 
#define RIC_GUNSHOTQUAD   2
 
#define SHOWNET(x)
 

Functions

static void CL_BeginDownloads (qbool aborteddownload)
 
static void CL_BeginDownloads_f (cmd_state_t *cmd)
 
static void CL_DownloadBegin_f (cmd_state_t *cmd)
 
static void CL_DownloadFinished_f (cmd_state_t *cmd)
 
static qbool CL_ExaminePrintString (const char *text)
 
static void CL_IPLog_Add (const char *address, const char *name, qbool checkexisting, qbool addtofile)
 
static void CL_IPLog_List_f (cmd_state_t *cmd)
 
static void CL_IPLog_Load (void)
 
void CL_KeepaliveMessage (qbool readmessages)
 
void CL_MoveLerpEntityStates (entity_t *ent)
 
static void CL_NetworkTimeReceived (double newtime)
 
void CL_NewBeam (int ent, vec3_t start, vec3_t end, model_t *m, int lightning)
 
void CL_Parse_DumpPacket (void)
 
void CL_Parse_ErrorCleanUp (void)
 
void CL_Parse_Init (void)
 
void CL_Parse_Shutdown (void)
 
static void CL_ParseBaseline (entity_t *ent, int large)
 
static void CL_ParseBeam (model_t *m, int lightning)
 
static void CL_ParseClientdata (void)
 
static void CL_ParseDownload (void)
 
static void CL_ParseEffect (void)
 
static void CL_ParseEffect2 (void)
 
void CL_ParseEntityLump (char *entdata)
 
static void CL_ParsePointParticles (void)
 
static void CL_ParsePointParticles1 (void)
 
static void CL_ParseServerInfo (void)
 
void CL_ParseServerMessage (void)
 
static void CL_ParseStartSoundPacket (int largesoundindex)
 
static void CL_ParseStatic (int large)
 
static void CL_ParseStaticSound (int large)
 
static void CL_ParseTempEntity (void)
 
static void CL_ParseTrailParticles (void)
 
static void CL_SendPlayerInfo (void)
 
static void CL_SetSignonStage_WithMsg (int signon_stage)
 
static void CL_SetupWorldModel (void)
 
static void CL_SignonReply (int signon_stage)
 
static void CL_StopDownload (int size, int crc)
 
static void CL_StopDownload_f (cmd_state_t *cmd)
 
static void CL_UpdateItemsAndWeapon (void)
 
void CL_ValidateState (entity_state_t *s)
 
static void QW_CL_Changing_f (cmd_state_t *cmd)
 
static qbool QW_CL_CheckOrDownloadFile (const char *filename)
 
static void QW_CL_NextUpload_f (cmd_state_t *cmd)
 
static void QW_CL_ParseDownload (void)
 
static void QW_CL_ParseModelList (void)
 
static void QW_CL_ParseNails (void)
 
static void QW_CL_ParseSoundList (void)
 
static void QW_CL_ProcessUserInfo (int slot)
 
static void QW_CL_RequestNextDownload (void)
 
static void QW_CL_ServerInfo (void)
 
static void QW_CL_SetInfo (void)
 
static void QW_CL_Skins_f (cmd_state_t *cmd)
 
void QW_CL_StartUpload (unsigned char *data, int size)
 
static void QW_CL_StopUpload_f (cmd_state_t *cmd)
 
static void QW_CL_UpdateUserInfo (void)
 

Variables

cvar_t cl_bottomcolor
 
cvar_t cl_gameplayfix_soundsmovewithentities = {CF_CLIENT, "cl_gameplayfix_soundsmovewithentities", "1", "causes sounds made by lifts, players, projectiles, and any other entities, to move with the entity, so for example a rocket noise follows the rocket rather than staying at the starting position"}
 
static cl_iplog_item_tcl_iplog_items
 
static qbool cl_iplog_loaded = false
 
static int cl_iplog_maxitems = 0
 
cvar_t cl_iplog_name = {CF_CLIENT | CF_ARCHIVE, "cl_iplog_name", "darkplaces_iplog.txt", "name of iplog file containing player addresses for iplog_list command and automatic ip logging when parsing status command"}
 
static int cl_iplog_numitems = 0
 
cvar_t cl_joinbeforedownloadsfinish = {CF_CLIENT | CF_ARCHIVE, "cl_joinbeforedownloadsfinish", "1", "if non-zero the game will begin after the map is loaded before other downloads finish"}
 
cvar_t cl_lerpexcess
 
cvar_t cl_nettimesyncboundmode = {CF_CLIENT | CF_ARCHIVE, "cl_nettimesyncboundmode", "6", "method of restricting client time to valid values, 0 = no correction, 1 = tight bounding (jerky with packet loss), 2 = loose bounding (corrects it if out of bounds), 3 = leniant bounding (ignores temporary errors due to varying framerate), 4 = slow adjustment method from Quake3, 5 = slightly nicer version of Quake3 method, 6 = tight bounding + mode 5, 7 = jitter compensated dynamic adjustment rate"}
 
cvar_t cl_nettimesyncboundtolerance = {CF_CLIENT | CF_ARCHIVE, "cl_nettimesyncboundtolerance", "0.25", "how much error is tolerated by bounding check, as a fraction of frametime, 0.25 = up to 25% margin of error tolerated, 1 = use only new time, 0 = use only old time (same effect as setting cl_nettimesyncfactor to 1) (only affects bound modes 2 and 3)"}
 
cvar_t cl_nettimesyncfactor = {CF_CLIENT | CF_ARCHIVE, "cl_nettimesyncfactor", "0", "rate at which client time adapts to match server time, 1 = instantly, 0.125 = slowly, 0 = not at all (only applied in bound modes 0, 1, 2, 3)"}
 
cvar_t cl_readpicture_force = {CF_CLIENT, "cl_readpicture_force", "0", "when enabled, the low quality pictures read by ReadPicture() are preferred over the high quality pictures on the file system"}
 
cvar_t cl_serverextension_download = {CF_CLIENT, "cl_serverextension_download", "0", "indicates whether the server supports the download command"}
 
cvar_t cl_sound_hknighthit = {CF_CLIENT, "cl_sound_hknighthit", "hknight/hit.wav", "sound to play during TE_KNIGHTSPIKE (empty cvar disables sound)"}
 
cvar_t cl_sound_r_exp3 = {CF_CLIENT, "cl_sound_r_exp3", "weapons/r_exp3.wav", "sound to play during TE_EXPLOSION and related effects (empty cvar disables sound)"}
 
cvar_t cl_sound_ric1 = {CF_CLIENT, "cl_sound_ric1", "weapons/ric1.wav", "sound to play with 5% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"}
 
cvar_t cl_sound_ric2 = {CF_CLIENT, "cl_sound_ric2", "weapons/ric2.wav", "sound to play with 5% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"}
 
cvar_t cl_sound_ric3 = {CF_CLIENT, "cl_sound_ric3", "weapons/ric3.wav", "sound to play with 10% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"}
 
cvar_t cl_sound_ric_gunshot = {CF_CLIENT, "cl_sound_ric_gunshot", "0", "specifies if and when the related cl_sound_ric and cl_sound_tink sounds apply to TE_GUNSHOT/TE_GUNSHOTQUAD, 0 = no sound, 1 = TE_GUNSHOT, 2 = TE_GUNSHOTQUAD, 3 = TE_GUNSHOT and TE_GUNSHOTQUAD"}
 
cvar_t cl_sound_tink1 = {CF_CLIENT, "cl_sound_tink1", "weapons/tink1.wav", "sound to play with 80% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"}
 
cvar_t cl_sound_wizardhit = {CF_CLIENT, "cl_sound_wizardhit", "wizard/hit.wav", "sound to play during TE_WIZSPIKE (empty cvar disables sound)"}
 
cvar_t cl_topcolor
 
cvar_t cl_worldbasename = {CF_CLIENT | CF_READONLY, "cl_worldbasename", "", "name of current worldmodel without maps/ prefix or extension"}
 
cvar_t cl_worldmessage = {CF_CLIENT | CF_READONLY, "cl_worldmessage", "", "title of current level"}
 
cvar_t cl_worldname = {CF_CLIENT | CF_READONLY, "cl_worldname", "", "name of current worldmodel"}
 
cvar_t cl_worldnamenoextension = {CF_CLIENT | CF_READONLY, "cl_worldnamenoextension", "", "name of current worldmodel without extension"}
 
cvar_t con_chatsound_team_file
 
static const vec3_t defaultmaxs = {4096, 4096, 4096}
 
static const vec3_t defaultmins = {-4096, -4096, -4096}
 
cvar_t developer_networkentities = {CF_CLIENT, "developer_networkentities", "0", "prints received entities, value is 0-10 (higher for more info, 10 being the most verbose)"}
 
cvar_t host_timescale
 
static unsigned char olddata [NET_MAXMESSAGE]
 
int parsingerror = false
 
const char * qw_svc_strings [128]
 
cvar_t snd_cdautopause = {CF_CLIENT | CF_ARCHIVE, "snd_cdautopause", "1", "pause the CD track while the game is paused"}
 
const char * svc_strings [128]
 

Macro Definition Documentation

◆ LOADPROGRESSWEIGHT_MODEL

#define LOADPROGRESSWEIGHT_MODEL   4.0

Definition at line 1084 of file cl_parse.c.

Referenced by CL_BeginDownloads().

◆ LOADPROGRESSWEIGHT_SOUND

#define LOADPROGRESSWEIGHT_SOUND   1.0

Definition at line 1083 of file cl_parse.c.

Referenced by CL_BeginDownloads().

◆ LOADPROGRESSWEIGHT_WORLDMODEL

#define LOADPROGRESSWEIGHT_WORLDMODEL   30.0

Definition at line 1085 of file cl_parse.c.

Referenced by CL_BeginDownloads().

◆ LOADPROGRESSWEIGHT_WORLDMODEL_INIT

#define LOADPROGRESSWEIGHT_WORLDMODEL_INIT   2.0

Definition at line 1086 of file cl_parse.c.

Referenced by CL_BeginDownloads().

◆ RIC_GUNSHOT

#define RIC_GUNSHOT   1

Definition at line 183 of file cl_parse.c.

Referenced by CL_ParseTempEntity().

◆ RIC_GUNSHOTQUAD

#define RIC_GUNSHOTQUAD   2

Definition at line 184 of file cl_parse.c.

Referenced by CL_ParseTempEntity().

◆ SHOWNET

#define SHOWNET ( x)
Value:
if(cl_shownet.integer==2)Con_Printf("%3i:%s(%i)\n", cl_message.readcount-1, x, cmd);
cvar_t cl_shownet
Definition cl_main.c:42
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
Definition console.c:1514
GLint GLenum GLint x
Definition glquake.h:651
void cmd(string command,...)
sizebuf_t cl_message
Definition netconn.c:71
int integer
Definition cvar.h:73
int readcount
Definition common.h:55

Definition at line 3427 of file cl_parse.c.

Referenced by CL_ParseServerMessage().

Function Documentation

◆ CL_BeginDownloads()

static void CL_BeginDownloads ( qbool aborteddownload)
static

Definition at line 1088 of file cl_parse.c.

1089{
1090 char vabuf[1024];
1091 // quakeworld works differently
1093 return;
1094
1095 // this would be a good place to do curl downloads
1097 {
1098 Curl_Register_predownload(); // come back later
1099 return;
1100 }
1101
1102 // if we got here...
1103 // curl is done, so let's start with the business
1104 if(!cl.loadbegun)
1105 SCR_PushLoadingScreen("Loading precaches", 1);
1106 cl.loadbegun = true;
1107
1108 // if already downloading something from the previous level, don't stop it
1109 if (cls.qw_downloadname[0])
1110 return;
1111
1112 if (cl.downloadcsqc)
1113 {
1114 size_t progsize;
1115 cl.downloadcsqc = false;
1116 if (cls.netcon
1117 && !sv.active
1119 && csqc_progname.string[0]
1120 && csqc_progcrc.integer >= 0
1122 && (FS_CRCFile(csqc_progname.string, &progsize) != csqc_progcrc.integer || ((int)progsize != csqc_progsize.integer && csqc_progsize.integer != -1))
1123 && !FS_FileExists(va(vabuf, sizeof(vabuf), "dlcache/%s.%i.%i", csqc_progname.string, csqc_progsize.integer, csqc_progcrc.integer)))
1124 {
1125 Con_Printf("Downloading new CSQC code to dlcache/%s.%i.%i\n", csqc_progname.string, csqc_progsize.integer, csqc_progcrc.integer);
1127 CL_ForwardToServer(va(vabuf, sizeof(vabuf), "download %s deflate", csqc_progname.string));
1128 else
1129 CL_ForwardToServer(va(vabuf, sizeof(vabuf), "download %s", csqc_progname.string));
1130 return;
1131 }
1132 }
1133
1135 {
1136 // loading models
1137 if(cl.loadmodel_current == 1)
1138 {
1139 // worldmodel counts as 16 models (15 + world model setup), for better progress bar
1140 SCR_PushLoadingScreen("Loading precached models",
1141 (
1145 ) / (
1150 )
1151 );
1152 }
1154 {
1156 (
1158 ) / (
1162 )
1163 );
1165 {
1166 SCR_PopLoadingScreen(false);
1167 if(cl.loadmodel_current == 1)
1168 {
1170 SCR_PopLoadingScreen(false);
1171 }
1172 continue;
1173 }
1174 CL_KeepaliveMessage(true);
1175
1176 // if running a local game, calling Mod_ForName is a completely wasted effort...
1177 if (sv.active)
1179 else
1180 {
1181 if(cl.loadmodel_current == 1)
1182 {
1183 // they'll be soon loaded, but make sure we apply freshly downloaded shaders from a curled pk3
1185 }
1187 }
1188 SCR_PopLoadingScreen(false);
1190 {
1191 // we now have the worldmodel so we can set up the game world
1192 SCR_PushLoadingScreen("world model setup",
1193 (
1195 ) / (
1199 )
1200 );
1204 {
1205 cl.loadfinished = true;
1206 // now issue the spawn to move on to signon 2 like normal
1207 if (cls.netcon)
1208 CL_ForwardToServer("prespawn");
1209 }
1210 }
1211 }
1212 SCR_PopLoadingScreen(false);
1213 // finished loading models
1214 }
1215
1217 {
1218 // loading sounds
1219 if(cl.loadsound_current == 1)
1220 SCR_PushLoadingScreen("Loading precached sounds",
1221 (
1223 ) / (
1228 )
1229 );
1231 {
1234 {
1235 SCR_PopLoadingScreen(false);
1236 continue;
1237 }
1238 CL_KeepaliveMessage(true);
1240 SCR_PopLoadingScreen(false);
1241 }
1242 SCR_PopLoadingScreen(false);
1243 // finished loading sounds
1244 }
1245
1248 // in Nexuiz/Xonotic, the built in download protocol is kinda broken (misses lots
1249 // of dependencies) anyway, and can mess around with the game directory;
1250 // until this is fixed, only support pk3 downloads via curl, and turn off
1251 // individual file downloads other than for CSQC
1252 // on the other end of the download protocol, GAME_NEXUIZ/GAME_XONOTIC enforces writing
1253 // to dlcache only
1254 // idea: support download of pk3 files using this protocol later
1255
1256 // note: the reason these loops skip already-loaded things is that it
1257 // enables this command to be issued during the game if desired
1258
1260 {
1261 // loading models
1262
1264 {
1265 if (aborteddownload)
1266 {
1267
1268 if (cl.downloadmodel_current == 1)
1269 {
1270 // the worldmodel failed, but we need to set up anyway
1274 {
1275 cl.loadfinished = true;
1276 // now issue the spawn to move on to signon 2 like normal
1277 if (cls.netcon)
1278 CL_ForwardToServer("prespawn");
1279 }
1280 }
1281 aborteddownload = false;
1282 continue;
1283 }
1285 continue;
1286 CL_KeepaliveMessage(true);
1288 {
1289 if (cl.downloadmodel_current == 1)
1290 Con_Printf("Map %s not found\n", cl.model_name[cl.downloadmodel_current]);
1291 else
1292 Con_Printf("Model %s not found\n", cl.model_name[cl.downloadmodel_current]);
1293 // regarding the * check: don't try to download submodels
1295 {
1296 CL_ForwardToServer(va(vabuf, sizeof(vabuf), "download %s", cl.model_name[cl.downloadmodel_current]));
1297 // we'll try loading again when the download finishes
1298 return;
1299 }
1300 }
1301
1302 if(cl.downloadmodel_current == 1)
1303 {
1304 // they'll be soon loaded, but make sure we apply freshly downloaded shaders from a curled pk3
1306 }
1307
1309 if (cl.downloadmodel_current == 1)
1310 {
1311 // we now have the worldmodel so we can set up the game world
1312 // or maybe we do not have it (cl_serverextension_download 0)
1313 // then we need to continue loading ANYWAY!
1316 {
1317 cl.loadfinished = true;
1318 // now issue the spawn to move on to signon 2 like normal
1319 if (cls.netcon)
1320 CL_ForwardToServer("prespawn");
1321 }
1322 }
1323 }
1324
1325 // finished loading models
1326 }
1327
1329 {
1330 // loading sounds
1331
1333 {
1334 char soundname[MAX_QPATH];
1335 if (aborteddownload)
1336 {
1337 aborteddownload = false;
1338 continue;
1339 }
1341 continue;
1342 CL_KeepaliveMessage(true);
1343 dpsnprintf(soundname, sizeof(soundname), "sound/%s", cl.sound_name[cl.downloadsound_current]);
1345 {
1347 {
1348 CL_ForwardToServer(va(vabuf, sizeof(vabuf), "download %s", soundname));
1349 // we'll try loading again when the download finishes
1350 return;
1351 }
1352 }
1354 }
1355
1356 // finished loading sounds
1357 }
1358
1359 SCR_PopLoadingScreen(false);
1360
1361 if (!cl.loadfinished)
1362 {
1363 cl.loadfinished = true;
1364
1365 // check memory integrity
1367
1368 // now issue the spawn to move on to signon 2 like normal
1369 if (cls.netcon)
1370 CL_ForwardToServer("prespawn");
1371 }
1372}
void CL_ForwardToServer(const char *s)
adds the string as a clc_stringcmd to the client message.
Definition cl_cmd.c:54
cvar_t csqc_progcrc
Definition cl_main.c:36
cvar_t csqc_progsize
Definition cl_main.c:37
client_state_t cl
Definition cl_main.c:117
cvar_t csqc_progname
Definition cl_main.c:35
client_static_t cls
Definition cl_main.c:116
#define LOADPROGRESSWEIGHT_WORLDMODEL_INIT
Definition cl_parse.c:1086
static void CL_SetupWorldModel(void)
Definition cl_parse.c:479
cvar_t cl_joinbeforedownloadsfinish
Definition cl_parse.c:190
cvar_t cl_serverextension_download
Definition cl_parse.c:189
#define LOADPROGRESSWEIGHT_WORLDMODEL
Definition cl_parse.c:1085
#define LOADPROGRESSWEIGHT_SOUND
Definition cl_parse.c:1083
#define LOADPROGRESSWEIGHT_MODEL
Definition cl_parse.c:1084
void CL_KeepaliveMessage(qbool readmessages)
Definition cl_parse.c:314
void SCR_PopLoadingScreen(qbool redraw)
Definition cl_screen.c:1899
void SCR_PushLoadingScreen(const char *msg, float len_in_parent)
Definition cl_screen.c:1873
gamemode_t gamemode
Definition com_game.c:26
#define IS_NEXUIZ_DERIVED(g)
Definition com_game.h:71
char * va(char *buf, size_t buflen, const char *format,...)
Definition common.c:972
int dpsnprintf(char *buffer, size_t buffersize, const char *format,...)
Returns the number of printed characters, excluding the final '\0' or returns -1 if the buffer isn't ...
Definition common.c:997
@ PROTOCOL_QUAKEWORLD
quakeworld protocol
Definition common.h:145
void Cvar_SetValueQuick(cvar_t *var, float value)
Definition cvar.c:473
qbool FS_HasZlib(void)
Definition fs.c:620
int FS_CRCFile(const char *filename, size_t *filesizepointer)
Definition fs.c:4158
const char * FS_FileExists(const char *filename)
Look for a file in the packages and in the filesystem Returns its canonical name (same case as used i...
Definition fs.c:3693
void Curl_Register_predownload(void)
Definition libcurl.c:315
qbool Curl_Have_forthismap(void)
Definition libcurl.c:310
model_t * Mod_ForName(const char *name, qbool crash, qbool checkdisk, const char *parentname)
void Mod_FreeQ3Shaders(void)
#define MAX_QPATH
max length of a quake game pathname
Definition qdefs.h:169
#define NULL
Definition qtypes.h:12
server_t sv
local server
Definition sv_main.c:223
qbool S_IsSoundPrecached(const sfx_t *sfx)
Definition snd_main.c:1105
sfx_t * S_PrecacheSound(const char *name, qbool complain, qbool levelsound)
Definition snd_main.c:1048
int loadsound_total
Definition client.h:1024
char sound_name[MAX_SOUNDS][MAX_QPATH]
Definition client.h:893
int downloadmodel_current
Definition client.h:1020
qbool downloadcsqc
Definition client.h:1025
int loadmodel_total
Definition client.h:1021
qbool loadfinished
Definition client.h:1028
int loadsound_current
Definition client.h:1022
struct sfx_s * sound_precache[MAX_SOUNDS]
Definition client.h:889
qbool loadbegun
Definition client.h:1027
struct model_s * model_precache[MAX_MODELS]
Definition client.h:888
char model_name[MAX_MODELS][MAX_QPATH]
Definition client.h:892
int downloadsound_current
Definition client.h:1023
int loadmodel_current
Definition client.h:1019
netconn_t * netcon
Definition client.h:630
protocolversion_t protocol
Definition client.h:617
char qw_downloadname[MAX_QPATH]
Definition client.h:648
const char * string
Definition cvar.h:71
qbool active
false if only a net client
Definition server.h:66
struct model_s * models[MAX_MODELS]
Definition server.h:117
#define Mem_CheckSentinelsGlobal()
Definition zone.h:102

References server_t::active, cl, CL_ForwardToServer(), cl_joinbeforedownloadsfinish, CL_KeepaliveMessage(), cl_serverextension_download, CL_SetupWorldModel(), cls, Con_Printf(), csqc_progcrc, csqc_progname, csqc_progsize, Curl_Have_forthismap(), Curl_Register_predownload(), Cvar_SetValueQuick(), client_state_t::downloadcsqc, client_state_t::downloadmodel_current, client_state_t::downloadsound_current, dpsnprintf(), FS_CRCFile(), FS_FileExists(), FS_HasZlib(), gamemode, cvar_t::integer, IS_NEXUIZ_DERIVED, client_state_t::loadbegun, client_state_t::loadfinished, client_state_t::loadmodel_current, client_state_t::loadmodel_total, LOADPROGRESSWEIGHT_MODEL, LOADPROGRESSWEIGHT_SOUND, LOADPROGRESSWEIGHT_WORLDMODEL, LOADPROGRESSWEIGHT_WORLDMODEL_INIT, client_state_t::loadsound_current, client_state_t::loadsound_total, MAX_QPATH, Mem_CheckSentinelsGlobal, Mod_ForName(), Mod_FreeQ3Shaders(), client_state_t::model_name, client_state_t::model_precache, server_t::models, client_static_t::netcon, NULL, client_static_t::protocol, PROTOCOL_QUAKEWORLD, client_static_t::qw_downloadname, S_IsSoundPrecached(), S_PrecacheSound(), SCR_PopLoadingScreen(), SCR_PushLoadingScreen(), client_state_t::sound_name, client_state_t::sound_precache, cvar_t::string, sv, and va().

Referenced by CL_BeginDownloads_f(), CL_DownloadFinished_f(), CL_StopDownload(), and CL_StopDownload_f().

◆ CL_BeginDownloads_f()

static void CL_BeginDownloads_f ( cmd_state_t * cmd)
static

Definition at line 1374 of file cl_parse.c.

1375{
1376 // prevent cl_begindownloads from being issued multiple times in one match
1377 // to prevent accidentally cancelled downloads
1378 if(cl.loadbegun)
1379 Con_Printf("cl_begindownloads is only valid once per match\n");
1380 else
1381 CL_BeginDownloads(false);
1382}
static void CL_BeginDownloads(qbool aborteddownload)
Definition cl_parse.c:1088

References cl, CL_BeginDownloads(), Con_Printf(), and client_state_t::loadbegun.

Referenced by CL_Parse_Init().

◆ CL_DownloadBegin_f()

static void CL_DownloadBegin_f ( cmd_state_t * cmd)
static

Definition at line 1517 of file cl_parse.c.

1518{
1519 int size = atoi(Cmd_Argv(cmd, 1));
1520
1521 if (size < 0 || size > 1<<30 || FS_CheckNastyPath(Cmd_Argv(cmd, 2), false))
1522 {
1523 Con_Printf("cl_downloadbegin: received bogus information\n");
1524 CL_StopDownload(0, 0);
1525 return;
1526 }
1527
1528 if (cls.qw_downloadname[0])
1529 Con_Printf("Download of %s aborted\n", cls.qw_downloadname);
1530
1531 CL_StopDownload(0, 0);
1532
1533 // we're really beginning a download now, so initialize stuff
1538
1539 cls.qw_download_deflate = false;
1540 if(Cmd_Argc(cmd) >= 4)
1541 {
1542 if(!strcmp(Cmd_Argv(cmd, 3), "deflate"))
1543 cls.qw_download_deflate = true;
1544 // check further encodings here
1545 }
1546
1547 CL_ForwardToServer("sv_startdownload");
1548}
static void CL_StopDownload(int size, int crc)
Definition cl_parse.c:1384
static int Cmd_Argc(cmd_state_t *cmd)
Definition cmd.h:249
static const char * Cmd_Argv(cmd_state_t *cmd, int arg)
Cmd_Argv(cmd, ) will return an empty string (not a NULL) if arg > argc, so string operations are alwa...
Definition cmd.h:254
#define dp_strlcpy(dst, src, dsize)
Definition common.h:303
vector size
int FS_CheckNastyPath(const char *path, qbool isgamedir)
Definition fs.c:2618
mempool_t * permanentmempool
Definition client.h:572
int qw_downloadnumber
Definition client.h:652
unsigned char * qw_downloadmemory
Definition client.h:649
qbool qw_download_deflate
Definition client.h:659
int qw_downloadmemorymaxsize
Definition client.h:651
#define Mem_Alloc(pool, size)
Definition zone.h:92

References CL_ForwardToServer(), CL_StopDownload(), cls, cmd(), Cmd_Argc(), Cmd_Argv(), Con_Printf(), dp_strlcpy, FS_CheckNastyPath(), Mem_Alloc, client_static_t::permanentmempool, client_static_t::qw_download_deflate, client_static_t::qw_downloadmemory, client_static_t::qw_downloadmemorymaxsize, client_static_t::qw_downloadname, client_static_t::qw_downloadnumber, and size.

Referenced by CL_Parse_Init().

◆ CL_DownloadFinished_f()

static void CL_DownloadFinished_f ( cmd_state_t * cmd)
static

Definition at line 1561 of file cl_parse.c.

1562{
1563 if (Cmd_Argc(cmd) < 3)
1564 {
1565 Con_Printf("Malformed cl_downloadfinished command\n");
1566 return;
1567 }
1568 CL_StopDownload(atoi(Cmd_Argv(cmd, 1)), atoi(Cmd_Argv(cmd, 2)));
1569 CL_BeginDownloads(false);
1570}

References CL_BeginDownloads(), CL_StopDownload(), cmd(), Cmd_Argc(), Cmd_Argv(), and Con_Printf().

Referenced by CL_Parse_Init().

◆ CL_ExaminePrintString()

static qbool CL_ExaminePrintString ( const char * text)
static

Definition at line 3142 of file cl_parse.c.

3143{
3144 int len;
3145 const char *t;
3146 char temp[MAX_INPUTLINE];
3147 if (!strcmp(text, "Client ping times:\n"))
3148 {
3150 // hide ping reports in demos
3151 if (cls.demoplayback)
3154 ;
3155 if (cl.parsingtextplayerindex >= cl.maxclients) // should never happen, since the client itself should be in cl.scores
3156 {
3157 Con_Printf("ping reply but empty scoreboard?!?\n");
3160 }
3163 }
3164 if (!strncmp(text, "host: ", 9))
3165 {
3166 // cl.parsingtextexpectingpingforscores = false; // really?
3169 return true;
3170 }
3172 {
3173 // if anything goes wrong, we'll assume this is not a ping report
3177 t = text;
3178 while (*t == ' ')
3179 t++;
3180 if ((*t >= '0' && *t <= '9') || *t == '-')
3181 {
3182 int ping = atoi(t);
3183 while ((*t >= '0' && *t <= '9') || *t == '-')
3184 t++;
3185 if (*t == ' ')
3186 {
3187 int charindex = 0;
3188 t++;
3190 {
3191 for (charindex = 0;cl.scores[cl.parsingtextplayerindex].name[charindex] == t[charindex];charindex++)
3192 ;
3193 // note: the matching algorithm stops at the end of the player name because some servers append text such as " READY" after the player name in the scoreboard but not in the ping report
3194 //if (cl.scores[cl.parsingtextplayerindex].name[charindex] == 0 && t[charindex] == '\n')
3195 if (t[charindex] == '\n')
3196 {
3199 ;
3200 //if (cl.parsingtextplayerindex < cl.maxclients) // we could still get unconnecteds!
3201 {
3202 // we parsed a valid ping entry, so expect another to follow
3205 }
3206 return !expected;
3207 }
3208 }
3209 if (!strncmp(t, "unconnected\n", 12))
3210 {
3211 // just ignore
3214 return !expected;
3215 }
3216 else
3217 Con_DPrintf("player names '%s' and '%s' didn't match\n", cl.scores[cl.parsingtextplayerindex].name, t);
3218 }
3219 }
3220 }
3222 {
3223 if (!strncmp(text, "players: ", 9))
3224 {
3227 return true;
3228 }
3229 else if (!strstr(text, ": "))
3230 {
3231 cl.parsingtextmode = CL_PARSETEXTMODE_NONE; // status report ended
3232 return true;
3233 }
3234 }
3236 {
3237 // if anything goes wrong, we'll assume this is not a status report
3239 if (text[0] == '#' && text[1] >= '0' && text[1] <= '9')
3240 {
3241 t = text + 1;
3242 cl.parsingtextplayerindex = atoi(t) - 1;
3243 while (*t >= '0' && *t <= '9')
3244 t++;
3245 if (*t == ' ')
3246 {
3248 return true;
3249 }
3250 // the player name follows here, along with frags and time
3251 }
3252 }
3254 {
3255 // if anything goes wrong, we'll assume this is not a status report
3257 if (text[0] == ' ')
3258 {
3259 t = text;
3260 while (*t == ' ')
3261 t++;
3262 for (len = 0;*t && *t != '\n';t++)
3263 if (len < (int)sizeof(temp) - 1)
3264 temp[len++] = *t;
3265 temp[len] = 0;
3266 // botclient is perfectly valid, but we don't care about bots
3267 // also don't try to look up the name of an invalid player index
3268 if (strcmp(temp, "botclient")
3272 {
3273 // log the player name and IP address string
3274 // (this operates entirely on strings to avoid issues with the
3275 // nature of a network address)
3276 CL_IPLog_Add(temp, cl.scores[cl.parsingtextplayerindex].name, true, true);
3277 }
3279 return true;
3280 }
3281 }
3282 return true;
3283}
static void CL_IPLog_Add(const char *address, const char *name, qbool checkexisting, qbool addtofile)
Definition cl_parse.c:2994
@ CL_PARSETEXTMODE_STATUS_PLAYERIP
Definition client.h:717
@ CL_PARSETEXTMODE_PING
Definition client.h:714
@ CL_PARSETEXTMODE_STATUS_PLAYERID
Definition client.h:716
@ CL_PARSETEXTMODE_NONE
Definition client.h:713
@ CL_PARSETEXTMODE_STATUS
Definition client.h:715
void Con_DPrintf(const char *fmt,...)
A Con_Printf that only shows up if the "developer" cvar is set.
Definition console.c:1544
float ping
#define bound(min, num, max)
Definition mathlib.h:34
#define MAX_INPUTLINE
maximum size of console commandline, QuakeC strings, and many other text processing buffers
Definition qdefs.h:94
bool qbool
Definition qtypes.h:9
int parsingtextexpectingpingforscores
Definition client.h:955
int parsingtextplayerindex
Definition client.h:949
scoreboard_t * scores
Definition client.h:945
cl_parsingtextmode_t parsingtextmode
Definition client.h:948
qbool demoplayback
Definition client.h:587
char name[MAX_SCOREBOARDNAME]
Definition client.h:489
int qw_ping
Definition client.h:496

References bound, cl, CL_IPLog_Add(), CL_PARSETEXTMODE_NONE, CL_PARSETEXTMODE_PING, CL_PARSETEXTMODE_STATUS, CL_PARSETEXTMODE_STATUS_PLAYERID, CL_PARSETEXTMODE_STATUS_PLAYERIP, cls, Con_DPrintf(), Con_Printf(), client_static_t::demoplayback, MAX_INPUTLINE, client_state_t::maxclients, scoreboard_t::name, client_state_t::parsingtextexpectingpingforscores, client_state_t::parsingtextmode, client_state_t::parsingtextplayerindex, ping, scoreboard_t::qw_ping, and client_state_t::scores.

Referenced by CL_ParseServerMessage().

◆ CL_IPLog_Add()

static void CL_IPLog_Add ( const char * address,
const char * name,
qbool checkexisting,
qbool addtofile )
static

Definition at line 2994 of file cl_parse.c.

2995{
2996 int i;
2997 size_t sz_name, sz_address;
2998 if (!address || !address[0] || !name || !name[0])
2999 return;
3000 if (!cl_iplog_loaded)
3001 CL_IPLog_Load();
3003 Con_DPrintf("CL_IPLog_Add(\"%s\", \"%s\", %i, %i);\n", address, name, checkexisting, addtofile);
3004 // see if it already exists
3005 if (checkexisting)
3006 {
3007 for (i = 0;i < cl_iplog_numitems;i++)
3008 {
3009 if (!strcmp(cl_iplog_items[i].address, address) && !strcmp(cl_iplog_items[i].name, name))
3010 {
3012 Con_DPrintf("... found existing \"%s\" \"%s\"\n", cl_iplog_items[i].address, cl_iplog_items[i].name);
3013 return;
3014 }
3015 }
3016 }
3017 // it does not already exist in the iplog, so add it
3019 {
3020 cl_iplog_item_t *olditems = cl_iplog_items;
3023 if (olditems)
3024 {
3026 memcpy(cl_iplog_items, olditems, cl_iplog_numitems * sizeof(cl_iplog_item_t));
3027 Mem_Free(olditems);
3028 }
3029 }
3030 sz_address = strlen(address) + 1;
3031 sz_name = strlen(name) + 1;
3034 dp_strlcpy(cl_iplog_items[cl_iplog_numitems].address, address, sz_address);
3035 // TODO: maybe it would be better to strip weird characters from name when
3036 // copying it here rather than using a straight strcpy?
3039 if (addtofile)
3040 {
3041 // add it to the iplog.txt file
3042 // TODO: this ought to open the one in the userpath version of the base
3043 // gamedir, not the current gamedir
3044// not necessary for mobile
3045#ifndef DP_MOBILETOUCH
3046 Log_Printf(cl_iplog_name.string, "%s %s\n", address, name);
3048 Con_DPrintf("CL_IPLog_Add: appending this line to %s: %s %s\n", cl_iplog_name.string, address, name);
3049#endif
3050 }
3051}
static cl_iplog_item_t * cl_iplog_items
Definition cl_parse.c:2991
cvar_t cl_iplog_name
Definition cl_parse.c:194
static int cl_iplog_maxitems
Definition cl_parse.c:2990
static qbool cl_iplog_loaded
Definition cl_parse.c:2988
static int cl_iplog_numitems
Definition cl_parse.c:2989
static void CL_IPLog_Load(void)
Definition cl_parse.c:3053
void Log_Printf(const char *logfilename, const char *fmt,...)
Definition console.c:655
const GLchar * name
Definition glquake.h:601
cvar_t developer_extra
Definition host.c:49
#define max(A, B)
Definition mathlib.h:38
float strlen(string s)
int i
#define Mem_Free(mem)
Definition zone.h:96

References cl_iplog_item_t::address, cl_iplog_items, CL_IPLog_Load(), cl_iplog_loaded, cl_iplog_maxitems, cl_iplog_name, cl_iplog_numitems, cls, Con_DPrintf(), developer_extra, dp_strlcpy, i, cvar_t::integer, Log_Printf(), max, Mem_Alloc, Mem_Free, cl_iplog_item_t::name, name, client_static_t::permanentmempool, cvar_t::string, and strlen().

Referenced by CL_ExaminePrintString(), and CL_IPLog_Load().

◆ CL_IPLog_List_f()

static void CL_IPLog_List_f ( cmd_state_t * cmd)
static

Definition at line 3100 of file cl_parse.c.

3101{
3102 int i, j;
3103 const char *addressprefix;
3104 if (Cmd_Argc(cmd) > 2)
3105 {
3106 Con_Printf("usage: %s 123.456.789.\n", Cmd_Argv(cmd, 0));
3107 return;
3108 }
3109 addressprefix = "";
3110 if (Cmd_Argc(cmd) >= 2)
3111 addressprefix = Cmd_Argv(cmd, 1);
3112 if (!cl_iplog_loaded)
3113 CL_IPLog_Load();
3114 if (addressprefix && addressprefix[0])
3115 Con_Printf("Listing iplog addresses beginning with %s\n", addressprefix);
3116 else
3117 Con_Printf("Listing all iplog entries\n");
3118 Con_Printf("address name\n");
3119 for (i = 0;i < cl_iplog_numitems;i++)
3120 {
3121 if (addressprefix && addressprefix[0])
3122 {
3123 for (j = 0;addressprefix[j];j++)
3124 if (addressprefix[j] != cl_iplog_items[i].address[j])
3125 break;
3126 // if this address does not begin with the addressprefix string
3127 // simply omit it from the output
3128 if (addressprefix[j])
3129 continue;
3130 }
3131 // if name is less than 15 characters, left justify it and pad
3132 // if name is more than 15 characters, print all of it, not worrying
3133 // about the fact it will misalign the columns
3134 if (strlen(cl_iplog_items[i].address) < 15)
3135 Con_Printf("%-15s %s\n", cl_iplog_items[i].address, cl_iplog_items[i].name);
3136 else
3137 Con_Printf("%5s %s\n", cl_iplog_items[i].address, cl_iplog_items[i].name);
3138 }
3139}

References cl_iplog_items, CL_IPLog_Load(), cl_iplog_loaded, cl_iplog_numitems, cmd(), Cmd_Argc(), Cmd_Argv(), Con_Printf(), i, name, and strlen().

Referenced by CL_Parse_Init().

◆ CL_IPLog_Load()

static void CL_IPLog_Load ( void )
static

Definition at line 3053 of file cl_parse.c.

3054{
3055 int i, len, linenumber;
3056 char *text, *textend;
3057 unsigned char *filedata;
3058 fs_offset_t filesize;
3059 char line[MAX_INPUTLINE];
3060 char address[MAX_INPUTLINE];
3061 cl_iplog_loaded = true;
3062 // TODO: this ought to open the one in the userpath version of the base
3063 // gamedir, not the current gamedir
3064// not necessary for mobile
3065#ifndef DP_MOBILETOUCH
3066 filedata = FS_LoadFile(cl_iplog_name.string, tempmempool, true, &filesize);
3067#else
3068 filedata = NULL;
3069#endif
3070 if (!filedata)
3071 return;
3072 text = (char *)filedata;
3073 textend = text + filesize;
3074 for (linenumber = 1;text < textend;linenumber++)
3075 {
3076 for (len = 0;text < textend && *text != '\r' && *text != '\n';text++)
3077 if (len < (int)sizeof(line) - 1)
3078 line[len++] = *text;
3079 line[len] = 0;
3080 if (text < textend && *text == '\r' && text[1] == '\n')
3081 text++;
3082 if (text < textend && *text == '\n')
3083 text++;
3084 if (line[0] == '/' && line[1] == '/')
3085 continue; // skip comments if anyone happens to add them
3086 for (i = 0;i < len && !ISWHITESPACE(line[i]);i++)
3087 address[i] = line[i];
3088 address[i] = 0;
3089 // skip exactly one space character
3090 i++;
3091 // address contains the address with termination,
3092 // line + i contains the name with termination
3093 if (address[0] && line[i])
3094 CL_IPLog_Add(address, line + i, false, false);
3095 else
3096 Con_Printf("%s:%i: could not parse address and name:\n%s\n", cl_iplog_name.string, linenumber, line);
3097 }
3098}
unsigned char * FS_LoadFile(const char *path, mempool_t *pool, qbool quiet, fs_offset_t *filesizepointer)
Definition fs.c:3540
int64_t fs_offset_t
Definition fs.h:37
#define ISWHITESPACE(ch)
Definition qdefs.h:184
mempool_t * tempmempool
Definition zone.c:794

References CL_IPLog_Add(), cl_iplog_loaded, cl_iplog_name, Con_Printf(), FS_LoadFile(), i, ISWHITESPACE, MAX_INPUTLINE, NULL, cvar_t::string, and tempmempool.

Referenced by CL_IPLog_Add(), and CL_IPLog_List_f().

◆ CL_KeepaliveMessage()

void CL_KeepaliveMessage ( qbool readmessages)

Definition at line 314 of file cl_parse.c.

315{
316 static double lastdirtytime = 0;
317 static qbool recursive = false;
318 double dirtytime;
319 double deltatime;
320 static double countdownmsg = 0;
321 static double countdownupdate = 0;
322 sizebuf_t old;
323
324 qbool thisrecursive;
325
326 thisrecursive = recursive;
327 recursive = true;
328
329 dirtytime = Sys_DirtyTime();
330 deltatime = dirtytime - lastdirtytime;
331 lastdirtytime = dirtytime;
332 if (deltatime <= 0 || deltatime >= 1800.0)
333 return;
334
335 countdownmsg -= deltatime;
336 countdownupdate -= deltatime;
337
338 if(!thisrecursive)
339 {
340 if(cls.state != ca_dedicated)
341 {
342 if(countdownupdate <= 0) // check if time stepped backwards
343 countdownupdate = 2;
344 }
345 }
346
347 // no need if server is local and definitely not if this is a demo
349 {
350 recursive = thisrecursive;
351 return;
352 }
353
354 if (readmessages)
355 {
356 // read messages from server, should just be nops
357 old = cl_message;
359
361
362 cl_message = old;
364 }
365
366 if (cls.netcon && countdownmsg <= 0) // check if time stepped backwards
367 {
368 sizebuf_t msg;
369 unsigned char buf[4];
370 countdownmsg = 5;
371 // write out a nop
372 // LadyHavoc: must use unreliable because reliable could kill the sigon message!
373 Con_Print("--> client to server keepalive\n");
374 memset(&msg, 0, sizeof(msg));
375 msg.data = buf;
376 msg.maxsize = sizeof(buf);
377 MSG_WriteChar(&msg, clc_nop);
378 NetConn_SendUnreliableMessage(cls.netcon, &msg, cls.protocol, 10000, 0, false);
379 }
380
381 recursive = thisrecursive;
382}
static unsigned char olddata[NET_MAXMESSAGE]
Definition cl_parse.c:313
@ ca_dedicated
Definition client.h:530
#define SIGNONS
Definition client.h:525
void MSG_WriteChar(sizebuf_t *sb, int c)
Definition com_msg.c:122
void Con_Print(const char *msg)
Prints to all appropriate console targets, and adds timestamps.
Definition console.c:1504
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition glquake.h:657
void NetConn_ClientFrame(void)
Definition netconn.c:2674
int NetConn_SendUnreliableMessage(netconn_t *conn, sizebuf_t *data, protocolversion_t protocol, int rate, int burstsize, qbool quakesignon_suppressreliables)
Definition netconn.c:844
#define clc_nop
Definition protocol.h:288
cactive_t state
Definition client.h:568
unsigned char * data
Definition common.h:52
int cursize
Definition common.h:54
int maxsize
Definition common.h:53
double Sys_DirtyTime(void)
Definition sys_shared.c:417

References server_t::active, buf, ca_dedicated, cl_message, clc_nop, cls, Con_Print(), sizebuf_t::cursize, sizebuf_t::data, sizebuf_t::maxsize, MSG_WriteChar(), client_static_t::netcon, NetConn_ClientFrame(), NetConn_SendUnreliableMessage(), olddata, client_static_t::protocol, PROTOCOL_QUAKEWORLD, client_static_t::signon, SIGNONS, client_static_t::state, sv, and Sys_DirtyTime().

Referenced by CL_BeginDownloads(), CL_ParseServerMessage(), CL_SetupWorldModel(), loadimagepixelsbgra(), Mod_Q2BSP_LoadBrushes(), Mod_Q3BSP_Load(), Mod_Q3BSP_LoadBrushes(), Mod_ShadowMesh_AddMesh(), Mod_ShadowMesh_Begin(), Mod_ShadowMesh_Finish(), and R_LoadTextureDDSFile().

◆ CL_MoveLerpEntityStates()

void CL_MoveLerpEntityStates ( entity_t * ent)

Definition at line 1991 of file cl_parse.c.

1992{
1993 float odelta[3], adelta[3];
1997 {
1998 // reset all persistent stuff if this is a new entity
1999 ent->persistent.lerpdeltatime = 0;
2000 ent->persistent.lerpstarttime = cl.mtime[1];
2005 // reset animation interpolation as well
2008 ent->render.framegroupblend[0].lerp = 1;ent->render.framegroupblend[1].lerp = 0;
2009 ent->render.shadertime = cl.time;
2010 // reset various persistent stuff
2011 ent->persistent.muzzleflash = 0;
2012 ent->persistent.trail_allowed = false;
2013 }
2015 {
2016 // don't interpolate the move
2017 ent->persistent.lerpdeltatime = 0;
2018 ent->persistent.lerpstarttime = cl.mtime[1];
2023 ent->persistent.trail_allowed = false;
2024
2025 // if(ent->state_current.frame != ent->state_previous.frame)
2026 // do this even if we did change the frame
2027 // teleport bit is only used if an animation restart, or a jump, is necessary
2028 // so it should be always harmless to do this
2029 {
2032 ent->render.framegroupblend[0].lerp = 1;ent->render.framegroupblend[1].lerp = 0;
2033 }
2034
2035 // note that this case must do everything the following case does too
2036 }
2038 {
2039 ent->render.framegroupblend[1] = ent->render.framegroupblend[0];
2040 ent->render.framegroupblend[1].lerp = 1;
2043 ent->render.framegroupblend[0].lerp = 0;
2044 }
2045 else if (DotProduct(odelta, odelta) > 1000*1000
2046 || (cl.fixangle[0] && !cl.fixangle[1])
2049 {
2050 // don't interpolate the move
2051 // (the fixangle[] check detects teleports, but not constant fixangles
2052 // such as when spectating)
2053 ent->persistent.lerpdeltatime = 0;
2054 ent->persistent.lerpstarttime = cl.mtime[1];
2059 ent->persistent.trail_allowed = false;
2060 }
2061 else if (ent->state_current.flags & RENDER_STEP)
2062 {
2063 // monster interpolation
2064 if (DotProduct(odelta, odelta) + DotProduct(adelta, adelta) > 0.01)
2065 {
2066 ent->persistent.lerpdeltatime = bound(0, cl.mtime[1] - ent->persistent.lerpstarttime, 0.1);
2067 ent->persistent.lerpstarttime = cl.mtime[1];
2072 }
2073 }
2074 else
2075 {
2076 // not a monster
2083 }
2084 // trigger muzzleflash effect if necessary
2086 ent->persistent.muzzleflash = 1;
2087
2088 // restart animation bit
2090 {
2091 ent->render.framegroupblend[1] = ent->render.framegroupblend[0];
2092 ent->render.framegroupblend[1].lerp = 1;
2095 ent->render.framegroupblend[0].lerp = 0;
2096 }
2097}
#define VectorSubtract(a, b, out)
Definition mathlib.h:99
#define DotProduct(a, b)
Definition mathlib.h:98
#define VectorCopy(in, out)
Definition mathlib.h:101
#define EF_RESTARTANIM_BIT
Definition protocol.h:88
#define EF_TELEPORT_BIT
Definition protocol.h:89
#define RENDER_STEP
Definition protocol.h:356
#define EF_MUZZLEFLASH
Definition protocol.h:69
qbool fixangle[2]
Definition client.h:800
double time
Definition client.h:868
double mtime[2]
Definition client.h:861
framegroupblend_t framegroupblend[MAX_FRAMEGROUPBLENDS]
Definition client.h:363
double shadertime
Definition client.h:366
unsigned char flags
Definition protocol.h:468
float origin[3]
Definition protocol.h:444
unsigned short tagentity
Definition protocol.h:451
unsigned short modelindex
Definition protocol.h:449
unsigned char tagindex
Definition protocol.h:470
float angles[3]
Definition protocol.h:445
unsigned char active
Definition protocol.h:459
unsigned short frame
Definition protocol.h:450
entity_persistent_t persistent
Definition client.h:474
entity_state_t state_current
Definition client.h:471
entity_state_t state_previous
Definition client.h:469
entity_render_t render
Definition client.h:477

References entity_state_t::active, entity_state_t::angles, bound, cl, DotProduct, EF_MUZZLEFLASH, EF_RESTARTANIM_BIT, EF_TELEPORT_BIT, entity_state_t::effects, client_state_t::fixangle, entity_state_t::flags, entity_state_t::frame, framegroupblend_t::frame, entity_render_t::framegroupblend, framegroupblend_t::lerp, entity_persistent_t::lerpdeltatime, entity_persistent_t::lerpstarttime, entity_state_t::modelindex, client_state_t::mtime, entity_persistent_t::muzzleflash, entity_persistent_t::newangles, entity_persistent_t::neworigin, entity_persistent_t::oldangles, entity_persistent_t::oldorigin, entity_state_t::origin, entity_t::persistent, entity_t::render, RENDER_STEP, entity_render_t::shadertime, framegroupblend_t::start, entity_t::state_current, entity_t::state_previous, entity_state_t::tagentity, entity_state_t::tagindex, client_state_t::time, entity_state_t::time, entity_persistent_t::trail_allowed, VectorCopy, and VectorSubtract.

Referenced by EntityFrame4_CL_ReadFrame(), EntityFrame5_CL_ReadFrame(), EntityFrame_CL_ReadFrame(), EntityFrameQuake_ReadEntity(), EntityFrameQW_CL_ReadFrame(), and EntityStateQW_ReadPlayerUpdate().

◆ CL_NetworkTimeReceived()

static void CL_NetworkTimeReceived ( double newtime)
static

Definition at line 3287 of file cl_parse.c.

3288{
3290 cl.mtime[1] = cl.mtime[0];
3291 cl.mtime[0] = newtime;
3292 if (cls.timedemo || cl.mtime[1] == cl.mtime[0] || cls.signon < SIGNONS)
3293 cl.time = cl.mtime[1] = newtime;
3294 else if (cls.demoplayback)
3295 {
3296 // when time falls behind during demo playback it means the cl.mtime[1] was altered
3297 // due to a large time gap, so treat it as an instant change in time
3298 // (this can also happen during heavy packet loss in the demo)
3299 if (cl.time < newtime - 0.1)
3300 cl.mtime[1] = cl.time = newtime;
3301 }
3302 else if (cls.protocol != PROTOCOL_QUAKEWORLD)
3303 {
3304 double timehigh = 0; // hush compiler warning
3305 cl.mtime[1] = max(cl.mtime[1], cl.mtime[0] - 0.1);
3306
3308 {
3309 if (cl.time < cl.mtime[1] - (cl.mtime[0] - cl.mtime[1]))
3310 Con_DPrintf("--- cl.time < cl.mtime[1] (%f < %f ... %f)\n", cl.time, cl.mtime[1], cl.mtime[0]);
3311 else if (cl.time > cl.mtime[0] + (cl.mtime[0] - cl.mtime[1]))
3312 Con_DPrintf("--- cl.time > cl.mtime[0] (%f > %f ... %f)\n", cl.time, cl.mtime[1], cl.mtime[0]);
3313 }
3314
3315selectmode:
3317 {
3318 default:
3320 goto selectmode;
3321 case 1:
3322 case 2:
3323 case 3:
3324 // doesn't make sense for modes > 3
3325 cl.time += (cl.mtime[1] - cl.time) * bound(0, cl_nettimesyncfactor.value, 1);
3326 timehigh = cl.mtime[1] + (cl.mtime[0] - cl.mtime[1]) * cl_nettimesyncboundtolerance.value;
3328 {
3329 case 1:
3330 cl.time = bound(cl.mtime[1], cl.time, cl.mtime[0]);
3331 break;
3332 case 2:
3333 if (cl.time < cl.mtime[1] || cl.time > timehigh)
3334 cl.time = cl.mtime[1];
3335 break;
3336 case 3:
3337 if ((cl.time < cl.mtime[1] && cl.oldtime < cl.mtime[1]) || (cl.time > timehigh && cl.oldtime > timehigh))
3338 cl.time = cl.mtime[1];
3339 break;
3340 }
3341 break;
3342
3343 case 4:
3344 if (fabs(cl.time - cl.mtime[1]) > 0.5)
3345 cl.time = cl.mtime[1]; // reset
3346 else if (fabs(cl.time - cl.mtime[1]) > 0.1)
3347 cl.time += 0.5 * (cl.mtime[1] - cl.time); // fast
3348 else if (cl.time > cl.mtime[1])
3349 cl.time -= 0.002 * cl.movevars_timescale; // fall into the past by 2ms
3350 else
3351 cl.time += 0.001 * cl.movevars_timescale; // creep forward 1ms
3352 break;
3353
3354 case 5:
3355 if (fabs(cl.time - cl.mtime[1]) > 0.5)
3356 cl.time = cl.mtime[1]; // reset
3357 else if (fabs(cl.time - cl.mtime[1]) > 0.1)
3358 cl.time += 0.5 * (cl.mtime[1] - cl.time); // fast
3359 else
3360 cl.time = bound(cl.time - 0.002 * cl.movevars_timescale, cl.mtime[1], cl.time + 0.001 * cl.movevars_timescale);
3361 break;
3362
3363 case 6:
3364 cl.time = bound(cl.mtime[1], cl.time, cl.mtime[0]);
3365 cl.time = bound(cl.time - 0.002 * cl.movevars_timescale, cl.mtime[1], cl.time + 0.001 * cl.movevars_timescale);
3366 break;
3367
3368 case 7:
3369 /* bones_was_here: this aims to prevent disturbances in the force from affecting cl.time
3370 * the rolling harmonic mean gives large time error outliers low significance
3371 * correction rate is dynamic and gradual (max 10% of mean error per tic)
3372 * time is correct within a few server frames of connect/map start
3373 * can achieve microsecond accuracy when cl.realframetime is a multiple of sv.frametime
3374 * prevents 0ms move frame times with uncapped fps
3375 * smoothest mode esp. for vsynced clients on servers with aggressive inputtimeout
3376 */
3377 {
3378 unsigned char i;
3379 float error;
3380 // in event of packet loss, cl.mtime[1] could be very old, so avoid if possible
3382 cl.ts_error_stor[cl.ts_error_num] = 1.0f / max(fabs(cl.time - target), FLT_MIN);
3384 for (i = 0, error = 0.0f; i < NUM_TS_ERRORS; i++)
3385 error += cl.ts_error_stor[i];
3386 error = 0.1f / (error / NUM_TS_ERRORS);
3388 }
3389 break;
3390 }
3391 }
3392 // this packet probably contains a player entity update, so we will need
3393 // to update the prediction
3394 cl.movement_replay = true;
3395 // this may get updated later in parsing by svc_clientdata
3396 cl.onground = false;
3397 // if true the cl.viewangles are interpolated from cl.mviewangles[]
3398 // during this frame
3399 // (makes spectating players much smoother and prevents mouse movement from turning)
3400 cl.fixangle[1] = cl.fixangle[0];
3401 cl.fixangle[0] = false;
3402 if (!cls.demoplayback)
3404 // update the csqc's server timestamps, critical for proper sync
3406
3407#ifdef USEODE
3408 if (cl.mtime[0] > cl.mtime[1])
3410#endif
3411
3412 // only lerp entities that also get an update in this frame, when lerp excess is used
3413 if(cl_lerpexcess.value > 0)
3414 {
3415 int i;
3416 for (i = 1;i < cl.num_entities;i++)
3417 {
3418 if (cl.entities_active[i])
3419 {
3420 entity_t *ent = cl.entities + i;
3421 ent->persistent.lerpdeltatime = 0;
3422 }
3423 }
3424 }
3425}
cvar_t cl_lerpexcess
Definition cl_main.c:44
cvar_t cl_nettimesyncboundmode
Definition cl_parse.c:192
cvar_t cl_nettimesyncfactor
Definition cl_parse.c:191
cvar_t cl_nettimesyncboundtolerance
Definition cl_parse.c:193
#define NUM_TS_ERRORS
Definition client.h:874
void CSQC_UpdateNetworkTimes(double newtime, double oldtime)
Definition csprogs.c:234
void Cvar_SetQuick(cvar_t *var, const char *value)
Definition cvar.c:436
void error(string err,...)
float fabs(float f)
string target
Definition progsdefs.qc:193
float movevars_timescale
Definition client.h:1058
double oldtime
Definition client.h:868
float movevars_ticrate
Definition client.h:1086
qbool onground
Definition client.h:843
unsigned char * entities_active
Definition client.h:993
uint8_t opt_inputs_since_update
Definition client.h:1051
unsigned char ts_error_num
Definition client.h:875
float movevars_gravity
Definition client.h:1059
entity_t * entities
Definition client.h:991
world_t world
Definition client.h:1122
float ts_error_stor[NUM_TS_ERRORS]
Definition client.h:876
qbool movement_replay
Definition client.h:807
vec3_t mviewangles[2]
Definition client.h:786
qbool timedemo
Definition client.h:589
float value
Definition cvar.h:74
const char * defstring
Definition cvar.h:77
qbool vid_activewindow
Definition vid_shared.c:77
void World_Physics_Frame(world_t *world, double frametime, double gravity)

References bound, cl, cl_lerpexcess, cl_nettimesyncboundmode, cl_nettimesyncboundtolerance, cl_nettimesyncfactor, cls, Con_DPrintf(), CSQC_UpdateNetworkTimes(), Cvar_SetQuick(), cvar_t::defstring, client_static_t::demoplayback, developer_extra, client_state_t::entities, client_state_t::entities_active, error(), fabs(), client_state_t::fixangle, i, cvar_t::integer, entity_persistent_t::lerpdeltatime, max, client_state_t::movement_replay, client_state_t::movevars_gravity, client_state_t::movevars_ticrate, client_state_t::movevars_timescale, client_state_t::mtime, client_state_t::mviewangles, client_state_t::num_entities, NUM_TS_ERRORS, client_state_t::oldtime, client_state_t::onground, client_state_t::opt_inputs_since_update, entity_t::persistent, client_static_t::protocol, PROTOCOL_QUAKEWORLD, client_static_t::signon, SIGNONS, target, client_state_t::time, client_static_t::timedemo, client_state_t::ts_error_num, client_state_t::ts_error_stor, cvar_t::value, VectorCopy, vid_activewindow, client_state_t::world, and World_Physics_Frame().

Referenced by CL_ParseServerMessage().

◆ CL_NewBeam()

void CL_NewBeam ( int ent,
vec3_t start,
vec3_t end,
model_t * m,
int lightning )

Definition at line 2356 of file cl_parse.c.

2357{
2358 int i;
2359 beam_t *b = NULL;
2360
2361 if (ent >= MAX_EDICTS)
2362 {
2363 Con_Printf("CL_NewBeam: invalid entity number %i\n", ent);
2364 ent = 0;
2365 }
2366
2367 if (ent >= cl.max_entities)
2368 CL_ExpandEntities(ent);
2369
2370 // override any beam with the same entity
2371 i = cl.max_beams;
2372 if (ent)
2373 for (i = 0, b = cl.beams;i < cl.max_beams;i++, b++)
2374 if (b->entity == ent)
2375 break;
2376 // if the entity was not found then just replace an unused beam
2377 if (i == cl.max_beams)
2378 for (i = 0, b = cl.beams;i < cl.max_beams;i++, b++)
2379 if (!b->model)
2380 break;
2381 if (i < cl.max_beams)
2382 {
2383 cl.num_beams = max(cl.num_beams, i + 1);
2384 b->entity = ent;
2385 b->lightning = lightning;
2386 b->model = m;
2387 b->endtime = cl.mtime[0] + 0.2;
2388 VectorCopy (start, b->start);
2389 VectorCopy (end, b->end);
2390 }
2391 else
2392 Con_DPrint("beam list overflow!\n");
2393}
void CL_ExpandEntities(int num)
Definition cl_main.c:300
void Con_DPrint(const char *msg)
A Con_Print that only shows up if the "developer" cvar is set.
Definition console.c:1531
#define MAX_EDICTS
max number of objects in game world at once (32768 protocol limit)
Definition qdefs.h:105
dp_FragColor b
beam_t * beams
Definition client.h:996
int max_entities
Definition client.h:980

References b, client_state_t::beams, cl, CL_ExpandEntities(), Con_DPrint(), Con_Printf(), i, max, client_state_t::max_beams, MAX_EDICTS, client_state_t::max_entities, client_state_t::mtime, NULL, client_state_t::num_beams, and VectorCopy.

Referenced by CL_ParseBeam(), VM_CL_te_beam(), VM_CL_te_lightning1(), VM_CL_te_lightning2(), and VM_CL_te_lightning3().

◆ CL_Parse_DumpPacket()

void CL_Parse_DumpPacket ( void )

Definition at line 4308 of file cl_parse.c.

4309{
4310 if (!parsingerror)
4311 return;
4312 Con_Print("Packet dump:\n");
4314 parsingerror = false;
4315}
int parsingerror
Definition cl_parse.c:3434
void SZ_HexDumpToConsole(const sizebuf_t *buf)
Definition common.c:148

References cl_message, Con_Print(), parsingerror, and SZ_HexDumpToConsole().

Referenced by Host_Error().

◆ CL_Parse_ErrorCleanUp()

void CL_Parse_ErrorCleanUp ( void )

Definition at line 4317 of file cl_parse.c.

4318{
4319 CL_StopDownload(0, 0);
4321}
static void QW_CL_StopUpload_f(cmd_state_t *cmd)
Definition cl_parse.c:968
cmd_state_t * cmd_local
command interpreter for local commands injected by SVQC, CSQC, MQC, server or client engine code uses...
Definition cmd.c:25

References CL_StopDownload(), cmd_local, and QW_CL_StopUpload_f().

Referenced by CL_DisconnectEx(), and Host_Error().

◆ CL_Parse_Init()

void CL_Parse_Init ( void )

Definition at line 4323 of file cl_parse.c.

4324{
4329
4332
4342
4344
4345 // server extension cvars set by commands issued from the server during connect
4347
4353
4354 Cmd_AddCommand(CF_CLIENT, "nextul", QW_CL_NextUpload_f, "sends next fragment of current upload buffer (screenshot for example)");
4355 Cmd_AddCommand(CF_CLIENT, "stopul", QW_CL_StopUpload_f, "aborts current upload (screenshot for example)");
4356 Cmd_AddCommand(CF_CLIENT | CF_CLIENT_FROM_SERVER, "skins", QW_CL_Skins_f, "downloads missing qw skins from server");
4357 Cmd_AddCommand(CF_CLIENT, "changing", QW_CL_Changing_f, "sent by qw servers to tell client to wait for level change");
4358 Cmd_AddCommand(CF_CLIENT, "cl_begindownloads", CL_BeginDownloads_f, "used internally by darkplaces client while connecting (causes loading of models and sounds or triggers downloads for missing ones)");
4359 Cmd_AddCommand(CF_CLIENT | CF_CLIENT_FROM_SERVER, "cl_downloadbegin", CL_DownloadBegin_f, "(networking) informs client of download file information, client replies with sv_startsoundload to begin the transfer");
4360 Cmd_AddCommand(CF_CLIENT | CF_CLIENT_FROM_SERVER, "stopdownload", CL_StopDownload_f, "terminates a download");
4361 Cmd_AddCommand(CF_CLIENT | CF_CLIENT_FROM_SERVER, "cl_downloadfinished", CL_DownloadFinished_f, "signals that a download has finished and provides the client with file size and crc to check its integrity");
4362 Cmd_AddCommand(CF_CLIENT, "iplog_list", CL_IPLog_List_f, "lists names of players whose IP address begins with the supplied text (example: iplog_list 123.456.789)");
4363}
static void QW_CL_Skins_f(cmd_state_t *cmd)
Definition cl_parse.c:894
cvar_t snd_cdautopause
Definition cl_parse.c:187
cvar_t cl_sound_ric_gunshot
Definition cl_parse.c:185
static void CL_DownloadFinished_f(cmd_state_t *cmd)
Definition cl_parse.c:1561
cvar_t cl_readpicture_force
Definition cl_parse.c:181
cvar_t cl_worldbasename
Definition cl_parse.c:171
cvar_t cl_sound_hknighthit
Definition cl_parse.c:176
static void QW_CL_Changing_f(cmd_state_t *cmd)
Definition cl_parse.c:901
cvar_t cl_sound_ric2
Definition cl_parse.c:179
cvar_t cl_worldname
Definition cl_parse.c:169
cvar_t cl_gameplayfix_soundsmovewithentities
Definition cl_parse.c:174
static void CL_IPLog_List_f(cmd_state_t *cmd)
Definition cl_parse.c:3100
static void CL_DownloadBegin_f(cmd_state_t *cmd)
Definition cl_parse.c:1517
cvar_t cl_sound_ric1
Definition cl_parse.c:178
static void QW_CL_NextUpload_f(cmd_state_t *cmd)
Definition cl_parse.c:912
cvar_t cl_worldnamenoextension
Definition cl_parse.c:170
static void CL_BeginDownloads_f(cmd_state_t *cmd)
Definition cl_parse.c:1374
cvar_t cl_sound_r_exp3
Definition cl_parse.c:186
cvar_t cl_worldmessage
Definition cl_parse.c:168
cvar_t cl_sound_tink1
Definition cl_parse.c:177
static void CL_StopDownload_f(cmd_state_t *cmd)
Definition cl_parse.c:1550
cvar_t developer_networkentities
Definition cl_parse.c:173
cvar_t cl_sound_ric3
Definition cl_parse.c:180
cvar_t cl_sound_wizardhit
Definition cl_parse.c:175
void Cmd_AddCommand(unsigned flags, const char *cmd_name, xcommand_t function, const char *description)
called by the init functions of other parts of the program to register commands and functions to call...
Definition cmd.c:1661
#define CF_CLIENT
cvar/command that only the client can change/execute
Definition cmd.h:48
#define CF_CLIENT_FROM_SERVER
command that the server is allowed to execute on the client
Definition cmd.h:50
void Cvar_RegisterVariable(cvar_t *variable)
registers a cvar that already has the name, string, and optionally the archive elements set.
Definition cvar.c:599

References CF_CLIENT, CF_CLIENT_FROM_SERVER, CL_BeginDownloads_f(), CL_DownloadBegin_f(), CL_DownloadFinished_f(), cl_gameplayfix_soundsmovewithentities, CL_IPLog_List_f(), cl_iplog_name, cl_joinbeforedownloadsfinish, cl_nettimesyncboundmode, cl_nettimesyncboundtolerance, cl_nettimesyncfactor, cl_readpicture_force, cl_serverextension_download, cl_sound_hknighthit, cl_sound_r_exp3, cl_sound_ric1, cl_sound_ric2, cl_sound_ric3, cl_sound_ric_gunshot, cl_sound_tink1, cl_sound_wizardhit, CL_StopDownload_f(), cl_worldbasename, cl_worldmessage, cl_worldname, cl_worldnamenoextension, Cmd_AddCommand(), Cvar_RegisterVariable(), developer_networkentities, QW_CL_Changing_f(), QW_CL_NextUpload_f(), QW_CL_Skins_f(), QW_CL_StopUpload_f(), and snd_cdautopause.

Referenced by CL_Init().

◆ CL_Parse_Shutdown()

void CL_Parse_Shutdown ( void )

Definition at line 4365 of file cl_parse.c.

4366{
4367}

Referenced by CL_Shutdown().

◆ CL_ParseBaseline()

static void CL_ParseBaseline ( entity_t * ent,
int large )
static

Definition at line 2104 of file cl_parse.c.

2105{
2106 int i;
2107
2109 // FIXME: set ent->state_baseline.number?
2110 ent->state_baseline.active = true;
2111 if (large)
2112 {
2113 ent->state_baseline.modelindex = (unsigned short) MSG_ReadShort(&cl_message);
2114 ent->state_baseline.frame = (unsigned short) MSG_ReadShort(&cl_message);
2115 }
2117 {
2118 ent->state_baseline.modelindex = (unsigned short) MSG_ReadShort(&cl_message);
2120 }
2121 else
2122 {
2125 }
2128 for (i = 0;i < 3;i++)
2129 {
2132 }
2133 ent->state_previous = ent->state_current = ent->state_baseline;
2134}
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
#define MSG_ReadShort
Definition common.h:191
@ 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
entity_state_t defaultstate
Definition protocol.c:4
unsigned char skin
Definition protocol.h:463
unsigned char colormap
Definition protocol.h:462
entity_state_t state_baseline
Definition client.h:467

References entity_state_t::active, entity_state_t::angles, cl_message, cls, entity_state_t::colormap, defaultstate, entity_state_t::frame, i, entity_state_t::modelindex, MSG_ReadAngle(), MSG_ReadByte, MSG_ReadCoord(), MSG_ReadShort, entity_state_t::origin, client_static_t::protocol, PROTOCOL_NEHAHRABJP, PROTOCOL_NEHAHRABJP2, PROTOCOL_NEHAHRABJP3, entity_state_t::skin, entity_t::state_baseline, entity_t::state_current, and entity_t::state_previous.

Referenced by CL_ParseServerMessage(), and CL_ParseStatic().

◆ CL_ParseBeam()

static void CL_ParseBeam ( model_t * m,
int lightning )
static

Definition at line 2395 of file cl_parse.c.

2396{
2397 int ent;
2398 vec3_t start, end;
2399
2400 ent = (unsigned short) MSG_ReadShort(&cl_message);
2403
2404 if (ent >= MAX_EDICTS)
2405 {
2406 Con_Printf("CL_ParseBeam: invalid entity number %i\n", ent);
2407 ent = 0;
2408 }
2409
2410 CL_NewBeam(ent, start, end, m, lightning);
2411}
void CL_NewBeam(int ent, vec3_t start, vec3_t end, model_t *m, int lightning)
Definition cl_parse.c:2356
void MSG_ReadVector(sizebuf_t *sb, vec3_t v, protocolversion_t protocol)
Definition com_msg.c:401
vec_t vec3_t[3]
Definition qtypes.h:71

References cl_message, CL_NewBeam(), cls, Con_Printf(), MAX_EDICTS, MSG_ReadShort, MSG_ReadVector(), and client_static_t::protocol.

Referenced by CL_ParseTempEntity().

◆ CL_ParseClientdata()

static void CL_ParseClientdata ( void )
static

Definition at line 2144 of file cl_parse.c.

2145{
2146 int i, bits;
2147
2151 cl.mviewzoom[1] = cl.mviewzoom[0];
2152
2154 {
2156 cl.stats[STAT_ITEMS] = 0;
2157 cl.stats[STAT_VIEWZOOM] = 255;
2158 }
2159 cl.idealpitch = 0;
2160 cl.mpunchangle[0][0] = 0;
2161 cl.mpunchangle[0][1] = 0;
2162 cl.mpunchangle[0][2] = 0;
2163 cl.mpunchvector[0][0] = 0;
2164 cl.mpunchvector[0][1] = 0;
2165 cl.mpunchvector[0][2] = 0;
2166 cl.mvelocity[0][0] = 0;
2167 cl.mvelocity[0][1] = 0;
2168 cl.mvelocity[0][2] = 0;
2169 cl.mviewzoom[0] = 1;
2170
2171 bits = (unsigned short) MSG_ReadShort(&cl_message);
2172 if (bits & SU_EXTEND1)
2173 bits |= (MSG_ReadByte(&cl_message) << 16);
2174 if (bits & SU_EXTEND2)
2175 bits |= (MSG_ReadByte(&cl_message) << 24);
2176
2177 if (bits & SU_VIEWHEIGHT)
2179
2180 if (bits & SU_IDEALPITCH)
2182
2183 for (i = 0;i < 3;i++)
2184 {
2185 if (bits & (SU_PUNCH1<<i) )
2186 {
2189 else
2191 }
2192 if (bits & (SU_PUNCHVEC1<<i))
2193 {
2196 else
2198 }
2199 if (bits & (SU_VELOCITY1<<i) )
2200 {
2203 else
2205 }
2206 }
2207
2208 // LadyHavoc: hipnotic demos don't have this bit set but should
2211
2212 cl.onground = (bits & SU_ONGROUND) != 0;
2213 cl.inwater = (bits & SU_INWATER) != 0;
2214
2216 {
2218 cl.stats[STAT_ARMOR] = (bits & SU_ARMOR) ? MSG_ReadShort(&cl_message) : 0;
2226 cl.stats[STAT_ACTIVEWEAPON] = (unsigned short) MSG_ReadShort(&cl_message);
2227 }
2229 {
2231 cl.stats[STAT_ARMOR] = (bits & SU_ARMOR) ? MSG_ReadByte(&cl_message) : 0;
2233 cl.stats[STAT_WEAPON] = (bits & SU_WEAPON) ? (unsigned short)MSG_ReadShort(&cl_message) : 0;
2234 else
2244 else
2246 }
2247
2248 if (bits & SU_VIEWZOOM)
2249 {
2252 else
2253 cl.stats[STAT_VIEWZOOM] = (unsigned short) MSG_ReadShort(&cl_message);
2254 }
2255
2256 // viewzoom interpolation
2257 cl.mviewzoom[0] = (float) max(cl.stats[STAT_VIEWZOOM], 2) * (1.0f / 255.0f);
2258}
#define IS_OLDNEXUIZ_DERIVED(g)
Definition com_game.h:73
@ GAME_QUOTH
Definition com_game.h:31
@ GAME_ROGUE
Definition com_game.h:30
@ GAME_HIPNOTIC
Definition com_game.h:29
float MSG_ReadCoord32f(sizebuf_t *sb)
Definition com_msg.c:384
float MSG_ReadAngle16i(sizebuf_t *sb)
Definition com_msg.c:414
float MSG_ReadCoord16i(sizebuf_t *sb)
Definition com_msg.c:379
#define MSG_ReadChar(sb)
Definition common.h:187
@ 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_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
#define MSG_ReadLong
Definition common.h:192
#define SU_VELOCITY1
Definition protocol.h:157
#define SU_VIEWHEIGHT
Definition protocol.h:152
#define SU_WEAPON
Definition protocol.h:166
#define SU_WEAPONFRAME
Definition protocol.h:164
#define SU_EXTEND1
Definition protocol.h:167
#define SU_IDEALPITCH
Definition protocol.h:153
#define SU_PUNCH1
Definition protocol.h:154
#define SU_PUNCHVEC1
Definition protocol.h:169
#define SU_ITEMS
Definition protocol.h:161
#define DEFAULT_VIEWHEIGHT
Definition protocol.h:198
#define SU_INWATER
no data follows, the bit is it
Definition protocol.h:163
#define SU_EXTEND2
another byte to follow, future expansion
Definition protocol.h:176
#define SU_VIEWZOOM
byte factor (0 = 0.0 (not valid), 255 = 1.0)
Definition protocol.h:172
#define SU_ONGROUND
no data follows, the bit is it
Definition protocol.h:162
#define SU_ARMOR
Definition protocol.h:165
#define STAT_WEAPONFRAME
Definition qstats.h:13
#define STAT_HEALTH
Definition qstats.h:8
#define STAT_SHELLS
Definition qstats.h:14
#define STAT_NAILS
Definition qstats.h:15
#define STAT_ACTIVEWEAPON
Definition qstats.h:18
#define STAT_CELLS
Definition qstats.h:17
#define STAT_ARMOR
Definition qstats.h:12
#define STAT_AMMO
Definition qstats.h:11
#define STAT_ITEMS
FTE, DP.
Definition qstats.h:23
#define STAT_WEAPON
Definition qstats.h:10
#define STAT_ROCKETS
Definition qstats.h:16
#define STAT_VIEWZOOM
DP.
Definition qstats.h:27
#define STAT_VIEWHEIGHT
FTE, DP.
Definition qstats.h:24
precision highp float
Definition shader_glsl.h:53
float idealpitch
Definition client.h:826
qbool inwater
Definition client.h:844
vec3_t mpunchvector[2]
Definition client.h:790
vec3_t mvelocity[2]
Definition client.h:792
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

References cl, cl_message, cls, DEFAULT_VIEWHEIGHT, float, GAME_HIPNOTIC, GAME_QUOTH, GAME_ROGUE, gamemode, i, client_state_t::idealpitch, client_state_t::inwater, IS_OLDNEXUIZ_DERIVED, max, client_state_t::mpunchangle, client_state_t::mpunchvector, MSG_ReadAngle16i(), MSG_ReadByte, MSG_ReadChar, MSG_ReadCoord16i(), MSG_ReadCoord32f(), MSG_ReadLong, MSG_ReadShort, client_state_t::mvelocity, client_state_t::mviewzoom, client_state_t::onground, client_static_t::protocol, PROTOCOL_DARKPLACES1, PROTOCOL_DARKPLACES2, PROTOCOL_DARKPLACES3, PROTOCOL_DARKPLACES4, PROTOCOL_DARKPLACES5, PROTOCOL_NEHAHRABJP, PROTOCOL_NEHAHRABJP2, PROTOCOL_NEHAHRABJP3, PROTOCOL_NEHAHRAMOVIE, PROTOCOL_QUAKE, PROTOCOL_QUAKEDP, STAT_ACTIVEWEAPON, STAT_AMMO, STAT_ARMOR, STAT_CELLS, STAT_HEALTH, STAT_ITEMS, STAT_NAILS, STAT_ROCKETS, STAT_SHELLS, STAT_VIEWHEIGHT, STAT_VIEWZOOM, STAT_WEAPON, STAT_WEAPONFRAME, client_state_t::stats, SU_ARMOR, SU_EXTEND1, SU_EXTEND2, SU_IDEALPITCH, SU_INWATER, SU_ITEMS, SU_ONGROUND, SU_PUNCH1, SU_PUNCHVEC1, SU_VELOCITY1, SU_VIEWHEIGHT, SU_VIEWZOOM, SU_WEAPON, SU_WEAPONFRAME, and VectorCopy.

Referenced by CL_ParseServerMessage().

◆ CL_ParseDownload()

static void CL_ParseDownload ( void )
static

Definition at line 1478 of file cl_parse.c.

1479{
1480 int i, start, size;
1481 static unsigned char data[NET_MAXMESSAGE];
1482 start = MSG_ReadLong(&cl_message);
1483 size = (unsigned short)MSG_ReadShort(&cl_message);
1484
1485 // record the start/size information to ack in the next input packet
1486 for (i = 0;i < CL_MAX_DOWNLOADACKS;i++)
1487 {
1489 {
1490 cls.dp_downloadack[i].start = start;
1492 break;
1493 }
1494 }
1495
1497
1498 if (!cls.qw_downloadname[0])
1499 {
1500 if (size > 0)
1501 Con_Printf("CL_ParseDownload: received %i bytes with no download active\n", size);
1502 return;
1503 }
1504
1505 if (start + size > cls.qw_downloadmemorymaxsize)
1506 Host_Error("corrupt download message\n");
1507
1508 // only advance cursize if the data is at the expected position
1509 // (gaps are unacceptable)
1510 memcpy(cls.qw_downloadmemory + start, data, size);
1515}
#define CL_MAX_DOWNLOADACKS
Definition client.h:546
size_t MSG_ReadBytes(sizebuf_t *sb, size_t numbytes, unsigned char *out)
Definition com_msg.c:364
static int(ZEXPORT *qz_inflate)(z_stream *strm
GLsizeiptr const GLvoid * data
Definition glquake.h:639
void Host_Error(const char *error,...)
Definition host.c:85
float floor(float f)
#define NET_MAXMESSAGE
max reliable packet size (sent as multiple fragments of MAX_PACKETFRAGMENT)
Definition qdefs.h:103
int qw_downloadpercent
Definition client.h:653
int qw_downloadspeedcount
Definition client.h:657
cl_downloadack_t dp_downloadack[CL_MAX_DOWNLOADACKS]
Definition client.h:634
int qw_downloadmemorycursize
Definition client.h:650

References bound, CL_MAX_DOWNLOADACKS, cl_message, cls, Con_Printf(), data, client_static_t::dp_downloadack, floor(), Host_Error(), i, int(), MSG_ReadBytes(), MSG_ReadLong, MSG_ReadShort, NET_MAXMESSAGE, client_static_t::qw_downloadmemory, client_static_t::qw_downloadmemorycursize, client_static_t::qw_downloadmemorymaxsize, client_static_t::qw_downloadname, client_static_t::qw_downloadpercent, client_static_t::qw_downloadspeedcount, cl_downloadack_t::size, size, and cl_downloadack_t::start.

Referenced by CL_ParseServerMessage().

◆ CL_ParseEffect()

static void CL_ParseEffect ( void )
static

Definition at line 2328 of file cl_parse.c.

2329{
2330 vec3_t org;
2331 int modelindex, startframe, framecount, framerate;
2332
2335 startframe = MSG_ReadByte(&cl_message);
2336 framecount = MSG_ReadByte(&cl_message);
2337 framerate = MSG_ReadByte(&cl_message);
2338
2339 CL_Effect(org, CL_GetModelByIndex(modelindex), startframe, framecount, framerate);
2340}
model_t * CL_GetModelByIndex(int modelindex)
void CL_Effect(vec3_t org, model_t *model, int startframe, int framecount, float framerate)
Definition cl_main.c:816
float modelindex

References CL_Effect(), CL_GetModelByIndex(), cl_message, cls, modelindex, MSG_ReadByte, MSG_ReadVector(), and client_static_t::protocol.

Referenced by CL_ParseServerMessage().

◆ CL_ParseEffect2()

static void CL_ParseEffect2 ( void )
static

Definition at line 2342 of file cl_parse.c.

2343{
2344 vec3_t org;
2345 int modelindex, startframe, framecount, framerate;
2346
2348 modelindex = (unsigned short) MSG_ReadShort(&cl_message);
2349 startframe = (unsigned short) MSG_ReadShort(&cl_message);
2350 framecount = MSG_ReadByte(&cl_message);
2351 framerate = MSG_ReadByte(&cl_message);
2352
2353 CL_Effect(org, CL_GetModelByIndex(modelindex), startframe, framecount, framerate);
2354}

References CL_Effect(), CL_GetModelByIndex(), cl_message, cls, modelindex, MSG_ReadByte, MSG_ReadShort, MSG_ReadVector(), and client_static_t::protocol.

Referenced by CL_ParseServerMessage().

◆ CL_ParseEntityLump()

void CL_ParseEntityLump ( char * entdata)

Definition at line 384 of file cl_parse.c.

385{
386 qbool loadedsky = false;
387 const char *data;
388 char key[128], value[MAX_INPUTLINE];
389 FOG_clear(); // LadyHavoc: no fog until set
390 // LadyHavoc: default to the map's sky (q3 shader parsing sets this)
391 R_SetSkyBox(cl.worldmodel->brush.skybox);
392 data = entdata;
393 if (!data)
394 return;
395 if (!COM_ParseToken_Simple(&data, false, false, true))
396 return; // error
397 if (com_token[0] != '{')
398 return; // error
399 while (1)
400 {
401 if (!COM_ParseToken_Simple(&data, false, false, true))
402 return; // error
403 if (com_token[0] == '}')
404 break; // end of worldspawn
405 if (com_token[0] == '_')
406 dp_strlcpy (key, com_token + 1, sizeof (key));
407 else
408 dp_strlcpy (key, com_token, sizeof (key));
409 while (key[strlen(key)-1] == ' ') // remove trailing spaces
410 key[strlen(key)-1] = 0;
411 if (!COM_ParseToken_Simple(&data, false, false, true))
412 return; // error
413 dp_strlcpy (value, com_token, sizeof (value));
414 if (!strcmp("sky", key))
415 {
416 loadedsky = true;
418 }
419 else if (!strcmp("skyname", key)) // non-standard, introduced by QuakeForge... sigh.
420 {
421 loadedsky = true;
423 }
424 else if (!strcmp("qlsky", key)) // non-standard, introduced by QuakeLives (EEK)
425 {
426 loadedsky = true;
428 }
429 else if (!strcmp("fog", key))
430 {
431 FOG_clear(); // so missing values get good defaults
434 r_refdef.fog_end = 16384;
435 r_refdef.fog_height = 1<<30;
437#if _MSC_VER >= 1400
438#define sscanf sscanf_s
439#endif
441 }
442 else if (!strcmp("fog_density", key))
443 r_refdef.fog_density = atof(value);
444 else if (!strcmp("fog_red", key))
445 r_refdef.fog_red = atof(value);
446 else if (!strcmp("fog_green", key))
447 r_refdef.fog_green = atof(value);
448 else if (!strcmp("fog_blue", key))
449 r_refdef.fog_blue = atof(value);
450 else if (!strcmp("fog_alpha", key))
451 r_refdef.fog_alpha = atof(value);
452 else if (!strcmp("fog_start", key))
453 r_refdef.fog_start = atof(value);
454 else if (!strcmp("fog_end", key))
455 r_refdef.fog_end = atof(value);
456 else if (!strcmp("fog_height", key))
457 r_refdef.fog_height = atof(value);
458 else if (!strcmp("fog_fadedepth", key))
460 else if (!strcmp("fog_heighttexture", key))
461 {
462 FOG_clear(); // so missing values get good defaults
463#if _MSC_VER >= 1400
465#else
467#endif
469 }
470 }
471
472 if (!loadedsky && cl.worldmodel->brush.isq2bsp)
473 R_SetSkyBox("unit1_");
474}
char com_token[MAX_INPUTLINE]
Definition common.c:39
qbool COM_ParseToken_Simple(const char **datapointer, qbool returnnewline, qbool parsebackslash, qbool parsecomments)
Definition common.c:463
void FOG_clear(void)
Definition gl_rmain.c:349
r_refdef_t r_refdef
Definition gl_rmain.c:57
GLsizei const GLfloat * value
Definition glquake.h:740
int R_SetSkyBox(const char *sky)
Definition r_sky.c:149
struct model_s * worldmodel
Definition client.h:934
char fog_height_texturename[64]
Definition render.h:444
float fog_start
Definition render.h:436
float fog_density
Definition render.h:431
float fog_height
Definition render.h:438
float fog_green
Definition render.h:433
float fog_alpha
Definition render.h:435
float fog_fadedepth
Definition render.h:439
float fog_end
Definition render.h:437
float fog_blue
Definition render.h:434
float fog_red
Definition render.h:432

References cl, COM_ParseToken_Simple(), com_token, data, dp_strlcpy, r_refdef_t::fog_alpha, r_refdef_t::fog_blue, FOG_clear(), r_refdef_t::fog_density, r_refdef_t::fog_end, r_refdef_t::fog_fadedepth, r_refdef_t::fog_green, r_refdef_t::fog_height, r_refdef_t::fog_height_texturename, r_refdef_t::fog_red, r_refdef_t::fog_start, MAX_INPUTLINE, r_refdef, R_SetSkyBox(), strlen(), value, and client_state_t::worldmodel.

Referenced by gl_main_newmap().

◆ CL_ParsePointParticles()

static void CL_ParsePointParticles ( void )
static

Definition at line 2961 of file cl_parse.c.

2962{
2963 int effectindex, count;
2965 effectindex = (unsigned short)MSG_ReadShort(&cl_message);
2968 count = (unsigned short)MSG_ReadShort(&cl_message);
2970}
void CL_ParticleEffect(int effectnameindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor)
vector velocity
vector origin
GLenum GLenum GLsizei count
Definition glquake.h:656

References cl_message, CL_ParticleEffect(), cls, count, MSG_ReadShort, MSG_ReadVector(), NULL, origin, client_static_t::protocol, and velocity.

Referenced by CL_ParseServerMessage().

◆ CL_ParsePointParticles1()

static void CL_ParsePointParticles1 ( void )
static

Definition at line 2972 of file cl_parse.c.

2973{
2974 int effectindex;
2975 vec3_t origin;
2976 effectindex = (unsigned short)MSG_ReadShort(&cl_message);
2979}
vec3_t vec3_origin
Definition mathlib.c:26

References cl_message, CL_ParticleEffect(), cls, MSG_ReadShort, MSG_ReadVector(), NULL, origin, client_static_t::protocol, and vec3_origin.

Referenced by CL_ParseServerMessage().

◆ CL_ParseServerInfo()

static void CL_ParseServerInfo ( void )
static

Definition at line 1678 of file cl_parse.c.

1679{
1680 const char *str;
1681 int i;
1682 protocolversion_t protocol;
1683 int nummodels, numsounds;
1684 char vabuf[1024];
1685
1686 // if we start loading a level and a video is still playing, stop it
1687 CL_VideoStop();
1688
1689 Con_DPrint("Serverinfo packet received.\n");
1691
1692 // if server is active, we already began a loading plaque
1693 if (!sv.active)
1694 {
1697 // prevent dlcache assets from the previous map from interfering with this one
1699 // free q3 shaders so that any newly downloaded shaders will be active
1700 // bones_was_here: we free the q3 shaders later in CL_SignonReply
1701 //Mod_FreeQ3Shaders();
1702 }
1703
1704 // check memory integrity
1706
1707 // clear cl_serverextension cvars
1709
1710//
1711// wipe the client_state_t struct
1712//
1713 CL_ClearState ();
1714
1715// parse protocol version number
1717 protocol = Protocol_EnumForNumber(i);
1718 if (protocol == PROTOCOL_UNKNOWN)
1719 {
1720 Host_Error("CL_ParseServerInfo: Server is unrecognized protocol number (%i)", i);
1721 return;
1722 }
1723 // hack for unmarked Nehahra movie demos which had a custom protocol
1724 if (protocol == PROTOCOL_QUAKEDP && cls.demoplayback && gamemode == GAME_NEHAHRA)
1725 protocol = PROTOCOL_NEHAHRAMOVIE;
1726 cls.protocol = protocol;
1727 Con_Printf("Server protocol is %s\n", Protocol_NameForEnum(cls.protocol));
1728
1729 cl.num_entities = 1;
1730
1731 if (protocol == PROTOCOL_QUAKEWORLD)
1732 {
1734
1736 Con_Printf("server gamedir is %s\n", str);
1737
1738 // change gamedir if needed
1739 if (!FS_ChangeGameDirs(1, &str, false))
1740 Host_Error("CL_ParseServerInfo: unable to switch to server specified gamedir");
1741
1743 cl.maxclients = 32;
1744
1745 // parse player number
1747 // cl.qw_spectator is an unneeded flag, cl.scores[cl.playerentity].qw_spectator works better (it can be updated by the server during the game)
1748 //cl.qw_spectator = (i & 128) != 0;
1749 cl.realplayerentity = cl.playerentity = cl.viewentity = (i & 127) + 1;
1751
1752 // get the full level name
1754 dp_strlcpy (cl.worldmessage, str, sizeof(cl.worldmessage));
1755
1756 // get the movevars that are defined in the qw protocol
1767
1768 // other movevars not in the protocol...
1777
1778 // seperate the printfs so the server message can have a color
1779 Con_Printf("\n\n<===================================>\n\n\2%s\n", str);
1780
1781 // check memory integrity
1783
1784 if (cls.netcon)
1785 {
1787 MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "soundlist %i %i", cl.qw_servercount, 0));
1788 }
1789
1790 cl.loadbegun = false;
1791 cl.loadfinished = false;
1792
1795
1796 // note: on QW protocol we can't set up the gameworld until after
1797 // downloads finish...
1798 // (we don't even know the name of the map yet)
1799 // this also means cl_autodemo does not work on QW protocol...
1800
1801 dp_strlcpy(cl.worldname, "", sizeof(cl.worldname));
1803 dp_strlcpy(cl.worldbasename, "qw", sizeof(cl.worldbasename));
1807
1808 // check memory integrity
1810 }
1811 else
1812 {
1813 // parse maxclients
1816 {
1817 Host_Error("Bad maxclients (%u) from server", cl.maxclients);
1818 return;
1819 }
1821
1822 // parse gametype
1824 // the original id singleplayer demos are bugged and contain
1825 // GAME_DEATHMATCH even for singleplayer
1826 if (cl.maxclients == 1 && cls.protocol == PROTOCOL_QUAKE)
1828
1829 // parse signon message
1831 dp_strlcpy (cl.worldmessage, str, sizeof(cl.worldmessage));
1832
1833 // seperate the printfs so the server message can have a color
1834 if (cls.protocol != PROTOCOL_NEHAHRAMOVIE) // no messages when playing the Nehahra movie
1835 Con_Printf("\n<===================================>\n\n\2%s\n", str);
1836
1837 // check memory integrity
1839
1840 // parse model precache list
1841 for (nummodels=1 ; ; nummodels++)
1842 {
1844 if (!str[0])
1845 break;
1846 if (nummodels==MAX_MODELS)
1847 Host_Error ("Server sent too many model precaches");
1848 if (strlen(str) >= MAX_QPATH)
1849 Host_Error ("Server sent a precache name of %i characters (max %i)", (int)strlen(str), MAX_QPATH - 1);
1850 dp_strlcpy (cl.model_name[nummodels], str, sizeof (cl.model_name[nummodels]));
1851 }
1852 // parse sound precache list
1853 for (numsounds=1 ; ; numsounds++)
1854 {
1856 if (!str[0])
1857 break;
1858 if (numsounds==MAX_SOUNDS)
1859 Host_Error("Server sent too many sound precaches");
1860 if (strlen(str) >= MAX_QPATH)
1861 Host_Error("Server sent a precache name of %i characters (max %i)", (int)strlen(str), MAX_QPATH - 1);
1862 dp_strlcpy (cl.sound_name[numsounds], str, sizeof (cl.sound_name[numsounds]));
1863 }
1864
1865 // set the base name for level-specific things... this gets updated again by CL_SetupWorldModel later
1873
1874 // touch all of the precached models that are still loaded so we can free
1875 // anything that isn't needed
1876 if (!sv.active)
1877 Mod_ClearUsed();
1878 for (i = 1;i < nummodels;i++)
1879 Mod_FindName(cl.model_name[i], cl.model_name[i][0] == '*' ? cl.model_name[1] : NULL);
1880 // precache any models used by the client (this also marks them used)
1881 cl.model_bolt = Mod_ForName("progs/bolt.mdl", false, false, NULL);
1882 cl.model_bolt2 = Mod_ForName("progs/bolt2.mdl", false, false, NULL);
1883 cl.model_bolt3 = Mod_ForName("progs/bolt3.mdl", false, false, NULL);
1884 cl.model_beam = Mod_ForName("progs/beam.mdl", false, false, NULL);
1885
1886 // we purge the models and sounds later in CL_SignonReply
1887 //Mod_PurgeUnused();
1888 //S_PurgeUnused();
1889
1890 // clear sound usage flags for purging of unused sounds
1891 S_ClearUsed();
1892
1893 // precache any sounds used by the client
1901
1902 // sounds used by the game
1903 for (i = 1;i < MAX_SOUNDS && cl.sound_name[i][0];i++)
1904 cl.sound_precache[i] = S_PrecacheSound(cl.sound_name[i], true, true);
1905
1906 // now we try to load everything that is new
1909 cl.loadmodel_total = nummodels;
1912 cl.loadsound_total = numsounds;
1913 cl.downloadcsqc = true;
1914 cl.loadbegun = false;
1915 cl.loadfinished = false;
1916 cl.loadcsqc = true;
1917
1918 // check memory integrity
1920
1921 // if cl_autodemo is set, automatically start recording a demo if one isn't being recorded already
1923 {
1924 char demofile[MAX_OSPATH];
1925
1926 if (cls.demorecording)
1927 {
1928 // finish the previous level's demo file
1930 }
1931
1932 // start a new demo file
1933 Sys_TimeString(vabuf, sizeof(vabuf), cl_autodemo_nameformat.string);
1934 dpsnprintf (demofile, sizeof(demofile), "%s_%s.dem", vabuf, cl.worldbasename);
1935
1936 Con_Printf ("Auto-recording to %s.\n", demofile);
1937
1938 // Reset bit 0 for every new demo
1941 |
1942 ((cl_autodemo_delete.integer & 0x2) ? 0x1 : 0)
1943 );
1944
1945 cls.demofile = FS_OpenRealFile(demofile, "wb", false);
1946 if (cls.demofile)
1947 {
1948 cls.forcetrack = -1;
1949 FS_Printf (cls.demofile, "%i\n", cls.forcetrack);
1950 cls.demorecording = true;
1951 dp_strlcpy(cls.demoname, demofile, sizeof(cls.demoname));
1954 }
1955 else
1956 Con_Print(CON_ERROR "ERROR: couldn't open.\n");
1957 }
1958 }
1960}
void CL_Stop_f(cmd_state_t *cmd)
Definition cl_demo.c:307
cvar_t cl_autodemo_delete
Definition cl_main.c:64
cvar_t cl_autodemo
Definition cl_main.c:62
cvar_t cl_autodemo_nameformat
Definition cl_main.c:63
void CL_ClearState(void)
Definition cl_main.c:125
static void CL_SetSignonStage_WithMsg(int signon_stage)
Definition cl_parse.c:202
void SCR_BeginLoadingPlaque(qbool startup)
Definition cl_screen.c:1838
void CL_VideoStop(void)
Definition cl_video.c:606
@ ca_connected
Definition client.h:532
void Collision_Cache_Reset(qbool resetlimits)
Definition collision.c:1480
@ GAME_NEHAHRA
Definition com_game.h:32
char * MSG_ReadString(sizebuf_t *sb, char *string, size_t maxstring)
Definition com_msg.c:341
void MSG_WriteString(sizebuf_t *sb, const char *s)
Definition com_msg.c:173
void MSG_WriteByte(sizebuf_t *sb, int c)
Definition com_msg.c:130
#define MSG_ReadFloat
Definition common.h:193
protocolversion_t
Definition common.h:132
@ PROTOCOL_UNKNOWN
Definition common.h:133
#define CON_ERROR
Definition console.h:102
qbool FS_ChangeGameDirs(int numgamedirs, const char *gamedirs[], qbool failmissing)
Definition fs.c:1719
qfile_t * FS_OpenRealFile(const char *filepath, const char *mode, qbool quiet)
Definition fs.c:2901
void FS_UnloadPacks_dlcache(void)
Definition fs.c:1485
void FS_StripExtension(const char *in, char *out, size_t size_out)
Definition fs.c:3611
int FS_Printf(qfile_t *file, const char *format,...)
Definition fs.c:3273
void Mod_ClearUsed(void)
model_t * Mod_FindName(const char *name, const char *parentname)
char cl_readstring[MAX_INPUTLINE]
Definition netconn.c:75
int NetConn_IsLocalGame(void)
Definition netconn.c:1696
const char * Protocol_NameForEnum(protocolversion_t p)
Definition protocol.c:77
protocolversion_t Protocol_EnumForNumber(int n)
Definition protocol.c:86
#define GAME_COOP
Definition protocol.h:203
#define qw_clc_stringcmd
Definition protocol.h:957
#define GAME_DEATHMATCH
Definition protocol.h:204
#define MAX_OSPATH
max length of a filesystem pathname
Definition qdefs.h:175
#define MAX_SOUNDS
max number of sounds loaded at once
Definition qdefs.h:107
#define MAX_SCOREBOARD
max number of players in game at once (255 protocol limit)
Definition qdefs.h:110
#define MAX_MODELS
max number of models loaded at once (including during level transitions)
Definition qdefs.h:106
void S_StopAllSounds(void)
Definition snd_main.c:1710
void S_ClearUsed(void)
Definition snd_main.c:996
float movevars_stopspeed
Definition client.h:1060
int realplayerentity
Definition client.h:905
float movevars_entgravity
Definition client.h:1066
float movevars_waterfriction
Definition client.h:1056
float movevars_jumpvelocity
Definition client.h:1067
float movevars_spectatormaxspeed
Definition client.h:1062
sfx_t * sfx_r_exp3
Definition client.h:927
model_t * model_beam
Definition client.h:920
sfx_t * sfx_tink1
Definition client.h:923
int qw_servercount
Definition client.h:1039
float movevars_airaccel_qw
Definition client.h:1071
sfx_t * sfx_ric3
Definition client.h:926
model_t * model_bolt3
Definition client.h:919
sfx_t * sfx_ric1
Definition client.h:924
char worldbasename[MAX_QPATH]
Definition client.h:898
model_t * model_bolt2
Definition client.h:918
sfx_t * sfx_wizhit
Definition client.h:921
float movevars_maxairspeed
Definition client.h:1069
float movevars_accelerate
Definition client.h:1063
qbool loadcsqc
Definition client.h:1026
float movevars_maxspeed
Definition client.h:1061
int islocalgame
Definition client.h:746
sfx_t * sfx_knighthit
Definition client.h:922
float movevars_airaccel_sideways_friction
Definition client.h:1073
float movevars_edgefriction
Definition client.h:1068
float movevars_friction
Definition client.h:1057
sfx_t * sfx_ric2
Definition client.h:925
char worldname[MAX_QPATH]
Definition client.h:899
model_t * model_bolt
Definition client.h:917
float movevars_airaccelerate
Definition client.h:1064
float movevars_stepheight
Definition client.h:1070
char worldmessage[MAX_QPATH]
Definition client.h:896
int playerentity
Definition client.h:910
float movevars_wateraccelerate
Definition client.h:1065
char worldnamenoextension[MAX_QPATH]
Definition client.h:900
float movevars_wallfriction
Definition client.h:1055
int demo_lastcsprogscrc
Definition client.h:586
qfile_t * demofile
Definition client.h:592
fs_offset_t demo_lastcsprogssize
Definition client.h:585
qbool demorecording
Definition client.h:584
mempool_t * levelmempool
Definition client.h:571
char demoname[MAX_QPATH]
Definition client.h:580
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
size_t Sys_TimeString(char buf[], size_t bufsize, const char *timeformat)
Definition sys_shared.c:45

References server_t::active, ca_connected, cl, cl_autodemo, cl_autodemo_delete, cl_autodemo_nameformat, CL_ClearState(), cl_message, cl_readstring, cl_serverextension_download, CL_SetSignonStage_WithMsg(), cl_sound_hknighthit, cl_sound_r_exp3, cl_sound_ric1, cl_sound_ric2, cl_sound_ric3, cl_sound_tink1, cl_sound_wizardhit, CL_Stop_f(), CL_VideoStop(), cl_worldbasename, cl_worldmessage, cl_worldname, cl_worldnamenoextension, cls, cmd_local, Collision_Cache_Reset(), Con_DPrint(), CON_ERROR, Con_Print(), Con_Printf(), Cvar_SetQuick(), Cvar_SetValueQuick(), client_static_t::demo_lastcsprogscrc, client_static_t::demo_lastcsprogssize, client_static_t::demofile, client_static_t::demoname, client_static_t::demoplayback, client_static_t::demorecording, client_state_t::downloadcsqc, client_state_t::downloadmodel_current, client_state_t::downloadsound_current, dp_strlcpy, dpsnprintf(), client_static_t::forcetrack, FS_ChangeGameDirs(), FS_OpenRealFile(), FS_Printf(), FS_StripExtension(), FS_UnloadPacks_dlcache(), GAME_COOP, GAME_DEATHMATCH, GAME_NEHAHRA, gamemode, client_state_t::gametype, Host_Error(), i, cvar_t::integer, client_state_t::islocalgame, client_static_t::levelmempool, client_state_t::loadbegun, client_state_t::loadcsqc, client_state_t::loadfinished, client_state_t::loadmodel_current, client_state_t::loadmodel_total, client_state_t::loadsound_current, client_state_t::loadsound_total, MAX_MODELS, MAX_OSPATH, MAX_QPATH, MAX_SCOREBOARD, MAX_SOUNDS, client_state_t::maxclients, Mem_Alloc, Mem_CheckSentinelsGlobal, netconn_t::message, Mod_ClearUsed(), Mod_FindName(), Mod_ForName(), client_state_t::model_beam, client_state_t::model_bolt, client_state_t::model_bolt2, client_state_t::model_bolt3, client_state_t::model_name, client_state_t::movevars_accelerate, client_state_t::movevars_airaccel_qw, client_state_t::movevars_airaccel_sideways_friction, client_state_t::movevars_airaccelerate, client_state_t::movevars_edgefriction, client_state_t::movevars_entgravity, client_state_t::movevars_friction, client_state_t::movevars_gravity, client_state_t::movevars_jumpvelocity, client_state_t::movevars_maxairspeed, client_state_t::movevars_maxspeed, client_state_t::movevars_spectatormaxspeed, client_state_t::movevars_stepheight, client_state_t::movevars_stopspeed, client_state_t::movevars_timescale, client_state_t::movevars_wallfriction, client_state_t::movevars_wateraccelerate, client_state_t::movevars_waterfriction, MSG_ReadByte, MSG_ReadFloat, MSG_ReadLong, MSG_ReadString(), MSG_WriteByte(), MSG_WriteString(), client_static_t::netcon, NetConn_IsLocalGame(), NULL, client_state_t::num_entities, client_state_t::playerentity, client_static_t::protocol, Protocol_EnumForNumber(), Protocol_NameForEnum(), PROTOCOL_NEHAHRAMOVIE, PROTOCOL_QUAKE, PROTOCOL_QUAKEDP, PROTOCOL_QUAKEWORLD, PROTOCOL_UNKNOWN, qw_clc_stringcmd, client_state_t::qw_servercount, client_state_t::realplayerentity, S_ClearUsed(), S_PrecacheSound(), S_StopAllSounds(), client_state_t::scores, SCR_BeginLoadingPlaque(), client_state_t::sfx_knighthit, client_state_t::sfx_r_exp3, client_state_t::sfx_ric1, client_state_t::sfx_ric2, client_state_t::sfx_ric3, client_state_t::sfx_tink1, client_state_t::sfx_wizhit, client_state_t::sound_name, client_state_t::sound_precache, client_static_t::state, cvar_t::string, strlen(), sv, Sys_TimeString(), va(), client_state_t::viewentity, client_state_t::worldbasename, client_state_t::worldmessage, client_state_t::worldname, and client_state_t::worldnamenoextension.

Referenced by CL_ParseServerMessage().

◆ CL_ParseServerMessage()

void CL_ParseServerMessage ( void )

Definition at line 3435 of file cl_parse.c.

3436{
3437 int cmd;
3438 int i;
3439 protocolversion_t protocol;
3440 unsigned char cmdlog[32];
3441 const char *cmdlogname[32], *temp;
3442 int cmdindex, cmdcount = 0;
3443 qbool qwplayerupdatereceived;
3444 qbool strip_pqc;
3445 char vabuf[1024];
3446 size_t cl_readstring_len;
3447
3448 // LadyHavoc: moved demo message writing from before the packet parse to
3449 // after the packet parse so that CL_Stop_f can be called by cl_autodemo
3450 // code in CL_ParseServerinfo
3451 //if (cls.demorecording)
3452 // CL_WriteDemoMessage (&cl_message);
3453
3455
3456 CL_KeepaliveMessage(false);
3457
3458//
3459// if recording demos, copy the message out
3460//
3461 if (cl_shownet.integer == 1)
3463 else if (cl_shownet.integer == 2)
3464 Con_Print("------------------\n");
3465
3466//
3467// parse the message
3468//
3469 //MSG_BeginReading ();
3470
3471 parsingerror = true;
3472
3474 {
3475 CL_NetworkTimeReceived(host.realtime); // qw has no clock
3476
3477 // kill all qw nails
3478 cl.qw_num_nails = 0;
3479
3480 // fade weapon view kick
3481 cl.qw_weaponkick = min(cl.qw_weaponkick + 10 * bound(0, cl.time - cl.oldtime, 0.1), 0);
3482
3484
3485 qwplayerupdatereceived = false;
3486
3487 while (1)
3488 {
3489 if (cl_message.badread)
3490 Host_Error ("CL_ParseServerMessage: Bad QW server message");
3491
3493
3494 if (cmd == -1)
3495 {
3496 SHOWNET("END OF MESSAGE");
3497 break; // end of message
3498 }
3499
3500 cmdindex = cmdcount & 31;
3501 cmdcount++;
3502 cmdlog[cmdindex] = cmd;
3503
3505 cmdlogname[cmdindex] = qw_svc_strings[cmd];
3506 if (!cmdlogname[cmdindex])
3507 {
3508 // LadyHavoc: fix for bizarre problem in MSVC that I do not understand (if I assign the string pointer directly it ends up storing a NULL pointer)
3509 const char *d = "<unknown>";
3510 cmdlogname[cmdindex] = d;
3511 }
3512
3513 // other commands
3514 switch (cmd)
3515 {
3516 default:
3517 {
3518 char description[32*64], logtemp[64];
3519 int count;
3520 dp_strlcpy(description, "packet dump: ", sizeof(description));
3521 i = cmdcount - 32;
3522 if (i < 0)
3523 i = 0;
3524 count = cmdcount - i;
3525 i &= 31;
3526 while(count > 0)
3527 {
3528 dpsnprintf(logtemp, sizeof(logtemp), "%3i:%s ", cmdlog[i], cmdlogname[i]);
3529 dp_strlcat(description, logtemp, sizeof(description));
3530 count--;
3531 i++;
3532 i &= 31;
3533 }
3534 description[strlen(description)-1] = '\n'; // replace the last space with a newline
3535 Con_Print(description);
3536 Host_Error("CL_ParseServerMessage: Illegible server message");
3537 }
3538 break;
3539
3540 case qw_svc_nop:
3541 //Con_Printf("qw_svc_nop\n");
3542 break;
3543
3544 case qw_svc_disconnect:
3545 if (cls.demonum != -1)
3546 CL_NextDemo();
3547 else
3548 CL_DisconnectEx(true, "Server disconnected");
3549 break;
3550
3551 case qw_svc_print:
3553 cl_readstring_len = MSG_ReadString_len(&cl_message, cl_readstring, sizeof(cl_readstring));
3554 temp = cl_readstring;
3555 if (CL_ExaminePrintString(temp)) // look for anything interesting like player IP addresses or ping reports
3556 {
3557 if (i == 3) // chat
3558 {
3559 cl_readstring_len = dpsnprintf(vabuf, sizeof(vabuf), "\1%s", temp);
3560 CSQC_AddPrintText(vabuf, cl_readstring_len); //[515]: csqc
3561 }
3562 else
3563 CSQC_AddPrintText(temp, cl_readstring_len);
3564 }
3565 break;
3566
3567 case qw_svc_centerprint:
3568 cl_readstring_len = MSG_ReadString_len(&cl_message, cl_readstring, sizeof(cl_readstring));
3569 CL_VM_Parse_CenterPrint(cl_readstring, cl_readstring_len); //[515]: csqc
3570 break;
3571
3572 case qw_svc_stufftext:
3573 cl_readstring_len = MSG_ReadString_len(&cl_message, cl_readstring, sizeof(cl_readstring));
3574 CL_VM_Parse_StuffCmd(cl_readstring, cl_readstring_len); //[515]: csqc
3575 break;
3576
3577 case qw_svc_damage:
3578 // svc_damage protocol is identical to nq
3579 V_ParseDamage ();
3580 break;
3581
3582 case qw_svc_serverdata:
3583 //Cbuf_Execute(); // make sure any stuffed commands are done
3585 break;
3586
3587 case qw_svc_setangle:
3588 for (i=0 ; i<3 ; i++)
3590 if (!cls.demoplayback)
3591 {
3592 cl.fixangle[0] = true;
3594 // disable interpolation if this is new
3595 if (!cl.fixangle[1])
3597 }
3598 break;
3599
3600 case qw_svc_lightstyle:
3602 if (i >= cl.max_lightstyle)
3603 {
3604 Con_Printf ("svc_lightstyle >= MAX_LIGHTSTYLES");
3605 break;
3606 }
3608 cl.lightstyle[i].map[MAX_STYLESTRING - 1] = 0;
3610 break;
3611
3612 case qw_svc_sound:
3614 break;
3615
3616 case qw_svc_stopsound:
3617 i = (unsigned short) MSG_ReadShort(&cl_message);
3618 S_StopSound(i>>3, i&7);
3619 break;
3620
3621 case qw_svc_updatefrags:
3623 if (i >= cl.maxclients)
3624 Host_Error("CL_ParseServerMessage: svc_updatefrags >= cl.maxclients");
3625 cl.scores[i].frags = (signed short) MSG_ReadShort(&cl_message);
3626 break;
3627
3628 case qw_svc_updateping:
3630 if (i >= cl.maxclients)
3631 Host_Error("CL_ParseServerMessage: svc_updateping >= cl.maxclients");
3633 break;
3634
3635 case qw_svc_updatepl:
3637 if (i >= cl.maxclients)
3638 Host_Error("CL_ParseServerMessage: svc_updatepl >= cl.maxclients");
3640 break;
3641
3644 if (i >= cl.maxclients)
3645 Host_Error("CL_ParseServerMessage: svc_updateentertime >= cl.maxclients");
3646 // seconds ago
3648 break;
3649
3651 i = (unsigned short) MSG_ReadShort(&cl_message);
3653 Host_Error ("CL_ParseServerMessage: svc_spawnbaseline: invalid entity number %i", i);
3654 if (i >= cl.max_entities)
3656 CL_ParseBaseline(cl.entities + i, false);
3657 break;
3658 case qw_svc_spawnstatic:
3659 CL_ParseStatic(false);
3660 break;
3661 case qw_svc_temp_entity:
3664 break;
3665
3668 break;
3669
3670 case qw_svc_foundsecret:
3672 break;
3673
3674 case qw_svc_updatestat:
3677 Host_Error ("svc_updatestat: %i is invalid", i);
3679 break;
3680
3684 Host_Error ("svc_updatestatlong: %i is invalid", i);
3686 break;
3687
3689 CL_ParseStaticSound (false);
3690 break;
3691
3692 case qw_svc_cdtrack:
3694 if ( (cls.demoplayback || cls.demorecording) && (cls.forcetrack != -1) )
3695 CDAudio_Play ((unsigned char)cls.forcetrack, true);
3696 else
3697 CDAudio_Play ((unsigned char)cl.cdtrack, true);
3698 break;
3699
3701 if(!cl.intermission)
3703 cl.intermission = 1;
3705 for (i = 0;i < 3;i++)
3707 break;
3708
3709 case qw_svc_finale:
3710 if(!cl.intermission)
3712 cl.intermission = 2;
3714 break;
3715
3716 case qw_svc_sellscreen:
3717 Cmd_ExecuteString(cmd_local, "help", 4, src_local, true);
3718 break;
3719
3720 case qw_svc_smallkick:
3721 cl.qw_weaponkick = -2;
3722 break;
3723 case qw_svc_bigkick:
3724 cl.qw_weaponkick = -4;
3725 break;
3726
3727 case qw_svc_muzzleflash:
3728 i = (unsigned short) MSG_ReadShort(&cl_message);
3729 // NOTE: in QW this only worked on clients
3731 Host_Error("CL_ParseServerMessage: svc_spawnbaseline: invalid entity number %i", i);
3732 if (i >= cl.max_entities)
3735 break;
3736
3739 break;
3740
3741 case qw_svc_setinfo:
3742 QW_CL_SetInfo();
3743 break;
3744
3745 case qw_svc_serverinfo:
3747 break;
3748
3749 case qw_svc_download:
3751 break;
3752
3753 case qw_svc_playerinfo:
3754 // slightly kill qw player entities now that we know there is
3755 // an update of player entities this frame...
3756 if (!qwplayerupdatereceived)
3757 {
3758 qwplayerupdatereceived = true;
3759 for (i = 1;i < cl.maxclients;i++)
3760 cl.entities_active[i] = false;
3761 }
3763 break;
3764
3765 case qw_svc_nails:
3767 break;
3768
3769 case qw_svc_chokecount:
3771 // FIXME: apply to netgraph
3772 //for (j = 0;j < i;j++)
3773 // cl.frames[(cls.netcon->qw.incoming_acknowledged-1-j)&QW_UPDATE_MASK].receivedtime = -2;
3774 break;
3775
3776 case qw_svc_modellist:
3778 break;
3779
3780 case qw_svc_soundlist:
3782 break;
3783
3786 // first update is the final signon stage
3787 if (cls.signon == SIGNONS - 1)
3789 break;
3790
3793 // first update is the final signon stage
3794 if (cls.signon == SIGNONS - 1)
3796 break;
3797
3798 case qw_svc_maxspeed:
3800 break;
3801
3802 case qw_svc_entgravity:
3805 cl.movevars_entgravity = 1.0f;
3806 break;
3807
3808 case qw_svc_setpause:
3811 CDAudio_Pause ();
3812 else if (bgmvolume.value > 0.0f)
3813 CDAudio_Resume ();
3815 break;
3816 }
3817 }
3818
3819 if (qwplayerupdatereceived)
3820 {
3821 // fully kill any player entities that were not updated this frame
3822 for (i = 1;i <= cl.maxclients;i++)
3823 if (!cl.entities_active[i])
3824 cl.entities[i].state_current.active = false;
3825 }
3826 }
3827 else
3828 {
3829 while (1)
3830 {
3831 if (cl_message.badread)
3832 Host_Error ("CL_ParseServerMessage: Bad server message");
3833
3835
3836 if (cmd == -1)
3837 {
3838// R_TimeReport("END OF MESSAGE");
3839 SHOWNET("END OF MESSAGE");
3840 break; // end of message
3841 }
3842
3843 cmdindex = cmdcount & 31;
3844 cmdcount++;
3845 cmdlog[cmdindex] = cmd;
3846
3847 // if the high bit of the command byte is set, it is a fast update
3848 if (cmd & 128)
3849 {
3850 // LadyHavoc: fix for bizarre problem in MSVC that I do not understand (if I assign the string pointer directly it ends up storing a NULL pointer)
3851 temp = "entity";
3852 cmdlogname[cmdindex] = temp;
3853 SHOWNET("fast update");
3854 if (cls.signon == SIGNONS - 1)
3855 // first update is the final signon stage
3858 continue;
3859 }
3860
3862 cmdlogname[cmdindex] = svc_strings[cmd];
3863 if (!cmdlogname[cmdindex])
3864 {
3865 // LadyHavoc: fix for bizarre problem in MSVC that I do not understand (if I assign the string pointer directly it ends up storing a NULL pointer)
3866 const char *d = "<unknown>";
3867 cmdlogname[cmdindex] = d;
3868 }
3869
3870 // other commands
3871 switch (cmd)
3872 {
3873 default:
3874 {
3875 char description[32*64], tempdesc[64];
3876 int count;
3877 dp_strlcpy (description, "packet dump: ", sizeof(description));
3878 i = cmdcount - 32;
3879 if (i < 0)
3880 i = 0;
3881 count = cmdcount - i;
3882 i &= 31;
3883 while(count > 0)
3884 {
3885 dpsnprintf (tempdesc, sizeof (tempdesc), "%3i:%s ", cmdlog[i], cmdlogname[i]);
3886 dp_strlcat (description, tempdesc, sizeof (description));
3887 count--;
3888 i++;
3889 i &= 31;
3890 }
3891 description[strlen(description)-1] = '\n'; // replace the last space with a newline
3892 Con_Print(description);
3893 Host_Error ("CL_ParseServerMessage: Illegible server message");
3894 }
3895 break;
3896
3897 case svc_nop:
3898 if (cls.signon < SIGNONS)
3899 Con_Print("<-- server to client keepalive\n");
3900 break;
3901
3902 case svc_time:
3904 break;
3905
3906 case svc_clientdata:
3908 break;
3909
3910 case svc_version:
3912 protocol = Protocol_EnumForNumber(i);
3913 if (protocol == PROTOCOL_UNKNOWN)
3914 Host_Error("CL_ParseServerMessage: Server is unrecognized protocol number (%i)", i);
3915 // hack for unmarked Nehahra movie demos which had a custom protocol
3916 if (protocol == PROTOCOL_QUAKEDP && cls.demoplayback && gamemode == GAME_NEHAHRA)
3917 protocol = PROTOCOL_NEHAHRAMOVIE;
3918 cls.protocol = protocol;
3919 break;
3920
3921 case svc_disconnect:
3922 if (cls.demonum != -1)
3923 CL_NextDemo();
3924 else
3926 break;
3927
3928 case svc_print:
3929 cl_readstring_len = MSG_ReadString_len(&cl_message, cl_readstring, sizeof(cl_readstring));
3930 temp = cl_readstring;
3931 if (CL_ExaminePrintString(temp)) // look for anything interesting like player IP addresses or ping reports
3932 CSQC_AddPrintText(temp, cl_readstring_len); //[515]: csqc
3933 break;
3934
3935 case svc_centerprint:
3936 cl_readstring_len = MSG_ReadString_len(&cl_message, cl_readstring, sizeof(cl_readstring));
3937 CL_VM_Parse_CenterPrint(cl_readstring, cl_readstring_len); //[515]: csqc
3938 break;
3939
3940 case svc_stufftext:
3941 cl_readstring_len = MSG_ReadString_len(&cl_message, cl_readstring, sizeof(cl_readstring));
3942 temp = cl_readstring;
3943 /* if(utf8_enable.integer)
3944 {
3945 strip_pqc = true;
3946 // we can safely strip and even
3947 // interpret these in utf8 mode
3948 }
3949 else */ switch(cls.protocol)
3950 {
3951 case PROTOCOL_QUAKE:
3952 case PROTOCOL_QUAKEDP:
3953 // maybe add other protocols if
3954 // so desired, but not DP7
3955 strip_pqc = true;
3956 break;
3958 default:
3959 // ProQuake does not support
3960 // these protocols
3961 strip_pqc = false;
3962 break;
3963 }
3964 if(strip_pqc)
3965 {
3966 // skip over ProQuake messages,
3967 // TODO actually interpret them
3968 // (they are sbar team score
3969 // updates), see proquake cl_parse.c
3970 if(*temp == 0x01)
3971 {
3972 ++temp;
3973 --cl_readstring_len;
3974 while(*temp >= 0x01 && *temp <= 0x1F)
3975 {
3976 ++temp;
3977 --cl_readstring_len;
3978 }
3979 }
3980 }
3981 CL_VM_Parse_StuffCmd(temp, cl_readstring_len); //[515]: csqc
3982 break;
3983
3984 case svc_damage:
3985 V_ParseDamage ();
3986 break;
3987
3988 case svc_serverinfo:
3990 break;
3991
3992 case svc_setangle:
3993 for (i=0 ; i<3 ; i++)
3995 if (!cls.demoplayback)
3996 {
3997 cl.fixangle[0] = true;
3999 // disable interpolation if this is new
4000 if (!cl.fixangle[1])
4002 }
4003 break;
4004
4005 case svc_setview:
4006 cl.viewentity = (unsigned short)MSG_ReadShort(&cl_message);
4007 if (cl.viewentity >= MAX_EDICTS)
4008 Host_Error("svc_setview >= MAX_EDICTS");
4011 // LadyHavoc: assume first setview recieved is the real player entity
4012 if (!cl.realplayerentity)
4014 // update cl.playerentity to this one if it is a valid player
4015 if (cl.viewentity >= 1 && cl.viewentity <= cl.maxclients)
4017 break;
4018
4019 case svc_lightstyle:
4021 if (i >= cl.max_lightstyle)
4022 {
4023 Con_Printf ("svc_lightstyle >= MAX_LIGHTSTYLES");
4024 break;
4025 }
4027 cl.lightstyle[i].map[MAX_STYLESTRING - 1] = 0;
4029 break;
4030
4031 case svc_sound:
4033 break;
4034
4035 case svc_precache:
4037 {
4038 // was svc_sound2 in protocols 1, 2, 3, removed in 4, 5, changed to svc_precache in 6
4040 }
4041 else
4042 {
4043 char *s;
4044 i = (unsigned short)MSG_ReadShort(&cl_message);
4046 if (i < 32768)
4047 {
4048 if (i >= 1 && i < MAX_MODELS)
4049 {
4050 model_t *model = Mod_ForName(s, false, false, s[0] == '*' ? cl.model_name[1] : NULL);
4051 if (!model)
4052 Con_DPrintf("svc_precache: Mod_ForName(\"%s\") failed\n", s);
4054 }
4055 else
4056 Con_Printf("svc_precache: index %i outside range %i...%i\n", i, 1, MAX_MODELS);
4057 }
4058 else
4059 {
4060 i -= 32768;
4061 if (i >= 1 && i < MAX_SOUNDS)
4062 {
4063 sfx_t *sfx = S_PrecacheSound (s, true, true);
4064 if (!sfx && snd_initialized.integer)
4065 Con_DPrintf("svc_precache: S_PrecacheSound(\"%s\") failed\n", s);
4066 cl.sound_precache[i] = sfx;
4067 }
4068 else
4069 Con_Printf("svc_precache: index %i outside range %i...%i\n", i, 1, MAX_SOUNDS);
4070 }
4071 }
4072 break;
4073
4074 case svc_stopsound:
4075 i = (unsigned short) MSG_ReadShort(&cl_message);
4076 S_StopSound(i>>3, i&7);
4077 break;
4078
4079 case svc_updatename:
4081 if (i >= cl.maxclients)
4082 Host_Error ("CL_ParseServerMessage: svc_updatename >= cl.maxclients");
4084 break;
4085
4086 case svc_updatefrags:
4088 if (i >= cl.maxclients)
4089 Host_Error ("CL_ParseServerMessage: svc_updatefrags >= cl.maxclients");
4090 cl.scores[i].frags = (signed short) MSG_ReadShort(&cl_message);
4091 break;
4092
4093 case svc_updatecolors:
4095 if (i >= cl.maxclients)
4096 Host_Error ("CL_ParseServerMessage: svc_updatecolors >= cl.maxclients");
4098 break;
4099
4100 case svc_particle:
4102 break;
4103
4104 case svc_effect:
4105 CL_ParseEffect ();
4106 break;
4107
4108 case svc_effect2:
4109 CL_ParseEffect2 ();
4110 break;
4111
4112 case svc_spawnbaseline:
4113 i = (unsigned short) MSG_ReadShort(&cl_message);
4115 Host_Error ("CL_ParseServerMessage: svc_spawnbaseline: invalid entity number %i", i);
4116 if (i >= cl.max_entities)
4118 CL_ParseBaseline (cl.entities + i, false);
4119 break;
4120 case svc_spawnbaseline2:
4121 i = (unsigned short) MSG_ReadShort(&cl_message);
4123 Host_Error ("CL_ParseServerMessage: svc_spawnbaseline2: invalid entity number %i", i);
4124 if (i >= cl.max_entities)
4126 CL_ParseBaseline (cl.entities + i, true);
4127 break;
4128 case svc_spawnstatic:
4129 CL_ParseStatic (false);
4130 break;
4131 case svc_spawnstatic2:
4132 CL_ParseStatic (true);
4133 break;
4134 case svc_temp_entity:
4137 break;
4138
4139 case svc_setpause:
4142 CDAudio_Pause ();
4143 else if (bgmvolume.value > 0.0f)
4144 CDAudio_Resume ();
4146 break;
4147
4148 case svc_signonnum:
4150 // LadyHavoc: it's rude to kick off the client if they missed the
4151 // reconnect somehow, so allow signon 1 even if at signon 1
4152 if (i <= cls.signon && i != 1)
4153 Host_Error ("Received signon %i when at %i", i, cls.signon);
4155 break;
4156
4157 case svc_killedmonster:
4159 break;
4160
4161 case svc_foundsecret:
4163 break;
4164
4165 case svc_updatestat:
4168 Host_Error ("svc_updatestat: %i is invalid", i);
4170 break;
4171
4175 Host_Error ("svc_updatestat: %i is invalid", i);
4177 break;
4178
4181 break;
4182
4184 CL_ParseStaticSound (true);
4185 break;
4186
4187 case svc_cdtrack:
4190 if ( (cls.demoplayback || cls.demorecording) && (cls.forcetrack != -1) )
4191 CDAudio_Play ((unsigned char)cls.forcetrack, true);
4192 else
4193 CDAudio_Play ((unsigned char)cl.cdtrack, true);
4194 break;
4195
4196 case svc_intermission:
4197 if(!cl.intermission)
4199 cl.intermission = 1;
4201 break;
4202
4203 case svc_finale:
4204 if(!cl.intermission)
4206 cl.intermission = 2;
4209 break;
4210
4211 case svc_cutscene:
4212 if(!cl.intermission)
4214 cl.intermission = 3;
4217 break;
4218
4219 case svc_sellscreen:
4220 Cmd_ExecuteString(cmd_local, "help", 4, src_local, true);
4221 break;
4222 case svc_hidelmp:
4223 if (gamemode == GAME_TENEBRAE)
4224 {
4225 // repeating particle effect
4236 }
4237 else
4239 break;
4240 case svc_showlmp:
4241 if (gamemode == GAME_TENEBRAE)
4242 {
4243 // particle effect
4249 }
4250 else
4252 break;
4253 case svc_skybox:
4255 break;
4256 case svc_entities:
4257 if (cls.signon == SIGNONS - 1)
4258 // first update is the final signon stage
4262 else if (cls.protocol == PROTOCOL_DARKPLACES4)
4264 else
4266 break;
4267 case svc_csqcentities:
4269 break;
4270 case svc_downloaddata:
4272 break;
4273 case svc_trailparticles:
4275 break;
4276 case svc_pointparticles:
4278 break;
4281 break;
4282 }
4283// R_TimeReport(svc_strings[cmd]);
4284 }
4285 }
4286
4287 if (cls.signon == SIGNONS)
4289// R_TimeReport("UpdateItems");
4290
4292// R_TimeReport("ISeeDeadEntities");
4293
4295// R_TimeReport("UpdateMoveVars");
4296
4297 parsingerror = false;
4298
4299 // LadyHavoc: this was at the start of the function before cl_autodemo was
4300 // implemented
4301 if (cls.demorecording)
4302 {
4304// R_TimeReport("WriteDemo");
4305 }
4306}
void CDAudio_Resume(void)
Definition cd_shared.c:258
void CDAudio_Play(int track, qbool looping)
Definition cd_shared.c:211
void CDAudio_Pause(void)
Definition cd_shared.c:247
void CL_WriteDemoMessage(sizebuf_t *message)
Definition cl_demo.c:110
void CL_NextDemo(void)
Definition cl_demo.c:50
void EntityFrame4_CL_ReadFrame(void)
Definition cl_ents4.c:4
void EntityFrame5_CL_ReadFrame(void)
Definition cl_ents5.c:289
void EntityFrame_CL_ReadFrame(void)
Definition cl_ents.c:220
void EntityFrameQuake_ReadEntity(int bits)
Definition cl_ents_nq.c:4
void EntityFrameQuake_ISeeDeadEntities(void)
Definition cl_ents_nq.c:117
void EntityStateQW_ReadPlayerUpdate(void)
Definition cl_ents_qw.c:46
void EntityFrameQW_CL_ReadFrame(qbool delta)
Definition cl_ents_qw.c:254
void CL_UpdateMoveVars(void)
Definition cl_input.c:1495
void CL_DisconnectEx(qbool kicked, const char *fmt,...)
Definition cl_main.c:370
static void QW_CL_ParseDownload(void)
Definition cl_parse.c:756
static void CL_ParseTempEntity(void)
Definition cl_parse.c:2413
static void CL_SignonReply(int signon_stage)
Definition cl_parse.c:1613
static void CL_ParsePointParticles1(void)
Definition cl_parse.c:2972
static void CL_ParseBaseline(entity_t *ent, int large)
Definition cl_parse.c:2104
static void QW_CL_ServerInfo(void)
Definition cl_parse.c:1029
#define SHOWNET(x)
Definition cl_parse.c:3427
static void QW_CL_ParseModelList(void)
Definition cl_parse.c:823
static void CL_ParseEffect2(void)
Definition cl_parse.c:2342
static void CL_UpdateItemsAndWeapon(void)
Definition cl_parse.c:1064
static void CL_ParseTrailParticles(void)
Definition cl_parse.c:2945
static void QW_CL_UpdateUserInfo(void)
Definition cl_parse.c:994
static void CL_ParseServerInfo(void)
Definition cl_parse.c:1678
static void CL_ParseStatic(int large)
Definition cl_parse.c:2265
static void CL_ParseStaticSound(int large)
Definition cl_parse.c:2305
static void CL_ParseDownload(void)
Definition cl_parse.c:1478
static qbool CL_ExaminePrintString(const char *text)
Definition cl_parse.c:3142
static void CL_NetworkTimeReceived(double newtime)
Definition cl_parse.c:3287
static void QW_CL_SetInfo(void)
Definition cl_parse.c:1011
static void CL_ParseStartSoundPacket(int largesoundindex)
Definition cl_parse.c:214
static void QW_CL_ParseNails(void)
Definition cl_parse.c:1042
const char * svc_strings[128]
Definition cl_parse.c:34
const char * qw_svc_strings[128]
Definition cl_parse.c:108
static void CL_ParseClientdata(void)
Definition cl_parse.c:2144
static void CL_ParseEffect(void)
Definition cl_parse.c:2328
static void QW_CL_ParseSoundList(void)
Definition cl_parse.c:858
static void CL_ParsePointParticles(void)
Definition cl_parse.c:2961
void CL_ParseParticleEffect(void)
void SCR_CenterPrint(const char *str)
Definition cl_screen.c:144
void SHOWLMP_decodehide(void)
Definition cl_screen.c:1368
void SHOWLMP_decodeshow(void)
Definition cl_screen.c:1381
void Cmd_ExecuteString(cmd_state_t *cmd, const char *text, size_t textlen, cmd_source_t src, qbool lockmutex)
Parses a single line of text into arguments and tries to execute it.
Definition cmd.c:2068
@ src_local
from the command buffer
Definition cmd.h:75
@ GAME_TENEBRAE
full of evil hackery
Definition com_game.h:41
size_t MSG_ReadString_len(sizebuf_t *sb, char *string, size_t maxstring)
Same as MSG_ReadString except it returns the number of bytes written to *string excluding the \0 term...
Definition com_msg.c:352
@ PROTOCOL_DARKPLACES7
added QuakeWorld-style movement protocol to allow more consistent prediction
Definition common.h:135
@ PROTOCOL_DARKPLACES8
added parting messages. WIP
Definition common.h:134
#define dp_strlcat(dst, src, dsize)
Definition common.h:304
void CSQC_AddPrintText(const char *msg, size_t msg_len)
Definition csprogs.c:656
void CL_VM_Parse_StuffCmd(const char *msg, size_t msg_len)
Definition csprogs.c:604
void CL_VM_UpdateIntermissionState(int intermission)
Definition csprogs.c:707
void CSQC_ReadEntities(void)
Definition csprogs.c:798
qbool CL_VM_Parse_TempEntity(void)
Definition csprogs.c:579
void CL_VM_Parse_CenterPrint(const char *msg, size_t msg_len)
Definition csprogs.c:689
void() predraw
string model
host_static_t host
Definition host.c:41
#define min(A, B)
Definition mathlib.h:37
#define qw_svc_bigkick
Definition protocol.h:933
#define svc_pointparticles1
Definition protocol.h:282
#define svc_particle
Definition protocol.h:237
#define qw_svc_packetentities
Definition protocol.h:945
#define svc_setview
Definition protocol.h:219
#define svc_print
Definition protocol.h:222
#define qw_svc_cdtrack
Definition protocol.h:930
#define svc_nop
Definition protocol.h:215
#define qw_svc_updatepl
Definition protocol.h:951
#define qw_svc_entgravity
Definition protocol.h:948
#define svc_setpause
Definition protocol.h:246
#define svc_stopsound
Definition protocol.h:235
#define qw_svc_sellscreen
Definition protocol.h:931
#define qw_svc_download
Definition protocol.h:939
#define qw_svc_sound
Definition protocol.h:911
#define svc_spawnstaticsound2
Definition protocol.h:279
#define svc_spawnstaticsound
Definition protocol.h:254
#define svc_disconnect
Definition protocol.h:216
#define qw_svc_nails
Definition protocol.h:941
#define svc_temp_entity
Definition protocol.h:244
#define qw_svc_updateuserinfo
Definition protocol.h:938
#define svc_cutscene
Definition protocol.h:262
#define svc_updatefrags
Definition protocol.h:233
#define qw_svc_spawnstaticsound
Definition protocol.h:927
#define qw_svc_serverinfo
Definition protocol.h:950
#define svc_entities
Definition protocol.h:277
#define qw_svc_updatefrags
Definition protocol.h:917
#define svc_killedmonster
Definition protocol.h:251
#define svc_spawnstatic2
Definition protocol.h:276
#define qw_svc_finale
Definition protocol.h:929
#define svc_version
Definition protocol.h:218
#define svc_showlmp
Definition protocol.h:264
#define qw_svc_modellist
Definition protocol.h:943
#define qw_svc_updatestat
Definition protocol.h:909
#define svc_spawnbaseline2
Definition protocol.h:275
#define qw_svc_serverdata
Definition protocol.h:915
#define qw_svc_updateping
Definition protocol.h:934
#define svc_downloaddata
Definition protocol.h:269
#define svc_stufftext
Definition protocol.h:223
#define qw_svc_playerinfo
Definition protocol.h:940
#define qw_svc_nop
Definition protocol.h:907
#define svc_signonnum
Definition protocol.h:247
#define svc_sound
Definition protocol.h:220
#define qw_svc_lightstyle
Definition protocol.h:916
#define qw_svc_stopsound
Definition protocol.h:918
#define qw_svc_temp_entity
Definition protocol.h:922
#define svc_serverinfo
Definition protocol.h:227
#define svc_hidelmp
Definition protocol.h:265
#define svc_setangle
Definition protocol.h:225
#define svc_intermission
Definition protocol.h:256
#define svc_updatestatubyte
Definition protocol.h:270
#define svc_spawnstatic
Definition protocol.h:240
#define qw_svc_setinfo
Definition protocol.h:949
#define svc_precache
Definition protocol.h:274
#define svc_cdtrack
Definition protocol.h:259
#define svc_updatestat
Definition protocol.h:217
#define svc_pointparticles
Definition protocol.h:281
#define svc_sellscreen
Definition protocol.h:260
#define svc_trailparticles
Definition protocol.h:280
#define qw_svc_muzzleflash
Definition protocol.h:937
#define qw_svc_spawnstatic
Definition protocol.h:920
#define qw_svc_deltapacketentities
Definition protocol.h:946
#define svc_damage
Definition protocol.h:238
#define svc_time
Definition protocol.h:221
#define svc_lightstyle
Definition protocol.h:231
#define qw_svc_updatestatlong
Definition protocol.h:936
#define qw_svc_spawnbaseline
Definition protocol.h:921
#define svc_spawnbaseline
Definition protocol.h:242
#define qw_svc_maxspeed
Definition protocol.h:947
#define qw_svc_setangle
Definition protocol.h:914
#define qw_svc_intermission
Definition protocol.h:928
#define svc_updatecolors
Definition protocol.h:236
#define svc_finale
Definition protocol.h:257
#define qw_svc_updateentertime
Definition protocol.h:935
#define qw_svc_disconnect
Definition protocol.h:908
#define svc_foundsecret
Definition protocol.h:252
#define svc_effect
Definition protocol.h:271
#define svc_skybox
Definition protocol.h:266
#define qw_svc_soundlist
Definition protocol.h:944
#define qw_svc_damage
Definition protocol.h:919
#define svc_clientdata
Definition protocol.h:234
#define svc_csqcentities
Definition protocol.h:278
#define qw_svc_smallkick
Definition protocol.h:932
#define svc_updatename
Definition protocol.h:232
#define qw_svc_chokecount
Definition protocol.h:942
#define qw_svc_stufftext
Definition protocol.h:913
#define svc_centerprint
Definition protocol.h:249
#define svc_effect2
Definition protocol.h:272
#define qw_svc_foundsecret
Definition protocol.h:926
#define qw_svc_killedmonster
Definition protocol.h:925
#define qw_svc_print
Definition protocol.h:912
#define qw_svc_centerprint
Definition protocol.h:924
#define qw_svc_setpause
Definition protocol.h:923
#define MAX_STYLESTRING
max length of flicker pattern for light style
Definition qdefs.h:109
#define STAT_MONSTERS
bumped by svc_killedmonster
Definition qstats.h:22
#define STAT_SECRETS
bumped on client side by svc_foundsecret
Definition qstats.h:21
#define MAX_CL_STATS
Definition qstats.h:7
cvar_t bgmvolume
Definition snd_main.c:165
void S_PauseGameSounds(qbool toggle)
Definition snd_main.c:1749
cvar_t snd_initialized
Definition snd_main.c:167
void S_StopSound(int entnum, int entchannel)
Definition snd_main.c:1698
lightstyle_t * lightstyle
Definition client.h:998
vec3_t qw_intermission_origin
Definition client.h:1095
int max_lightstyle
Definition client.h:986
float last_received_message
Definition client.h:885
double completed_time
Definition client.h:858
qbool paused
Definition client.h:842
vec3_t viewangles
Definition client.h:786
int intermission
Definition client.h:856
vec3_t qw_intermission_angles
Definition client.h:1096
float qw_weaponkick
Definition client.h:1102
unsigned int servermovesequence
Definition client.h:637
double realtime
the accumulated mainloop time since application started (with filtering), without any slowmo or clamp...
Definition host.h:46
char map[MAX_STYLESTRING]
Definition client.h:484
unsigned int incoming_sequence
Definition netconn.h:205
struct netconn_t::netconn_qw_s qw
int qw_packetloss
Definition client.h:497
float qw_entertime
Definition client.h:495
qbool badread
Definition common.h:56
void V_ParseDamage(void)
Definition view.c:261

References entity_state_t::active, sizebuf_t::badread, bgmvolume, bound, CDAudio_Pause(), CDAudio_Play(), CDAudio_Resume(), client_state_t::cdtrack, cl, CL_DisconnectEx(), CL_ExaminePrintString(), CL_ExpandEntities(), CL_KeepaliveMessage(), cl_message, CL_NetworkTimeReceived(), CL_NextDemo(), CL_ParseBaseline(), CL_ParseClientdata(), CL_ParseDownload(), CL_ParseEffect(), CL_ParseEffect2(), CL_ParseParticleEffect(), CL_ParsePointParticles(), CL_ParsePointParticles1(), CL_ParseServerInfo(), CL_ParseStartSoundPacket(), CL_ParseStatic(), CL_ParseStaticSound(), CL_ParseTempEntity(), CL_ParseTrailParticles(), cl_readstring, cl_shownet, CL_SignonReply(), CL_UpdateItemsAndWeapon(), CL_UpdateMoveVars(), CL_VM_Parse_CenterPrint(), CL_VM_Parse_StuffCmd(), CL_VM_Parse_TempEntity(), CL_VM_UpdateIntermissionState(), CL_WriteDemoMessage(), cls, cmd(), Cmd_ExecuteString(), cmd_local, scoreboard_t::colors, client_state_t::completed_time, Con_DPrintf(), Con_Print(), Con_Printf(), count, CSQC_AddPrintText(), CSQC_ReadEntities(), sizebuf_t::cursize, client_static_t::demonum, client_static_t::demoplayback, client_static_t::demorecording, dp_strlcat, dp_strlcpy, dpsnprintf(), client_state_t::entities, client_state_t::entities_active, EntityFrame4_CL_ReadFrame(), EntityFrame5_CL_ReadFrame(), EntityFrame_CL_ReadFrame(), EntityFrameQuake_ISeeDeadEntities(), EntityFrameQuake_ReadEntity(), EntityFrameQW_CL_ReadFrame(), EntityStateQW_ReadPlayerUpdate(), client_state_t::fixangle, client_static_t::forcetrack, scoreboard_t::frags, GAME_NEHAHRA, GAME_TENEBRAE, gamemode, host, Host_Error(), i, netconn_t::netconn_qw_s::incoming_sequence, int(), cvar_t::integer, client_state_t::intermission, client_state_t::last_received_message, lightstyle_t::length, client_state_t::lightstyle, client_state_t::looptrack, lightstyle_t::map, MAX_CL_STATS, MAX_EDICTS, client_state_t::max_entities, client_state_t::max_lightstyle, MAX_MODELS, MAX_SOUNDS, MAX_STYLESTRING, client_state_t::maxclients, min, Mod_ForName(), model, client_state_t::model_name, client_state_t::model_precache, client_state_t::movevars_entgravity, client_state_t::movevars_maxspeed, MSG_ReadAngle(), MSG_ReadByte, MSG_ReadCoord(), MSG_ReadFloat, MSG_ReadLong, MSG_ReadShort, MSG_ReadString(), MSG_ReadString_len(), MSG_ReadVector(), entity_persistent_t::muzzleflash, client_state_t::mviewangles, scoreboard_t::name, client_static_t::netcon, NULL, client_state_t::oldtime, parsingerror, client_state_t::paused, entity_t::persistent, client_state_t::playerentity, client_static_t::protocol, PROTOCOL_DARKPLACES1, PROTOCOL_DARKPLACES2, PROTOCOL_DARKPLACES3, PROTOCOL_DARKPLACES4, PROTOCOL_DARKPLACES7, PROTOCOL_DARKPLACES8, Protocol_EnumForNumber(), PROTOCOL_NEHAHRABJP2, PROTOCOL_NEHAHRABJP3, PROTOCOL_NEHAHRAMOVIE, PROTOCOL_QUAKE, PROTOCOL_QUAKEDP, PROTOCOL_QUAKEWORLD, PROTOCOL_UNKNOWN, netconn_t::qw, QW_CL_ParseDownload(), QW_CL_ParseModelList(), QW_CL_ParseNails(), QW_CL_ParseSoundList(), QW_CL_ServerInfo(), QW_CL_SetInfo(), QW_CL_UpdateUserInfo(), scoreboard_t::qw_entertime, client_state_t::qw_intermission_angles, client_state_t::qw_intermission_origin, client_state_t::qw_num_nails, scoreboard_t::qw_packetloss, scoreboard_t::qw_ping, qw_svc_bigkick, qw_svc_cdtrack, qw_svc_centerprint, qw_svc_chokecount, qw_svc_damage, qw_svc_deltapacketentities, qw_svc_disconnect, qw_svc_download, qw_svc_entgravity, qw_svc_finale, qw_svc_foundsecret, qw_svc_intermission, qw_svc_killedmonster, qw_svc_lightstyle, qw_svc_maxspeed, qw_svc_modellist, qw_svc_muzzleflash, qw_svc_nails, qw_svc_nop, qw_svc_packetentities, qw_svc_playerinfo, qw_svc_print, qw_svc_sellscreen, qw_svc_serverdata, qw_svc_serverinfo, qw_svc_setangle, qw_svc_setinfo, qw_svc_setpause, qw_svc_smallkick, qw_svc_sound, qw_svc_soundlist, qw_svc_spawnbaseline, qw_svc_spawnstatic, qw_svc_spawnstaticsound, qw_svc_stopsound, qw_svc_strings, qw_svc_stufftext, qw_svc_temp_entity, qw_svc_updateentertime, qw_svc_updatefrags, qw_svc_updateping, qw_svc_updatepl, qw_svc_updatestat, qw_svc_updatestatlong, qw_svc_updateuserinfo, client_state_t::qw_weaponkick, R_SetSkyBox(), client_state_t::realplayerentity, host_static_t::realtime, S_PauseGameSounds(), S_PrecacheSound(), S_StopSound(), client_state_t::scores, SCR_CenterPrint(), client_static_t::servermovesequence, SHOWLMP_decodehide(), SHOWLMP_decodeshow(), SHOWNET, client_static_t::signon, SIGNONS, snd_cdautopause, snd_initialized, client_state_t::sound_precache, src_local, STAT_MONSTERS, STAT_SECRETS, entity_t::state_current, client_state_t::stats, strlen(), svc_cdtrack, svc_centerprint, svc_clientdata, svc_csqcentities, svc_cutscene, svc_damage, svc_disconnect, svc_downloaddata, svc_effect, svc_effect2, svc_entities, svc_finale, svc_foundsecret, svc_hidelmp, svc_intermission, svc_killedmonster, svc_lightstyle, svc_nop, svc_particle, svc_pointparticles, svc_pointparticles1, svc_precache, svc_print, svc_sellscreen, svc_serverinfo, svc_setangle, svc_setpause, svc_setview, svc_showlmp, svc_signonnum, svc_skybox, svc_sound, svc_spawnbaseline, svc_spawnbaseline2, svc_spawnstatic, svc_spawnstatic2, svc_spawnstaticsound, svc_spawnstaticsound2, svc_stopsound, svc_strings, svc_stufftext, svc_temp_entity, svc_time, svc_trailparticles, svc_updatecolors, svc_updatefrags, svc_updatename, svc_updatestat, svc_updatestatubyte, svc_version, client_state_t::time, V_ParseDamage(), cvar_t::value, VectorCopy, client_state_t::viewangles, client_state_t::viewentity, and void().

Referenced by CL_ReadDemoMessage(), and NetConn_ClientParsePacket().

◆ CL_ParseStartSoundPacket()

static void CL_ParseStartSoundPacket ( int largesoundindex)
static

Definition at line 214 of file cl_parse.c.

215{
216 vec3_t pos;
217 int channel, ent;
218 int sound_num;
219 int nvolume;
220 int field_mask;
221 float attenuation;
222 float speed;
223 int fflags = CHANNELFLAG_NONE;
224
226 {
227 channel = MSG_ReadShort(&cl_message);
228
229 if (channel & (1<<15))
230 nvolume = MSG_ReadByte(&cl_message);
231 else
233
234 if (channel & (1<<14))
235 attenuation = MSG_ReadByte(&cl_message) / 64.0;
236 else
238
239 speed = 1.0f;
240
241 ent = (channel>>3)&1023;
242 channel &= 7;
243
244 sound_num = MSG_ReadByte(&cl_message);
245 }
246 else
247 {
248 field_mask = MSG_ReadByte(&cl_message);
249
250 if (field_mask & SND_VOLUME)
251 nvolume = MSG_ReadByte(&cl_message);
252 else
254
255 if (field_mask & SND_ATTENUATION)
256 attenuation = MSG_ReadByte(&cl_message) / 64.0;
257 else
259
260 if (field_mask & SND_SPEEDUSHORT4000)
261 speed = ((unsigned short)MSG_ReadShort(&cl_message)) / 4000.0f;
262 else
263 speed = 1.0f;
264
265 if (field_mask & SND_LARGEENTITY)
266 {
267 ent = (unsigned short) MSG_ReadShort(&cl_message);
268 channel = MSG_ReadChar(&cl_message);
269 }
270 else
271 {
272 channel = (unsigned short) MSG_ReadShort(&cl_message);
273 ent = channel >> 3;
274 channel &= 7;
275 }
276
277 if (largesoundindex || (field_mask & SND_LARGESOUND) || cls.protocol == PROTOCOL_NEHAHRABJP2 || cls.protocol == PROTOCOL_NEHAHRABJP3)
278 sound_num = (unsigned short) MSG_ReadShort(&cl_message);
279 else
280 sound_num = MSG_ReadByte(&cl_message);
281 }
282
284
285 if (sound_num < 0 || sound_num >= MAX_SOUNDS)
286 {
287 Con_Printf("CL_ParseStartSoundPacket: sound_num (%i) >= MAX_SOUNDS (%i)\n", sound_num, MAX_SOUNDS);
288 return;
289 }
290
291 if (ent >= MAX_EDICTS)
292 {
293 Con_Printf("CL_ParseStartSoundPacket: ent = %i", ent);
294 return;
295 }
296
297 if (ent >= cl.max_entities)
299
300 if( !CL_VM_Event_Sound(sound_num, nvolume / 255.0f, channel, attenuation, ent, pos, fflags, speed) )
301 S_StartSound_StartPosition_Flags (ent, channel, cl.sound_precache[sound_num], pos, nvolume/255.0f, attenuation, 0, fflags, speed);
302}
qbool CL_VM_Event_Sound(int sound_num, float fvolume, int channel, float attenuation, int ent, vec3_t pos, int flags, float speed)
Definition csprogs.c:721
#define SND_ATTENUATION
Definition protocol.h:190
#define SND_VOLUME
Definition protocol.h:189
#define SND_SPEEDUSHORT4000
Definition protocol.h:194
#define SND_LARGEENTITY
Definition protocol.h:192
#define SND_LARGESOUND
Definition protocol.h:193
int S_StartSound_StartPosition_Flags(int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation, float startposition, int flags, float fspeed)
Definition snd_main.c:1571
#define CHANNELFLAG_NONE
Definition sound.h:37
#define DEFAULT_SOUND_PACKET_ATTENUATION
Definition sound.h:33
#define DEFAULT_SOUND_PACKET_VOLUME
Definition sound.h:32

References CHANNELFLAG_NONE, cl, CL_ExpandEntities(), cl_message, CL_VM_Event_Sound(), cls, Con_Printf(), DEFAULT_SOUND_PACKET_ATTENUATION, DEFAULT_SOUND_PACKET_VOLUME, MAX_EDICTS, client_state_t::max_entities, MAX_SOUNDS, MSG_ReadByte, MSG_ReadChar, MSG_ReadShort, MSG_ReadVector(), client_static_t::protocol, PROTOCOL_NEHAHRABJP2, PROTOCOL_NEHAHRABJP3, PROTOCOL_QUAKEWORLD, S_StartSound_StartPosition_Flags(), SND_ATTENUATION, SND_LARGEENTITY, SND_LARGESOUND, SND_SPEEDUSHORT4000, SND_VOLUME, and client_state_t::sound_precache.

Referenced by CL_ParseServerMessage().

◆ CL_ParseStatic()

static void CL_ParseStatic ( int large)
static

Definition at line 2265 of file cl_parse.c.

2266{
2267 entity_t *ent;
2268
2270 Host_Error ("Too many static entities");
2272 CL_ParseBaseline (ent, large);
2273
2274 if (ent->state_baseline.modelindex == 0)
2275 {
2276 Con_DPrintf("svc_parsestatic: static entity without model at %f %f %f\n", ent->state_baseline.origin[0], ent->state_baseline.origin[1], ent->state_baseline.origin[2]);
2278 // This is definitely a cheesy way to conserve resources...
2279 return;
2280 }
2281
2282// copy it to the current state
2285 ent->render.framegroupblend[0].lerp = 1;
2286 // make torchs play out of sync
2287 ent->render.framegroupblend[0].start = lhrandom(-10, -1);
2288 ent->render.skinnum = ent->state_baseline.skin;
2290 ent->render.alpha = 1;
2291
2292 //VectorCopy (ent->state_baseline.origin, ent->render.origin);
2293 //VectorCopy (ent->state_baseline.angles, ent->render.angles);
2294
2296 ent->render.allowdecals = true;
2298}
void CL_UpdateRenderEntity(entity_render_t *ent)
Definition cl_main.c:702
#define lhrandom(MIN, MAX)
LadyHavoc: this function never returns exactly MIN or exactly MAX, because of a QuakeC bug in id1 whe...
Definition mathlib.h:48
void Matrix4x4_CreateFromQuakeEntity(matrix4x4_t *out, double x, double y, double z, double pitch, double yaw, double roll, double scale)
Definition matrixlib.c:715
int max_static_entities
Definition client.h:982
entity_t * static_entities
Definition client.h:994
int num_static_entities
Definition client.h:1004
matrix4x4_t matrix
Definition client.h:332
model_t * model
Definition client.h:343

References entity_render_t::allowdecals, entity_render_t::alpha, entity_state_t::angles, cl, CL_GetModelByIndex(), CL_ParseBaseline(), CL_UpdateRenderEntity(), Con_DPrintf(), entity_render_t::effects, entity_state_t::effects, entity_state_t::frame, framegroupblend_t::frame, entity_render_t::framegroupblend, Host_Error(), framegroupblend_t::lerp, lhrandom, entity_render_t::matrix, Matrix4x4_CreateFromQuakeEntity(), client_state_t::max_static_entities, entity_render_t::model, entity_state_t::modelindex, client_state_t::num_static_entities, entity_state_t::origin, entity_t::render, entity_state_t::skin, entity_render_t::skinnum, framegroupblend_t::start, entity_t::state_baseline, and client_state_t::static_entities.

Referenced by CL_ParseServerMessage().

◆ CL_ParseStaticSound()

static void CL_ParseStaticSound ( int large)
static

Definition at line 2305 of file cl_parse.c.

2306{
2307 vec3_t org;
2308 int sound_num, vol, atten;
2309
2311 if (large)
2312 sound_num = (unsigned short) MSG_ReadShort(&cl_message);
2313 else
2314 sound_num = MSG_ReadByte(&cl_message);
2315
2316 if (sound_num < 0 || sound_num >= MAX_SOUNDS)
2317 {
2318 Con_Printf("CL_ParseStaticSound: sound_num(%i) >= MAX_SOUNDS (%i)\n", sound_num, MAX_SOUNDS);
2319 return;
2320 }
2321
2322 vol = MSG_ReadByte(&cl_message);
2323 atten = MSG_ReadByte(&cl_message);
2324
2325 S_StaticSound (cl.sound_precache[sound_num], org, vol/255.0f, atten);
2326}
void S_StaticSound(sfx_t *sfx, vec3_t origin, float fvol, float attenuation)
Definition snd_main.c:1809

References cl, cl_message, cls, Con_Printf(), MAX_SOUNDS, MSG_ReadByte, MSG_ReadShort, MSG_ReadVector(), client_static_t::protocol, S_StaticSound(), and client_state_t::sound_precache.

Referenced by CL_ParseServerMessage().

◆ CL_ParseTempEntity()

static void CL_ParseTempEntity ( void )
static

Definition at line 2413 of file cl_parse.c.

2414{
2415 int type;
2416 vec3_t pos, pos2;
2417 vec3_t vel1, vel2;
2418 vec3_t dir;
2419 vec3_t color;
2420 int rnd;
2421 int colorStart, colorLength, count;
2422 float velspeed, radius;
2423 unsigned char *tempcolor;
2424 matrix4x4_t tempmatrix;
2425
2427 {
2429 switch (type)
2430 {
2431 case QW_TE_WIZSPIKE:
2432 // spike hitting wall
2434 CL_FindNonSolidLocation(pos, pos, 4);
2436 S_StartSound(-1, 0, cl.sfx_wizhit, pos, 1, 1);
2437 break;
2438
2439 case QW_TE_KNIGHTSPIKE:
2440 // spike hitting wall
2442 CL_FindNonSolidLocation(pos, pos, 4);
2444 S_StartSound(-1, 0, cl.sfx_knighthit, pos, 1, 1);
2445 break;
2446
2447 case QW_TE_SPIKE:
2448 // spike hitting wall
2450 CL_FindNonSolidLocation(pos, pos, 4);
2452 if (rand() % 5)
2453 S_StartSound(-1, 0, cl.sfx_tink1, pos, 1, 1);
2454 else
2455 {
2456 rnd = rand() & 3;
2457 if (rnd == 1)
2458 S_StartSound(-1, 0, cl.sfx_ric1, pos, 1, 1);
2459 else if (rnd == 2)
2460 S_StartSound(-1, 0, cl.sfx_ric2, pos, 1, 1);
2461 else
2462 S_StartSound(-1, 0, cl.sfx_ric3, pos, 1, 1);
2463 }
2464 break;
2465 case QW_TE_SUPERSPIKE:
2466 // super spike hitting wall
2468 CL_FindNonSolidLocation(pos, pos, 4);
2470 if (rand() % 5)
2471 S_StartSound(-1, 0, cl.sfx_tink1, pos, 1, 1);
2472 else
2473 {
2474 rnd = rand() & 3;
2475 if (rnd == 1)
2476 S_StartSound(-1, 0, cl.sfx_ric1, pos, 1, 1);
2477 else if (rnd == 2)
2478 S_StartSound(-1, 0, cl.sfx_ric2, pos, 1, 1);
2479 else
2480 S_StartSound(-1, 0, cl.sfx_ric3, pos, 1, 1);
2481 }
2482 break;
2483
2484 case QW_TE_EXPLOSION:
2485 // rocket explosion
2487 CL_FindNonSolidLocation(pos, pos, 10);
2489 S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
2491 break;
2492
2493 case QW_TE_TAREXPLOSION:
2494 // tarbaby explosion
2496 CL_FindNonSolidLocation(pos, pos, 10);
2498 S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
2499 break;
2500
2501 case QW_TE_LIGHTNING1:
2502 // lightning bolts
2503 CL_ParseBeam(cl.model_bolt, true);
2504 break;
2505
2506 case QW_TE_LIGHTNING2:
2507 // lightning bolts
2509 break;
2510
2511 case QW_TE_LIGHTNING3:
2512 // lightning bolts
2513 CL_ParseBeam(cl.model_bolt3, false);
2514 break;
2515
2516 case QW_TE_LAVASPLASH:
2519 break;
2520
2521 case QW_TE_TELEPORT:
2524 break;
2525
2526 case QW_TE_GUNSHOT:
2527 // bullet hitting wall
2528 radius = MSG_ReadByte(&cl_message);
2530 CL_FindNonSolidLocation(pos, pos, 4);
2531 VectorSet(pos2, pos[0] + radius, pos[1] + radius, pos[2] + radius);
2532 VectorSet(pos, pos[0] - radius, pos[1] - radius, pos[2] - radius);
2535 {
2536 if (rand() % 5)
2537 S_StartSound(-1, 0, cl.sfx_tink1, pos, 1, 1);
2538 else
2539 {
2540 rnd = rand() & 3;
2541 if (rnd == 1)
2542 S_StartSound(-1, 0, cl.sfx_ric1, pos, 1, 1);
2543 else if (rnd == 2)
2544 S_StartSound(-1, 0, cl.sfx_ric2, pos, 1, 1);
2545 else
2546 S_StartSound(-1, 0, cl.sfx_ric3, pos, 1, 1);
2547 }
2548 }
2549 break;
2550
2551 case QW_TE_BLOOD:
2554 CL_FindNonSolidLocation(pos, pos, 4);
2556 break;
2557
2560 CL_FindNonSolidLocation(pos, pos, 4);
2562 break;
2563
2564 default:
2565 Host_Error("CL_ParseTempEntity: bad type %d (hex %02X)", type, type);
2566 }
2567 }
2568 else
2569 {
2571 switch (type)
2572 {
2573 case TE_WIZSPIKE:
2574 // spike hitting wall
2576 CL_FindNonSolidLocation(pos, pos, 4);
2578 S_StartSound(-1, 0, cl.sfx_wizhit, pos, 1, 1);
2579 break;
2580
2581 case TE_KNIGHTSPIKE:
2582 // spike hitting wall
2584 CL_FindNonSolidLocation(pos, pos, 4);
2586 S_StartSound(-1, 0, cl.sfx_knighthit, pos, 1, 1);
2587 break;
2588
2589 case TE_SPIKE:
2590 // spike hitting wall
2592 CL_FindNonSolidLocation(pos, pos, 4);
2594 if (rand() % 5)
2595 S_StartSound(-1, 0, cl.sfx_tink1, pos, 1, 1);
2596 else
2597 {
2598 rnd = rand() & 3;
2599 if (rnd == 1)
2600 S_StartSound(-1, 0, cl.sfx_ric1, pos, 1, 1);
2601 else if (rnd == 2)
2602 S_StartSound(-1, 0, cl.sfx_ric2, pos, 1, 1);
2603 else
2604 S_StartSound(-1, 0, cl.sfx_ric3, pos, 1, 1);
2605 }
2606 break;
2607 case TE_SPIKEQUAD:
2608 // quad spike hitting wall
2610 CL_FindNonSolidLocation(pos, pos, 4);
2612 if (rand() % 5)
2613 S_StartSound(-1, 0, cl.sfx_tink1, pos, 1, 1);
2614 else
2615 {
2616 rnd = rand() & 3;
2617 if (rnd == 1)
2618 S_StartSound(-1, 0, cl.sfx_ric1, pos, 1, 1);
2619 else if (rnd == 2)
2620 S_StartSound(-1, 0, cl.sfx_ric2, pos, 1, 1);
2621 else
2622 S_StartSound(-1, 0, cl.sfx_ric3, pos, 1, 1);
2623 }
2624 break;
2625 case TE_SUPERSPIKE:
2626 // super spike hitting wall
2628 CL_FindNonSolidLocation(pos, pos, 4);
2630 if (rand() % 5)
2631 S_StartSound(-1, 0, cl.sfx_tink1, pos, 1, 1);
2632 else
2633 {
2634 rnd = rand() & 3;
2635 if (rnd == 1)
2636 S_StartSound(-1, 0, cl.sfx_ric1, pos, 1, 1);
2637 else if (rnd == 2)
2638 S_StartSound(-1, 0, cl.sfx_ric2, pos, 1, 1);
2639 else
2640 S_StartSound(-1, 0, cl.sfx_ric3, pos, 1, 1);
2641 }
2642 break;
2643 case TE_SUPERSPIKEQUAD:
2644 // quad super spike hitting wall
2646 CL_FindNonSolidLocation(pos, pos, 4);
2648 if (rand() % 5)
2649 S_StartSound(-1, 0, cl.sfx_tink1, pos, 1, 1);
2650 else
2651 {
2652 rnd = rand() & 3;
2653 if (rnd == 1)
2654 S_StartSound(-1, 0, cl.sfx_ric1, pos, 1, 1);
2655 else if (rnd == 2)
2656 S_StartSound(-1, 0, cl.sfx_ric2, pos, 1, 1);
2657 else
2658 S_StartSound(-1, 0, cl.sfx_ric3, pos, 1, 1);
2659 }
2660 break;
2661 // LadyHavoc: added for improved blood splatters
2662 case TE_BLOOD:
2663 // blood puff
2665 CL_FindNonSolidLocation(pos, pos, 4);
2671 break;
2672 case TE_SPARK:
2673 // spark shower
2675 CL_FindNonSolidLocation(pos, pos, 4);
2681 break;
2682 case TE_PLASMABURN:
2684 CL_FindNonSolidLocation(pos, pos, 4);
2686 break;
2687 // LadyHavoc: added for improved gore
2688 case TE_BLOODSHOWER:
2689 // vaporized body
2690 MSG_ReadVector(&cl_message, pos, cls.protocol); // mins
2691 MSG_ReadVector(&cl_message, pos2, cls.protocol); // maxs
2692 velspeed = MSG_ReadCoord(&cl_message, cls.protocol); // speed
2693 count = (unsigned short) MSG_ReadShort(&cl_message); // number of particles
2694 vel1[0] = -velspeed;
2695 vel1[1] = -velspeed;
2696 vel1[2] = -velspeed;
2697 vel2[0] = velspeed;
2698 vel2[1] = velspeed;
2699 vel2[2] = velspeed;
2700 CL_ParticleEffect(EFFECT_TE_BLOOD, count, pos, pos2, vel1, vel2, NULL, 0);
2701 break;
2702
2703 case TE_PARTICLECUBE:
2704 // general purpose particle effect
2705 MSG_ReadVector(&cl_message, pos, cls.protocol); // mins
2706 MSG_ReadVector(&cl_message, pos2, cls.protocol); // maxs
2708 count = (unsigned short) MSG_ReadShort(&cl_message); // number of particles
2709 colorStart = MSG_ReadByte(&cl_message); // color
2710 colorLength = MSG_ReadByte(&cl_message); // gravity (1 or 0)
2711 velspeed = MSG_ReadCoord(&cl_message, cls.protocol); // randomvel
2712 CL_ParticleCube(pos, pos2, dir, count, colorStart, colorLength != 0, velspeed);
2713 break;
2714
2715 case TE_PARTICLERAIN:
2716 // general purpose particle effect
2717 MSG_ReadVector(&cl_message, pos, cls.protocol); // mins
2718 MSG_ReadVector(&cl_message, pos2, cls.protocol); // maxs
2720 count = (unsigned short) MSG_ReadShort(&cl_message); // number of particles
2721 colorStart = MSG_ReadByte(&cl_message); // color
2722 CL_ParticleRain(pos, pos2, dir, count, colorStart, 0);
2723 break;
2724
2725 case TE_PARTICLESNOW:
2726 // general purpose particle effect
2727 MSG_ReadVector(&cl_message, pos, cls.protocol); // mins
2728 MSG_ReadVector(&cl_message, pos2, cls.protocol); // maxs
2730 count = (unsigned short) MSG_ReadShort(&cl_message); // number of particles
2731 colorStart = MSG_ReadByte(&cl_message); // color
2732 CL_ParticleRain(pos, pos2, dir, count, colorStart, 1);
2733 break;
2734
2735 case TE_GUNSHOT:
2736 // bullet hitting wall
2738 CL_FindNonSolidLocation(pos, pos, 4);
2741 {
2742 if (rand() % 5)
2743 S_StartSound(-1, 0, cl.sfx_tink1, pos, 1, 1);
2744 else
2745 {
2746 rnd = rand() & 3;
2747 if (rnd == 1)
2748 S_StartSound(-1, 0, cl.sfx_ric1, pos, 1, 1);
2749 else if (rnd == 2)
2750 S_StartSound(-1, 0, cl.sfx_ric2, pos, 1, 1);
2751 else
2752 S_StartSound(-1, 0, cl.sfx_ric3, pos, 1, 1);
2753 }
2754 }
2755 break;
2756
2757 case TE_GUNSHOTQUAD:
2758 // quad bullet hitting wall
2760 CL_FindNonSolidLocation(pos, pos, 4);
2763 {
2764 if (rand() % 5)
2765 S_StartSound(-1, 0, cl.sfx_tink1, pos, 1, 1);
2766 else
2767 {
2768 rnd = rand() & 3;
2769 if (rnd == 1)
2770 S_StartSound(-1, 0, cl.sfx_ric1, pos, 1, 1);
2771 else if (rnd == 2)
2772 S_StartSound(-1, 0, cl.sfx_ric2, pos, 1, 1);
2773 else
2774 S_StartSound(-1, 0, cl.sfx_ric3, pos, 1, 1);
2775 }
2776 }
2777 break;
2778
2779 case TE_EXPLOSION:
2780 // rocket explosion
2782 CL_FindNonSolidLocation(pos, pos, 10);
2784 S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
2785 break;
2786
2787 case TE_EXPLOSIONQUAD:
2788 // quad rocket explosion
2790 CL_FindNonSolidLocation(pos, pos, 10);
2792 S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
2793 break;
2794
2795 case TE_EXPLOSION3:
2796 // Nehahra movie colored lighting explosion
2798 CL_FindNonSolidLocation(pos, pos, 10);
2799 color[0] = MSG_ReadCoord(&cl_message, cls.protocol) * (2.0f / 1.0f);
2800 color[1] = MSG_ReadCoord(&cl_message, cls.protocol) * (2.0f / 1.0f);
2801 color[2] = MSG_ReadCoord(&cl_message, cls.protocol) * (2.0f / 1.0f);
2803 Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
2804 CL_AllocLightFlash(NULL, &tempmatrix, 350, color[0], color[1], color[2], 700, 0.5, NULL, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
2805 S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
2806 break;
2807
2808 case TE_EXPLOSIONRGB:
2809 // colored lighting explosion
2811 CL_FindNonSolidLocation(pos, pos, 10);
2813 color[0] = MSG_ReadByte(&cl_message) * (2.0f / 255.0f);
2814 color[1] = MSG_ReadByte(&cl_message) * (2.0f / 255.0f);
2815 color[2] = MSG_ReadByte(&cl_message) * (2.0f / 255.0f);
2816 Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
2817 CL_AllocLightFlash(NULL, &tempmatrix, 350, color[0], color[1], color[2], 700, 0.5, NULL, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
2818 S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
2819 break;
2820
2821 case TE_TAREXPLOSION:
2822 // tarbaby explosion
2824 CL_FindNonSolidLocation(pos, pos, 10);
2826 S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
2827 break;
2828
2829 case TE_SMALLFLASH:
2831 CL_FindNonSolidLocation(pos, pos, 10);
2833 break;
2834
2835 case TE_CUSTOMFLASH:
2837 CL_FindNonSolidLocation(pos, pos, 4);
2838 radius = (MSG_ReadByte(&cl_message) + 1) * 8;
2839 velspeed = (MSG_ReadByte(&cl_message) + 1) * (1.0 / 256.0);
2840 color[0] = MSG_ReadByte(&cl_message) * (2.0f / 255.0f);
2841 color[1] = MSG_ReadByte(&cl_message) * (2.0f / 255.0f);
2842 color[2] = MSG_ReadByte(&cl_message) * (2.0f / 255.0f);
2843 Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
2844 CL_AllocLightFlash(NULL, &tempmatrix, radius, color[0], color[1], color[2], radius / velspeed, velspeed, NULL, -1, true, 1, 0.25, 1, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
2845 break;
2846
2847 case TE_FLAMEJET:
2852 break;
2853
2854 case TE_LIGHTNING1:
2855 // lightning bolts
2856 CL_ParseBeam(cl.model_bolt, true);
2857 break;
2858
2859 case TE_LIGHTNING2:
2860 // lightning bolts
2862 break;
2863
2864 case TE_LIGHTNING3:
2865 // lightning bolts
2866 CL_ParseBeam(cl.model_bolt3, false);
2867 break;
2868
2869 // PGM 01/21/97
2870 case TE_BEAM:
2871 // grappling hook beam
2872 CL_ParseBeam(cl.model_beam, false);
2873 break;
2874 // PGM 01/21/97
2875
2876 // LadyHavoc: for compatibility with the Nehahra movie...
2877 case TE_LIGHTNING4NEH:
2879 break;
2880
2881 case TE_LAVASPLASH:
2884 break;
2885
2886 case TE_TELEPORT:
2889 break;
2890
2891 case TE_EXPLOSION2:
2892 // color mapped explosion
2894 CL_FindNonSolidLocation(pos, pos, 10);
2895 colorStart = MSG_ReadByte(&cl_message);
2896 colorLength = MSG_ReadByte(&cl_message);
2897 if (colorLength == 0)
2898 colorLength = 1;
2899 CL_ParticleExplosion2(pos, colorStart, colorLength);
2900 tempcolor = palette_rgb[(rand()%colorLength) + colorStart];
2901 color[0] = tempcolor[0] * (2.0f / 255.0f);
2902 color[1] = tempcolor[1] * (2.0f / 255.0f);
2903 color[2] = tempcolor[2] * (2.0f / 255.0f);
2904 Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
2905 CL_AllocLightFlash(NULL, &tempmatrix, 350, color[0], color[1], color[2], 700, 0.5, NULL, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
2906 S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
2907 break;
2908
2909 case TE_TEI_G3:
2913 CL_ParticleTrail(EFFECT_TE_TEI_G3, 1, pos, pos2, dir, dir, NULL, 0, true, true, NULL, NULL, 1);
2914 break;
2915
2916 case TE_TEI_SMOKE:
2920 CL_FindNonSolidLocation(pos, pos, 4);
2922 break;
2923
2926 CL_FindNonSolidLocation(pos, pos, 10);
2928 S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
2929 break;
2930
2931 case TE_TEI_PLASMAHIT:
2935 CL_FindNonSolidLocation(pos, pos, 5);
2937 break;
2938
2939 default:
2940 Host_Error("CL_ParseTempEntity: bad type %d (hex %02X)", type, type);
2941 }
2942 }
2943}
void CL_FindNonSolidLocation(const vec3_t in, vec3_t out, vec_t radius)
void CL_AllocLightFlash(entity_render_t *ent, matrix4x4_t *matrix, float radius, float red, float green, float blue, float decay, float lifetime, char *cubemapname, int style, int shadowenable, vec_t corona, vec_t coronasizescale, vec_t ambientscale, vec_t diffusescale, vec_t specularscale, int flags)
Definition cl_main.c:852
static void CL_ParseBeam(model_t *m, int lightning)
Definition cl_parse.c:2395
#define RIC_GUNSHOTQUAD
Definition cl_parse.c:184
#define RIC_GUNSHOT
Definition cl_parse.c:183
void CL_ParticleTrail(int effectnameindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor, qbool spawndlight, qbool spawnparticles, float tintmins[4], float tintmaxs[4], float fade)
void CL_ParticleRain(const vec3_t mins, const vec3_t maxs, const vec3_t dir, int count, int colorbase, int type)
void CL_ParticleExplosion2(const vec3_t org, int colorStart, int colorLength)
void CL_ParticleCube(const vec3_t mins, const vec3_t maxs, const vec3_t dir, int count, int colorbase, vec_t gravity, vec_t randomvel)
void CL_ParticleExplosion(const vec3_t org)
@ EFFECT_TE_WIZSPIKE
@ EFFECT_TE_TEI_SMOKE
@ EFFECT_TE_FLAMEJET
@ EFFECT_TE_SUPERSPIKEQUAD
@ EFFECT_TE_SPIKEQUAD
@ EFFECT_TE_SPARK
@ EFFECT_TE_GUNSHOTQUAD
@ EFFECT_TE_EXPLOSIONQUAD
@ EFFECT_TE_EXPLOSION
@ EFFECT_TE_GUNSHOT
@ EFFECT_TE_PLASMABURN
@ EFFECT_TE_TAREXPLOSION
@ EFFECT_TE_LAVASPLASH
@ EFFECT_TE_TELEPORT
@ EFFECT_TE_SMALLFLASH
@ EFFECT_TE_KNIGHTSPIKE
@ EFFECT_TE_BLOOD
@ EFFECT_TE_TEI_PLASMAHIT
@ EFFECT_TE_SUPERSPIKE
@ EFFECT_TE_TEI_G3
@ EFFECT_TE_TEI_BIGEXPLOSION
@ EFFECT_TE_SPIKE
#define LIGHTFLAG_NORMALMODE
Definition client.h:34
#define LIGHTFLAG_REALTIMEMODE
Definition client.h:35
vector color
GLenum type
Definition glquake.h:656
#define VectorSet(vec, x, y, z)
Definition mathlib.h:96
void Matrix4x4_CreateTranslate(matrix4x4_t *out, double x, double y, double z)
Definition matrixlib.c:584
unsigned char palette_rgb[256][3]
Definition palette.c:7
#define TE_CUSTOMFLASH
Definition protocol.h:345
#define QW_TE_TAREXPLOSION
Definition protocol.h:1012
#define TE_EXPLOSION
Definition protocol.h:311
#define QW_TE_KNIGHTSPIKE
Definition protocol.h:1016
#define TE_WIZSPIKE
Definition protocol.h:315
#define QW_TE_LIGHTNING3
Definition protocol.h:1017
#define TE_TEI_G3
Definition protocol.h:349
#define TE_GUNSHOTQUAD
Definition protocol.h:338
#define TE_TAREXPLOSION
Definition protocol.h:312
#define TE_GUNSHOT
Definition protocol.h:310
#define QW_TE_LIGHTNINGBLOOD
Definition protocol.h:1021
#define QW_TE_LIGHTNING2
Definition protocol.h:1014
#define TE_SPIKEQUAD
Definition protocol.h:339
#define QW_TE_BLOOD
Definition protocol.h:1020
#define TE_PARTICLERAIN
Definition protocol.h:336
#define TE_BEAM
Definition protocol.h:323
#define TE_PLASMABURN
Definition protocol.h:347
#define TE_EXPLOSION3
Definition protocol.h:327
#define TE_TEI_PLASMAHIT
Definition protocol.h:352
#define TE_TEI_BIGEXPLOSION
Definition protocol.h:351
#define TE_PARTICLESNOW
Definition protocol.h:337
#define TE_LAVASPLASH
Definition protocol.h:318
#define TE_SMALLFLASH
Definition protocol.h:344
#define TE_EXPLOSION2
Definition protocol.h:320
#define TE_TELEPORT
Definition protocol.h:319
#define QW_TE_EXPLOSION
Definition protocol.h:1011
#define QW_TE_SPIKE
Definition protocol.h:1008
#define TE_SUPERSPIKEQUAD
Definition protocol.h:340
#define TE_LIGHTNING2
Definition protocol.h:314
#define TE_BLOODSHOWER
Definition protocol.h:333
#define TE_KNIGHTSPIKE
Definition protocol.h:316
#define TE_FLAMEJET
Definition protocol.h:346
#define QW_TE_LIGHTNING1
Definition protocol.h:1013
#define QW_TE_SUPERSPIKE
Definition protocol.h:1009
#define TE_PARTICLECUBE
Definition protocol.h:335
#define QW_TE_LAVASPLASH
Definition protocol.h:1018
#define TE_TEI_SMOKE
Definition protocol.h:350
#define TE_LIGHTNING4NEH
Definition protocol.h:328
#define TE_LIGHTNING1
Definition protocol.h:313
#define TE_BLOOD
Definition protocol.h:331
#define TE_SUPERSPIKE
Definition protocol.h:309
#define TE_EXPLOSIONRGB
Definition protocol.h:334
#define TE_LIGHTNING3
Definition protocol.h:317
#define TE_SPARK
Definition protocol.h:332
#define QW_TE_GUNSHOT
Definition protocol.h:1010
#define TE_EXPLOSIONQUAD
Definition protocol.h:342
#define QW_TE_WIZSPIKE
Definition protocol.h:1015
#define QW_TE_TELEPORT
Definition protocol.h:1019
#define TE_SPIKE
Definition protocol.h:308
vec2 dir
int S_StartSound(int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation)
S_StartSound returns the channel index, or -1 if an error occurred.
Definition snd_main.c:1643
int qw_modelindex_s_explod
Definition client.h:1093

References cl, CL_AllocLightFlash(), CL_Effect(), CL_FindNonSolidLocation(), CL_GetModelByIndex(), cl_message, CL_ParseBeam(), CL_ParticleCube(), CL_ParticleEffect(), CL_ParticleExplosion(), CL_ParticleExplosion2(), CL_ParticleRain(), CL_ParticleTrail(), cl_readstring, cl_sound_ric_gunshot, cls, color, count, dir, EFFECT_TE_BLOOD, EFFECT_TE_EXPLOSION, EFFECT_TE_EXPLOSIONQUAD, EFFECT_TE_FLAMEJET, EFFECT_TE_GUNSHOT, EFFECT_TE_GUNSHOTQUAD, EFFECT_TE_KNIGHTSPIKE, EFFECT_TE_LAVASPLASH, EFFECT_TE_PLASMABURN, EFFECT_TE_SMALLFLASH, EFFECT_TE_SPARK, EFFECT_TE_SPIKE, EFFECT_TE_SPIKEQUAD, EFFECT_TE_SUPERSPIKE, EFFECT_TE_SUPERSPIKEQUAD, EFFECT_TE_TAREXPLOSION, EFFECT_TE_TEI_BIGEXPLOSION, EFFECT_TE_TEI_G3, EFFECT_TE_TEI_PLASMAHIT, EFFECT_TE_TEI_SMOKE, EFFECT_TE_TELEPORT, EFFECT_TE_WIZSPIKE, Host_Error(), cvar_t::integer, LIGHTFLAG_NORMALMODE, LIGHTFLAG_REALTIMEMODE, Matrix4x4_CreateTranslate(), Mod_ForName(), client_state_t::model_beam, client_state_t::model_bolt, client_state_t::model_bolt2, client_state_t::model_bolt3, MSG_ReadByte, MSG_ReadChar, MSG_ReadCoord(), MSG_ReadShort, MSG_ReadString(), MSG_ReadVector(), NULL, palette_rgb, client_static_t::protocol, PROTOCOL_QUAKEWORLD, client_state_t::qw_modelindex_s_explod, QW_TE_BLOOD, QW_TE_EXPLOSION, QW_TE_GUNSHOT, QW_TE_KNIGHTSPIKE, QW_TE_LAVASPLASH, QW_TE_LIGHTNING1, QW_TE_LIGHTNING2, QW_TE_LIGHTNING3, QW_TE_LIGHTNINGBLOOD, QW_TE_SPIKE, QW_TE_SUPERSPIKE, QW_TE_TAREXPLOSION, QW_TE_TELEPORT, QW_TE_WIZSPIKE, RIC_GUNSHOT, RIC_GUNSHOTQUAD, S_StartSound(), client_state_t::sfx_knighthit, client_state_t::sfx_r_exp3, client_state_t::sfx_ric1, client_state_t::sfx_ric2, client_state_t::sfx_ric3, client_state_t::sfx_tink1, client_state_t::sfx_wizhit, TE_BEAM, TE_BLOOD, TE_BLOODSHOWER, TE_CUSTOMFLASH, TE_EXPLOSION, TE_EXPLOSION2, TE_EXPLOSION3, TE_EXPLOSIONQUAD, TE_EXPLOSIONRGB, TE_FLAMEJET, TE_GUNSHOT, TE_GUNSHOTQUAD, TE_KNIGHTSPIKE, TE_LAVASPLASH, TE_LIGHTNING1, TE_LIGHTNING2, TE_LIGHTNING3, TE_LIGHTNING4NEH, TE_PARTICLECUBE, TE_PARTICLERAIN, TE_PARTICLESNOW, TE_PLASMABURN, TE_SMALLFLASH, TE_SPARK, TE_SPIKE, TE_SPIKEQUAD, TE_SUPERSPIKE, TE_SUPERSPIKEQUAD, TE_TAREXPLOSION, TE_TEI_BIGEXPLOSION, TE_TEI_G3, TE_TEI_PLASMAHIT, TE_TEI_SMOKE, TE_TELEPORT, TE_WIZSPIKE, type, vec3_origin, and VectorSet.

Referenced by CL_ParseServerMessage().

◆ CL_ParseTrailParticles()

static void CL_ParseTrailParticles ( void )
static

Definition at line 2945 of file cl_parse.c.

2946{
2947 int entityindex;
2948 int effectindex;
2949 vec3_t start, end;
2950 entityindex = (unsigned short)MSG_ReadShort(&cl_message);
2951 if (entityindex >= MAX_EDICTS)
2952 entityindex = 0;
2953 if (entityindex >= cl.max_entities)
2954 CL_ExpandEntities(entityindex);
2955 effectindex = (unsigned short)MSG_ReadShort(&cl_message);
2958 CL_ParticleTrail(effectindex, 1, start, end, vec3_origin, vec3_origin, entityindex > 0 ? cl.entities + entityindex : NULL, 0, true, true, NULL, NULL, 1);
2959}

References cl, CL_ExpandEntities(), cl_message, CL_ParticleTrail(), cls, client_state_t::entities, MAX_EDICTS, client_state_t::max_entities, MSG_ReadShort, MSG_ReadVector(), NULL, client_static_t::protocol, and vec3_origin.

Referenced by CL_ParseServerMessage().

◆ CL_SendPlayerInfo()

static void CL_SendPlayerInfo ( void )
static

Definition at line 1574 of file cl_parse.c.

1575{
1576 char vabuf[1024];
1578 MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "name \"%s\"", cl_name.string));
1579
1581 MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "color %i %i", cl_topcolor.integer, cl_bottomcolor.integer));
1582
1584 MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "rate %i", cl_rate.integer));
1585
1587 MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "rate_burstsize %i", cl_rate_burstsize.integer));
1588
1589 if (cl_pmodel.integer)
1590 {
1592 MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "pmodel %i", cl_pmodel.integer));
1593 }
1595 {
1597 MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "playermodel %s", cl_playermodel.string));
1598 }
1599 if (*cl_playerskin.string)
1600 {
1602 MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "playerskin %s", cl_playerskin.string));
1603 }
1604}
cvar_t cl_rate_burstsize
Definition cl_cmd.c:34
cvar_t cl_rate
Definition cl_cmd.c:33
cvar_t cl_name
User-visible names of these CF_USERINFO cvars must be matched in CL_SetInfo()!
Definition cl_cmd.c:32
cvar_t cl_pmodel
Definition cl_cmd.c:40
cvar_t cl_bottomcolor
Definition cl_cmd.c:36
cvar_t cl_topcolor
Definition cl_cmd.c:35
cvar_t cl_playerskin
Definition common.c:37
cvar_t cl_playermodel
Definition common.c:36
#define clc_stringcmd
Definition protocol.h:291

References cl_bottomcolor, cl_name, cl_playermodel, cl_playerskin, cl_pmodel, cl_rate, cl_rate_burstsize, cl_topcolor, clc_stringcmd, cls, cvar_t::integer, netconn_t::message, MSG_WriteByte(), MSG_WriteString(), client_static_t::netcon, cvar_t::string, and va().

Referenced by CL_SignonReply().

◆ CL_SetSignonStage_WithMsg()

static void CL_SetSignonStage_WithMsg ( int signon_stage)
inlinestatic

Definition at line 202 of file cl_parse.c.

203{
204 cls.signon = signon_stage;
205 dpsnprintf(cl_connect_status, sizeof(cl_connect_status), "Connect: signon stage %i of %i", cls.signon, SIGNONS);
207}
char cl_connect_status[MAX_QPATH]
User-friendly connection status for the menu and/or loading screen, colours and not supported.
Definition cl_screen.c:1573

References cl_connect_status, cls, Con_DPrint(), dpsnprintf(), client_static_t::signon, and SIGNONS.

Referenced by CL_ParseServerInfo(), CL_SignonReply(), QW_CL_Changing_f(), QW_CL_ParseModelList(), QW_CL_ParseSoundList(), and QW_CL_RequestNextDownload().

◆ CL_SetupWorldModel()

static void CL_SetupWorldModel ( void )
static

Definition at line 479 of file cl_parse.c.

480{
481 prvm_prog_t *prog = CLVM_prog;
482 // update the world model
485
486 // make sure the cl.worldname and related cvars are set up now that we know the world model name
487 // set up csqc world for collision culling
488 if (cl.worldmodel)
489 {
497 World_SetSize(&cl.world, cl.worldname, cl.worldmodel->normalmins, cl.worldmodel->normalmaxs, prog);
498 }
499 else
500 {
505 }
507
508 // load or reload .loc file for team chat messages
510
511 // make sure we send enough keepalives
512 CL_KeepaliveMessage(false);
513
514 // reset particles and other per-level things
516
517 // make sure we send enough keepalives
518 CL_KeepaliveMessage(false);
519
520 // load the team chat beep if possible
522
523 // check memory integrity
525
526#ifdef CONFIG_MENU
527 // make menu know
528 MR_NewMap();
529#endif
530
531 // load the csqc now
532 if (cl.loadcsqc)
533 {
534 cl.loadcsqc = false;
535
536 CL_VM_Init();
537 }
538}
void CL_Locs_Reload_f(cmd_state_t *cmd)
Definition cl_main.c:2377
cvar_t con_chatsound_team_file
Definition console.c:62
static const vec3_t defaultmins
Definition cl_parse.c:477
static const vec3_t defaultmaxs
Definition cl_parse.c:478
void CL_VM_Init(void)
Definition csprogs.c:980
void(* MR_NewMap)(void)
Definition menu.c:5482
#define CLVM_prog
Definition progsvm.h:767
void R_Modules_NewMap(void)
Definition r_modules.c:92
qbool foundteamchatsound
Definition client.h:929
void World_SetSize(world_t *world, const char *filename, const vec3_t mins, const vec3_t maxs, prvm_prog_t *prog)
Definition world.c:118
void World_Start(world_t *world)
Definition world.c:59

References cl, CL_GetModelByIndex(), CL_KeepaliveMessage(), CL_Locs_Reload_f(), CL_UpdateRenderEntity(), CL_VM_Init(), cl_worldbasename, cl_worldmessage, cl_worldname, cl_worldnamenoextension, CLVM_prog, cmd_local, con_chatsound_team_file, Cvar_SetQuick(), defaultmaxs, defaultmins, dp_strlcpy, client_state_t::entities, client_state_t::foundteamchatsound, FS_FileExists(), FS_StripExtension(), client_state_t::loadcsqc, Mem_CheckSentinelsGlobal, entity_render_t::model, MR_NewMap, R_Modules_NewMap(), entity_t::render, cvar_t::string, client_state_t::world, World_SetSize(), World_Start(), client_state_t::worldbasename, client_state_t::worldmessage, client_state_t::worldmodel, client_state_t::worldname, and client_state_t::worldnamenoextension.

Referenced by CL_BeginDownloads(), and QW_CL_RequestNextDownload().

◆ CL_SignonReply()

static void CL_SignonReply ( int signon_stage)
static

Definition at line 1613 of file cl_parse.c.

1614{
1615 CL_SetSignonStage_WithMsg(signon_stage);
1616
1617 Con_DPrintf("CL_SignonReply: %i\n", cls.signon);
1618
1619 switch (cls.signon)
1620 {
1621 case 1:
1622 if (cls.netcon)
1623 {
1624 // send player info before we begin downloads
1625 // (so that the server can see the player name while downloading)
1627
1628 //MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
1629 //MSG_WriteString (&cls.netcon->message, "prespawn");
1630 }
1631 // execute cl_begindownloads next frame
1632 // (after any commands added by svc_stufftext have been executed)
1633 // when done with downloads the "prespawn" will be sent
1634 Cbuf_AddText(cmd_local, "\ncl_begindownloads\n");
1635 break;
1636
1637 case 2:
1638 if (cls.netcon)
1639 {
1640 // LadyHavoc: quake sent the player info here but due to downloads
1641 // it is sent earlier instead
1642 // CL_SendPlayerInfo();
1643
1644 // LadyHavoc: changed to begin a loading stage and issue this when done
1646 MSG_WriteString (&cls.netcon->message, "spawn");
1647 }
1648 break;
1649
1650 case 3:
1651 if (cls.netcon)
1652 {
1654 MSG_WriteString (&cls.netcon->message, "begin");
1655 }
1656 break;
1657
1658 case 4:
1659 // after the level has been loaded, we shouldn't need the shaders, and
1660 // if they are needed again they will be automatically loaded...
1661 // we also don't need the unused models or sounds from the last level
1664 S_PurgeUnused();
1665
1667 if (Sys_CheckParm("-profilegameonly"))
1668 Sys_AllowProfiling(true);
1669 break;
1670 }
1671}
static void CL_SendPlayerInfo(void)
Definition cl_parse.c:1574
void Cbuf_AddText(cmd_state_t *cmd, const char *text)
Definition cmd.c:264
void Con_ClearNotify(void)
Clear all notify lines.
Definition console.c:702
void Mod_PurgeUnused(void)
void S_PurgeUnused(void)
Definition snd_main.c:1028
void Sys_AllowProfiling(qbool enable)
Definition sys_shared.c:65
int Sys_CheckParm(const char *parm)
Definition sys_shared.c:327

References Cbuf_AddText(), CL_SendPlayerInfo(), CL_SetSignonStage_WithMsg(), clc_stringcmd, cls, cmd_local, Con_ClearNotify(), Con_DPrintf(), netconn_t::message, Mod_FreeQ3Shaders(), Mod_PurgeUnused(), MSG_WriteByte(), MSG_WriteString(), client_static_t::netcon, S_PurgeUnused(), client_static_t::signon, Sys_AllowProfiling(), and Sys_CheckParm().

Referenced by CL_ParseServerMessage().

◆ CL_StopDownload()

static void CL_StopDownload ( int size,
int crc )
static

Definition at line 1384 of file cl_parse.c.

1385{
1387 {
1388 int existingcrc;
1389 size_t existingsize;
1390 const char *extension;
1391
1393 {
1394 unsigned char *out;
1395 size_t inflated_size;
1398 if(out)
1399 {
1400 Con_Printf("Inflated download: new size: %u (%g%%)\n", (unsigned)inflated_size, 100.0 - 100.0*(cls.qw_downloadmemorycursize / (float)inflated_size));
1401 cls.qw_downloadmemory = out;
1402 cls.qw_downloadmemorycursize = (int)inflated_size;
1403 }
1404 else
1405 {
1408 Con_Printf("Cannot inflate download, possibly corrupt or zlib not present\n");
1409 }
1410 }
1411
1413 {
1414 Con_Printf("Download \"%s\" is corrupt (see above!)\n", cls.qw_downloadname);
1415 }
1416 else
1417 {
1420 // finished file
1421 // save to disk only if we don't already have it
1422 // (this is mainly for playing back demos)
1423 existingcrc = FS_CRCFile(cls.qw_downloadname, &existingsize);
1424 if (existingsize || IS_NEXUIZ_DERIVED(gamemode) || !strcmp(cls.qw_downloadname, csqc_progname.string))
1425 // let csprogs ALWAYS go to dlcache, to prevent "viral csprogs"; also, never put files outside dlcache for Nexuiz/Xonotic
1426 {
1427 if ((int)existingsize != size || existingcrc != crc)
1428 {
1429 // we have a mismatching file, pick another name for it
1430 char name[MAX_QPATH*2];
1431 dpsnprintf(name, sizeof(name), "dlcache/%s.%i.%i", cls.qw_downloadname, size, crc);
1432 if (!FS_FileExists(name))
1433 {
1434 Con_Printf("Downloaded \"%s\" (%i bytes, %i CRC)\n", name, size, crc);
1437 {
1443 Con_DPrintf("Buffered \"%s\"\n", name);
1444 }
1445 }
1446 }
1447 }
1448 else
1449 {
1450 // we either don't have it or have a mismatching file...
1451 // so it's time to accept the file
1452 // but if we already have a mismatching file we need to rename
1453 // this new one, and if we already have this file in renamed form,
1454 // we do nothing
1455 Con_Printf("Downloaded \"%s\" (%i bytes, %i CRC)\n", cls.qw_downloadname, size, crc);
1458 if (!strcasecmp(extension, "pak") || !strcasecmp(extension, "pk3") || !strcasecmp(extension, "dpk"))
1459 FS_Rescan();
1460 }
1461 }
1462 }
1463 else if (cls.qw_downloadmemory && size)
1464 {
1465 Con_Printf("Download \"%s\" is corrupt (%i bytes, %i CRC, should be %i bytes, %i CRC), discarding\n", cls.qw_downloadname, size, crc, (int)cls.qw_downloadmemorycursize, (int)CRC_Block(cls.qw_downloadmemory, cls.qw_downloadmemorycursize));
1466 CL_BeginDownloads(true);
1467 }
1468
1472 cls.qw_downloadname[0] = 0;
1476}
unsigned short CRC_Block(const unsigned char *data, size_t size)
Definition com_crc16.c:75
const char * FS_FileExtension(const char *in)
Definition fs.c:1403
unsigned char * FS_Inflate(const unsigned char *data, size_t size, size_t *inflated_size, mempool_t *mempool)
Definition fs.c:4273
void FS_Rescan(void)
Definition fs.c:1538
qbool FS_WriteFile(const char *filename, const void *data, fs_offset_t len)
Definition fs.c:3592
unsigned char * caughtcsprogsdata
Definition client.h:688
fs_offset_t caughtcsprogsdatasize
Definition client.h:689

References client_static_t::caughtcsprogsdata, client_static_t::caughtcsprogsdatasize, CL_BeginDownloads(), cls, Con_DPrintf(), Con_Printf(), CRC_Block(), csqc_progname, dpsnprintf(), FS_CRCFile(), FS_FileExists(), FS_FileExtension(), FS_Inflate(), FS_Rescan(), FS_WriteFile(), gamemode, int(), IS_NEXUIZ_DERIVED, MAX_QPATH, Mem_Alloc, Mem_Free, name, NULL, client_static_t::permanentmempool, client_static_t::qw_download_deflate, client_static_t::qw_downloadmemory, client_static_t::qw_downloadmemorycursize, client_static_t::qw_downloadmemorymaxsize, client_static_t::qw_downloadname, client_static_t::qw_downloadpercent, size, cvar_t::string, and tempmempool.

Referenced by CL_DownloadBegin_f(), CL_DownloadFinished_f(), CL_Parse_ErrorCleanUp(), and CL_StopDownload_f().

◆ CL_StopDownload_f()

static void CL_StopDownload_f ( cmd_state_t * cmd)
static

Definition at line 1550 of file cl_parse.c.

1551{
1553 if (cls.qw_downloadname[0])
1554 {
1555 Con_Printf("Download of %s aborted\n", cls.qw_downloadname);
1556 CL_StopDownload(0, 0);
1557 }
1558 CL_BeginDownloads(true);
1559}
void Curl_CancelAll(void)
Definition libcurl.c:1284

References CL_BeginDownloads(), CL_StopDownload(), cls, Con_Printf(), Curl_CancelAll(), and client_static_t::qw_downloadname.

Referenced by CL_Parse_Init().

◆ CL_UpdateItemsAndWeapon()

static void CL_UpdateItemsAndWeapon ( void )
static

Definition at line 1064 of file cl_parse.c.

1065{
1066 int j;
1067 // check for important changes
1068
1069 // set flash times
1070 // UBSan: unsigned literals because left shifting by 31 causes signed overflow, although it works as expected on x86.
1071 if (cl.olditems != cl.stats[STAT_ITEMS])
1072 for (j = 0;j < 32;j++)
1073 if ((cl.stats[STAT_ITEMS] & (1u<<j)) && !(cl.olditems & (1u<<j)))
1074 cl.item_gettime[j] = cl.time;
1076
1077 // GAME_NEXUIZ hud needs weapon change time
1079 cl.weapontime = cl.time;
1081}
float item_gettime[32]
Definition client.h:763
float weapontime
Definition client.h:767
int activeweapon
Definition client.h:765

References client_state_t::activeweapon, cl, client_state_t::item_gettime, client_state_t::olditems, STAT_ACTIVEWEAPON, STAT_ITEMS, client_state_t::stats, client_state_t::time, and client_state_t::weapontime.

Referenced by CL_ParseServerMessage().

◆ CL_ValidateState()

void CL_ValidateState ( entity_state_t * s)

Definition at line 1962 of file cl_parse.c.

1963{
1964 model_t *model;
1965
1966 if (!s->active)
1967 return;
1968
1969 if (s->modelindex >= MAX_MODELS)
1970 Host_Error("CL_ValidateState: modelindex (%i) >= MAX_MODELS (%i)\n", s->modelindex, MAX_MODELS);
1971
1972 // these warnings are only warnings, no corrections are made to the state
1973 // because states are often copied for decoding, which otherwise would
1974 // propogate some of the corrections accidentally
1975 // (this used to happen, sometimes affecting skin and frame)
1976
1977 // colormap is client index + 1
1978 if (!(s->flags & RENDER_COLORMAPPED) && s->colormap > cl.maxclients)
1979 Con_DPrintf("CL_ValidateState: colormap (%i) > cl.maxclients (%i)\n", s->colormap, cl.maxclients);
1980
1982 {
1984 if (model && model->type && s->frame >= model->numframes)
1985 Con_DPrintf("CL_ValidateState: no such frame %i in \"%s\" (which has %i frames)\n", s->frame, model->name, model->numframes);
1986 if (model && model->type && s->skin > 0 && s->skin >= model->numskins && !(s->lightpflags & PFLAGS_FULLDYNAMIC))
1987 Con_DPrintf("CL_ValidateState: no such skin %i in \"%s\" (which has %i skins)\n", s->skin, model->name, model->numskins);
1988 }
1989}
#define PFLAGS_FULLDYNAMIC
Definition protocol.h:108
#define RENDER_COLORMAPPED
Definition protocol.h:361
unsigned char lightpflags
Definition protocol.h:461

References entity_state_t::active, cl, CL_GetModelByIndex(), entity_state_t::colormap, Con_DPrintf(), developer_extra, entity_state_t::flags, entity_state_t::frame, Host_Error(), cvar_t::integer, entity_state_t::lightpflags, MAX_MODELS, client_state_t::maxclients, model, entity_state_t::modelindex, PFLAGS_FULLDYNAMIC, RENDER_COLORMAPPED, and entity_state_t::skin.

◆ QW_CL_Changing_f()

static void QW_CL_Changing_f ( cmd_state_t * cmd)
static

Definition at line 901 of file cl_parse.c.

902{
903 if (cls.qw_downloadmemory) // don't change when downloading
904 return;
905
907 cl.intermission = 0;
908 CL_SetSignonStage_WithMsg(1); // not active anymore, but not disconnected
909 Con_Printf("\nChanging map...\n");
910}

References cl, CL_SetSignonStage_WithMsg(), cls, Con_Printf(), client_state_t::intermission, client_static_t::qw_downloadmemory, and S_StopAllSounds().

Referenced by CL_Parse_Init().

◆ QW_CL_CheckOrDownloadFile()

static qbool QW_CL_CheckOrDownloadFile ( const char * filename)
static

Definition at line 540 of file cl_parse.c.

541{
542 qfile_t *file;
543 char vabuf[1024];
544
545 // see if the file already exists
546 file = FS_OpenVirtualFile(filename, true);
547 if (file)
548 {
549 FS_Close(file);
550 return true;
551 }
552
553 // download messages in a demo would be bad
554 if (cls.demorecording)
555 {
556 Con_Printf("Unable to download \"%s\" when recording.\n", filename);
557 return true;
558 }
559
560 // don't try to download when playing a demo
561 if (!cls.netcon)
562 return true;
563
565 Con_Printf("Downloading %s\n", filename);
566
568 {
571 cls.qw_downloadmemorymaxsize = 1024*1024; // start out with a 1MB buffer
572 }
573
575 MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "download %s", filename));
576
580
581 return false;
582}
qfile_t * FS_OpenVirtualFile(const char *filepath, qbool quiet)
Definition fs.c:2928
int FS_Close(qfile_t *file)
Definition fs.c:2970

References cls, Con_Printf(), client_static_t::demorecording, dp_strlcpy, FS_Close(), FS_OpenVirtualFile(), netconn_t::message, MSG_WriteByte(), MSG_WriteString(), client_static_t::netcon, NULL, qw_clc_stringcmd, client_static_t::qw_downloadmemory, client_static_t::qw_downloadmemorycursize, client_static_t::qw_downloadmemorymaxsize, client_static_t::qw_downloadname, client_static_t::qw_downloadnumber, client_static_t::qw_downloadpercent, and va().

Referenced by QW_CL_RequestNextDownload().

◆ QW_CL_NextUpload_f()

void QW_CL_NextUpload_f ( cmd_state_t * cmd)
static

Definition at line 912 of file cl_parse.c.

913{
914 int r, percent, size;
915
916 if (!cls.qw_uploaddata)
917 return;
918
920 if (r > 768)
921 r = 768;
923 percent = (cls.qw_uploadpos+r)*100/size;
924
927 MSG_WriteByte(&cls.netcon->message, percent);
929
930 Con_DPrintf("UPLOAD: %6d: %d written\n", cls.qw_uploadpos, r);
931
932 cls.qw_uploadpos += r;
933
935 return;
936
937 Con_Printf("Upload completed\n");
938
940}
void MSG_WriteShort(sizebuf_t *sb, int c)
Definition com_msg.c:138
void SZ_Write(sizebuf_t *buf, const unsigned char *data, int length)
Definition common.c:72
#define qw_clc_upload
Definition protocol.h:960
dp_FragColor r
int qw_uploadsize
Definition client.h:663
unsigned char * qw_uploaddata
Definition client.h:662

References cls, cmd(), Con_DPrintf(), Con_Printf(), netconn_t::message, min, MSG_WriteByte(), MSG_WriteShort(), client_static_t::netcon, QW_CL_StopUpload_f(), qw_clc_upload, client_static_t::qw_uploaddata, client_static_t::qw_uploadpos, client_static_t::qw_uploadsize, r, size, and SZ_Write().

Referenced by CL_Parse_Init(), and QW_CL_StartUpload().

◆ QW_CL_ParseDownload()

static void QW_CL_ParseDownload ( void )
static

Definition at line 756 of file cl_parse.c.

757{
758 int size = (signed short)MSG_ReadShort(&cl_message);
759 int percent = MSG_ReadByte(&cl_message);
760
761 //Con_Printf("download %i %i%% (%i/%i)\n", size, percent, cls.qw_downloadmemorycursize, cls.qw_downloadmemorymaxsize);
762
763 // skip the download fragment if playing a demo
764 if (!cls.netcon)
765 {
766 if (size > 0)
768 return;
769 }
770
771 if (size == -1)
772 {
773 Con_Printf("File not found.\n");
775 return;
776 }
777
778 if (cl_message.readcount + (unsigned short)size > cl_message.cursize)
779 Host_Error("corrupt download message\n");
780
781 // make sure the buffer is big enough to include this new fragment
783 {
784 unsigned char *old;
789 if (old)
790 {
792 Mem_Free(old);
793 }
794 }
795
796 // read the fragment out of the packet
800
801 cls.qw_downloadpercent = percent;
802
803 if (percent != 100)
804 {
805 // request next fragment
807 MSG_WriteString(&cls.netcon->message, "nextdl");
808 }
809 else
810 {
811 // finished file
812 Con_Printf("Downloaded \"%s\"\n", cls.qw_downloadname);
813
815
817
818 // start downloading the next file (or join the game)
820 }
821}
static void QW_CL_RequestNextDownload(void)
Definition cl_parse.c:585

References cl_message, cls, Con_Printf(), sizebuf_t::cursize, FS_WriteFile(), Host_Error(), Mem_Alloc, Mem_Free, netconn_t::message, MSG_ReadByte, MSG_ReadBytes(), MSG_ReadShort, MSG_WriteByte(), MSG_WriteString(), client_static_t::netcon, client_static_t::permanentmempool, QW_CL_RequestNextDownload(), qw_clc_stringcmd, client_static_t::qw_downloadmemory, client_static_t::qw_downloadmemorycursize, client_static_t::qw_downloadmemorymaxsize, client_static_t::qw_downloadname, client_static_t::qw_downloadpercent, client_static_t::qw_downloadspeedcount, sizebuf_t::readcount, and size.

Referenced by CL_ParseServerMessage().

◆ QW_CL_ParseModelList()

static void QW_CL_ParseModelList ( void )
static

Definition at line 823 of file cl_parse.c.

824{
825 int n;
826 int nummodels = MSG_ReadByte(&cl_message);
827 char *str;
828 char vabuf[1024];
829
830 // parse model precache list
831 for (;;)
832 {
834 if (!str[0])
835 break;
836 nummodels++;
837 if (nummodels==MAX_MODELS)
838 Host_Error("Server sent too many model precaches");
839 if (strlen(str) >= MAX_QPATH)
840 Host_Error("Server sent a precache name of %i characters (max %i)", (int)strlen(str), MAX_QPATH - 1);
841 dp_strlcpy(cl.model_name[nummodels], str, sizeof (cl.model_name[nummodels]));
842 }
843
845 if (n)
846 {
848 MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "modellist %i %i", cl.qw_servercount, n));
849 return;
850 }
851
856}
@ dl_model
Definition client.h:541
#define n(x, y)
qw_downloadtype_t qw_downloadtype
Definition client.h:654

References cl, cl_message, cl_readstring, CL_SetSignonStage_WithMsg(), cls, dl_model, dp_strlcpy, Host_Error(), MAX_MODELS, MAX_QPATH, netconn_t::message, client_state_t::model_name, MSG_ReadByte, MSG_ReadString(), MSG_WriteByte(), MSG_WriteString(), n, client_static_t::netcon, QW_CL_RequestNextDownload(), qw_clc_stringcmd, client_static_t::qw_downloadnumber, client_static_t::qw_downloadtype, client_state_t::qw_servercount, strlen(), and va().

Referenced by CL_ParseServerMessage().

◆ QW_CL_ParseNails()

static void QW_CL_ParseNails ( void )
static

Definition at line 1042 of file cl_parse.c.

1043{
1044 int i, j;
1045 int numnails = MSG_ReadByte(&cl_message);
1046 vec_t *v;
1047 unsigned char bits[6];
1048 for (i = 0;i < numnails;i++)
1049 {
1050 for (j = 0;j < 6;j++)
1051 bits[j] = MSG_ReadByte(&cl_message);
1052 if (cl.qw_num_nails >= 255)
1053 continue;
1055 v[0] = ( ( bits[0] + ((bits[1]&15)<<8) ) <<1) - 4096;
1056 v[1] = ( ( (bits[1]>>4) + (bits[2]<<4) ) <<1) - 4096;
1057 v[2] = ( ( bits[3] + ((bits[4]&15)<<8) ) <<1) - 4096;
1058 v[3] = -360*(bits[4]>>4)/16;
1059 v[4] = 360*bits[5]/256;
1060 v[5] = 0;
1061 }
1062}
const GLdouble * v
Definition glquake.h:762
float vec_t
Definition qtypes.h:68
vec_t qw_nails[255][6]
Definition client.h:1100

References cl, cl_message, i, MSG_ReadByte, client_state_t::qw_nails, client_state_t::qw_num_nails, and v.

Referenced by CL_ParseServerMessage().

◆ QW_CL_ParseSoundList()

static void QW_CL_ParseSoundList ( void )
static

Definition at line 858 of file cl_parse.c.

859{
860 int n;
861 int numsounds = MSG_ReadByte(&cl_message);
862 char *str;
863 char vabuf[1024];
864
865 // parse sound precache list
866 for (;;)
867 {
869 if (!str[0])
870 break;
871 numsounds++;
872 if (numsounds==MAX_SOUNDS)
873 Host_Error("Server sent too many sound precaches");
874 if (strlen(str) >= MAX_QPATH)
875 Host_Error("Server sent a precache name of %i characters (max %i)", (int)strlen(str), MAX_QPATH - 1);
876 dp_strlcpy(cl.sound_name[numsounds], str, sizeof (cl.sound_name[numsounds]));
877 }
878
880
881 if (n)
882 {
884 MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "soundlist %i %i", cl.qw_servercount, n));
885 return;
886 }
887
892}
@ dl_sound
Definition client.h:542

References cl, cl_message, cl_readstring, CL_SetSignonStage_WithMsg(), cls, dl_sound, dp_strlcpy, Host_Error(), MAX_QPATH, MAX_SOUNDS, netconn_t::message, MSG_ReadByte, MSG_ReadString(), MSG_WriteByte(), MSG_WriteString(), n, client_static_t::netcon, QW_CL_RequestNextDownload(), qw_clc_stringcmd, client_static_t::qw_downloadnumber, client_static_t::qw_downloadtype, client_state_t::qw_servercount, client_state_t::sound_name, strlen(), and va().

Referenced by CL_ParseServerMessage().

◆ QW_CL_ProcessUserInfo()

static void QW_CL_ProcessUserInfo ( int slot)
static

Definition at line 977 of file cl_parse.c.

978{
979 int topcolor, bottomcolor;
980 char temp[2048];
981 InfoString_GetValue(cl.scores[slot].qw_userinfo, "name", cl.scores[slot].name, sizeof(cl.scores[slot].name));
982 InfoString_GetValue(cl.scores[slot].qw_userinfo, "topcolor", temp, sizeof(temp));topcolor = atoi(temp);
983 InfoString_GetValue(cl.scores[slot].qw_userinfo, "bottomcolor", temp, sizeof(temp));bottomcolor = atoi(temp);
984 cl.scores[slot].colors = topcolor * 16 + bottomcolor;
985 InfoString_GetValue(cl.scores[slot].qw_userinfo, "*spectator", temp, sizeof(temp));
986 cl.scores[slot].qw_spectator = temp[0] != 0;
987 InfoString_GetValue(cl.scores[slot].qw_userinfo, "team", cl.scores[slot].qw_team, sizeof(cl.scores[slot].qw_team));
988 InfoString_GetValue(cl.scores[slot].qw_userinfo, "skin", cl.scores[slot].qw_skin, sizeof(cl.scores[slot].qw_skin));
989 if (!cl.scores[slot].qw_skin[0])
990 dp_strlcpy(cl.scores[slot].qw_skin, "base", sizeof(cl.scores[slot].qw_skin));
991 // TODO: skin cache
992}
size_t InfoString_GetValue(const char *buffer, const char *key, char *value, size_t valuesize)
Returns the number of bytes written to *value excluding the \0 terminator.
char qw_team[8]
Definition client.h:500
char qw_skin[MAX_QPATH]
Definition client.h:501
int qw_spectator
Definition client.h:499
char qw_userinfo[MAX_USERINFO_STRING]
Definition client.h:494

References cl, scoreboard_t::colors, dp_strlcpy, InfoString_GetValue(), scoreboard_t::name, scoreboard_t::qw_skin, scoreboard_t::qw_spectator, scoreboard_t::qw_team, scoreboard_t::qw_userinfo, and client_state_t::scores.

Referenced by QW_CL_RequestNextDownload(), QW_CL_SetInfo(), and QW_CL_UpdateUserInfo().

◆ QW_CL_RequestNextDownload()

static void QW_CL_RequestNextDownload ( void )
static

Definition at line 585 of file cl_parse.c.

586{
587 int i;
588 char vabuf[1024];
589
590 // clear name of file that just finished
591 cls.qw_downloadname[0] = 0;
592
593 // skip the download fragment if playing a demo
594 if (!cls.netcon)
595 {
596 return;
597 }
598
599 switch (cls.qw_downloadtype)
600 {
601 case dl_single:
602 break;
603 case dl_skin:
604 if (cls.qw_downloadnumber == 0)
605 Con_Printf("Checking skins...\n");
607 {
609 continue;
610 // check if we need to download the file, and return if so
611 if (!QW_CL_CheckOrDownloadFile(va(vabuf, sizeof(vabuf), "skins/%s.pcx", cl.scores[cls.qw_downloadnumber].qw_skin)))
612 return;
613 }
614
616
617 // load any newly downloaded skins
618 for (i = 0;i < cl.maxclients;i++)
620
621 // if we're still in signon stages, request the next one
622 if (cls.signon != SIGNONS)
623 {
625 // we'll go to SIGNONS when the first entity update is received
627 MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "begin %i", cl.qw_servercount));
628 }
629 break;
630 case dl_model:
631 if (cls.qw_downloadnumber == 0)
632 {
633 Con_Printf("Checking models...\n");
635 }
636
638 {
639 // skip submodels
640 if (cl.model_name[cls.qw_downloadnumber][0] == '*')
641 continue;
642 if (!strcmp(cl.model_name[cls.qw_downloadnumber], "progs/spike.mdl"))
644 if (!strcmp(cl.model_name[cls.qw_downloadnumber], "progs/player.mdl"))
646 if (!strcmp(cl.model_name[cls.qw_downloadnumber], "progs/flag.mdl"))
648 if (!strcmp(cl.model_name[cls.qw_downloadnumber], "progs/s_explod.spr"))
650 // check if we need to download the file, and return if so
652 return;
653 }
654
656
657 // touch all of the precached models that are still loaded so we can free
658 // anything that isn't needed
659 if (!sv.active)
661 for (i = 1;i < MAX_MODELS && cl.model_name[i][0];i++)
662 Mod_FindName(cl.model_name[i], cl.model_name[i][0] == '*' ? cl.model_name[1] : NULL);
663 // precache any models used by the client (this also marks them used)
664 cl.model_bolt = Mod_ForName("progs/bolt.mdl", false, false, NULL);
665 cl.model_bolt2 = Mod_ForName("progs/bolt2.mdl", false, false, NULL);
666 cl.model_bolt3 = Mod_ForName("progs/bolt3.mdl", false, false, NULL);
667 cl.model_beam = Mod_ForName("progs/beam.mdl", false, false, NULL);
668
669 // we purge the models and sounds later in CL_SignonReply
670 //Mod_PurgeUnused();
671
672 // now we try to load everything that is new
673
674 // world model
675 cl.model_precache[1] = Mod_ForName(cl.model_name[1], false, false, NULL);
676 if (cl.model_precache[1]->Draw == NULL)
677 Con_Printf("Map %s could not be found or downloaded\n", cl.model_name[1]);
678
679 // normal models
680 for (i = 2;i < MAX_MODELS && cl.model_name[i][0];i++)
681 if ((cl.model_precache[i] = Mod_ForName(cl.model_name[i], false, false, cl.model_name[i][0] == '*' ? cl.model_name[1] : NULL))->Draw == NULL)
682 Con_Printf("Model %s could not be found or downloaded\n", cl.model_name[i]);
683
684 // check memory integrity
686
687 // now that we have a world model, set up the world entity, renderer
688 // modules and csqc
690
691 // add pmodel/emodel CRCs to userinfo
692 CL_SetInfo("pmodel", va(vabuf, sizeof(vabuf), "%i", FS_CRCFile("progs/player.mdl", NULL)), true, true, true, true);
693 CL_SetInfo("emodel", va(vabuf, sizeof(vabuf), "%i", FS_CRCFile("progs/eyes.mdl", NULL)), true, true, true, true);
694
695 // done checking sounds and models, send a prespawn command now
697 MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "prespawn %i 0 %i", cl.qw_servercount, cl.model_precache[1]->brush.qw_md4sum2));
698
700 {
703 }
704
705 // done loading
706 cl.loadfinished = true;
707 break;
708 case dl_sound:
709 if (cls.qw_downloadnumber == 0)
710 {
711 Con_Printf("Checking sounds...\n");
713 }
714
716 {
717 // check if we need to download the file, and return if so
718 if (!QW_CL_CheckOrDownloadFile(va(vabuf, sizeof(vabuf), "sound/%s", cl.sound_name[cls.qw_downloadnumber])))
719 return;
720 }
721
723
724 // clear sound usage flags for purging of unused sounds
725 S_ClearUsed();
726
727 // precache any sounds used by the client
735
736 // sounds used by the game
737 for (i = 1;i < MAX_SOUNDS && cl.sound_name[i][0];i++)
739
740 // we purge the models and sounds later in CL_SignonReply
741 //S_PurgeUnused();
742
743 // check memory integrity
745
746 // done with sound downloads, next we check models
748 MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "modellist %i %i", cl.qw_servercount, 0));
749 break;
750 case dl_none:
751 default:
752 Con_Printf("Unknown download type.\n");
753 }
754}
void CL_SetInfo(const char *key, const char *value, qbool send, qbool allowstarkey, qbool allowmodel, qbool quiet)
Definition cl_main.c:233
static void QW_CL_ProcessUserInfo(int slot)
Definition cl_parse.c:977
static qbool QW_CL_CheckOrDownloadFile(const char *filename)
Definition cl_parse.c:540
@ dl_none
Definition client.h:538
@ dl_single
Definition client.h:539
@ dl_skin
Definition client.h:540
int qw_modelindex_flag
Definition client.h:1092
int qw_modelindex_spike
Definition client.h:1090
int qw_modelindex_player
Definition client.h:1091

References server_t::active, cl, CL_SetInfo(), CL_SetSignonStage_WithMsg(), CL_SetupWorldModel(), cl_sound_hknighthit, cl_sound_r_exp3, cl_sound_ric1, cl_sound_ric2, cl_sound_ric3, cl_sound_tink1, cl_sound_wizardhit, cls, Con_Printf(), dl_model, dl_none, dl_single, dl_skin, dl_sound, FS_CRCFile(), i, client_state_t::loadfinished, MAX_MODELS, MAX_SOUNDS, client_state_t::maxclients, Mem_CheckSentinelsGlobal, Mem_Free, netconn_t::message, Mod_ClearUsed(), Mod_FindName(), Mod_ForName(), client_state_t::model_beam, client_state_t::model_bolt, client_state_t::model_bolt2, client_state_t::model_bolt3, client_state_t::model_name, client_state_t::model_precache, MSG_WriteByte(), MSG_WriteString(), scoreboard_t::name, client_static_t::netcon, NULL, QW_CL_CheckOrDownloadFile(), QW_CL_ProcessUserInfo(), qw_clc_stringcmd, client_static_t::qw_downloadmemory, client_static_t::qw_downloadname, client_static_t::qw_downloadnumber, client_static_t::qw_downloadtype, client_state_t::qw_modelindex_flag, client_state_t::qw_modelindex_player, client_state_t::qw_modelindex_s_explod, client_state_t::qw_modelindex_spike, client_state_t::qw_servercount, scoreboard_t::qw_skin, S_ClearUsed(), S_PrecacheSound(), client_state_t::scores, client_state_t::sfx_knighthit, client_state_t::sfx_r_exp3, client_state_t::sfx_ric1, client_state_t::sfx_ric2, client_state_t::sfx_ric3, client_state_t::sfx_tink1, client_state_t::sfx_wizhit, client_static_t::signon, SIGNONS, client_state_t::sound_name, client_state_t::sound_precache, cvar_t::string, sv, and va().

Referenced by QW_CL_ParseDownload(), QW_CL_ParseModelList(), QW_CL_ParseSoundList(), and QW_CL_Skins_f().

◆ QW_CL_ServerInfo()

static void QW_CL_ServerInfo ( void )
static

Definition at line 1029 of file cl_parse.c.

1030{
1031 char key[2048];
1032 char value[2048];
1033 char temp[32];
1034 dp_strlcpy(key, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof(key));
1036 Con_DPrintf("SERVERINFO: %s=%s\n", key, value);
1038 InfoString_GetValue(cl.qw_serverinfo, "teamplay", temp, sizeof(temp));
1039 cl.qw_teamplay = atoi(temp);
1040}
void InfoString_SetValue(char *buffer, size_t bufferlength, const char *key, const char *value)
char qw_serverinfo[MAX_SERVERINFO_STRING]
Definition client.h:1033

References cl, cl_message, cl_readstring, Con_DPrintf(), dp_strlcpy, InfoString_GetValue(), InfoString_SetValue(), MSG_ReadString(), client_state_t::qw_serverinfo, client_state_t::qw_teamplay, and value.

Referenced by CL_ParseServerMessage().

◆ QW_CL_SetInfo()

static void QW_CL_SetInfo ( void )
static

Definition at line 1011 of file cl_parse.c.

1012{
1013 int slot;
1014 char key[2048];
1015 char value[2048];
1016 slot = MSG_ReadByte(&cl_message);
1017 dp_strlcpy(key, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof(key));
1019 if (slot >= cl.maxclients)
1020 {
1021 Con_Printf("svc_setinfo >= cl.maxclients\n");
1022 return;
1023 }
1024 InfoString_SetValue(cl.scores[slot].qw_userinfo, sizeof(cl.scores[slot].qw_userinfo), key, value);
1025
1027}

References cl, cl_message, cl_readstring, Con_Printf(), dp_strlcpy, InfoString_SetValue(), client_state_t::maxclients, MSG_ReadByte, MSG_ReadString(), QW_CL_ProcessUserInfo(), scoreboard_t::qw_userinfo, client_state_t::scores, and value.

Referenced by CL_ParseServerMessage().

◆ QW_CL_Skins_f()

static void QW_CL_Skins_f ( cmd_state_t * cmd)
static

◆ QW_CL_StartUpload()

void QW_CL_StartUpload ( unsigned char * data,
int size )

Definition at line 942 of file cl_parse.c.

943{
944 // do nothing in demos or if not connected
945 if (!cls.netcon)
946 return;
947
948 // abort existing upload if in progress
950
951 Con_DPrintf("Starting upload of %d bytes...\n", size);
952
953 cls.qw_uploaddata = (unsigned char *)Mem_Alloc(cls.permanentmempool, size);
954 memcpy(cls.qw_uploaddata, data, size);
956 cls.qw_uploadpos = 0;
957
959}

References cls, cmd_local, Con_DPrintf(), data, Mem_Alloc, client_static_t::netcon, client_static_t::permanentmempool, QW_CL_NextUpload_f(), QW_CL_StopUpload_f(), client_static_t::qw_uploaddata, client_static_t::qw_uploadpos, client_static_t::qw_uploadsize, and size.

◆ QW_CL_StopUpload_f()

◆ QW_CL_UpdateUserInfo()

static void QW_CL_UpdateUserInfo ( void )
static

Definition at line 994 of file cl_parse.c.

995{
996 int slot;
997 slot = MSG_ReadByte(&cl_message);
998 if (slot >= cl.maxclients)
999 {
1000 Con_Printf("svc_updateuserinfo >= cl.maxclients\n");
1003 return;
1004 }
1007
1009}
int qw_userid
Definition client.h:493

References cl, cl_message, cl_readstring, Con_Printf(), dp_strlcpy, client_state_t::maxclients, MSG_ReadByte, MSG_ReadLong, MSG_ReadString(), QW_CL_ProcessUserInfo(), scoreboard_t::qw_userid, scoreboard_t::qw_userinfo, and client_state_t::scores.

Referenced by CL_ParseServerMessage().

Variable Documentation

◆ cl_bottomcolor

cvar_t cl_bottomcolor
extern

Definition at line 36 of file cl_cmd.c.

36{CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "bottomcolor", "0", "color of your pants"};
#define CF_USERINFO
command or cvar used to communicate userinfo to the server
Definition cmd.h:57
#define CF_ARCHIVE
cvar should have its set value saved to config.cfg and persist across sessions
Definition cmd.h:53

Referenced by CL_SendPlayerInfo().

◆ cl_gameplayfix_soundsmovewithentities

cvar_t cl_gameplayfix_soundsmovewithentities = {CF_CLIENT, "cl_gameplayfix_soundsmovewithentities", "1", "causes sounds made by lifts, players, projectiles, and any other entities, to move with the entity, so for example a rocket noise follows the rocket rather than staying at the starting position"}

Definition at line 174 of file cl_parse.c.

174{CF_CLIENT, "cl_gameplayfix_soundsmovewithentities", "1", "causes sounds made by lifts, players, projectiles, and any other entities, to move with the entity, so for example a rocket noise follows the rocket rather than staying at the starting position"};

Referenced by CL_Parse_Init(), and SND_Spatialize_WithSfx().

◆ cl_iplog_items

cl_iplog_item_t* cl_iplog_items
static

Definition at line 2991 of file cl_parse.c.

Referenced by CL_IPLog_Add(), and CL_IPLog_List_f().

◆ cl_iplog_loaded

qbool cl_iplog_loaded = false
static

Definition at line 2988 of file cl_parse.c.

Referenced by CL_IPLog_Add(), CL_IPLog_List_f(), and CL_IPLog_Load().

◆ cl_iplog_maxitems

int cl_iplog_maxitems = 0
static

Definition at line 2990 of file cl_parse.c.

Referenced by CL_IPLog_Add().

◆ cl_iplog_name

cvar_t cl_iplog_name = {CF_CLIENT | CF_ARCHIVE, "cl_iplog_name", "darkplaces_iplog.txt", "name of iplog file containing player addresses for iplog_list command and automatic ip logging when parsing status command"}

Definition at line 194 of file cl_parse.c.

194{CF_CLIENT | CF_ARCHIVE, "cl_iplog_name", "darkplaces_iplog.txt", "name of iplog file containing player addresses for iplog_list command and automatic ip logging when parsing status command"};

Referenced by CL_IPLog_Add(), CL_IPLog_Load(), and CL_Parse_Init().

◆ cl_iplog_numitems

int cl_iplog_numitems = 0
static

Definition at line 2989 of file cl_parse.c.

Referenced by CL_IPLog_Add(), and CL_IPLog_List_f().

◆ cl_joinbeforedownloadsfinish

cvar_t cl_joinbeforedownloadsfinish = {CF_CLIENT | CF_ARCHIVE, "cl_joinbeforedownloadsfinish", "1", "if non-zero the game will begin after the map is loaded before other downloads finish"}

Definition at line 190 of file cl_parse.c.

190{CF_CLIENT | CF_ARCHIVE, "cl_joinbeforedownloadsfinish", "1", "if non-zero the game will begin after the map is loaded before other downloads finish"};

Referenced by CL_BeginDownloads(), and CL_Parse_Init().

◆ cl_lerpexcess

cvar_t cl_lerpexcess
extern

Definition at line 44 of file cl_main.c.

44{CF_CLIENT, "cl_lerpexcess", "0","maximum allowed lerp excess (hides, not fixes, some packet loss)"};

Referenced by CL_Init(), CL_LerpPoint(), CL_NetworkTimeReceived(), and CL_UpdateNetworkEntity().

◆ cl_nettimesyncboundmode

cvar_t cl_nettimesyncboundmode = {CF_CLIENT | CF_ARCHIVE, "cl_nettimesyncboundmode", "6", "method of restricting client time to valid values, 0 = no correction, 1 = tight bounding (jerky with packet loss), 2 = loose bounding (corrects it if out of bounds), 3 = leniant bounding (ignores temporary errors due to varying framerate), 4 = slow adjustment method from Quake3, 5 = slightly nicer version of Quake3 method, 6 = tight bounding + mode 5, 7 = jitter compensated dynamic adjustment rate"}

Definition at line 192 of file cl_parse.c.

192{CF_CLIENT | CF_ARCHIVE, "cl_nettimesyncboundmode", "6", "method of restricting client time to valid values, 0 = no correction, 1 = tight bounding (jerky with packet loss), 2 = loose bounding (corrects it if out of bounds), 3 = leniant bounding (ignores temporary errors due to varying framerate), 4 = slow adjustment method from Quake3, 5 = slightly nicer version of Quake3 method, 6 = tight bounding + mode 5, 7 = jitter compensated dynamic adjustment rate"};

Referenced by CL_LerpPoint(), CL_NetworkTimeReceived(), and CL_Parse_Init().

◆ cl_nettimesyncboundtolerance

cvar_t cl_nettimesyncboundtolerance = {CF_CLIENT | CF_ARCHIVE, "cl_nettimesyncboundtolerance", "0.25", "how much error is tolerated by bounding check, as a fraction of frametime, 0.25 = up to 25% margin of error tolerated, 1 = use only new time, 0 = use only old time (same effect as setting cl_nettimesyncfactor to 1) (only affects bound modes 2 and 3)"}

Definition at line 193 of file cl_parse.c.

193{CF_CLIENT | CF_ARCHIVE, "cl_nettimesyncboundtolerance", "0.25", "how much error is tolerated by bounding check, as a fraction of frametime, 0.25 = up to 25% margin of error tolerated, 1 = use only new time, 0 = use only old time (same effect as setting cl_nettimesyncfactor to 1) (only affects bound modes 2 and 3)"};

Referenced by CL_NetworkTimeReceived(), and CL_Parse_Init().

◆ cl_nettimesyncfactor

cvar_t cl_nettimesyncfactor = {CF_CLIENT | CF_ARCHIVE, "cl_nettimesyncfactor", "0", "rate at which client time adapts to match server time, 1 = instantly, 0.125 = slowly, 0 = not at all (only applied in bound modes 0, 1, 2, 3)"}

Definition at line 191 of file cl_parse.c.

191{CF_CLIENT | CF_ARCHIVE, "cl_nettimesyncfactor", "0", "rate at which client time adapts to match server time, 1 = instantly, 0.125 = slowly, 0 = not at all (only applied in bound modes 0, 1, 2, 3)"};

Referenced by CL_NetworkTimeReceived(), and CL_Parse_Init().

◆ cl_readpicture_force

cvar_t cl_readpicture_force = {CF_CLIENT, "cl_readpicture_force", "0", "when enabled, the low quality pictures read by ReadPicture() are preferred over the high quality pictures on the file system"}

Definition at line 181 of file cl_parse.c.

181{CF_CLIENT, "cl_readpicture_force", "0", "when enabled, the low quality pictures read by ReadPicture() are preferred over the high quality pictures on the file system"};

Referenced by CL_Parse_Init(), and VM_CL_ReadPicture().

◆ cl_serverextension_download

cvar_t cl_serverextension_download = {CF_CLIENT, "cl_serverextension_download", "0", "indicates whether the server supports the download command"}

Definition at line 189 of file cl_parse.c.

189{CF_CLIENT, "cl_serverextension_download", "0", "indicates whether the server supports the download command"};

Referenced by CL_BeginDownloads(), CL_Parse_Init(), and CL_ParseServerInfo().

◆ cl_sound_hknighthit

cvar_t cl_sound_hknighthit = {CF_CLIENT, "cl_sound_hknighthit", "hknight/hit.wav", "sound to play during TE_KNIGHTSPIKE (empty cvar disables sound)"}

Definition at line 176 of file cl_parse.c.

176{CF_CLIENT, "cl_sound_hknighthit", "hknight/hit.wav", "sound to play during TE_KNIGHTSPIKE (empty cvar disables sound)"};

Referenced by CL_Parse_Init(), CL_ParseServerInfo(), and QW_CL_RequestNextDownload().

◆ cl_sound_r_exp3

cvar_t cl_sound_r_exp3 = {CF_CLIENT, "cl_sound_r_exp3", "weapons/r_exp3.wav", "sound to play during TE_EXPLOSION and related effects (empty cvar disables sound)"}

Definition at line 186 of file cl_parse.c.

186{CF_CLIENT, "cl_sound_r_exp3", "weapons/r_exp3.wav", "sound to play during TE_EXPLOSION and related effects (empty cvar disables sound)"};

Referenced by CL_Parse_Init(), CL_ParseServerInfo(), and QW_CL_RequestNextDownload().

◆ cl_sound_ric1

cvar_t cl_sound_ric1 = {CF_CLIENT, "cl_sound_ric1", "weapons/ric1.wav", "sound to play with 5% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"}

Definition at line 178 of file cl_parse.c.

178{CF_CLIENT, "cl_sound_ric1", "weapons/ric1.wav", "sound to play with 5% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"};

Referenced by CL_Parse_Init(), CL_ParseServerInfo(), and QW_CL_RequestNextDownload().

◆ cl_sound_ric2

cvar_t cl_sound_ric2 = {CF_CLIENT, "cl_sound_ric2", "weapons/ric2.wav", "sound to play with 5% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"}

Definition at line 179 of file cl_parse.c.

179{CF_CLIENT, "cl_sound_ric2", "weapons/ric2.wav", "sound to play with 5% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"};

Referenced by CL_Parse_Init(), CL_ParseServerInfo(), and QW_CL_RequestNextDownload().

◆ cl_sound_ric3

cvar_t cl_sound_ric3 = {CF_CLIENT, "cl_sound_ric3", "weapons/ric3.wav", "sound to play with 10% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"}

Definition at line 180 of file cl_parse.c.

180{CF_CLIENT, "cl_sound_ric3", "weapons/ric3.wav", "sound to play with 10% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"};

Referenced by CL_Parse_Init(), CL_ParseServerInfo(), and QW_CL_RequestNextDownload().

◆ cl_sound_ric_gunshot

cvar_t cl_sound_ric_gunshot = {CF_CLIENT, "cl_sound_ric_gunshot", "0", "specifies if and when the related cl_sound_ric and cl_sound_tink sounds apply to TE_GUNSHOT/TE_GUNSHOTQUAD, 0 = no sound, 1 = TE_GUNSHOT, 2 = TE_GUNSHOTQUAD, 3 = TE_GUNSHOT and TE_GUNSHOTQUAD"}

Definition at line 185 of file cl_parse.c.

185{CF_CLIENT, "cl_sound_ric_gunshot", "0", "specifies if and when the related cl_sound_ric and cl_sound_tink sounds apply to TE_GUNSHOT/TE_GUNSHOTQUAD, 0 = no sound, 1 = TE_GUNSHOT, 2 = TE_GUNSHOTQUAD, 3 = TE_GUNSHOT and TE_GUNSHOTQUAD"};

Referenced by CL_Parse_Init(), CL_ParseTempEntity(), VM_CL_te_gunshot(), and VM_CL_te_gunshotquad().

◆ cl_sound_tink1

cvar_t cl_sound_tink1 = {CF_CLIENT, "cl_sound_tink1", "weapons/tink1.wav", "sound to play with 80% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"}

Definition at line 177 of file cl_parse.c.

177{CF_CLIENT, "cl_sound_tink1", "weapons/tink1.wav", "sound to play with 80% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"};

Referenced by CL_Parse_Init(), CL_ParseServerInfo(), and QW_CL_RequestNextDownload().

◆ cl_sound_wizardhit

cvar_t cl_sound_wizardhit = {CF_CLIENT, "cl_sound_wizardhit", "wizard/hit.wav", "sound to play during TE_WIZSPIKE (empty cvar disables sound)"}

Definition at line 175 of file cl_parse.c.

175{CF_CLIENT, "cl_sound_wizardhit", "wizard/hit.wav", "sound to play during TE_WIZSPIKE (empty cvar disables sound)"};

Referenced by CL_Parse_Init(), CL_ParseServerInfo(), and QW_CL_RequestNextDownload().

◆ cl_topcolor

cvar_t cl_topcolor
extern

Definition at line 35 of file cl_cmd.c.

35{CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "topcolor", "0", "color of your shirt"};

Referenced by CL_SendPlayerInfo().

◆ cl_worldbasename

cvar_t cl_worldbasename = {CF_CLIENT | CF_READONLY, "cl_worldbasename", "", "name of current worldmodel without maps/ prefix or extension"}

Definition at line 171 of file cl_parse.c.

171{CF_CLIENT | CF_READONLY, "cl_worldbasename", "", "name of current worldmodel without maps/ prefix or extension"};
#define CF_READONLY
cvar cannot be changed from the console or the command buffer, and is considered CF_PERSISTENT
Definition cmd.h:54

Referenced by CL_Parse_Init(), CL_ParseServerInfo(), and CL_SetupWorldModel().

◆ cl_worldmessage

cvar_t cl_worldmessage = {CF_CLIENT | CF_READONLY, "cl_worldmessage", "", "title of current level"}

Definition at line 168 of file cl_parse.c.

168{CF_CLIENT | CF_READONLY, "cl_worldmessage", "", "title of current level"};

Referenced by CL_Parse_Init(), CL_ParseServerInfo(), and CL_SetupWorldModel().

◆ cl_worldname

cvar_t cl_worldname = {CF_CLIENT | CF_READONLY, "cl_worldname", "", "name of current worldmodel"}

Definition at line 169 of file cl_parse.c.

169{CF_CLIENT | CF_READONLY, "cl_worldname", "", "name of current worldmodel"};

Referenced by CL_Parse_Init(), CL_ParseServerInfo(), and CL_SetupWorldModel().

◆ cl_worldnamenoextension

cvar_t cl_worldnamenoextension = {CF_CLIENT | CF_READONLY, "cl_worldnamenoextension", "", "name of current worldmodel without extension"}

Definition at line 170 of file cl_parse.c.

170{CF_CLIENT | CF_READONLY, "cl_worldnamenoextension", "", "name of current worldmodel without extension"};

Referenced by CL_Parse_Init(), CL_ParseServerInfo(), and CL_SetupWorldModel().

◆ con_chatsound_team_file

cvar_t con_chatsound_team_file
extern

Definition at line 62 of file console.c.

62{CF_CLIENT, "con_chatsound_team_file","sound/misc/talk2.wav", "The sound to play for team chat messages"};

Referenced by CL_SetupWorldModel(), Con_Init(), and Con_MaskPrint().

◆ defaultmaxs

const vec3_t defaultmaxs = {4096, 4096, 4096}
static

Definition at line 478 of file cl_parse.c.

478{4096, 4096, 4096};

Referenced by CL_SetupWorldModel().

◆ defaultmins

const vec3_t defaultmins = {-4096, -4096, -4096}
static

Definition at line 477 of file cl_parse.c.

477{-4096, -4096, -4096};

Referenced by CL_SetupWorldModel().

◆ developer_networkentities

cvar_t developer_networkentities = {CF_CLIENT, "developer_networkentities", "0", "prints received entities, value is 0-10 (higher for more info, 10 being the most verbose)"}

◆ host_timescale

cvar_t host_timescale
extern

Definition at line 53 of file sv_main.c.

53{CF_CLIENT | CF_SERVER, "host_timescale", "1.0", "controls game speed, 0.5 is half speed, 2 is double speed"};
#define CF_SERVER
cvar/command that only the server can change/execute
Definition cmd.h:49

◆ olddata

unsigned char olddata[NET_MAXMESSAGE]
static

Definition at line 313 of file cl_parse.c.

Referenced by _Mem_Alloc(), AssertBufsize(), CL_KeepaliveMessage(), and GrowBuf().

◆ parsingerror

int parsingerror = false

Definition at line 3434 of file cl_parse.c.

Referenced by CL_Parse_DumpPacket(), and CL_ParseServerMessage().

◆ qw_svc_strings

const char* qw_svc_strings[128]

Definition at line 108 of file cl_parse.c.

109{
110 "qw_svc_bad", // 0
111 "qw_svc_nop", // 1
112 "qw_svc_disconnect", // 2
113 "qw_svc_updatestat", // 3 // [byte] [byte]
114 "", // 4
115 "qw_svc_setview", // 5 // [short] entity number
116 "qw_svc_sound", // 6 // <see code>
117 "", // 7
118 "qw_svc_print", // 8 // [byte] id [string] null terminated string
119 "qw_svc_stufftext", // 9 // [string] stuffed into client's console buffer
120 "qw_svc_setangle", // 10 // [angle3] set the view angle to this absolute value
121 "qw_svc_serverdata", // 11 // [long] protocol ...
122 "qw_svc_lightstyle", // 12 // [byte] [string]
123 "", // 13
124 "qw_svc_updatefrags", // 14 // [byte] [short]
125 "", // 15
126 "qw_svc_stopsound", // 16 // <see code>
127 "", // 17
128 "", // 18
129 "qw_svc_damage", // 19
130 "qw_svc_spawnstatic", // 20
131 "", // 21
132 "qw_svc_spawnbaseline", // 22
133 "qw_svc_temp_entity", // 23 // variable
134 "qw_svc_setpause", // 24 // [byte] on / off
135 "", // 25
136 "qw_svc_centerprint", // 26 // [string] to put in center of the screen
137 "qw_svc_killedmonster", // 27
138 "qw_svc_foundsecret", // 28
139 "qw_svc_spawnstaticsound", // 29 // [coord3] [byte] samp [byte] vol [byte] aten
140 "qw_svc_intermission", // 30 // [vec3_t] origin [vec3_t] angle
141 "qw_svc_finale", // 31 // [string] text
142 "qw_svc_cdtrack", // 32 // [byte] track
143 "qw_svc_sellscreen", // 33
144 "qw_svc_smallkick", // 34 // set client punchangle to 2
145 "qw_svc_bigkick", // 35 // set client punchangle to 4
146 "qw_svc_updateping", // 36 // [byte] [short]
147 "qw_svc_updateentertime", // 37 // [byte] [float]
148 "qw_svc_updatestatlong", // 38 // [byte] [long]
149 "qw_svc_muzzleflash", // 39 // [short] entity
150 "qw_svc_updateuserinfo", // 40 // [byte] slot [long] uid
151 "qw_svc_download", // 41 // [short] size [size bytes]
152 "qw_svc_playerinfo", // 42 // variable
153 "qw_svc_nails", // 43 // [byte] num [48 bits] xyzpy 12 12 12 4 8
154 "qw_svc_chokecount", // 44 // [byte] packets choked
155 "qw_svc_modellist", // 45 // [strings]
156 "qw_svc_soundlist", // 46 // [strings]
157 "qw_svc_packetentities", // 47 // [...]
158 "qw_svc_deltapacketentities", // 48 // [...]
159 "qw_svc_maxspeed", // 49 // maxspeed change, for prediction
160 "qw_svc_entgravity", // 50 // gravity change, for prediction
161 "qw_svc_setinfo", // 51 // setinfo on a client
162 "qw_svc_serverinfo", // 52 // serverinfo
163 "qw_svc_updatepl", // 53 // [byte] [byte]
164};

Referenced by CL_ParseServerMessage().

◆ snd_cdautopause

cvar_t snd_cdautopause = {CF_CLIENT | CF_ARCHIVE, "snd_cdautopause", "1", "pause the CD track while the game is paused"}

Definition at line 187 of file cl_parse.c.

187{CF_CLIENT | CF_ARCHIVE, "snd_cdautopause", "1", "pause the CD track while the game is paused"};

Referenced by CL_Parse_Init(), and CL_ParseServerMessage().

◆ svc_strings

const char* svc_strings[128]

Definition at line 34 of file cl_parse.c.

35{
36 "svc_bad",
37 "svc_nop",
38 "svc_disconnect", // (DP8) [string] null terminated parting message
39 "svc_updatestat",
40 "svc_version", // [int] server version
41 "svc_setview", // [short] entity number
42 "svc_sound", // <see code>
43 "svc_time", // [float] server time
44 "svc_print", // [string] null terminated string
45 "svc_stufftext", // [string] stuffed into client's console buffer
46 // the string should be \n terminated
47 "svc_setangle", // [vec3] set the view angle to this absolute value
48
49 "svc_serverinfo", // [int] version
50 // [string] signon string
51 // [string]..[0]model cache [string]...[0]sounds cache
52 // [string]..[0]item cache
53 "svc_lightstyle", // [byte] [string]
54 "svc_updatename", // [byte] [string]
55 "svc_updatefrags", // [byte] [short]
56 "svc_clientdata", // <shortbits + data>
57 "svc_stopsound", // <see code>
58 "svc_updatecolors", // [byte] [byte]
59 "svc_particle", // [vec3] <variable>
60 "svc_damage", // [byte] impact [byte] blood [vec3] from
61
62 "svc_spawnstatic",
63 "OBSOLETE svc_spawnbinary",
64 "svc_spawnbaseline",
65
66 "svc_temp_entity", // <variable>
67 "svc_setpause",
68 "svc_signonnum",
69 "svc_centerprint",
70 "svc_killedmonster",
71 "svc_foundsecret",
72 "svc_spawnstaticsound",
73 "svc_intermission",
74 "svc_finale", // [string] music [string] text
75 "svc_cdtrack", // [byte] track [byte] looptrack
76 "svc_sellscreen",
77 "svc_cutscene",
78 "svc_showlmp", // [string] iconlabel [string] lmpfile [short] x [short] y
79 "svc_hidelmp", // [string] iconlabel
80 "svc_skybox", // [string] skyname
81 "", // 38
82 "", // 39
83 "", // 40
84 "", // 41
85 "", // 42
86 "", // 43
87 "", // 44
88 "", // 45
89 "", // 46
90 "", // 47
91 "", // 48
92 "", // 49
93 "svc_downloaddata", // 50 // [int] start [short] size [variable length] data
94 "svc_updatestatubyte", // 51 // [byte] stat [byte] value
95 "svc_effect", // 52 // [vector] org [byte] modelindex [byte] startframe [byte] framecount [byte] framerate
96 "svc_effect2", // 53 // [vector] org [short] modelindex [short] startframe [byte] framecount [byte] framerate
97 "svc_sound2", // 54 // short soundindex instead of byte
98 "svc_spawnbaseline2", // 55 // short modelindex instead of byte
99 "svc_spawnstatic2", // 56 // short modelindex instead of byte
100 "svc_entities", // 57 // [int] deltaframe [int] thisframe [float vector] eye [variable length] entitydata
101 "svc_csqcentities", // 58 // [short] entnum [variable length] entitydata ... [short] 0x0000
102 "svc_spawnstaticsound2", // 59 // [coord3] [short] samp [byte] vol [byte] aten
103 "svc_trailparticles", // 60 // [short] entnum [short] effectnum [vector] start [vector] end
104 "svc_pointparticles", // 61 // [short] effectnum [vector] start [vector] velocity [short] count
105 "svc_pointparticles1", // 62 // [short] effectnum [vector] start, same as svc_pointparticles except velocity is zero and count is 1
106};

Referenced by CL_ParseServerMessage().