63 "OBSOLETE svc_spawnbinary",
72 "svc_spawnstaticsound",
94 "svc_updatestatubyte",
102 "svc_spawnstaticsound2",
103 "svc_trailparticles",
104 "svc_pointparticles",
105 "svc_pointparticles1",
124 "qw_svc_updatefrags",
130 "qw_svc_spawnstatic",
132 "qw_svc_spawnbaseline",
133 "qw_svc_temp_entity",
136 "qw_svc_centerprint",
137 "qw_svc_killedmonster",
138 "qw_svc_foundsecret",
139 "qw_svc_spawnstaticsound",
140 "qw_svc_intermission",
147 "qw_svc_updateentertime",
148 "qw_svc_updatestatlong",
149 "qw_svc_muzzleflash",
150 "qw_svc_updateuserinfo",
157 "qw_svc_packetentities",
158 "qw_svc_deltapacketentities",
174cvar_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"};
177cvar_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)"};
178cvar_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)"};
179cvar_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)"};
180cvar_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)"};
181cvar_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"};
184#define RIC_GUNSHOTQUAD 2
185cvar_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"};
186cvar_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)"};
192cvar_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"};
193cvar_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)"};
194cvar_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"};
204 cls.signon = signon_stage;
229 if (channel & (1<<15))
234 if (channel & (1<<14))
241 ent = (channel>>3)&1023;
287 Con_Printf(
"CL_ParseStartSoundPacket: sound_num (%i) >= MAX_SOUNDS (%i)\n", sound_num,
MAX_SOUNDS);
293 Con_Printf(
"CL_ParseStartSoundPacket: ent = %i", ent);
297 if (ent >=
cl.max_entities)
300 if( !
CL_VM_Event_Sound(sound_num, nvolume / 255.0f, channel, attenuation, ent, pos, fflags, speed) )
316 static double lastdirtytime = 0;
317 static qbool recursive =
false;
320 static double countdownmsg = 0;
321 static double countdownupdate = 0;
326 thisrecursive = recursive;
330 deltatime = dirtytime - lastdirtytime;
331 lastdirtytime = dirtytime;
332 if (deltatime <= 0 || deltatime >= 1800.0)
335 countdownmsg -= deltatime;
336 countdownupdate -= deltatime;
342 if(countdownupdate <= 0)
350 recursive = thisrecursive;
366 if (
cls.netcon && countdownmsg <= 0)
369 unsigned char buf[4];
373 Con_Print(
"--> client to server keepalive\n");
374 memset(&msg, 0,
sizeof(msg));
381 recursive = thisrecursive;
386 qbool loadedsky =
false;
409 while (key[
strlen(key)-1] ==
' ')
414 if (!strcmp(
"sky", key))
419 else if (!strcmp(
"skyname", key))
424 else if (!strcmp(
"qlsky", key))
429 else if (!strcmp(
"fog", key))
438#define sscanf sscanf_s
440 sscanf(
value,
"%f %f %f %f %f %f %f %f %f", &
r_refdef.fog_density, &
r_refdef.fog_red, &
r_refdef.fog_green, &
r_refdef.fog_blue, &
r_refdef.fog_alpha, &
r_refdef.fog_start, &
r_refdef.fog_end, &
r_refdef.fog_height, &
r_refdef.fog_fadedepth);
442 else if (!strcmp(
"fog_density", key))
444 else if (!strcmp(
"fog_red", key))
446 else if (!strcmp(
"fog_green", key))
448 else if (!strcmp(
"fog_blue", key))
450 else if (!strcmp(
"fog_alpha", key))
452 else if (!strcmp(
"fog_start", key))
454 else if (!strcmp(
"fog_end", key))
456 else if (!strcmp(
"fog_height", key))
458 else if (!strcmp(
"fog_fadedepth", key))
460 else if (!strcmp(
"fog_heighttexture", key))
464 sscanf_s(
value,
"%f %f %f %f %f %f %f %f %f %s", &
r_refdef.fog_density, &
r_refdef.fog_red, &
r_refdef.fog_green, &
r_refdef.fog_blue, &
r_refdef.fog_alpha, &
r_refdef.fog_start, &
r_refdef.fog_end, &
r_refdef.fog_height, &
r_refdef.fog_fadedepth,
r_refdef.fog_height_texturename, (
unsigned int)
sizeof(
r_refdef.fog_height_texturename));
466 sscanf(
value,
"%f %f %f %f %f %f %f %f %f %63s", &
r_refdef.fog_density, &
r_refdef.fog_red, &
r_refdef.fog_green, &
r_refdef.fog_blue, &
r_refdef.fog_alpha, &
r_refdef.fog_start, &
r_refdef.fog_end, &
r_refdef.fog_height, &
r_refdef.fog_fadedepth,
r_refdef.fog_height_texturename);
468 r_refdef.fog_height_texturename[63] = 0;
472 if (!loadedsky &&
cl.worldmodel->brush.isq2bsp)
492 dp_strlcpy(
cl.worldbasename, !strncmp(
cl.worldnamenoextension,
"maps/", 5) ?
cl.worldnamenoextension + 5 :
cl.worldnamenoextension,
sizeof(
cl.worldbasename));
554 if (
cls.demorecording)
556 Con_Printf(
"Unable to download \"%s\" when recording.\n", filename);
567 if (!
cls.qw_downloadmemory)
570 cls.qw_downloadmemorycursize = 0;
571 cls.qw_downloadmemorymaxsize = 1024*1024;
577 cls.qw_downloadnumber++;
578 cls.qw_downloadpercent = 0;
579 cls.qw_downloadmemorycursize = 0;
591 cls.qw_downloadname[0] = 0;
599 switch (
cls.qw_downloadtype)
604 if (
cls.qw_downloadnumber == 0)
606 for (;
cls.qw_downloadnumber <
cl.maxclients;
cls.qw_downloadnumber++)
608 if (!
cl.scores[
cls.qw_downloadnumber].name[0])
618 for (i = 0;i <
cl.maxclients;i++)
631 if (
cls.qw_downloadnumber == 0)
634 cls.qw_downloadnumber = 1;
637 for (;
cls.qw_downloadnumber <
MAX_MODELS &&
cl.model_name[
cls.qw_downloadnumber][0];
cls.qw_downloadnumber++)
640 if (
cl.model_name[
cls.qw_downloadnumber][0] ==
'*')
642 if (!strcmp(
cl.model_name[
cls.qw_downloadnumber],
"progs/spike.mdl"))
643 cl.qw_modelindex_spike =
cls.qw_downloadnumber;
644 if (!strcmp(
cl.model_name[
cls.qw_downloadnumber],
"progs/player.mdl"))
645 cl.qw_modelindex_player =
cls.qw_downloadnumber;
646 if (!strcmp(
cl.model_name[
cls.qw_downloadnumber],
"progs/flag.mdl"))
647 cl.qw_modelindex_flag =
cls.qw_downloadnumber;
648 if (!strcmp(
cl.model_name[
cls.qw_downloadnumber],
"progs/s_explod.spr"))
649 cl.qw_modelindex_s_explod =
cls.qw_downloadnumber;
676 if (
cl.model_precache[1]->Draw ==
NULL)
677 Con_Printf(
"Map %s could not be found or downloaded\n",
cl.model_name[1]);
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]);
697 MSG_WriteString(&
cls.netcon->message,
va(vabuf,
sizeof(vabuf),
"prespawn %i 0 %i",
cl.qw_servercount,
cl.model_precache[1]->brush.qw_md4sum2));
699 if (
cls.qw_downloadmemory)
706 cl.loadfinished =
true;
709 if (
cls.qw_downloadnumber == 0)
712 cls.qw_downloadnumber = 1;
715 for (;
cl.sound_name[
cls.qw_downloadnumber][0];
cls.qw_downloadnumber++)
782 if (!
cls.qw_downloadmemory ||
cls.qw_downloadmemorymaxsize <
cls.qw_downloadmemorycursize +
size)
785 while (
cls.qw_downloadmemorymaxsize <
cls.qw_downloadmemorycursize +
size)
786 cls.qw_downloadmemorymaxsize *= 2;
787 old =
cls.qw_downloadmemory;
788 cls.qw_downloadmemory = (
unsigned char *)
Mem_Alloc(
cls.permanentmempool,
cls.qw_downloadmemorymaxsize);
791 memcpy(
cls.qw_downloadmemory, old,
cls.qw_downloadmemorycursize);
798 cls.qw_downloadmemorycursize +=
size;
799 cls.qw_downloadspeedcount +=
size;
801 cls.qw_downloadpercent = percent;
816 cls.qw_downloadpercent = 0;
838 Host_Error(
"Server sent too many model precaches");
841 dp_strlcpy(
cl.model_name[nummodels], str, sizeof (
cl.model_name[nummodels]));
853 cls.qw_downloadnumber = 0;
873 Host_Error(
"Server sent too many sound precaches");
876 dp_strlcpy(
cl.sound_name[numsounds], str, sizeof (
cl.sound_name[numsounds]));
889 cls.qw_downloadnumber = 0;
896 cls.qw_downloadnumber = 0;
903 if (
cls.qw_downloadmemory)
914 int r, percent,
size;
916 if (!
cls.qw_uploaddata)
919 r =
cls.qw_uploadsize -
cls.qw_uploadpos;
923 percent = (
cls.qw_uploadpos+
r)*100/
size;
932 cls.qw_uploadpos +=
r;
934 if (
cls.qw_uploadpos <
cls.qw_uploadsize)
956 cls.qw_uploadpos = 0;
962qbool QW_CL_IsUploading(
void)
964 return cls.qw_uploaddata !=
NULL;
970 if (
cls.qw_uploaddata)
973 cls.qw_uploadsize = 0;
974 cls.qw_uploadpos = 0;
979 int topcolor, bottomcolor;
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;
986 cl.scores[slot].qw_spectator = temp[0] != 0;
989 if (!
cl.scores[slot].qw_skin[0])
990 dp_strlcpy(
cl.scores[slot].qw_skin,
"base",
sizeof(
cl.scores[slot].qw_skin));
998 if (slot >=
cl.maxclients)
1000 Con_Printf(
"svc_updateuserinfo >= cl.maxclients\n");
1019 if (slot >=
cl.maxclients)
1021 Con_Printf(
"svc_setinfo >= cl.maxclients\n");
1039 cl.qw_teamplay = atoi(temp);
1047 unsigned char bits[6];
1048 for (i = 0;i < numnails;i++)
1050 for (j = 0;j < 6;j++)
1052 if (
cl.qw_num_nails >= 255)
1054 v =
cl.qw_nails[
cl.qw_num_nails++];
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;
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;
1079 cl.weapontime =
cl.time;
1083#define LOADPROGRESSWEIGHT_SOUND 1.0
1084#define LOADPROGRESSWEIGHT_MODEL 4.0
1085#define LOADPROGRESSWEIGHT_WORLDMODEL 30.0
1086#define LOADPROGRESSWEIGHT_WORLDMODEL_INIT 2.0
1106 cl.loadbegun =
true;
1109 if (
cls.qw_downloadname[0])
1112 if (
cl.downloadcsqc)
1115 cl.downloadcsqc =
false;
1134 if (
cl.loadmodel_current <
cl.loadmodel_total)
1137 if(
cl.loadmodel_current == 1)
1153 for (;
cl.loadmodel_current <
cl.loadmodel_total;
cl.loadmodel_current++)
1164 if (
cl.model_precache[
cl.loadmodel_current] &&
cl.model_precache[
cl.loadmodel_current]->Draw)
1167 if(
cl.loadmodel_current == 1)
1178 cl.model_precache[
cl.loadmodel_current] =
sv.models[
cl.loadmodel_current];
1181 if(
cl.loadmodel_current == 1)
1186 cl.model_precache[
cl.loadmodel_current] =
Mod_ForName(
cl.model_name[
cl.loadmodel_current],
false,
false,
cl.model_name[
cl.loadmodel_current][0] ==
'*' ?
cl.model_name[1] :
NULL);
1189 if (
cl.model_precache[
cl.loadmodel_current] &&
cl.model_precache[
cl.loadmodel_current]->Draw &&
cl.loadmodel_current == 1)
1205 cl.loadfinished =
true;
1216 if (
cl.loadsound_current <
cl.loadsound_total)
1219 if(
cl.loadsound_current == 1)
1230 for (;
cl.loadsound_current <
cl.loadsound_total;
cl.loadsound_current++)
1259 if (
cl.downloadmodel_current <
cl.loadmodel_total)
1263 for (;
cl.downloadmodel_current <
cl.loadmodel_total;
cl.downloadmodel_current++)
1265 if (aborteddownload)
1268 if (
cl.downloadmodel_current == 1)
1275 cl.loadfinished =
true;
1281 aborteddownload =
false;
1284 if (
cl.model_precache[
cl.downloadmodel_current] &&
cl.model_precache[
cl.downloadmodel_current]->Draw)
1287 if (
cl.model_name[
cl.downloadmodel_current][0] !=
'*' && strcmp(
cl.model_name[
cl.downloadmodel_current],
"null") && !
FS_FileExists(
cl.model_name[
cl.downloadmodel_current]))
1289 if (
cl.downloadmodel_current == 1)
1290 Con_Printf(
"Map %s not found\n",
cl.model_name[
cl.downloadmodel_current]);
1292 Con_Printf(
"Model %s not found\n",
cl.model_name[
cl.downloadmodel_current]);
1302 if(
cl.downloadmodel_current == 1)
1308 cl.model_precache[
cl.downloadmodel_current] =
Mod_ForName(
cl.model_name[
cl.downloadmodel_current],
false,
true,
cl.model_name[
cl.downloadmodel_current][0] ==
'*' ?
cl.model_name[1] :
NULL);
1309 if (
cl.downloadmodel_current == 1)
1317 cl.loadfinished =
true;
1328 if (
cl.downloadsound_current <
cl.loadsound_total)
1332 for (;
cl.downloadsound_current <
cl.loadsound_total;
cl.downloadsound_current++)
1335 if (aborteddownload)
1337 aborteddownload =
false;
1343 dpsnprintf(soundname,
sizeof(soundname),
"sound/%s",
cl.sound_name[
cl.downloadsound_current]);
1353 cl.sound_precache[
cl.downloadsound_current] =
S_PrecacheSound(
cl.sound_name[
cl.downloadsound_current],
false,
true);
1361 if (!
cl.loadfinished)
1363 cl.loadfinished =
true;
1379 Con_Printf(
"cl_begindownloads is only valid once per match\n");
1386 if (
cls.qw_downloadmemory &&
cls.qw_downloadmemorycursize ==
size &&
CRC_Block(
cls.qw_downloadmemory,
cls.qw_downloadmemorycursize) == crc)
1389 size_t existingsize;
1390 const char *extension;
1392 if(
cls.qw_download_deflate)
1395 size_t inflated_size;
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;
1407 cls.qw_downloadmemorycursize = 0;
1408 Con_Printf(
"Cannot inflate download, possibly corrupt or zlib not present\n");
1412 if(!
cls.qw_downloadmemory)
1414 Con_Printf(
"Download \"%s\" is corrupt (see above!)\n",
cls.qw_downloadname);
1419 size =
cls.qw_downloadmemorycursize;
1423 existingcrc =
FS_CRCFile(
cls.qw_downloadname, &existingsize);
1427 if ((
int)existingsize !=
size || existingcrc != crc)
1438 if(
cls.caughtcsprogsdata)
1440 cls.caughtcsprogsdata = (
unsigned char *)
Mem_Alloc(
cls.permanentmempool,
cls.qw_downloadmemorycursize);
1441 memcpy(
cls.caughtcsprogsdata,
cls.qw_downloadmemory,
cls.qw_downloadmemorycursize);
1442 cls.caughtcsprogsdatasize =
cls.qw_downloadmemorycursize;
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"))
1463 else if (
cls.qw_downloadmemory &&
size)
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));
1469 if (
cls.qw_downloadmemory)
1472 cls.qw_downloadname[0] = 0;
1473 cls.qw_downloadmemorymaxsize = 0;
1474 cls.qw_downloadmemorycursize = 0;
1475 cls.qw_downloadpercent = 0;
1488 if (!
cls.dp_downloadack[i].start && !
cls.dp_downloadack[i].size)
1490 cls.dp_downloadack[i].start = start;
1491 cls.dp_downloadack[i].size =
size;
1498 if (!
cls.qw_downloadname[0])
1501 Con_Printf(
"CL_ParseDownload: received %i bytes with no download active\n",
size);
1505 if (start +
size >
cls.qw_downloadmemorymaxsize)
1510 memcpy(
cls.qw_downloadmemory + start,
data,
size);
1511 cls.qw_downloadmemorycursize = start +
size;
1512 cls.qw_downloadpercent = (
int)
floor((start+
size) * 100.0 /
cls.qw_downloadmemorymaxsize);
1513 cls.qw_downloadpercent =
bound(0,
cls.qw_downloadpercent, 100);
1514 cls.qw_downloadspeedcount +=
size;
1523 Con_Printf(
"cl_downloadbegin: received bogus information\n");
1528 if (
cls.qw_downloadname[0])
1529 Con_Printf(
"Download of %s aborted\n",
cls.qw_downloadname);
1535 cls.qw_downloadmemorymaxsize =
size;
1536 cls.qw_downloadmemory = (
unsigned char *)
Mem_Alloc(
cls.permanentmempool,
cls.qw_downloadmemorymaxsize);
1537 cls.qw_downloadnumber++;
1539 cls.qw_download_deflate =
false;
1543 cls.qw_download_deflate =
true;
1553 if (
cls.qw_downloadname[0])
1555 Con_Printf(
"Download of %s aborted\n",
cls.qw_downloadname);
1565 Con_Printf(
"Malformed cl_downloadfinished command\n");
1683 int nummodels, numsounds;
1720 Host_Error(
"CL_ParseServerInfo: Server is unrecognized protocol number (%i)", i);
1726 cls.protocol = protocol;
1729 cl.num_entities = 1;
1740 Host_Error(
"CL_ParseServerInfo: unable to switch to server specified gamedir");
1749 cl.realplayerentity =
cl.playerentity =
cl.viewentity = (i & 127) + 1;
1769 cl.movevars_wallfriction = 0;
1770 cl.movevars_timescale = 1;
1771 cl.movevars_jumpvelocity = 270;
1772 cl.movevars_edgefriction = 1;
1773 cl.movevars_maxairspeed = 30;
1774 cl.movevars_stepheight = 18;
1775 cl.movevars_airaccel_qw = 1;
1776 cl.movevars_airaccel_sideways_friction = 0;
1779 Con_Printf(
"\n\n<===================================>\n\n\2%s\n", str);
1787 MSG_WriteString(&
cls.netcon->message,
va(vabuf,
sizeof(vabuf),
"soundlist %i %i",
cl.qw_servercount, 0));
1790 cl.loadbegun =
false;
1791 cl.loadfinished =
false;
1802 dp_strlcpy(
cl.worldnamenoextension,
"",
sizeof(
cl.worldnamenoextension));
1817 Host_Error(
"Bad maxclients (%u) from server",
cl.maxclients);
1835 Con_Printf(
"\n<===================================>\n\n\2%s\n", str);
1841 for (nummodels=1 ; ; nummodels++)
1847 Host_Error (
"Server sent too many model precaches");
1850 dp_strlcpy (
cl.model_name[nummodels], str, sizeof (
cl.model_name[nummodels]));
1853 for (numsounds=1 ; ; numsounds++)
1859 Host_Error(
"Server sent too many sound precaches");
1862 dp_strlcpy (
cl.sound_name[numsounds], str, sizeof (
cl.sound_name[numsounds]));
1868 dp_strlcpy(
cl.worldbasename, !strncmp(
cl.worldnamenoextension,
"maps/", 5) ?
cl.worldnamenoextension + 5 :
cl.worldnamenoextension,
sizeof(
cl.worldbasename));
1878 for (i = 1;i < nummodels;i++)
1907 cl.loadmodel_current = 1;
1908 cl.downloadmodel_current = 1;
1909 cl.loadmodel_total = nummodels;
1910 cl.loadsound_current = 1;
1911 cl.downloadsound_current = 1;
1912 cl.loadsound_total = numsounds;
1913 cl.downloadcsqc =
true;
1914 cl.loadbegun =
false;
1915 cl.loadfinished =
false;
1926 if (
cls.demorecording)
1934 dpsnprintf (demofile,
sizeof(demofile),
"%s_%s.dem", vabuf,
cl.worldbasename);
1936 Con_Printf (
"Auto-recording to %s.\n", demofile);
1948 cls.forcetrack = -1;
1950 cls.demorecording =
true;
1952 cls.demo_lastcsprogssize = -1;
1953 cls.demo_lastcsprogscrc = -1;
1985 Con_DPrintf(
"CL_ValidateState: no such frame %i in \"%s\" (which has %i frames)\n", s->
frame,
model->name,
model->numframes);
1987 Con_DPrintf(
"CL_ValidateState: no such skin %i in \"%s\" (which has %i skins)\n", s->
skin,
model->name,
model->numskins);
1993 float odelta[3], adelta[3];
2045 else if (
DotProduct(odelta, odelta) > 1000*1000
2046 || (
cl.fixangle[0] && !
cl.fixangle[1])
2128 for (i = 0;i < 3;i++)
2151 cl.mviewzoom[1] =
cl.mviewzoom[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;
2183 for (i = 0;i < 3;i++)
2269 if (
cl.num_static_entities >=
cl.max_static_entities)
2271 ent = &
cl.static_entities[
cl.num_static_entities++];
2277 cl.num_static_entities--;
2308 int sound_num, vol, atten;
2316 if (sound_num < 0 || sound_num >=
MAX_SOUNDS)
2331 int modelindex, startframe, framecount, framerate;
2345 int modelindex, startframe, framecount, framerate;
2363 Con_Printf(
"CL_NewBeam: invalid entity number %i\n", ent);
2367 if (ent >=
cl.max_entities)
2373 for (i = 0,
b =
cl.beams;i <
cl.max_beams;i++,
b++)
2374 if (
b->entity == ent)
2377 if (i ==
cl.max_beams)
2378 for (i = 0,
b =
cl.beams;i <
cl.max_beams;i++,
b++)
2381 if (i <
cl.max_beams)
2383 cl.num_beams =
max(
cl.num_beams, i + 1);
2385 b->lightning = lightning;
2387 b->endtime =
cl.mtime[0] + 0.2;
2406 Con_Printf(
"CL_ParseBeam: invalid entity number %i\n", ent);
2421 int colorStart, colorLength,
count;
2422 float velspeed, radius;
2423 unsigned char *tempcolor;
2531 VectorSet(pos2, pos[0] + radius, pos[1] + radius, pos[2] + radius);
2532 VectorSet(pos, pos[0] - radius, pos[1] - radius, pos[2] - radius);
2694 vel1[0] = -velspeed;
2695 vel1[1] = -velspeed;
2696 vel1[2] = -velspeed;
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);
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);
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);
2897 if (colorLength == 0)
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);
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);
2913 CL_ParticleTrail(
EFFECT_TE_TEI_G3, 1, pos, pos2,
dir,
dir,
NULL, 0,
true,
true,
NULL,
NULL, 1);
2953 if (entityindex >=
cl.max_entities)
2958 CL_ParticleTrail(effectindex, 1, start, end,
vec3_origin,
vec3_origin, entityindex > 0 ?
cl.entities + entityindex :
NULL, 0,
true,
true,
NULL,
NULL, 1);
2963 int effectindex,
count;
2981typedef struct cl_iplog_item_s
2997 size_t sz_name, sz_address;
2998 if (!address || !address[0] || !
name || !
name[0])
3003 Con_DPrintf(
"CL_IPLog_Add(\"%s\", \"%s\", %i, %i);\n", address,
name, checkexisting, addtofile);
3030 sz_address =
strlen(address) + 1;
3045#ifndef DP_MOBILETOUCH
3055 int i, len, linenumber;
3056 char *text, *textend;
3057 unsigned char *filedata;
3065#ifndef DP_MOBILETOUCH
3072 text = (
char *)filedata;
3073 textend = text + filesize;
3074 for (linenumber = 1;text < textend;linenumber++)
3076 for (len = 0;text < textend && *text !=
'\r' && *text !=
'\n';text++)
3077 if (len < (
int)
sizeof(line) - 1)
3078 line[len++] = *text;
3080 if (text < textend && *text ==
'\r' && text[1] ==
'\n')
3082 if (text < textend && *text ==
'\n')
3084 if (line[0] ==
'/' && line[1] ==
'/')
3087 address[i] = line[i];
3093 if (address[0] && line[i])
3103 const char *addressprefix;
3114 if (addressprefix && addressprefix[0])
3115 Con_Printf(
"Listing iplog addresses beginning with %s\n", addressprefix);
3121 if (addressprefix && addressprefix[0])
3123 for (j = 0;addressprefix[j];j++)
3128 if (addressprefix[j])
3147 if (!strcmp(text,
"Client ping times:\n"))
3151 if (
cls.demoplayback)
3152 cl.parsingtextexpectingpingforscores = 1;
3153 for(
cl.parsingtextplayerindex = 0;
cl.parsingtextplayerindex <
cl.maxclients && !
cl.scores[
cl.parsingtextplayerindex].name[0];
cl.parsingtextplayerindex++)
3155 if (
cl.parsingtextplayerindex >=
cl.maxclients)
3157 Con_Printf(
"ping reply but empty scoreboard?!?\n");
3159 cl.parsingtextexpectingpingforscores = 0;
3161 cl.parsingtextexpectingpingforscores =
cl.parsingtextexpectingpingforscores ? 2 : 0;
3162 return !
cl.parsingtextexpectingpingforscores;
3164 if (!strncmp(text,
"host: ", 9))
3168 cl.parsingtextplayerindex = 0;
3174 qbool expected =
cl.parsingtextexpectingpingforscores != 0;
3175 cl.parsingtextexpectingpingforscores = 0;
3180 if ((*t >=
'0' && *t <=
'9') || *t ==
'-')
3183 while ((*t >=
'0' && *t <=
'9') || *t ==
'-')
3189 if(
cl.parsingtextplayerindex <
cl.maxclients)
3191 for (charindex = 0;
cl.scores[
cl.parsingtextplayerindex].name[charindex] == t[charindex];charindex++)
3195 if (t[charindex] ==
'\n')
3197 cl.scores[
cl.parsingtextplayerindex].qw_ping =
bound(0,
ping, 9999);
3198 for (
cl.parsingtextplayerindex++;
cl.parsingtextplayerindex <
cl.maxclients && !
cl.scores[
cl.parsingtextplayerindex].name[0];
cl.parsingtextplayerindex++)
3204 cl.parsingtextexpectingpingforscores = expected;
3209 if (!strncmp(t,
"unconnected\n", 12))
3213 cl.parsingtextexpectingpingforscores = expected;
3217 Con_DPrintf(
"player names '%s' and '%s' didn't match\n",
cl.scores[
cl.parsingtextplayerindex].name, t);
3223 if (!strncmp(text,
"players: ", 9))
3226 cl.parsingtextplayerindex = 0;
3229 else if (!strstr(text,
": "))
3239 if (text[0] ==
'#' && text[1] >=
'0' && text[1] <=
'9')
3242 cl.parsingtextplayerindex = atoi(t) - 1;
3243 while (*t >=
'0' && *t <=
'9')
3262 for (len = 0;*t && *t !=
'\n';t++)
3263 if (len < (
int)
sizeof(temp) - 1)
3268 if (strcmp(temp,
"botclient")
3269 &&
cl.parsingtextplayerindex >= 0
3270 &&
cl.parsingtextplayerindex <
cl.maxclients
3271 &&
cl.scores[
cl.parsingtextplayerindex].name[0])
3289 cl.opt_inputs_since_update = 0;
3290 cl.mtime[1] =
cl.mtime[0];
3291 cl.mtime[0] = newtime;
3293 cl.time =
cl.mtime[1] = newtime;
3294 else if (
cls.demoplayback)
3299 if (
cl.time < newtime - 0.1)
3300 cl.mtime[1] =
cl.time = newtime;
3304 double timehigh = 0;
3305 cl.mtime[1] =
max(
cl.mtime[1],
cl.mtime[0] - 0.1);
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]);
3333 if (
cl.time <
cl.mtime[1] ||
cl.time > timehigh)
3334 cl.time =
cl.mtime[1];
3337 if ((
cl.time <
cl.mtime[1] &&
cl.oldtime <
cl.mtime[1]) || (
cl.time > timehigh &&
cl.oldtime > timehigh))
3338 cl.time =
cl.mtime[1];
3344 if (
fabs(
cl.time -
cl.mtime[1]) > 0.5)
3345 cl.time =
cl.mtime[1];
3346 else if (
fabs(
cl.time -
cl.mtime[1]) > 0.1)
3347 cl.time += 0.5 * (
cl.mtime[1] -
cl.time);
3348 else if (
cl.time >
cl.mtime[1])
3349 cl.time -= 0.002 *
cl.movevars_timescale;
3351 cl.time += 0.001 *
cl.movevars_timescale;
3355 if (
fabs(
cl.time -
cl.mtime[1]) > 0.5)
3356 cl.time =
cl.mtime[1];
3357 else if (
fabs(
cl.time -
cl.mtime[1]) > 0.1)
3358 cl.time += 0.5 * (
cl.mtime[1] -
cl.time);
3360 cl.time =
bound(
cl.time - 0.002 *
cl.movevars_timescale,
cl.mtime[1],
cl.time + 0.001 *
cl.movevars_timescale);
3365 cl.time =
bound(
cl.time - 0.002 *
cl.movevars_timescale,
cl.mtime[1],
cl.time + 0.001 *
cl.movevars_timescale);
3381 double target =
cl.movevars_ticrate ?
cl.mtime[0] -
cl.movevars_ticrate :
cl.mtime[1];
3394 cl.movement_replay =
true;
3396 cl.onground =
false;
3400 cl.fixangle[1] =
cl.fixangle[0];
3401 cl.fixangle[0] =
false;
3402 if (!
cls.demoplayback)
3408 if (
cl.mtime[0] >
cl.mtime[1])
3416 for (i = 1;i <
cl.num_entities;i++)
3418 if (
cl.entities_active[i])
3427#define SHOWNET(x) if(cl_shownet.integer==2)Con_Printf("%3i:%s(%i)\n", cl_message.readcount-1, x, cmd);
3440 unsigned char cmdlog[32];
3441 const char *cmdlogname[32], *temp;
3442 int cmdindex, cmdcount = 0;
3443 qbool qwplayerupdatereceived;
3446 size_t cl_readstring_len;
3454 cl.last_received_message =
host.realtime;
3478 cl.qw_num_nails = 0;
3481 cl.qw_weaponkick =
min(
cl.qw_weaponkick + 10 *
bound(0,
cl.time -
cl.oldtime, 0.1), 0);
3483 cls.servermovesequence =
cls.netcon->qw.incoming_sequence;
3485 qwplayerupdatereceived =
false;
3490 Host_Error (
"CL_ParseServerMessage: Bad QW server message");
3500 cmdindex = cmdcount & 31;
3502 cmdlog[cmdindex] =
cmd;
3506 if (!cmdlogname[cmdindex])
3509 const char *d =
"<unknown>";
3510 cmdlogname[cmdindex] = d;
3518 char description[32*64], logtemp[64];
3520 dp_strlcpy(description,
"packet dump: ",
sizeof(description));
3524 count = cmdcount - i;
3528 dpsnprintf(logtemp,
sizeof(logtemp),
"%3i:%s ", cmdlog[i], cmdlogname[i]);
3529 dp_strlcat(description, logtemp,
sizeof(description));
3534 description[
strlen(description)-1] =
'\n';
3536 Host_Error(
"CL_ParseServerMessage: Illegible server message");
3545 if (
cls.demonum != -1)
3559 cl_readstring_len =
dpsnprintf(vabuf,
sizeof(vabuf),
"\1%s", temp);
3588 for (i=0 ; i<3 ; i++)
3590 if (!
cls.demoplayback)
3592 cl.fixangle[0] =
true;
3595 if (!
cl.fixangle[1])
3602 if (i >=
cl.max_lightstyle)
3604 Con_Printf (
"svc_lightstyle >= MAX_LIGHTSTYLES");
3609 cl.lightstyle[i].length = (
int)
strlen(
cl.lightstyle[i].map);
3623 if (i >=
cl.maxclients)
3624 Host_Error(
"CL_ParseServerMessage: svc_updatefrags >= cl.maxclients");
3630 if (i >=
cl.maxclients)
3631 Host_Error(
"CL_ParseServerMessage: svc_updateping >= cl.maxclients");
3637 if (i >=
cl.maxclients)
3638 Host_Error(
"CL_ParseServerMessage: svc_updatepl >= cl.maxclients");
3644 if (i >=
cl.maxclients)
3645 Host_Error(
"CL_ParseServerMessage: svc_updateentertime >= cl.maxclients");
3653 Host_Error (
"CL_ParseServerMessage: svc_spawnbaseline: invalid entity number %i", i);
3654 if (i >=
cl.max_entities)
3677 Host_Error (
"svc_updatestat: %i is invalid", i);
3684 Host_Error (
"svc_updatestatlong: %i is invalid", i);
3694 if ( (
cls.demoplayback ||
cls.demorecording) && (
cls.forcetrack != -1) )
3701 if(!
cl.intermission)
3702 cl.completed_time =
cl.time;
3703 cl.intermission = 1;
3705 for (i = 0;i < 3;i++)
3710 if(!
cl.intermission)
3711 cl.completed_time =
cl.time;
3712 cl.intermission = 2;
3721 cl.qw_weaponkick = -2;
3724 cl.qw_weaponkick = -4;
3731 Host_Error(
"CL_ParseServerMessage: svc_spawnbaseline: invalid entity number %i", i);
3732 if (i >=
cl.max_entities)
3734 cl.entities[i].persistent.muzzleflash = 1.0f;
3756 if (!qwplayerupdatereceived)
3758 qwplayerupdatereceived =
true;
3759 for (i = 1;i <
cl.maxclients;i++)
3760 cl.entities_active[i] =
false;
3804 if (!
cl.movevars_entgravity)
3805 cl.movevars_entgravity = 1.0f;
3819 if (qwplayerupdatereceived)
3822 for (i = 1;i <=
cl.maxclients;i++)
3823 if (!
cl.entities_active[i])
3824 cl.entities[i].state_current.active =
false;
3832 Host_Error (
"CL_ParseServerMessage: Bad server message");
3843 cmdindex = cmdcount & 31;
3845 cmdlog[cmdindex] =
cmd;
3852 cmdlogname[cmdindex] = temp;
3863 if (!cmdlogname[cmdindex])
3866 const char *d =
"<unknown>";
3867 cmdlogname[cmdindex] = d;
3875 char description[32*64], tempdesc[64];
3877 dp_strlcpy (description,
"packet dump: ",
sizeof(description));
3881 count = cmdcount - i;
3885 dpsnprintf (tempdesc,
sizeof (tempdesc),
"%3i:%s ", cmdlog[i], cmdlogname[i]);
3886 dp_strlcat (description, tempdesc,
sizeof (description));
3891 description[
strlen(description)-1] =
'\n';
3893 Host_Error (
"CL_ParseServerMessage: Illegible server message");
3899 Con_Print(
"<-- server to client keepalive\n");
3914 Host_Error(
"CL_ParseServerMessage: Server is unrecognized protocol number (%i)", i);
3918 cls.protocol = protocol;
3922 if (
cls.demonum != -1)
3949 switch(
cls.protocol)
3973 --cl_readstring_len;
3974 while(*temp >= 0x01 && *temp <= 0x1F)
3977 --cl_readstring_len;
3993 for (i=0 ; i<3 ; i++)
3995 if (!
cls.demoplayback)
3997 cl.fixangle[0] =
true;
4000 if (!
cl.fixangle[1])
4009 if (
cl.viewentity >=
cl.max_entities)
4012 if (!
cl.realplayerentity)
4013 cl.realplayerentity =
cl.viewentity;
4015 if (
cl.viewentity >= 1 &&
cl.viewentity <=
cl.maxclients)
4016 cl.playerentity =
cl.viewentity;
4021 if (i >=
cl.max_lightstyle)
4023 Con_Printf (
"svc_lightstyle >= MAX_LIGHTSTYLES");
4028 cl.lightstyle[i].length = (
int)
strlen(
cl.lightstyle[i].map);
4052 Con_DPrintf(
"svc_precache: Mod_ForName(\"%s\") failed\n", s);
4065 Con_DPrintf(
"svc_precache: S_PrecacheSound(\"%s\") failed\n", s);
4066 cl.sound_precache[i] = sfx;
4081 if (i >=
cl.maxclients)
4082 Host_Error (
"CL_ParseServerMessage: svc_updatename >= cl.maxclients");
4088 if (i >=
cl.maxclients)
4089 Host_Error (
"CL_ParseServerMessage: svc_updatefrags >= cl.maxclients");
4095 if (i >=
cl.maxclients)
4096 Host_Error (
"CL_ParseServerMessage: svc_updatecolors >= cl.maxclients");
4115 Host_Error (
"CL_ParseServerMessage: svc_spawnbaseline: invalid entity number %i", i);
4116 if (i >=
cl.max_entities)
4123 Host_Error (
"CL_ParseServerMessage: svc_spawnbaseline2: invalid entity number %i", i);
4124 if (i >=
cl.max_entities)
4152 if (i <=
cls.signon && i != 1)
4153 Host_Error (
"Received signon %i when at %i", i,
cls.signon);
4168 Host_Error (
"svc_updatestat: %i is invalid", i);
4175 Host_Error (
"svc_updatestat: %i is invalid", i);
4190 if ( (
cls.demoplayback ||
cls.demorecording) && (
cls.forcetrack != -1) )
4197 if(!
cl.intermission)
4198 cl.completed_time =
cl.time;
4199 cl.intermission = 1;
4204 if(!
cl.intermission)
4205 cl.completed_time =
cl.time;
4206 cl.intermission = 2;
4212 if(!
cl.intermission)
4213 cl.completed_time =
cl.time;
4214 cl.intermission = 3;
4301 if (
cls.demorecording)
void CDAudio_Resume(void)
void CDAudio_Play(int track, qbool looping)
cvar_t cl_name
User-visible names of these CF_USERINFO cvars must be matched in CL_SetInfo()!
void CL_ForwardToServer(const char *s)
adds the string as a clc_stringcmd to the client message.
void CL_FindNonSolidLocation(const vec3_t in, vec3_t out, vec_t radius)
model_t * CL_GetModelByIndex(int modelindex)
void CL_Stop_f(cmd_state_t *cmd)
void CL_WriteDemoMessage(sizebuf_t *message)
void EntityFrame4_CL_ReadFrame(void)
void EntityFrame5_CL_ReadFrame(void)
void EntityFrame_CL_ReadFrame(void)
void EntityFrameQuake_ReadEntity(int bits)
void EntityFrameQuake_ISeeDeadEntities(void)
void EntityStateQW_ReadPlayerUpdate(void)
void EntityFrameQW_CL_ReadFrame(qbool delta)
void CL_DisconnectEx(qbool kicked, const char *fmt,...)
cvar_t cl_autodemo_delete
void CL_UpdateRenderEntity(entity_render_t *ent)
void CL_Effect(vec3_t org, model_t *model, int startframe, int framecount, float framerate)
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)
void CL_Locs_Reload_f(cmd_state_t *cmd)
cvar_t cl_autodemo_nameformat
void CL_SetInfo(const char *key, const char *value, qbool send, qbool allowstarkey, qbool allowmodel, qbool quiet)
void CL_ExpandEntities(int num)
cvar_t con_chatsound_team_file
static void QW_CL_ParseDownload(void)
#define LOADPROGRESSWEIGHT_WORLDMODEL_INIT
void CL_Parse_Shutdown(void)
static void QW_CL_ProcessUserInfo(int slot)
static void QW_CL_Skins_f(cmd_state_t *cmd)
static void CL_SetupWorldModel(void)
cvar_t cl_joinbeforedownloadsfinish
cvar_t cl_sound_ric_gunshot
static void CL_ParseTempEntity(void)
static void CL_DownloadFinished_f(cmd_state_t *cmd)
cvar_t cl_readpicture_force
void CL_Parse_ErrorCleanUp(void)
static void CL_SignonReply(int signon_stage)
static void CL_ParsePointParticles1(void)
cvar_t cl_sound_hknighthit
static void QW_CL_RequestNextDownload(void)
static cl_iplog_item_t * cl_iplog_items
static void CL_ParseBaseline(entity_t *ent, int large)
void CL_ParseEntityLump(char *entdata)
cvar_t cl_serverextension_download
static void QW_CL_Changing_f(cmd_state_t *cmd)
#define LOADPROGRESSWEIGHT_WORLDMODEL
static void QW_CL_ServerInfo(void)
cvar_t cl_gameplayfix_soundsmovewithentities
static void CL_SendPlayerInfo(void)
static void QW_CL_ParseModelList(void)
static int cl_iplog_maxitems
static void CL_ParseBeam(model_t *m, int lightning)
static void CL_IPLog_List_f(cmd_state_t *cmd)
static void CL_DownloadBegin_f(cmd_state_t *cmd)
cvar_t cl_nettimesyncboundmode
void CL_MoveLerpEntityStates(entity_t *ent)
static const vec3_t defaultmins
void CL_NewBeam(int ent, vec3_t start, vec3_t end, model_t *m, int lightning)
static void CL_ParseEffect2(void)
void CL_ValidateState(entity_state_t *s)
static void CL_StopDownload(int size, int crc)
static void CL_UpdateItemsAndWeapon(void)
static void QW_CL_NextUpload_f(cmd_state_t *cmd)
static qbool cl_iplog_loaded
static void CL_ParseTrailParticles(void)
cvar_t cl_nettimesyncfactor
static const vec3_t defaultmaxs
static void QW_CL_UpdateUserInfo(void)
static void CL_ParseServerInfo(void)
static int cl_iplog_numitems
static void CL_ParseStatic(int large)
static void CL_ParseStaticSound(int large)
#define LOADPROGRESSWEIGHT_SOUND
static void CL_IPLog_Load(void)
static void CL_ParseDownload(void)
cvar_t cl_nettimesyncboundtolerance
cvar_t cl_worldnamenoextension
static void CL_BeginDownloads_f(cmd_state_t *cmd)
#define LOADPROGRESSWEIGHT_MODEL
static qbool QW_CL_CheckOrDownloadFile(const char *filename)
static void QW_CL_StopUpload_f(cmd_state_t *cmd)
void CL_KeepaliveMessage(qbool readmessages)
static void CL_IPLog_Add(const char *address, const char *name, qbool checkexisting, qbool addtofile)
static qbool CL_ExaminePrintString(const char *text)
static void CL_SetSignonStage_WithMsg(int signon_stage)
void QW_CL_StartUpload(unsigned char *data, int size)
static void CL_NetworkTimeReceived(double newtime)
static void CL_BeginDownloads(qbool aborteddownload)
static void QW_CL_SetInfo(void)
static void CL_ParseStartSoundPacket(int largesoundindex)
static unsigned char olddata[NET_MAXMESSAGE]
static void QW_CL_ParseNails(void)
static void CL_StopDownload_f(cmd_state_t *cmd)
const char * svc_strings[128]
const char * qw_svc_strings[128]
static void CL_ParseClientdata(void)
cvar_t developer_networkentities
void CL_ParseServerMessage(void)
static void CL_ParseEffect(void)
static void QW_CL_ParseSoundList(void)
void CL_Parse_DumpPacket(void)
static void CL_ParsePointParticles(void)
cvar_t cl_sound_wizardhit
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_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)
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)
void CL_ParseParticleEffect(void)
@ EFFECT_TE_SUPERSPIKEQUAD
@ EFFECT_TE_EXPLOSIONQUAD
@ EFFECT_TE_TEI_PLASMAHIT
@ EFFECT_TE_TEI_BIGEXPLOSION
void SCR_BeginLoadingPlaque(qbool startup)
void SCR_CenterPrint(const char *str)
void SHOWLMP_decodehide(void)
void SCR_PopLoadingScreen(qbool redraw)
void SHOWLMP_decodeshow(void)
void SCR_PushLoadingScreen(const char *msg, float len_in_parent)
char cl_connect_status[MAX_QPATH]
User-friendly connection status for the menu and/or loading screen, colours and not supported.
#define LIGHTFLAG_NORMALMODE
#define LIGHTFLAG_REALTIMEMODE
#define CL_MAX_DOWNLOADACKS
@ CL_PARSETEXTMODE_STATUS_PLAYERIP
@ CL_PARSETEXTMODE_STATUS_PLAYERID
@ CL_PARSETEXTMODE_STATUS
void Cbuf_AddText(cmd_state_t *cmd, const char *text)
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...
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.
cmd_state_t * cmd_local
command interpreter for local commands injected by SVQC, CSQC, MQC, server or client engine code uses...
#define CF_READONLY
cvar cannot be changed from the console or the command buffer, and is considered CF_PERSISTENT
@ src_local
from the command buffer
static int Cmd_Argc(cmd_state_t *cmd)
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...
#define CF_CLIENT
cvar/command that only the client can change/execute
#define CF_CLIENT_FROM_SERVER
command that the server is allowed to execute on the client
#define CF_ARCHIVE
cvar should have its set value saved to config.cfg and persist across sessions
void Collision_Cache_Reset(qbool resetlimits)
unsigned short CRC_Block(const unsigned char *data, size_t size)
#define IS_NEXUIZ_DERIVED(g)
#define IS_OLDNEXUIZ_DERIVED(g)
@ GAME_TENEBRAE
full of evil hackery
void InfoString_SetValue(char *buffer, size_t bufferlength, const char *key, const char *value)
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 * MSG_ReadString(sizebuf_t *sb, char *string, size_t maxstring)
float MSG_ReadAngle(sizebuf_t *sb, protocolversion_t protocol)
void MSG_WriteShort(sizebuf_t *sb, int c)
void MSG_ReadVector(sizebuf_t *sb, vec3_t v, protocolversion_t protocol)
void MSG_WriteString(sizebuf_t *sb, const char *s)
float MSG_ReadCoord32f(sizebuf_t *sb)
size_t MSG_ReadBytes(sizebuf_t *sb, size_t numbytes, unsigned char *out)
float MSG_ReadAngle16i(sizebuf_t *sb)
void MSG_WriteByte(sizebuf_t *sb, int c)
float MSG_ReadCoord(sizebuf_t *sb, protocolversion_t protocol)
float MSG_ReadCoord16i(sizebuf_t *sb)
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...
void MSG_WriteChar(sizebuf_t *sb, int c)
char com_token[MAX_INPUTLINE]
char * va(char *buf, size_t buflen, const char *format,...)
void SZ_HexDumpToConsole(const sizebuf_t *buf)
qbool COM_ParseToken_Simple(const char **datapointer, qbool returnnewline, qbool parsebackslash, qbool parsecomments)
void SZ_Write(sizebuf_t *buf, const unsigned char *data, int length)
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 ...
@ PROTOCOL_DARKPLACES2
various changes
@ PROTOCOL_DARKPLACES4
various changes
@ PROTOCOL_NEHAHRABJP2
same as NEHAHRABJP but with 16bit soundindex
@ PROTOCOL_DARKPLACES3
uses EntityFrame4 entity snapshot encoder/decoder which is broken, this attempted to do partial snaps...
@ PROTOCOL_NEHAHRABJP
same as QUAKEDP but with 16bit modelindex
@ PROTOCOL_DARKPLACES5
uses EntityFrame5 entity snapshot encoder/decoder which is based on a Tribes networking article at ht...
@ PROTOCOL_DARKPLACES7
added QuakeWorld-style movement protocol to allow more consistent prediction
@ PROTOCOL_QUAKEDP
darkplaces extended quake protocol (used by TomazQuake and others), backwards compatible as long as n...
@ PROTOCOL_QUAKE
quake (aka netquake/normalquake/nq) protocol
@ PROTOCOL_DARKPLACES8
added parting messages. WIP
@ PROTOCOL_NEHAHRABJP3
same as NEHAHRABJP2 but with some changes
@ PROTOCOL_NEHAHRAMOVIE
Nehahra movie protocol, a big nasty hack dating back to early days of the Quake Standards Group (but ...
@ PROTOCOL_QUAKEWORLD
quakeworld protocol
@ PROTOCOL_DARKPLACES1
uses EntityFrame entity snapshot encoder/decoder which is a QuakeWorld-like entity snapshot delta com...
#define dp_strlcat(dst, src, dsize)
#define dp_strlcpy(dst, src, dsize)
void Con_Print(const char *msg)
Prints to all appropriate console targets, and adds timestamps.
void Con_DPrintf(const char *fmt,...)
A Con_Printf that only shows up if the "developer" cvar is set.
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
void Con_ClearNotify(void)
Clear all notify lines.
void Con_DPrint(const char *msg)
A Con_Print that only shows up if the "developer" cvar is set.
void Log_Printf(const char *logfilename, const char *fmt,...)
void CSQC_AddPrintText(const char *msg, size_t msg_len)
void CSQC_UpdateNetworkTimes(double newtime, double oldtime)
void CL_VM_Parse_StuffCmd(const char *msg, size_t msg_len)
void CL_VM_UpdateIntermissionState(int intermission)
qbool CL_VM_Event_Sound(int sound_num, float fvolume, int channel, float attenuation, int ent, vec3_t pos, int flags, float speed)
void CSQC_ReadEntities(void)
qbool CL_VM_Parse_TempEntity(void)
void CL_VM_Parse_CenterPrint(const char *msg, size_t msg_len)
void Cvar_SetValueQuick(cvar_t *var, float value)
void Cvar_SetQuick(cvar_t *var, const char *value)
void Cvar_RegisterVariable(cvar_t *variable)
registers a cvar that already has the name, string, and optionally the archive elements set.
const char * FS_FileExtension(const char *in)
unsigned char * FS_Inflate(const unsigned char *data, size_t size, size_t *inflated_size, mempool_t *mempool)
qfile_t * FS_OpenVirtualFile(const char *filepath, qbool quiet)
qbool FS_WriteFile(const char *filename, const void *data, fs_offset_t len)
qbool FS_ChangeGameDirs(int numgamedirs, const char *gamedirs[], qbool failmissing)
unsigned char * FS_LoadFile(const char *path, mempool_t *pool, qbool quiet, fs_offset_t *filesizepointer)
qfile_t * FS_OpenRealFile(const char *filepath, const char *mode, qbool quiet)
void FS_UnloadPacks_dlcache(void)
static int(ZEXPORT *qz_inflate)(z_stream *strm
void FS_StripExtension(const char *in, char *out, size_t size_out)
int FS_Close(qfile_t *file)
int FS_Printf(qfile_t *file, const char *format,...)
int FS_CRCFile(const char *filename, size_t *filesizepointer)
int FS_CheckNastyPath(const char *path, qbool isgamedir)
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...
GLsizei const GLfloat * value
GLenum GLenum GLsizei count
GLsizeiptr const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
void Host_Error(const char *error,...)
void Curl_Register_predownload(void)
qbool Curl_Have_forthismap(void)
void Curl_CancelAll(void)
#define bound(min, num, max)
#define lhrandom(MIN, MAX)
LadyHavoc: this function never returns exactly MIN or exactly MAX, because of a QuakeC bug in id1 whe...
#define VectorSet(vec, x, y, z)
#define VectorSubtract(a, b, out)
#define VectorCopy(in, out)
void Matrix4x4_CreateTranslate(matrix4x4_t *out, double x, double y, double z)
void Matrix4x4_CreateFromQuakeEntity(matrix4x4_t *out, double x, double y, double z, double pitch, double yaw, double roll, double scale)
model_t * Mod_ForName(const char *name, qbool crash, qbool checkdisk, const char *parentname)
void Mod_PurgeUnused(void)
model_t * Mod_FindName(const char *name, const char *parentname)
void Mod_FreeQ3Shaders(void)
char cl_readstring[MAX_INPUTLINE]
void NetConn_ClientFrame(void)
int NetConn_IsLocalGame(void)
int NetConn_SendUnreliableMessage(netconn_t *conn, sizebuf_t *data, protocolversion_t protocol, int rate, int burstsize, qbool quakesignon_suppressreliables)
unsigned char palette_rgb[256][3]
entity_state_t defaultstate
const char * Protocol_NameForEnum(protocolversion_t p)
protocolversion_t Protocol_EnumForNumber(int n)
#define svc_pointparticles1
#define qw_svc_packetentities
#define QW_TE_TAREXPLOSION
#define qw_svc_entgravity
#define qw_svc_sellscreen
#define QW_TE_KNIGHTSPIKE
#define svc_spawnstaticsound2
#define svc_spawnstaticsound
#define EF_RESTARTANIM_BIT
#define qw_svc_updateuserinfo
#define QW_TE_LIGHTNINGBLOOD
#define qw_svc_spawnstaticsound
#define qw_svc_serverinfo
#define qw_svc_updatefrags
#define svc_killedmonster
#define qw_svc_updatestat
#define svc_spawnbaseline2
#define qw_svc_serverdata
#define qw_svc_updateping
#define TE_TEI_BIGEXPLOSION
#define qw_svc_playerinfo
#define qw_svc_lightstyle
#define qw_svc_temp_entity
#define DEFAULT_VIEWHEIGHT
#define TE_SUPERSPIKEQUAD
#define SU_INWATER
no data follows, the bit is it
#define svc_updatestatubyte
#define PFLAGS_FULLDYNAMIC
#define SND_SPEEDUSHORT4000
#define svc_pointparticles
#define svc_trailparticles
#define qw_svc_muzzleflash
#define qw_svc_spawnstatic
#define qw_svc_deltapacketentities
#define SU_EXTEND2
another byte to follow, future expansion
#define RENDER_COLORMAPPED
#define qw_svc_updatestatlong
#define qw_svc_spawnbaseline
#define SU_VIEWZOOM
byte factor (0 = 0.0 (not valid), 255 = 1.0)
#define svc_spawnbaseline
#define qw_svc_intermission
#define qw_svc_updateentertime
#define qw_svc_disconnect
#define SU_ONGROUND
no data follows, the bit is it
#define qw_svc_chokecount
#define qw_svc_foundsecret
#define qw_svc_killedmonster
#define qw_svc_centerprint
#define MAX_INPUTLINE
maximum size of console commandline, QuakeC strings, and many other text processing buffers
#define MAX_STYLESTRING
max length of flicker pattern for light style
#define MAX_OSPATH
max length of a filesystem pathname
#define MAX_EDICTS
max number of objects in game world at once (32768 protocol limit)
#define NET_MAXMESSAGE
max reliable packet size (sent as multiple fragments of MAX_PACKETFRAGMENT)
#define MAX_SOUNDS
max number of sounds loaded at once
#define MAX_QPATH
max length of a quake game pathname
#define MAX_SCOREBOARD
max number of players in game at once (255 protocol limit)
#define MAX_MODELS
max number of models loaded at once (including during level transitions)
#define STAT_MONSTERS
bumped by svc_killedmonster
#define STAT_SECRETS
bumped on client side by svc_foundsecret
#define STAT_ACTIVEWEAPON
#define STAT_ITEMS
FTE, DP.
#define STAT_VIEWHEIGHT
FTE, DP.
void R_Modules_NewMap(void)
int R_SetSkyBox(const char *sky)
void S_StaticSound(sfx_t *sfx, vec3_t origin, float fvol, float attenuation)
void S_StopAllSounds(void)
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.
void S_PauseGameSounds(qbool toggle)
qbool S_IsSoundPrecached(const sfx_t *sfx)
void S_StopSound(int entnum, int entchannel)
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)
sfx_t * S_PrecacheSound(const char *name, qbool complain, qbool levelsound)
#define DEFAULT_SOUND_PACKET_ATTENUATION
#define DEFAULT_SOUND_PACKET_VOLUME
command interpreter state - the tokenizing and execution of commands, as well as pointers to which cv...
framegroupblend_t framegroupblend[MAX_FRAMEGROUPBLENDS]
unsigned short modelindex
unsigned char lightpflags
entity_state_t state_baseline
entity_persistent_t persistent
entity_state_t state_current
entity_state_t state_previous
size_t Sys_TimeString(char buf[], size_t bufsize, const char *timeformat)
void Sys_AllowProfiling(qbool enable)
double Sys_DirtyTime(void)
int Sys_CheckParm(const char *parm)
void World_SetSize(world_t *world, const char *filename, const vec3_t mins, const vec3_t maxs, prvm_prog_t *prog)
void World_Start(world_t *world)
void World_Physics_Frame(world_t *world, double frametime, double gravity)
#define Mem_Alloc(pool, size)
#define Mem_CheckSentinelsGlobal()