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

Go to the source code of this file.

Functions

void CL_KeepaliveMessage (qbool readmessages)
 
void CL_Parse_DumpPacket (void)
 
void CL_Parse_ErrorCleanUp (void)
 
void CL_Parse_Init (void)
 
void CL_Parse_Shutdown (void)
 
void CL_ParseServerMessage (void)
 
void QW_CL_StartUpload (unsigned char *data, int size)
 

Variables

cvar_t qport
 

Function Documentation

◆ 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}
client_static_t cls
Definition cl_main.c:116
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
@ PROTOCOL_QUAKEWORLD
quakeworld protocol
Definition common.h:145
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
sizebuf_t cl_message
Definition netconn.c:71
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
bool qbool
Definition qtypes.h:9
server_t sv
local server
Definition sv_main.c:223
cactive_t state
Definition client.h:568
netconn_t * netcon
Definition client.h:630
protocolversion_t protocol
Definition client.h:617
qbool active
false if only a net client
Definition server.h:66
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_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 CL_StopDownload(int size, int crc)
Definition cl_parse.c:1384
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_joinbeforedownloadsfinish
Definition cl_parse.c:190
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
cvar_t cl_iplog_name
Definition cl_parse.c:194
cvar_t cl_serverextension_download
Definition cl_parse.c:189
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
cvar_t cl_nettimesyncboundmode
Definition cl_parse.c:192
static void QW_CL_NextUpload_f(cmd_state_t *cmd)
Definition cl_parse.c:912
cvar_t cl_nettimesyncfactor
Definition cl_parse.c:191
cvar_t cl_nettimesyncboundtolerance
Definition cl_parse.c:193
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_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
client_state_t cl
Definition cl_main.c:117
cvar_t cl_shownet
Definition cl_main.c:42
void CL_ExpandEntities(int num)
Definition cl_main.c:300
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
void CL_KeepaliveMessage(qbool readmessages)
Definition cl_parse.c:314
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
gamemode_t gamemode
Definition com_game.c:26
@ GAME_NEHAHRA
Definition com_game.h:32
@ GAME_TENEBRAE
full of evil hackery
Definition com_game.h:41
char * MSG_ReadString(sizebuf_t *sb, char *string, size_t maxstring)
Definition com_msg.c:341
float MSG_ReadAngle(sizebuf_t *sb, protocolversion_t protocol)
Definition com_msg.c:424
void MSG_ReadVector(sizebuf_t *sb, vec3_t v, protocolversion_t protocol)
Definition com_msg.c:401
float MSG_ReadCoord(sizebuf_t *sb, protocolversion_t protocol)
Definition com_msg.c:389
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
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
#define MSG_ReadShort
Definition common.h:191
#define MSG_ReadFloat
Definition common.h:193
protocolversion_t
Definition common.h:132
@ PROTOCOL_DARKPLACES2
various changes
Definition common.h:140
@ PROTOCOL_DARKPLACES4
various changes
Definition common.h:138
@ PROTOCOL_NEHAHRABJP2
same as NEHAHRABJP but with 16bit soundindex
Definition common.h:147
@ PROTOCOL_DARKPLACES3
uses EntityFrame4 entity snapshot encoder/decoder which is broken, this attempted to do partial snaps...
Definition common.h:139
@ PROTOCOL_DARKPLACES7
added QuakeWorld-style movement protocol to allow more consistent prediction
Definition common.h:135
@ PROTOCOL_QUAKEDP
darkplaces extended quake protocol (used by TomazQuake and others), backwards compatible as long as n...
Definition common.h:142
@ PROTOCOL_UNKNOWN
Definition common.h:133
@ PROTOCOL_QUAKE
quake (aka netquake/normalquake/nq) protocol
Definition common.h:144
@ PROTOCOL_DARKPLACES8
added parting messages. WIP
Definition common.h:134
@ PROTOCOL_NEHAHRABJP3
same as NEHAHRABJP2 but with some changes
Definition common.h:148
@ 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 dp_strlcat(dst, src, dsize)
Definition common.h:304
#define dp_strlcpy(dst, src, dsize)
Definition common.h:303
#define MSG_ReadByte(sb)
Definition common.h:188
void Con_DPrintf(const char *fmt,...)
A Con_Printf that only shows up if the "developer" cvar is set.
Definition console.c:1544
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
Definition console.c:1514
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
static int(ZEXPORT *qz_inflate)(z_stream *strm
GLenum GLenum GLsizei count
Definition glquake.h:656
host_static_t host
Definition host.c:41
void Host_Error(const char *error,...)
Definition host.c:85
#define min(A, B)
Definition mathlib.h:37
#define bound(min, num, max)
Definition mathlib.h:34
#define VectorCopy(in, out)
Definition mathlib.h:101
float strlen(string s)
void cmd(string command,...)
model_t * Mod_ForName(const char *name, qbool crash, qbool checkdisk, const char *parentname)
char cl_readstring[MAX_INPUTLINE]
Definition netconn.c:75
protocolversion_t Protocol_EnumForNumber(int n)
Definition protocol.c:86
#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
int i
#define MAX_STYLESTRING
max length of flicker pattern for light style
Definition qdefs.h:109
#define MAX_EDICTS
max number of objects in game world at once (32768 protocol limit)
Definition qdefs.h:105
#define MAX_SOUNDS
max number of sounds loaded at once
Definition qdefs.h:107
#define MAX_MODELS
max number of models loaded at once (including during level transitions)
Definition qdefs.h:106
#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
#define NULL
Definition qtypes.h:12
int R_SetSkyBox(const char *sky)
Definition r_sky.c:149
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
sfx_t * S_PrecacheSound(const char *name, qbool complain, qbool levelsound)
Definition snd_main.c:1048
double oldtime
Definition client.h:868
int realplayerentity
Definition client.h:905
float movevars_entgravity
Definition client.h:1066
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
unsigned char * entities_active
Definition client.h:993
scoreboard_t * scores
Definition client.h:945
double completed_time
Definition client.h:858
qbool paused
Definition client.h:842
struct sfx_s * sound_precache[MAX_SOUNDS]
Definition client.h:889
vec3_t viewangles
Definition client.h:786
entity_t * entities
Definition client.h:991
int intermission
Definition client.h:856
qbool fixangle[2]
Definition client.h:800
struct model_s * model_precache[MAX_MODELS]
Definition client.h:888
float movevars_maxspeed
Definition client.h:1061
double time
Definition client.h:868
char model_name[MAX_MODELS][MAX_QPATH]
Definition client.h:892
int max_entities
Definition client.h:980
int playerentity
Definition client.h:910
vec3_t qw_intermission_angles
Definition client.h:1096
int stats[MAX_CL_STATS]
Definition client.h:758
vec3_t mviewangles[2]
Definition client.h:786
float qw_weaponkick
Definition client.h:1102
unsigned int servermovesequence
Definition client.h:637
qbool demoplayback
Definition client.h:587
qbool demorecording
Definition client.h:584
float value
Definition cvar.h:74
int integer
Definition cvar.h:73
unsigned char active
Definition protocol.h:459
entity_persistent_t persistent
Definition client.h:474
entity_state_t state_current
Definition client.h:471
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
char name[MAX_SCOREBOARDNAME]
Definition client.h:489
int qw_ping
Definition client.h:496
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().

◆ 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}
vector size
GLsizeiptr const GLvoid * data
Definition glquake.h:639
mempool_t * permanentmempool
Definition client.h:572
int qw_uploadsize
Definition client.h:663
unsigned char * qw_uploaddata
Definition client.h:662
#define Mem_Alloc(pool, size)
Definition zone.h:92

Variable Documentation

◆ qport

cvar_t qport
extern

Definition at line 90 of file cl_main.c.

90{CF_CLIENT, "qport", "0", "identification key for playing on qw servers (allows you to maintain a connection to a quakeworld server even if your port changes)"};

Referenced by CL_Init(), and NetConn_ClientParsePacket().