icculus quake2 doxygen  1.0 dev
cl_main.c File Reference
#include "client.h"

Go to the source code of this file.

Classes

struct  cheatvar_t
 

Macros

#define PLAYER_MULT   5
 
#define ENV_CNT   (CS_PLAYERSKINS + MAX_CLIENTS * PLAYER_MULT)
 
#define TEXTURE_CNT   (ENV_CNT+13)
 

Functions

void CL_WriteDemoMessage (void)
 
void CL_Stop_f (void)
 
void CL_Record_f (void)
 
void Cmd_ForwardToServer (void)
 
void CL_Setenv_f (void)
 
void CL_ForwardToServer_f (void)
 
void CL_Pause_f (void)
 
void CL_Quit_f (void)
 
void CL_Drop (void)
 
void CL_SendConnectPacket (void)
 
void CL_CheckForResend (void)
 
void CL_Connect_f (void)
 
void CL_Rcon_f (void)
 
void CL_ClearState (void)
 
void CL_Disconnect (void)
 
void CL_Disconnect_f (void)
 
void CL_Packet_f (void)
 
void CL_Changing_f (void)
 
void CL_Reconnect_f (void)
 
void CL_ParseStatusMessage (void)
 
void CL_PingServers_f (void)
 
void CL_Skins_f (void)
 
void CL_ConnectionlessPacket (void)
 
void CL_DumpPackets (void)
 
void CL_ReadPackets (void)
 
void CL_FixUpGender (void)
 
void CL_Userinfo_f (void)
 
void CL_Snd_Restart_f (void)
 
void CL_RequestNextDownload (void)
 
void CL_Precache_f (void)
 
void CL_InitLocal (void)
 
void CL_WriteConfiguration (void)
 
void CL_FixCvarCheats (void)
 
void CL_SendCommand (void)
 
void CL_Frame (int msec)
 
void CL_Init (void)
 
void CL_Shutdown (void)
 

Variables

cvar_tfreelook
 
cvar_tadr0
 
cvar_tadr1
 
cvar_tadr2
 
cvar_tadr3
 
cvar_tadr4
 
cvar_tadr5
 
cvar_tadr6
 
cvar_tadr7
 
cvar_tadr8
 
cvar_tcl_stereo_separation
 
cvar_tcl_stereo
 
cvar_trcon_client_password
 
cvar_trcon_address
 
cvar_tcl_noskins
 
cvar_tcl_autoskins
 
cvar_tcl_footsteps
 
cvar_tcl_timeout
 
cvar_tcl_predict
 
cvar_tcl_maxfps
 
cvar_tcl_drawfps
 
cvar_tcl_gun
 
cvar_tcl_add_particles
 
cvar_tcl_add_lights
 
cvar_tcl_add_entities
 
cvar_tcl_add_blend
 
cvar_tcl_shownet
 
cvar_tcl_showmiss
 
cvar_tcl_showclamp
 
cvar_tcl_paused
 
cvar_tcl_timedemo
 
cvar_tlookspring
 
cvar_tlookstrafe
 
cvar_tsensitivity
 
cvar_tm_pitch
 
cvar_tm_yaw
 
cvar_tm_forward
 
cvar_tm_side
 
cvar_tcl_lightlevel
 
cvar_tinfo_password
 
cvar_tinfo_spectator
 
cvar_tname
 
cvar_tskin
 
cvar_trate
 
cvar_tfov
 
cvar_tmsg
 
cvar_thand
 
cvar_tgender
 
cvar_tgender_auto
 
cvar_tcl_vwep
 
client_static_t cls
 
client_state_t cl
 
centity_t cl_entities [MAX_EDICTS]
 
entity_state_t cl_parse_entities [MAX_PARSE_ENTITIES]
 
cvar_tallow_download
 
cvar_tallow_download_players
 
cvar_tallow_download_models
 
cvar_tallow_download_sounds
 
cvar_tallow_download_maps
 
int precache_check
 
int precache_spawncount
 
int precache_tex
 
int precache_model_skin
 
byteprecache_model
 
static const char * env_suf [6] = {"rt", "bk", "lf", "ft", "up", "dn"}
 
cheatvar_t cheatvars []
 
int numcheatvars
 

Macro Definition Documentation

◆ ENV_CNT

#define ENV_CNT   (CS_PLAYERSKINS + MAX_CLIENTS * PLAYER_MULT)

Definition at line 1136 of file cl_main.c.

◆ PLAYER_MULT

#define PLAYER_MULT   5

Definition at line 1133 of file cl_main.c.

◆ TEXTURE_CNT

#define TEXTURE_CNT   (ENV_CNT+13)

Definition at line 1137 of file cl_main.c.

Function Documentation

◆ CL_Changing_f()

void CL_Changing_f ( void  )

Definition at line 746 of file cl_main.c.

747 {
748  //ZOID
749  //if we are downloading, we don't change! This so we don't suddenly stop downloading a map
750  if (cls.download)
751  return;
752 
754  cls.state = ca_connected; // not active anymore, but not disconnected
755  Com_Printf ("\nChanging map...\n");
756 }

Referenced by CL_InitLocal().

◆ CL_CheckForResend()

void CL_CheckForResend ( void  )

Definition at line 465 of file cl_main.c.

466 {
467  netadr_t adr;
468 
469  // if the local server is running and we aren't
470  // then connect
472  {
474  strncpy (cls.servername, "localhost", sizeof(cls.servername)-1);
475  // we don't need a challenge on the localhost
477  return;
478 // cls.connect_time = -99999; // CL_CheckForResend() will fire immediately
479  }
480 
481  // resend if we haven't gotten a reply yet
482  if (cls.state != ca_connecting)
483  return;
484 
485  if (cls.realtime - cls.connect_time < 3000)
486  return;
487 
488  if (!NET_StringToAdr (cls.servername, &adr))
489  {
490  Com_Printf ("Bad server address\n");
492  return;
493  }
494  if (adr.port == 0)
495  adr.port = BigShort (PORT_SERVER);
496 
497  cls.connect_time = cls.realtime; // for retransmit requests
498 
499  Com_Printf ("Connecting to %s...\n", cls.servername);
500 
501  Netchan_OutOfBandPrint (NS_CLIENT, adr, "getchallenge\n");
502 }

Referenced by CL_SendCommand().

◆ CL_ClearState()

void CL_ClearState ( void  )

Definition at line 610 of file cl_main.c.

611 {
612  S_StopAllSounds ();
613  CL_ClearEffects ();
614  CL_ClearTEnts ();
615 
616 // wipe the entire cl structure
617  memset (&cl, 0, sizeof(cl));
618  memset (&cl_entities, 0, sizeof(cl_entities));
619 
621 
622 }

Referenced by CL_Disconnect(), and CL_ParseServerData().

◆ CL_Connect_f()

void CL_Connect_f ( void  )

Definition at line 511 of file cl_main.c.

512 {
513  char *server;
514 
515  if (Cmd_Argc() != 2)
516  {
517  Com_Printf ("usage: connect <server>\n");
518  return;
519  }
520 
521  if (Com_ServerState ())
522  { // if running a local server, kill it and reissue
523  SV_Shutdown (va("Server quit\n", msg), false);
524  }
525  else
526  {
527  CL_Disconnect ();
528  }
529 
530  server = Cmd_Argv (1);
531 
532  NET_Config (true); // allow remote
533 
534  CL_Disconnect ();
535 
537  strncpy (cls.servername, server, sizeof(cls.servername)-1);
538  cls.connect_time = -99999; // CL_CheckForResend() will fire immediately
539 }

Referenced by CL_InitLocal().

◆ CL_ConnectionlessPacket()

void CL_ConnectionlessPacket ( void  )

Definition at line 904 of file cl_main.c.

905 {
906  char *s;
907  char *c;
908 
910  MSG_ReadLong (&net_message); // skip the -1
911 
913 
914  Cmd_TokenizeString (s, false);
915 
916  c = Cmd_Argv(0);
917 
918  Com_Printf ("%s: %s\n", NET_AdrToString (net_from), c);
919 
920  // server connection
921  if (!strcmp(c, "client_connect"))
922  {
923  if (cls.state == ca_connected)
924  {
925  Com_Printf ("Dup connect received. Ignored.\n");
926  return;
927  }
930  MSG_WriteString (&cls.netchan.message, "new");
932  return;
933  }
934 
935  // server responding to a status broadcast
936  if (!strcmp(c, "info"))
937  {
939  return;
940  }
941 
942  // remote command from gui front end
943  if (!strcmp(c, "cmd"))
944  {
946  {
947  Com_Printf ("Command packet from remote host. Ignored.\n");
948  return;
949  }
950  Sys_AppActivate ();
952  Cbuf_AddText (s);
953  Cbuf_AddText ("\n");
954  return;
955  }
956  // print command from somewhere
957  if (!strcmp(c, "print"))
958  {
960  Com_Printf ("%s", s);
961  return;
962  }
963 
964  // ping from somewhere
965  if (!strcmp(c, "ping"))
966  {
968  return;
969  }
970 
971  // challenge from the server we are connecting to
972  if (!strcmp(c, "challenge"))
973  {
974  cls.challenge = atoi(Cmd_Argv(1));
976  return;
977  }
978 
979  // echo request from server
980  if (!strcmp(c, "echo"))
981  {
983  return;
984  }
985 
986  Com_Printf ("Unknown command.\n");
987 }

Referenced by CL_ReadPackets().

◆ CL_Disconnect()

void CL_Disconnect ( void  )

Definition at line 633 of file cl_main.c.

634 {
635  byte final[32];
636 
637  if (cls.state == ca_disconnected)
638  return;
639 
640  if (cl_timedemo && cl_timedemo->value)
641  {
642  int time;
643 
644  time = Sys_Milliseconds () - cl.timedemo_start;
645  if (time > 0)
646  Com_Printf ("%i frames, %3.1f seconds: %3.1f fps\n", cl.timedemo_frames,
647  time/1000.0, cl.timedemo_frames*1000.0 / time);
648  }
649 
652 
653  M_ForceMenuOff ();
654 
655  cls.connect_time = 0;
656 
658 
659  if (cls.demorecording)
660  CL_Stop_f ();
661 
662  // send a disconnect message to the server
663  final[0] = clc_stringcmd;
664  strcpy ((char *)final+1, "disconnect");
665  Netchan_Transmit (&cls.netchan, strlen((char *)final), final);
666  Netchan_Transmit (&cls.netchan, strlen((char *)final), final);
667  Netchan_Transmit (&cls.netchan, strlen((char *)final), final);
668 
669  CL_ClearState ();
670 
671  // stop download
672  if (cls.download) {
673  fclose(cls.download);
674  cls.download = NULL;
675  }
676 
678 }

Referenced by CL_Connect_f(), CL_Drop(), CL_Quit_f(), CL_ReadPackets(), and CL_Reconnect_f().

◆ CL_Disconnect_f()

void CL_Disconnect_f ( void  )

Definition at line 680 of file cl_main.c.

681 {
682  Com_Error (ERR_DROP, "Disconnected from server");
683 }

Referenced by CL_InitLocal().

◆ CL_Drop()

void CL_Drop ( void  )

Definition at line 412 of file cl_main.c.

413 {
414  if (cls.state == ca_uninitialized)
415  return;
416  if (cls.state == ca_disconnected)
417  return;
418 
419  CL_Disconnect ();
420 
421  // drop loading plaque unless this is the initial game start
422  if (cls.disable_servercount != -1)
423  SCR_EndLoadingPlaque (); // get rid of loading plaque
424 }

Referenced by Com_Error(), and SV_InitGame().

◆ CL_DumpPackets()

void CL_DumpPackets ( void  )

Definition at line 998 of file cl_main.c.

999 {
1001  {
1002  Com_Printf ("dumnping a packet\n");
1003  }
1004 }

◆ CL_FixCvarCheats()

void CL_FixCvarCheats ( void  )

Definition at line 1654 of file cl_main.c.

1655 {
1656  int i;
1657  cheatvar_t *var;
1658 
1659  if ( !strcmp(cl.configstrings[CS_MAXCLIENTS], "1")
1660  || !cl.configstrings[CS_MAXCLIENTS][0] )
1661  return; // single player can cheat
1662 
1663  // find all the cvars if we haven't done it yet
1664  if (!numcheatvars)
1665  {
1666  while (cheatvars[numcheatvars].name)
1667  {
1670  numcheatvars++;
1671  }
1672  }
1673 
1674  // make sure they are all set to the proper values
1675  for (i=0, var = cheatvars ; i<numcheatvars ; i++, var++)
1676  {
1677  if ( strcmp (var->var->string, var->value) )
1678  {
1679  Cvar_Set (var->name, var->value);
1680  }
1681  }
1682 }

Referenced by CL_SendCommand().

◆ CL_FixUpGender()

void CL_FixUpGender ( void  )

Definition at line 1074 of file cl_main.c.

1075 {
1076  char *p;
1077  char sk[80];
1078 
1079  if (gender_auto->value) {
1080 
1081  if (gender->modified) {
1082  // was set directly, don't override the user
1083  gender->modified = false;
1084  return;
1085  }
1086 
1087  strncpy(sk, skin->string, sizeof(sk) - 1);
1088  if ((p = strchr(sk, '/')) != NULL)
1089  *p = 0;
1090  if (Q_stricmp(sk, "male") == 0 || Q_stricmp(sk, "cyborg") == 0)
1091  Cvar_Set ("gender", "male");
1092  else if (Q_stricmp(sk, "female") == 0 || Q_stricmp(sk, "crackhor") == 0)
1093  Cvar_Set ("gender", "female");
1094  else
1095  Cvar_Set ("gender", "none");
1096  gender->modified = false;
1097  }
1098 }

Referenced by CL_SendCmd().

◆ CL_ForwardToServer_f()

void CL_ForwardToServer_f ( void  )

Definition at line 360 of file cl_main.c.

361 {
362  if (cls.state != ca_connected && cls.state != ca_active)
363  {
364  Com_Printf ("Can't \"%s\", not connected\n", Cmd_Argv(0));
365  return;
366  }
367 
368  // don't forward the first argument
369  if (Cmd_Argc() > 1)
370  {
373  }
374 }

Referenced by CL_InitLocal().

◆ CL_Frame()

void CL_Frame ( int  msec)

Definition at line 1720 of file cl_main.c.

1721 {
1722  static int extratime;
1723  static int lasttimecalled;
1724 
1725  if (dedicated->value)
1726  return;
1727 
1728  extratime += msec;
1729 
1730  if (!cl_timedemo->value)
1731  {
1732  if (cls.state == ca_connected && extratime < 100)
1733  return; // don't flood packets out while connecting
1734  if (extratime < 1000/cl_maxfps->value)
1735  return; // framerate is too high
1736  }
1737 
1738  // let the mouse activate or deactivate
1739  IN_Frame ();
1740 
1741  // decide the simulation time
1742  cls.frametime = extratime/1000.0;
1743  cl.time += extratime;
1744  cls.realtime = curtime;
1745 
1746  extratime = 0;
1747 #if 0
1748  if (cls.frametime > (1.0 / cl_minfps->value))
1749  cls.frametime = (1.0 / cl_minfps->value);
1750 #else
1751  if (cls.frametime > (1.0 / 5))
1752  cls.frametime = (1.0 / 5);
1753 #endif
1754 
1755  // if in the debugger last frame, don't timeout
1756  if (msec > 5000)
1758 
1759  // fetch results from server
1760  CL_ReadPackets ();
1761 
1762  // send a new command message to the server
1763  CL_SendCommand ();
1764 
1765  // predict all unacknowledged movements
1766  CL_PredictMovement ();
1767 
1768  // allow rendering DLL change
1769  VID_CheckChanges ();
1770  if (!cl.refresh_prepped && cls.state == ca_active)
1771  CL_PrepRefresh ();
1772 
1773  // update the screen
1774  if (host_speeds->value)
1776  SCR_UpdateScreen ();
1777  if (host_speeds->value)
1779 
1780  // update audio
1782 
1783  CDAudio_Update();
1784 
1785  // advance local effects for next frame
1786  CL_RunDLights ();
1787  CL_RunLightStyles ();
1788  SCR_RunCinematic ();
1789  SCR_RunConsole ();
1790 
1791  cls.framecount++;
1792 
1793  if ( log_stats->value )
1794  {
1795  if ( cls.state == ca_active )
1796  {
1797  if ( !lasttimecalled )
1798  {
1799  lasttimecalled = Sys_Milliseconds();
1800  if ( log_stats_file )
1801  fprintf( log_stats_file, "0\n" );
1802  }
1803  else
1804  {
1805  int now = Sys_Milliseconds();
1806 
1807  if ( log_stats_file )
1808  fprintf( log_stats_file, "%d\n", now - lasttimecalled );
1809  lasttimecalled = now;
1810  }
1811  }
1812  }
1813 }

Referenced by Qcommon_Frame().

◆ CL_Init()

void CL_Init ( void  )

Definition at line 1823 of file cl_main.c.

1824 {
1825  if (dedicated->value)
1826  return; // nothing running on the client
1827 
1828  // all archived variables will now be loaded
1829 
1830  Con_Init ();
1831 #if defined __linux__ || defined __FreeBSD__ || defined __sgi
1832  S_Init ();
1833  VID_Init ();
1834 #else
1835  VID_Init ();
1836  S_Init (); // sound must be initialized after window is created
1837 #endif
1838 
1839  V_Init ();
1840 
1843 
1844  M_Init ();
1845 
1846  SCR_Init ();
1847  cls.disable_screen = true; // don't draw yet
1848 
1849  CDAudio_Init ();
1850  CL_InitLocal ();
1851  IN_Init ();
1852 
1853 // Cbuf_AddText ("exec autoexec.cfg\n");
1854  FS_ExecAutoexec ();
1855  Cbuf_Execute ();
1856 
1857 }

Referenced by Qcommon_Init().

◆ CL_InitLocal()

void CL_InitLocal ( void  )

Definition at line 1430 of file cl_main.c.

1431 {
1434 
1435  CL_InitInput ();
1436 
1437  adr0 = Cvar_Get( "adr0", "", CVAR_ARCHIVE );
1438  adr1 = Cvar_Get( "adr1", "", CVAR_ARCHIVE );
1439  adr2 = Cvar_Get( "adr2", "", CVAR_ARCHIVE );
1440  adr3 = Cvar_Get( "adr3", "", CVAR_ARCHIVE );
1441  adr4 = Cvar_Get( "adr4", "", CVAR_ARCHIVE );
1442  adr5 = Cvar_Get( "adr5", "", CVAR_ARCHIVE );
1443  adr6 = Cvar_Get( "adr6", "", CVAR_ARCHIVE );
1444  adr7 = Cvar_Get( "adr7", "", CVAR_ARCHIVE );
1445  adr8 = Cvar_Get( "adr8", "", CVAR_ARCHIVE );
1446 
1447 //
1448 // register our variables
1449 //
1450  cl_stereo_separation = Cvar_Get( "cl_stereo_separation", "0.4", CVAR_ARCHIVE );
1451  cl_stereo = Cvar_Get( "cl_stereo", "0", 0 );
1452 
1453  cl_add_blend = Cvar_Get ("cl_blend", "1", 0);
1454  cl_add_lights = Cvar_Get ("cl_lights", "1", 0);
1455  cl_add_particles = Cvar_Get ("cl_particles", "1", 0);
1456  cl_add_entities = Cvar_Get ("cl_entities", "1", 0);
1457  cl_gun = Cvar_Get ("cl_gun", "1", 0);
1458  cl_footsteps = Cvar_Get ("cl_footsteps", "1", 0);
1459  cl_noskins = Cvar_Get ("cl_noskins", "0", 0);
1460  cl_autoskins = Cvar_Get ("cl_autoskins", "0", 0);
1461  cl_predict = Cvar_Get ("cl_predict", "1", 0);
1462 // cl_minfps = Cvar_Get ("cl_minfps", "5", 0);
1463  cl_maxfps = Cvar_Get ("cl_maxfps", "90", 0);
1464  cl_drawfps = Cvar_Get("cl_drawfps","0",CVAR_ARCHIVE); // FPS hack
1465 
1466 #ifdef QMAX
1467  cl_blood = Cvar_Get ("cl_blood", "1", 0);
1468 
1469  //psychospaz -- railgun fun
1470  cl_railred = Cvar_Get ("cl_railred", "20", CVAR_ARCHIVE);
1471  cl_railgreen = Cvar_Get ("cl_railgreen", "50", CVAR_ARCHIVE);
1472  cl_railblue = Cvar_Get ("cl_railblue", "175", CVAR_ARCHIVE);
1473  cl_railtype = Cvar_Get ("cl_railtype", "1", CVAR_ARCHIVE);
1474  //3d camera
1475  cl_3dcam = Cvar_Get ("cl_3dcam", "0", CVAR_ARCHIVE);
1476  cl_3dcam_angle = Cvar_Get ("cl_3dcam_angle", "0", CVAR_ARCHIVE);
1477  cl_3dcam_dist = Cvar_Get ("cl_3dcam_dist", "50", CVAR_ARCHIVE);
1478  cl_3dcam_alpha = Cvar_Get ("cl_3dcam_alpha", "1", CVAR_ARCHIVE);
1479  cl_3dcam_chase = Cvar_Get ("cl_3dcam_chase", "1", CVAR_ARCHIVE);
1480  cl_3dcam_adjust = Cvar_Get ("cl_3dcam_adjust", "1", CVAR_ARCHIVE);
1481  //cl_playermodel_default = Cvar_Get ("cl_playermodel_default", DEFAULTSKIN, CVAR_USERINFO);
1482 #endif
1483 
1484  cl_upspeed = Cvar_Get ("cl_upspeed", "200", 0);
1485  cl_forwardspeed = Cvar_Get ("cl_forwardspeed", "200", 0);
1486  cl_sidespeed = Cvar_Get ("cl_sidespeed", "200", 0);
1487  cl_yawspeed = Cvar_Get ("cl_yawspeed", "140", 0);
1488  cl_pitchspeed = Cvar_Get ("cl_pitchspeed", "150", 0);
1489  cl_anglespeedkey = Cvar_Get ("cl_anglespeedkey", "1.5", 0);
1490 
1491  cl_run = Cvar_Get ("cl_run", "0", CVAR_ARCHIVE);
1492  freelook = Cvar_Get( "freelook", "0", CVAR_ARCHIVE );
1493  lookspring = Cvar_Get ("lookspring", "0", CVAR_ARCHIVE);
1494  lookstrafe = Cvar_Get ("lookstrafe", "0", CVAR_ARCHIVE);
1495  sensitivity = Cvar_Get ("sensitivity", "3", CVAR_ARCHIVE);
1496 
1497  m_pitch = Cvar_Get ("m_pitch", "0.022", CVAR_ARCHIVE);
1498  m_yaw = Cvar_Get ("m_yaw", "0.022", 0);
1499  m_forward = Cvar_Get ("m_forward", "1", 0);
1500  m_side = Cvar_Get ("m_side", "1", 0);
1501 
1502  cl_shownet = Cvar_Get ("cl_shownet", "0", 0);
1503  cl_showmiss = Cvar_Get ("cl_showmiss", "0", 0);
1504  cl_showclamp = Cvar_Get ("showclamp", "0", 0);
1505  cl_timeout = Cvar_Get ("cl_timeout", "120", 0);
1506  cl_paused = Cvar_Get ("paused", "0", 0);
1507  cl_timedemo = Cvar_Get ("timedemo", "0", 0);
1508 
1509  rcon_client_password = Cvar_Get ("rcon_password", "", 0);
1510  rcon_address = Cvar_Get ("rcon_address", "", 0);
1511 
1512  cl_lightlevel = Cvar_Get ("r_lightlevel", "0", 0);
1513 
1514  //
1515  // userinfo
1516  //
1517  info_password = Cvar_Get ("password", "", CVAR_USERINFO);
1518  info_spectator = Cvar_Get ("spectator", "0", CVAR_USERINFO);
1519  name = Cvar_Get ("name", "unnamed", CVAR_USERINFO | CVAR_ARCHIVE);
1520  skin = Cvar_Get ("skin", "male/grunt", CVAR_USERINFO | CVAR_ARCHIVE);
1521  rate = Cvar_Get ("rate", "25000", CVAR_USERINFO | CVAR_ARCHIVE); // FIXME
1522  msg = Cvar_Get ("msg", "1", CVAR_USERINFO | CVAR_ARCHIVE);
1523  hand = Cvar_Get ("hand", "0", CVAR_USERINFO | CVAR_ARCHIVE);
1524  fov = Cvar_Get ("fov", "90", CVAR_USERINFO | CVAR_ARCHIVE);
1525  gender = Cvar_Get ("gender", "male", CVAR_USERINFO | CVAR_ARCHIVE);
1526  gender_auto = Cvar_Get ("gender_auto", "1", CVAR_ARCHIVE);
1527  gender->modified = false; // clear this so we know when user sets it manually
1528 
1529  cl_vwep = Cvar_Get ("cl_vwep", "1", CVAR_ARCHIVE);
1530 
1531 
1532  //
1533  // register our commands
1534  //
1536  Cmd_AddCommand ("pause", CL_Pause_f);
1537  Cmd_AddCommand ("pingservers", CL_PingServers_f);
1538  Cmd_AddCommand ("skins", CL_Skins_f);
1539 
1540  Cmd_AddCommand ("userinfo", CL_Userinfo_f);
1541  Cmd_AddCommand ("snd_restart", CL_Snd_Restart_f);
1542 
1543  Cmd_AddCommand ("changing", CL_Changing_f);
1544  Cmd_AddCommand ("disconnect", CL_Disconnect_f);
1545  Cmd_AddCommand ("record", CL_Record_f);
1546  Cmd_AddCommand ("stop", CL_Stop_f);
1547 
1548  Cmd_AddCommand ("quit", CL_Quit_f);
1549 
1550  Cmd_AddCommand ("connect", CL_Connect_f);
1551  Cmd_AddCommand ("reconnect", CL_Reconnect_f);
1552 
1553  Cmd_AddCommand ("rcon", CL_Rcon_f);
1554 
1555 // Cmd_AddCommand ("packet", CL_Packet_f); // this is dangerous to leave in
1556 
1557  Cmd_AddCommand ("setenv", CL_Setenv_f );
1558 
1559  Cmd_AddCommand ("precache", CL_Precache_f);
1560 
1561  Cmd_AddCommand ("download", CL_Download_f);
1562 
1563  //
1564  // forward to server commands
1565  //
1566  // the only thing this does is allow command completion
1567  // to work -- all unknown commands are automatically
1568  // forwarded to the server
1569  Cmd_AddCommand ("wave", NULL);
1570  Cmd_AddCommand ("inven", NULL);
1571  Cmd_AddCommand ("kill", NULL);
1572  Cmd_AddCommand ("use", NULL);
1573  Cmd_AddCommand ("drop", NULL);
1574  Cmd_AddCommand ("say", NULL);
1575  Cmd_AddCommand ("say_team", NULL);
1576  Cmd_AddCommand ("info", NULL);
1577  Cmd_AddCommand ("prog", NULL);
1578  Cmd_AddCommand ("give", NULL);
1579  Cmd_AddCommand ("god", NULL);
1580  Cmd_AddCommand ("notarget", NULL);
1581  Cmd_AddCommand ("noclip", NULL);
1582  Cmd_AddCommand ("invuse", NULL);
1583  Cmd_AddCommand ("invprev", NULL);
1584  Cmd_AddCommand ("invnext", NULL);
1585  Cmd_AddCommand ("invdrop", NULL);
1586  Cmd_AddCommand ("weapnext", NULL);
1587  Cmd_AddCommand ("weapprev", NULL);
1588 }

Referenced by CL_Init().

◆ CL_Packet_f()

void CL_Packet_f ( void  )

Definition at line 695 of file cl_main.c.

696 {
697  char send[2048];
698  int i, l;
699  char *in, *out;
700  netadr_t adr;
701 
702  if (Cmd_Argc() != 3)
703  {
704  Com_Printf ("packet <destination> <contents>\n");
705  return;
706  }
707 
708  NET_Config (true); // allow remote
709 
710  if (!NET_StringToAdr (Cmd_Argv(1), &adr))
711  {
712  Com_Printf ("Bad address\n");
713  return;
714  }
715  if (!adr.port)
716  adr.port = BigShort (PORT_SERVER);
717 
718  in = Cmd_Argv(2);
719  out = send+4;
720  send[0] = send[1] = send[2] = send[3] = (char)0xff;
721 
722  l = strlen (in);
723  for (i=0 ; i<l ; i++)
724  {
725  if (in[i] == '\\' && in[i+1] == 'n')
726  {
727  *out++ = '\n';
728  i++;
729  }
730  else
731  *out++ = in[i];
732  }
733  *out = 0;
734 
735  NET_SendPacket (NS_CLIENT, out-send, send, adr);
736 }

◆ CL_ParseStatusMessage()

void CL_ParseStatusMessage ( void  )

Definition at line 801 of file cl_main.c.

802 {
803  char *s;
804 
806 
807  Com_Printf ("%s\n", s);
809 }

Referenced by CL_ConnectionlessPacket().

◆ CL_Pause_f()

void CL_Pause_f ( void  )

Definition at line 382 of file cl_main.c.

383 {
384  // never pause in multiplayer
385  if (Cvar_VariableValue ("maxclients") > 1 || !Com_ServerState ())
386  {
387  Cvar_SetValue ("paused", 0);
388  return;
389  }
390 
391  Cvar_SetValue ("paused", !cl_paused->value);
392 }

Referenced by CL_InitLocal().

◆ CL_PingServers_f()

void CL_PingServers_f ( void  )

Definition at line 817 of file cl_main.c.

818 {
819  int i;
820  netadr_t adr;
821  char name[32];
822  char *adrstring;
823  cvar_t *noudp;
824  cvar_t *noipx;
825 
826  NET_Config (true); // allow remote
827 
828  // send a broadcast packet
829  Com_Printf ("pinging broadcast...\n");
830 
831  noudp = Cvar_Get ("noudp", "0", CVAR_NOSET);
832  if (!noudp->value)
833  {
834  adr.type = NA_BROADCAST;
835  adr.port = BigShort(PORT_SERVER);
837 #ifdef HAVE_IPV6
838  Com_Printf ("pinging multicast...\n");
839  adr.type = NA_MULTICAST6;
840  adr.port = BigShort(PORT_SERVER);
842 #endif
843  }
844 
845  noipx = Cvar_Get ("noipx", "0", CVAR_NOSET);
846  if (!noipx->value)
847  {
848  adr.type = NA_BROADCAST_IPX;
849  adr.port = BigShort(PORT_SERVER);
851  }
852 
853  // send a packet to each address book entry
854  for (i=0 ; i<16 ; i++)
855  {
856  Com_sprintf (name, sizeof(name), "adr%i", i);
857  adrstring = Cvar_VariableString (name);
858  if (!adrstring || !adrstring[0])
859  continue;
860 
861  Com_Printf ("pinging %s...\n", adrstring);
862  if (!NET_StringToAdr (adrstring, &adr))
863  {
864  Com_Printf ("Bad address: %s\n", adrstring);
865  continue;
866  }
867  if (!adr.port)
868  adr.port = BigShort(PORT_SERVER);
870  }
871 }

Referenced by CL_InitLocal(), and SearchLocalGames().

◆ CL_Precache_f()

void CL_Precache_f ( void  )

Definition at line 1403 of file cl_main.c.

1404 {
1405  //Yet another hack to let old demos work
1406  //the old precache sequence
1407  if (Cmd_Argc() < 2) {
1408  unsigned map_checksum; // for detecting cheater maps
1409 
1410  CM_LoadMap (cl.configstrings[CS_MODELS+1], true, &map_checksum);
1411  CL_RegisterSounds ();
1412  CL_PrepRefresh ();
1413  return;
1414  }
1415 
1417  precache_spawncount = atoi(Cmd_Argv(1));
1418  precache_model = 0;
1419  precache_model_skin = 0;
1420 
1422 }

Referenced by CL_InitLocal().

◆ CL_Quit_f()

void CL_Quit_f ( void  )

Definition at line 399 of file cl_main.c.

400 {
401  CL_Disconnect ();
402  Com_Quit ();
403 }

Referenced by CL_InitLocal(), and M_Quit_Key().

◆ CL_Rcon_f()

void CL_Rcon_f ( void  )

Definition at line 550 of file cl_main.c.

551 {
552  char message[1024];
553  int i;
554  netadr_t to;
555 
557  {
558  Com_Printf ("You must set 'rcon_password' before\n"
559  "issuing an rcon command.\n");
560  return;
561  }
562 
563  memset(&to, 0, sizeof(to));
564  message[0] = (char)255;
565  message[1] = (char)255;
566  message[2] = (char)255;
567  message[3] = (char)255;
568  message[4] = 0;
569 
570  NET_Config (true); // allow remote
571 
572  strcat (message, "rcon ");
573 
574  strcat (message, rcon_client_password->string);
575  strcat (message, " ");
576 
577  for (i=1 ; i<Cmd_Argc() ; i++)
578  {
579  strcat (message, Cmd_Argv(i));
580  strcat (message, " ");
581  }
582 
583  if (cls.state >= ca_connected)
585  else
586  {
587  if (!strlen(rcon_address->string))
588  {
589  Com_Printf ("You must either be connected,\n"
590  "or set the 'rcon_address' cvar\n"
591  "to issue rcon commands\n");
592 
593  return;
594  }
596  if (to.port == 0)
597  to.port = BigShort (PORT_SERVER);
598  }
599 
600  NET_SendPacket (NS_CLIENT, strlen(message)+1, message, to);
601 }

Referenced by CL_InitLocal().

◆ CL_ReadPackets()

void CL_ReadPackets ( void  )

Definition at line 1011 of file cl_main.c.

1012 {
1014  {
1015 // Com_Printf ("packet\n");
1016  //
1017  // remote command packet
1018  //
1019  if (*(int *)net_message.data == -1)
1020  {
1022  continue;
1023  }
1024 
1026  continue; // dump it if not connected
1027 
1028  if (net_message.cursize < 8)
1029  {
1030  Com_Printf ("%s: Runt packet\n",NET_AdrToString(net_from));
1031  continue;
1032  }
1033 
1034  //
1035  // packet from server
1036  //
1038  {
1039  Com_DPrintf ("%s:sequenced packet without connection\n"
1041  continue;
1042  }
1044  continue; // wasn't accepted for some reason
1046  }
1047 
1048  //
1049  // check timeout
1050  //
1051  if (cls.state >= ca_connected
1053  {
1054  if (++cl.timeoutcount > 5) // timeoutcount saves debugger
1055  {
1056  Com_Printf ("\nServer connection timed out.\n");
1057  CL_Disconnect ();
1058  return;
1059  }
1060  }
1061  else
1062  cl.timeoutcount = 0;
1063 
1064 }

Referenced by CL_Frame().

◆ CL_Reconnect_f()

void CL_Reconnect_f ( void  )

Definition at line 766 of file cl_main.c.

767 {
768  //ZOID
769  //if we are downloading, we don't change! This so we don't suddenly stop downloading a map
770  if (cls.download)
771  return;
772 
773  S_StopAllSounds ();
774  if (cls.state == ca_connected) {
775  Com_Printf ("reconnecting...\n");
778  MSG_WriteString (&cls.netchan.message, "new");
779  return;
780  }
781 
782  if (*cls.servername) {
783  if (cls.state >= ca_connected) {
784  CL_Disconnect();
785  cls.connect_time = cls.realtime - 1500;
786  } else
787  cls.connect_time = -99999; // fire immediately
788 
790  Com_Printf ("reconnecting...\n");
791  }
792 }

Referenced by CL_InitLocal().

◆ CL_Record_f()

void CL_Record_f ( void  )

Definition at line 175 of file cl_main.c.

176 {
177  char name[MAX_OSPATH];
178  byte buf_data[MAX_MSGLEN];
179  sizebuf_t buf;
180  int i;
181  int len;
182  entity_state_t *ent;
183  entity_state_t nullstate;
184 
185  if (Cmd_Argc() != 2)
186  {
187  Com_Printf ("record <demoname>\n");
188  return;
189  }
190 
191  if (cls.demorecording)
192  {
193  Com_Printf ("Already recording.\n");
194  return;
195  }
196 
197  if (cls.state != ca_active)
198  {
199  Com_Printf ("You must be in a level to record.\n");
200  return;
201  }
202 
203  //
204  // open the demo file
205  //
206  Com_sprintf (name, sizeof(name), "%s/demos/%s.dm2", FS_Gamedir(), Cmd_Argv(1));
207 
208  Com_Printf ("recording to %s.\n", name);
210  cls.demofile = fopen (name, "wb");
211  if (!cls.demofile)
212  {
213  Com_Printf ("ERROR: couldn't open.\n");
214  return;
215  }
216  cls.demorecording = true;
217 
218  // don't start saving messages until a non-delta compressed message is received
219  cls.demowaiting = true;
220 
221  //
222  // write out messages to hold the startup information
223  //
224  SZ_Init (&buf, buf_data, sizeof(buf_data));
225 
226  // send the serverdata
229  MSG_WriteLong (&buf, 0x10000 + cl.servercount);
230  MSG_WriteByte (&buf, 1); // demos are always attract loops
231  MSG_WriteString (&buf, cl.gamedir);
232  MSG_WriteShort (&buf, cl.playernum);
233 
235 
236  // configstrings
237  for (i=0 ; i<MAX_CONFIGSTRINGS ; i++)
238  {
239  if (cl.configstrings[i][0])
240  {
241  if (buf.cursize + strlen (cl.configstrings[i]) + 32 > buf.maxsize)
242  { // write it out
243  len = LittleLong (buf.cursize);
244  fwrite (&len, 4, 1, cls.demofile);
245  fwrite (buf.data, buf.cursize, 1, cls.demofile);
246  buf.cursize = 0;
247  }
248 
250  MSG_WriteShort (&buf, i);
252  }
253 
254  }
255 
256  // baselines
257  memset (&nullstate, 0, sizeof(nullstate));
258  for (i=0; i<MAX_EDICTS ; i++)
259  {
260  ent = &cl_entities[i].baseline;
261  if (!ent->modelindex)
262  continue;
263 
264  if (buf.cursize + 64 > buf.maxsize)
265  { // write it out
266  len = LittleLong (buf.cursize);
267  fwrite (&len, 4, 1, cls.demofile);
268  fwrite (buf.data, buf.cursize, 1, cls.demofile);
269  buf.cursize = 0;
270  }
271 
273  MSG_WriteDeltaEntity (&nullstate, &cl_entities[i].baseline, &buf, true, true);
274  }
275 
277  MSG_WriteString (&buf, "precache\n");
278 
279  // write it to the demo file
280 
281  len = LittleLong (buf.cursize);
282  fwrite (&len, 4, 1, cls.demofile);
283  fwrite (buf.data, buf.cursize, 1, cls.demofile);
284 
285  // the rest of the demo file will be individual frames
286 }

Referenced by CL_InitLocal().

◆ CL_RequestNextDownload()

void CL_RequestNextDownload ( void  )

Definition at line 1141 of file cl_main.c.

1142 {
1143  unsigned map_checksum; // for detecting cheater maps
1144  char fn[MAX_OSPATH];
1145  dmdl_t *pheader;
1146 
1147  if (cls.state != ca_connected)
1148  return;
1149 
1152 
1153 //ZOID
1154  if (precache_check == CS_MODELS) { // confirm map
1155  precache_check = CS_MODELS+2; // 0 isn't used
1158  return; // started a download
1159  }
1162  while (precache_check < CS_MODELS+MAX_MODELS &&
1164  if (cl.configstrings[precache_check][0] == '*' ||
1165  cl.configstrings[precache_check][0] == '#') {
1166  precache_check++;
1167  continue;
1168  }
1169  if (precache_model_skin == 0) {
1171  precache_model_skin = 1;
1172  return; // started a download
1173  }
1174  precache_model_skin = 1;
1175  }
1176 
1177  // checking for skins in the model
1178  if (!precache_model) {
1179 
1181  if (!precache_model) {
1182  precache_model_skin = 0;
1183  precache_check++;
1184  continue; // couldn't load it
1185  }
1186  if (LittleLong(*(unsigned *)precache_model) != IDALIASHEADER) {
1187  // not an alias model
1189  precache_model = 0;
1190  precache_model_skin = 0;
1191  precache_check++;
1192  continue;
1193  }
1194  pheader = (dmdl_t *)precache_model;
1195  if (LittleLong (pheader->version) != ALIAS_VERSION) {
1196  precache_check++;
1197  precache_model_skin = 0;
1198  continue; // couldn't load it
1199  }
1200  }
1201 
1202  pheader = (dmdl_t *)precache_model;
1203 
1204  while (precache_model_skin - 1 < LittleLong(pheader->num_skins)) {
1205  if (!CL_CheckOrDownloadFile((char *)precache_model +
1206  LittleLong(pheader->ofs_skins) +
1209  return; // started a download
1210  }
1212  }
1213  if (precache_model) {
1215  precache_model = 0;
1216  }
1217  precache_model_skin = 0;
1218  precache_check++;
1219  }
1220  }
1222  }
1225  if (precache_check == CS_SOUNDS)
1226  precache_check++; // zero is blank
1227  while (precache_check < CS_SOUNDS+MAX_SOUNDS &&
1229  if (cl.configstrings[precache_check][0] == '*') {
1230  precache_check++;
1231  continue;
1232  }
1233  Com_sprintf(fn, sizeof(fn), "sound/%s", cl.configstrings[precache_check++]);
1234  if (!CL_CheckOrDownloadFile(fn))
1235  return; // started a download
1236  }
1237  }
1239  }
1241  if (precache_check == CS_IMAGES)
1242  precache_check++; // zero is blank
1243  while (precache_check < CS_IMAGES+MAX_IMAGES &&
1245  Com_sprintf(fn, sizeof(fn), "pics/%s.pcx", cl.configstrings[precache_check++]);
1246  if (!CL_CheckOrDownloadFile(fn))
1247  return; // started a download
1248  }
1250  }
1251  // skins are special, since a player has three things to download:
1252  // model, weapon model and skin
1253  // so precache_check is now *3
1257  int i, n;
1258  char model[MAX_QPATH], skin[MAX_QPATH], *p;
1259 
1262 
1263  if (!cl.configstrings[CS_PLAYERSKINS+i][0]) {
1265  continue;
1266  }
1267 
1268  if ((p = strchr(cl.configstrings[CS_PLAYERSKINS+i], '\\')) != NULL)
1269  p++;
1270  else
1272  strcpy(model, p);
1273  p = strchr(model, '/');
1274  if (!p)
1275  p = strchr(model, '\\');
1276  if (p) {
1277  *p++ = 0;
1278  strcpy(skin, p);
1279  } else
1280  *skin = 0;
1281 
1282  switch (n) {
1283  case 0: // model
1284  Com_sprintf(fn, sizeof(fn), "players/%s/tris.md2", model);
1285  if (!CL_CheckOrDownloadFile(fn)) {
1287  return; // started a download
1288  }
1289  n++;
1290  /*FALL THROUGH*/
1291 
1292  case 1: // weapon model
1293  Com_sprintf(fn, sizeof(fn), "players/%s/weapon.md2", model);
1294  if (!CL_CheckOrDownloadFile(fn)) {
1296  return; // started a download
1297  }
1298  n++;
1299  /*FALL THROUGH*/
1300 
1301  case 2: // weapon skin
1302  Com_sprintf(fn, sizeof(fn), "players/%s/weapon.pcx", model);
1303  if (!CL_CheckOrDownloadFile(fn)) {
1305  return; // started a download
1306  }
1307  n++;
1308  /*FALL THROUGH*/
1309 
1310  case 3: // skin
1311  Com_sprintf(fn, sizeof(fn), "players/%s/%s.pcx", model, skin);
1312  if (!CL_CheckOrDownloadFile(fn)) {
1314  return; // started a download
1315  }
1316  n++;
1317  /*FALL THROUGH*/
1318 
1319  case 4: // skin_i
1320  Com_sprintf(fn, sizeof(fn), "players/%s/%s_i.pcx", model, skin);
1321  if (!CL_CheckOrDownloadFile(fn)) {
1323  return; // started a download
1324  }
1325  // move on to next model
1327  }
1328  }
1329  }
1330  // precache phase completed
1332  }
1333 
1334  if (precache_check == ENV_CNT) {
1335  precache_check = ENV_CNT + 1;
1336 
1337  CM_LoadMap (cl.configstrings[CS_MODELS+1], true, &map_checksum);
1338 
1339  if (map_checksum != atoi(cl.configstrings[CS_MAPCHECKSUM])) {
1340  Com_Error (ERR_DROP, "Local map version differs from server: %i != '%s'\n",
1341  map_checksum, cl.configstrings[CS_MAPCHECKSUM]);
1342  return;
1343  }
1344  }
1345 
1348  while (precache_check < TEXTURE_CNT) {
1349  int n = precache_check++ - ENV_CNT - 1;
1350 
1351  if (n & 1)
1352  Com_sprintf(fn, sizeof(fn), "env/%s%s.pcx",
1353  cl.configstrings[CS_SKY], env_suf[n/2]);
1354  else
1355  Com_sprintf(fn, sizeof(fn), "env/%s%s.tga",
1356  cl.configstrings[CS_SKY], env_suf[n/2]);
1357  if (!CL_CheckOrDownloadFile(fn))
1358  return; // started a download
1359  }
1360  }
1362  }
1363 
1364  if (precache_check == TEXTURE_CNT) {
1366  precache_tex = 0;
1367  }
1368 
1369  // confirm existance of textures, download any that don't exist
1370  if (precache_check == TEXTURE_CNT+1) {
1371  // from qcommon/cmodel.c
1372  extern int numtexinfo;
1373  extern mapsurface_t map_surfaces[];
1374 
1376  while (precache_tex < numtexinfo) {
1377  char fn[MAX_OSPATH];
1378 
1379  sprintf(fn, "textures/%s.wal", map_surfaces[precache_tex++].rname);
1380  if (!CL_CheckOrDownloadFile(fn))
1381  return; // started a download
1382  }
1383  }
1385  }
1386 
1387 //ZOID
1388  CL_RegisterSounds ();
1389  CL_PrepRefresh ();
1390 
1393 }

Referenced by CL_ParseDownload(), and CL_Precache_f().

◆ CL_SendCommand()

void CL_SendCommand ( void  )

Definition at line 1692 of file cl_main.c.

1693 {
1694  // get new key events
1695  Sys_SendKeyEvents ();
1696 
1697  // allow mice or other external controllers to add commands
1698  IN_Commands ();
1699 
1700  // process console commands
1701  Cbuf_Execute ();
1702 
1703  // fix any cheating cvars
1704  CL_FixCvarCheats ();
1705 
1706  // send intentions now
1707  CL_SendCmd ();
1708 
1709  // resend a connection request if necessary
1710  CL_CheckForResend ();
1711 }

Referenced by CL_Frame().

◆ CL_SendConnectPacket()

void CL_SendConnectPacket ( void  )

Definition at line 435 of file cl_main.c.

436 {
437  netadr_t adr;
438  int port;
439 
440  memset(&adr, 0, sizeof(adr));
441 
442  if (!NET_StringToAdr (cls.servername, &adr))
443  {
444  Com_Printf ("Bad server address\n");
445  cls.connect_time = 0;
446  return;
447  }
448  if (adr.port == 0)
449  adr.port = BigShort (PORT_SERVER);
450 
451  port = Cvar_VariableValue ("qport");
452  userinfo_modified = false;
453 
454  Netchan_OutOfBandPrint (NS_CLIENT, adr, "connect %i %i %i \"%s\"\n",
456 }

Referenced by CL_CheckForResend(), and CL_ConnectionlessPacket().

◆ CL_Setenv_f()

void CL_Setenv_f ( void  )

Definition at line 319 of file cl_main.c.

320 {
321  int argc = Cmd_Argc();
322 
323  if ( argc > 2 )
324  {
325  char buffer[1000];
326  int i;
327 
328  strcpy( buffer, Cmd_Argv(1) );
329  strcat( buffer, "=" );
330 
331  for ( i = 2; i < argc; i++ )
332  {
333  strcat( buffer, Cmd_Argv( i ) );
334  strcat( buffer, " " );
335  }
336 
337  putenv( buffer );
338  }
339  else if ( argc == 2 )
340  {
341  char *env = getenv( Cmd_Argv(1) );
342 
343  if ( env )
344  {
345  Com_Printf( "%s=%s\n", Cmd_Argv(1), env );
346  }
347  else
348  {
349  Com_Printf( "%s undefined\n", Cmd_Argv(1), env );
350  }
351  }
352 }

Referenced by CL_InitLocal().

◆ CL_Shutdown()

void CL_Shutdown ( void  )

Definition at line 1868 of file cl_main.c.

1869 {
1870  static qboolean isdown = false;
1871 
1872  if (isdown)
1873  {
1874  printf ("recursive shutdown\n");
1875  return;
1876  }
1877  isdown = true;
1878 
1880 
1881  CDAudio_Shutdown ();
1882  S_Shutdown();
1883  IN_Shutdown ();
1884  VID_Shutdown();
1885 }

Referenced by Com_Error(), Com_Quit(), Sys_Error(), and Sys_Quit().

◆ CL_Skins_f()

void CL_Skins_f ( void  )

Definition at line 881 of file cl_main.c.

882 {
883  int i;
884 
885  for (i=0 ; i<MAX_CLIENTS ; i++)
886  {
887  if (!cl.configstrings[CS_PLAYERSKINS+i][0])
888  continue;
889  Com_Printf ("client %i: %s\n", i, cl.configstrings[CS_PLAYERSKINS+i]);
890  SCR_UpdateScreen ();
891  Sys_SendKeyEvents (); // pump message loop
893  }
894 }

Referenced by CL_InitLocal().

◆ CL_Snd_Restart_f()

void CL_Snd_Restart_f ( void  )

Definition at line 1119 of file cl_main.c.

1120 {
1121  S_Shutdown ();
1122  S_Init ();
1123  CL_RegisterSounds ();
1124 }

Referenced by CL_InitLocal(), SCR_PlayCinematic(), SCR_StopCinematic(), and UpdateSoundQualityFunc().

◆ CL_Stop_f()

void CL_Stop_f ( void  )

Definition at line 147 of file cl_main.c.

148 {
149  int len;
150 
151  if (!cls.demorecording)
152  {
153  Com_Printf ("Not recording a demo.\n");
154  return;
155  }
156 
157 // finish up
158  len = -1;
159  fwrite (&len, 4, 1, cls.demofile);
160  fclose (cls.demofile);
161  cls.demofile = NULL;
162  cls.demorecording = false;
163  Com_Printf ("Stopped demo.\n");
164 }

Referenced by CL_Disconnect(), and CL_InitLocal().

◆ CL_Userinfo_f()

void CL_Userinfo_f ( void  )

Definition at line 1105 of file cl_main.c.

1106 {
1107  Com_Printf ("User info settings:\n");
1109 }

Referenced by CL_InitLocal().

◆ CL_WriteConfiguration()

void CL_WriteConfiguration ( void  )

Definition at line 1599 of file cl_main.c.

1600 {
1601  FILE *f;
1602  char path[MAX_QPATH];
1603 
1604  if (cls.state == ca_uninitialized)
1605  return;
1606 
1607  Com_sprintf (path, sizeof(path),"%s/config.cfg",FS_Gamedir());
1608  f = fopen (path, "w");
1609  if (!f)
1610  {
1611  Com_Printf ("Couldn't write config.cfg.\n");
1612  return;
1613  }
1614 
1615  fprintf (f, "// generated by quake, do not modify\n");
1616  Key_WriteBindings (f);
1617  fclose (f);
1618 
1619  Cvar_WriteVariables (path);
1620 }

Referenced by CL_Shutdown().

◆ CL_WriteDemoMessage()

void CL_WriteDemoMessage ( void  )

Definition at line 128 of file cl_main.c.

129 {
130  int len, swlen;
131 
132  // the first eight bytes are just packet sequencing stuff
133  len = net_message.cursize-8;
134  swlen = LittleLong(len);
135  fwrite (&swlen, 4, 1, cls.demofile);
136  fwrite (net_message.data+8, len, 1, cls.demofile);
137 }

Referenced by CL_ParseServerMessage().

◆ Cmd_ForwardToServer()

void Cmd_ForwardToServer ( void  )

Definition at line 299 of file cl_main.c.

300 {
301  char *cmd;
302 
303  cmd = Cmd_Argv(0);
304  if (cls.state <= ca_connected || *cmd == '-' || *cmd == '+')
305  {
306  Com_Printf ("Unknown command \"%s\"\n", cmd);
307  return;
308  }
309 
311  SZ_Print (&cls.netchan.message, cmd);
312  if (Cmd_Argc() > 1)
313  {
314  SZ_Print (&cls.netchan.message, " ");
316  }
317 }

Referenced by Cmd_ExecuteString().

Variable Documentation

◆ adr0

cvar_t* adr0

Definition at line 26 of file cl_main.c.

Referenced by CL_InitLocal().

◆ adr1

cvar_t* adr1

Definition at line 27 of file cl_main.c.

Referenced by CL_InitLocal().

◆ adr2

cvar_t* adr2

Definition at line 28 of file cl_main.c.

Referenced by CL_InitLocal().

◆ adr3

cvar_t* adr3

Definition at line 29 of file cl_main.c.

Referenced by CL_InitLocal().

◆ adr4

cvar_t* adr4

Definition at line 30 of file cl_main.c.

Referenced by CL_InitLocal().

◆ adr5

cvar_t* adr5

Definition at line 31 of file cl_main.c.

Referenced by CL_InitLocal().

◆ adr6

cvar_t* adr6

Definition at line 32 of file cl_main.c.

Referenced by CL_InitLocal().

◆ adr7

cvar_t* adr7

Definition at line 33 of file cl_main.c.

Referenced by CL_InitLocal().

◆ adr8

cvar_t* adr8

Definition at line 34 of file cl_main.c.

Referenced by CL_InitLocal().

◆ allow_download

cvar_t* allow_download

Definition at line 37 of file sv_main.c.

Referenced by CL_RequestNextDownload(), SV_BeginDownload_f(), and SV_Init().

◆ allow_download_maps

cvar_t* allow_download_maps

Definition at line 41 of file sv_main.c.

Referenced by CL_RequestNextDownload(), SV_BeginDownload_f(), and SV_Init().

◆ allow_download_models

cvar_t* allow_download_models

Definition at line 39 of file sv_main.c.

Referenced by CL_RequestNextDownload(), SV_BeginDownload_f(), and SV_Init().

◆ allow_download_players

cvar_t* allow_download_players

Definition at line 38 of file sv_main.c.

Referenced by CL_RequestNextDownload(), SV_BeginDownload_f(), and SV_Init().

◆ allow_download_sounds

cvar_t* allow_download_sounds

Definition at line 40 of file sv_main.c.

Referenced by CL_RequestNextDownload(), SV_BeginDownload_f(), and SV_Init().

◆ cheatvars

cheatvar_t cheatvars[]
Initial value:
= {
{"timescale", "1"},
{"timedemo", "0"},
{"r_drawworld", "1"},
{"cl_testlights", "0"},
{"r_fullbright", "0"},
{"r_drawflat", "0"},
{"paused", "0"},
{"fixedtime", "0"},
{"sw_draworder", "0"},
{"gl_lightmap", "0"},
{"gl_saturatelighting", "0"},
}

Definition at line 1637 of file cl_main.c.

Referenced by CL_FixCvarCheats().

◆ cl

Definition at line 106 of file cl_main.c.

Referenced by CheckDMRules(), CL_AddBeams(), CL_AddEntities(), CL_AddExplosions(), CL_AddLasers(), CL_AddNetgraph(), CL_AddPacketEntities(), CL_AddParticles(), CL_AddPlayerBeams(), CL_AddViewWeapon(), CL_AdjustAngles(), CL_AllocDlight(), CL_AllocExplosion(), CL_AllocFreeDlight(), CL_BaseMove(), CL_BFGExplosionParticles(), CL_BfgParticles(), CL_BigTeleportParticles(), CL_BlasterParticles(), CL_BlasterParticles2(), CL_BlasterTrail(), CL_BlasterTrail2(), CL_BubbleTrail(), CL_BubbleTrail2(), CL_CalcViewValues(), CL_CheckPredictionError(), CL_ClampPitch(), CL_ClearState(), CL_ClipMoveToEntities(), CL_ColorExplosionParticles(), CL_ColorFlash(), CL_DebugTrail(), CL_DeltaEntity(), CL_DiminishingTrail(), CL_Disconnect(), CL_DrawInventory(), CL_ExplosionParticles(), CL_FinishMove(), CL_FixCvarCheats(), CL_FlagTrail(), CL_FlameEffects(), CL_Flashlight(), CL_FlyEffect(), CL_FlyParticles(), CL_ForceWall(), CL_Frame(), CL_GenericParticleEffect(), CL_Heatbeam(), CL_IonripperTrail(), CL_ItemRespawnParticles(), CL_LightningBeam(), CL_LightningFlare(), CL_LogoutEffect(), CL_MonsterPlasma_Shell(), CL_NewDlight(), CL_Nukeblast(), CL_ParseBeam(), CL_ParseBeam2(), CL_ParseClientinfo(), CL_ParseConfigString(), CL_ParseFrame(), CL_ParseInventory(), CL_ParseLaser(), CL_ParseLightning(), CL_ParseMuzzleFlash(), CL_ParseMuzzleFlash2(), CL_ParseNuke(), CL_ParsePacketEntities(), CL_ParsePlayerBeam(), CL_ParsePlayerstate(), CL_ParseServerData(), CL_ParseServerMessage(), CL_ParseStartSoundPacket(), CL_ParseSteam(), CL_ParseTEnt(), CL_ParseWidow(), CL_ParticleEffect(), CL_ParticleEffect2(), CL_ParticleEffect3(), CL_ParticleSmokeEffect(), CL_ParticleSteamEffect(), CL_ParticleSteamEffect2(), CL_PMpointcontents(), CL_Precache_f(), CL_PredictMovement(), CL_PrepRefresh(), CL_ProcessSustain(), CL_QuadTrail(), CL_RailTrail(), CL_ReadPackets(), CL_Record_f(), CL_RegisterSounds(), CL_RequestNextDownload(), CL_RocketTrail(), CL_RunDLights(), CL_RunLightStyles(), CL_SendCmd(), CL_SetLightstyle(), CL_Skins_f(), CL_SmokeAndFlash(), CL_SmokeTrail(), CL_TagTrail(), CL_TeleporterParticles(), CL_TeleportParticles(), CL_Tracker_Explode(), CL_Tracker_Shell(), CL_TrackerTrail(), CL_TrapParticles(), CL_Widowbeamout(), CL_WidowSplash(), Cmd_Inven_f(), Cmd_Say_f(), Cmd_WeapLast_f(), Cmd_WeapNext_f(), Cmd_WeapPrev_f(), Con_ToggleConsole_f(), ConsoleFunc(), DeathmatchScoreboardMessage(), G_CheckChaseStats(), G_SetSpectatorStats(), Huff1TableInit(), IN_CenterView(), IN_Frame(), IN_JoyMove(), IN_MouseMove(), Key_Event(), M_Draw(), pLensFlareThink(), pWeatherFXThink(), Qcommon_Frame(), S_AddLoopSounds(), S_PickChannel(), S_Play(), S_RegisterSexedModel(), S_RegisterSexedSound(), S_Spatialize(), S_StartLocalSound(), S_StartSound(), SCR_BeginLoadingPlaque(), SCR_CenterPrint(), SCR_DrawCinematic(), SCR_DrawConsole(), SCR_DrawCrosshair(), SCR_DrawLayout(), SCR_DrawStats(), SCR_ExecuteLayoutString(), SCR_FinishCinematic(), SCR_PlayCinematic(), SCR_ReadNextFrame(), SCR_RunCinematic(), SCR_StopCinematic(), SCR_TileClear(), SCR_TimeRefresh_f(), SCR_UpdateScreen(), SelectNextItem(), SelectPrevItem(), setupParticle(), StartGame(), SV_BroadcastPrintf(), SV_CalcPings(), SV_CheckTimeouts(), SV_ClientPrintf(), SV_ClientThink(), SV_ExecuteClientMessage(), SV_FinalMessage(), SV_GameMap_f(), SV_GiveMsec(), SV_ReadPackets(), SV_SetPlayer(), SV_Status_f(), SV_StatusString(), SV_UserinfoChanged(), SVC_DirectConnect(), UpdateCDVolumeFunc(), V_RenderView(), V_TestEntities(), V_TestLights(), V_TestParticles(), V_Viewpos_f(), ValidateSelectedItem(), VID_CheckChanges(), and VID_NewWindow().

◆ cl_add_blend

cvar_t* cl_add_blend

Definition at line 69 of file cl_main.c.

Referenced by CL_InitLocal(), and V_RenderView().

◆ cl_add_entities

cvar_t* cl_add_entities

Definition at line 68 of file cl_main.c.

Referenced by CL_InitLocal(), and V_RenderView().

◆ cl_add_lights

cvar_t* cl_add_lights

Definition at line 67 of file cl_main.c.

Referenced by CL_InitLocal(), and V_RenderView().

◆ cl_add_particles

cvar_t* cl_add_particles

Definition at line 66 of file cl_main.c.

Referenced by CL_InitLocal(), and V_RenderView().

◆ cl_autoskins

cvar_t* cl_autoskins

Definition at line 43 of file cl_main.c.

Referenced by CL_InitLocal().

◆ cl_drawfps

cvar_t* cl_drawfps

Definition at line 49 of file cl_main.c.

Referenced by CL_InitLocal(), and SCR_UpdateScreen().

◆ cl_entities

◆ cl_footsteps

cvar_t* cl_footsteps

Definition at line 44 of file cl_main.c.

Referenced by CL_EntityEvent(), and CL_InitLocal().

◆ cl_gun

cvar_t* cl_gun

Definition at line 50 of file cl_main.c.

Referenced by CL_AddViewWeapon(), and CL_InitLocal().

◆ cl_lightlevel

cvar_t* cl_lightlevel

Definition at line 87 of file cl_main.c.

Referenced by CL_FinishMove(), and CL_InitLocal().

◆ cl_maxfps

cvar_t* cl_maxfps

Definition at line 48 of file cl_main.c.

Referenced by CL_InitLocal().

◆ cl_noskins

cvar_t* cl_noskins

Definition at line 42 of file cl_main.c.

Referenced by CL_InitLocal(), and CL_LoadClientinfo().

◆ cl_parse_entities

◆ cl_paused

cvar_t* cl_paused

◆ cl_predict

cvar_t* cl_predict

◆ cl_showclamp

cvar_t* cl_showclamp

Definition at line 73 of file cl_main.c.

Referenced by CL_AddEntities(), and CL_InitLocal().

◆ cl_showmiss

cvar_t* cl_showmiss

Definition at line 72 of file cl_main.c.

Referenced by CL_CheckPredictionError(), CL_InitLocal(), and CL_PredictMovement().

◆ cl_shownet

cvar_t* cl_shownet

◆ cl_stereo

cvar_t* cl_stereo

Definition at line 37 of file cl_main.c.

Referenced by CL_InitLocal(), and SCR_UpdateScreen().

◆ cl_stereo_separation

cvar_t* cl_stereo_separation

Definition at line 36 of file cl_main.c.

Referenced by CL_InitLocal(), and SCR_UpdateScreen().

◆ cl_timedemo

cvar_t* cl_timedemo

Definition at line 76 of file cl_main.c.

Referenced by CL_AddEntities(), CL_Disconnect(), CL_Frame(), CL_InitLocal(), and V_RenderView().

◆ cl_timeout

cvar_t* cl_timeout

Definition at line 45 of file cl_main.c.

Referenced by CL_InitLocal(), and CL_ReadPackets().

◆ cl_vwep

cvar_t* cl_vwep

Definition at line 103 of file cl_main.c.

Referenced by CL_AddPacketEntities(), CL_InitLocal(), and CL_LoadClientinfo().

◆ cls

Definition at line 105 of file cl_main.c.

Referenced by CL_AddEntities(), CL_AddNetgraph(), CL_AdjustAngles(), CL_CalcViewValues(), CL_Changing_f(), CL_CheckForResend(), CL_CheckOrDownloadFile(), CL_CheckPredictionError(), CL_ClearState(), CL_Connect_f(), CL_ConnectionlessPacket(), CL_Disconnect(), CL_Download_f(), CL_DrawInventory(), CL_Drop(), CL_FinishMove(), CL_ForwardToServer_f(), CL_Frame(), CL_Init(), CL_InitLocal(), CL_ParseDownload(), CL_ParseFrame(), CL_ParseServerData(), CL_ParseServerMessage(), CL_PredictMovement(), CL_Rcon_f(), CL_ReadPackets(), CL_Reconnect_f(), CL_Record_f(), CL_RequestNextDownload(), CL_RunDLights(), CL_SendCmd(), CL_SendConnectPacket(), CL_Stop_f(), CL_WriteConfiguration(), CL_WriteDemoMessage(), Cmd_ForwardToServer(), Con_DrawConsole(), Con_DrawInput(), Con_DrawNotify(), Con_MessageMode2_f(), Con_MessageMode_f(), Con_Print(), Con_ToggleChat_f(), Con_ToggleConsole_f(), ConsoleFunc(), IN_Frame(), IN_JoyMove(), Key_Console(), Key_Event(), Key_Message(), M_Credits_MenuDraw(), M_Draw(), M_ForceMenuOff(), M_Main_Draw(), M_Menu_Credits_f(), M_PushMenu(), M_Quit_Key(), PlayerConfig_MenuDraw(), S_AddLoopSounds(), S_SpatializeOrigin(), S_Update(), SCR_BeginLoadingPlaque(), SCR_CheckDrawCenterString(), SCR_DrawCinematic(), SCR_DrawConsole(), SCR_DrawNet(), SCR_EndLoadingPlaque(), SCR_ExecuteLayoutString(), SCR_FinishCinematic(), SCR_PlayCinematic(), SCR_RunCinematic(), SCR_RunConsole(), SCR_TimeRefresh_f(), SCR_UpdateScreen(), StartGame(), V_RenderView(), and VID_CheckChanges().

◆ env_suf

const char* env_suf[6] = {"rt", "bk", "lf", "ft", "up", "dn"}
static

Definition at line 1139 of file cl_main.c.

Referenced by CL_RequestNextDownload().

◆ fov

cvar_t* fov

Definition at line 97 of file cl_main.c.

Referenced by CL_InitLocal().

◆ freelook

cvar_t* freelook

Definition at line 24 of file cl_main.c.

Referenced by CL_InitLocal(), ControlsSetMenuItemValues(), IN_MLookUp(), and IN_MouseMove().

◆ gender

cvar_t* gender

Definition at line 100 of file cl_main.c.

Referenced by CL_FixUpGender(), and CL_InitLocal().

◆ gender_auto

cvar_t* gender_auto

Definition at line 101 of file cl_main.c.

Referenced by CL_FixUpGender(), and CL_InitLocal().

◆ hand

cvar_t* hand

Definition at line 99 of file cl_main.c.

Referenced by CL_AddPlayerBeams(), CL_InitLocal(), and PlayerConfig_MenuInit().

◆ info_password

cvar_t* info_password

Definition at line 92 of file cl_main.c.

Referenced by CL_InitLocal().

◆ info_spectator

cvar_t* info_spectator

Definition at line 93 of file cl_main.c.

Referenced by CL_InitLocal().

◆ lookspring

cvar_t* lookspring

Definition at line 78 of file cl_main.c.

Referenced by CL_InitLocal(), ControlsSetMenuItemValues(), IN_MLookUp(), and LookspringFunc().

◆ lookstrafe

cvar_t* lookstrafe

◆ m_forward

cvar_t* m_forward

Definition at line 84 of file cl_main.c.

Referenced by CL_InitLocal(), and IN_MouseMove().

◆ m_pitch

cvar_t* m_pitch

◆ m_side

cvar_t* m_side

Definition at line 85 of file cl_main.c.

Referenced by CL_InitLocal(), and IN_MouseMove().

◆ m_yaw

cvar_t* m_yaw

Definition at line 83 of file cl_main.c.

Referenced by CL_InitLocal(), and IN_MouseMove().

◆ msg

◆ name

◆ numcheatvars

int numcheatvars

Definition at line 1652 of file cl_main.c.

Referenced by CL_FixCvarCheats().

◆ precache_check

int precache_check

Definition at line 1126 of file cl_main.c.

Referenced by CL_Precache_f(), and CL_RequestNextDownload().

◆ precache_model

byte* precache_model

Definition at line 1131 of file cl_main.c.

Referenced by CL_Precache_f(), and CL_RequestNextDownload().

◆ precache_model_skin

int precache_model_skin

Definition at line 1129 of file cl_main.c.

Referenced by CL_Precache_f(), and CL_RequestNextDownload().

◆ precache_spawncount

int precache_spawncount

Definition at line 1127 of file cl_main.c.

Referenced by CL_Precache_f(), and CL_RequestNextDownload().

◆ precache_tex

int precache_tex

Definition at line 1128 of file cl_main.c.

Referenced by CL_RequestNextDownload().

◆ rate

cvar_t* rate

Definition at line 96 of file cl_main.c.

Referenced by CL_InitLocal(), and S_RawSamples().

◆ rcon_address

cvar_t* rcon_address

Definition at line 40 of file cl_main.c.

Referenced by CL_InitLocal(), and CL_Rcon_f().

◆ rcon_client_password

cvar_t* rcon_client_password

Definition at line 39 of file cl_main.c.

Referenced by CL_InitLocal(), and CL_Rcon_f().

◆ sensitivity

cvar_t* sensitivity

Definition at line 80 of file cl_main.c.

Referenced by CL_InitLocal(), ControlsSetMenuItemValues(), and IN_MouseMove().

◆ skin

sensitivity
cvar_t * sensitivity
Definition: cl_main.c:80
adr4
cvar_t * adr4
Definition: cl_main.c:30
CL_InitLocal
void CL_InitLocal(void)
Definition: cl_main.c:1430
CS_MAXCLIENTS
#define CS_MAXCLIENTS
Definition: q_shared.h:1133
CL_Record_f
void CL_Record_f(void)
Definition: cl_main.c:175
MAX_CLIENTS
#define MAX_CLIENTS
Definition: q_shared.h:79
CL_Setenv_f
void CL_Setenv_f(void)
Definition: cl_main.c:319
refdef_t::vieworg
float vieworg[3]
Definition: ref.h:124
cl_paused
cvar_t * cl_paused
Definition: cl_main.c:75
SCR_EndLoadingPlaque
void SCR_EndLoadingPlaque(void)
Definition: cl_scrn.c:598
numcheatvars
int numcheatvars
Definition: cl_main.c:1652
dedicated
cvar_t * dedicated
Definition: common.c:47
curtime
int curtime
Definition: q_shwin.c:119
client_static_t::challenge
int challenge
Definition: client.h:247
sizebuf_s
Definition: qcommon.h:75
value
GLfloat value
Definition: qgl_win.c:63
gender
cvar_t * gender
Definition: cl_main.c:100
adr8
cvar_t * adr8
Definition: cl_main.c:34
CS_SKY
#define CS_SKY
Definition: q_shared.h:1127
rcon_address
cvar_t * rcon_address
Definition: cl_main.c:40
client_state_t::servercount
int servercount
Definition: client.h:174
MAX_QPATH
#define MAX_QPATH
Definition: q_shared.h:73
MAX_MODELS
#define MAX_MODELS
Definition: q_shared.h:82
BigShort
short BigShort(short l)
Definition: q_shared.c:945
CS_SOUNDS
#define CS_SOUNDS
Definition: q_shared.h:1137
allow_download
cvar_t * allow_download
Definition: sv_main.c:37
adr6
cvar_t * adr6
Definition: cl_main.c:32
CL_ParseClientinfo
void CL_ParseClientinfo(int player)
Definition: cl_parse.c:508
V_Init
void V_Init(void)
Definition: cl_view.c:642
log_stats
cvar_t * log_stats
Definition: common.c:40
CVAR_NOSET
#define CVAR_NOSET
Definition: q_shared.h:312
client_state_t::v_forward
vec3_t v_forward
Definition: client.h:153
Key_WriteBindings
void Key_WriteBindings(FILE *f)
Definition: keys.c:619
adr2
cvar_t * adr2
Definition: cl_main.c:28
CL_RegisterSounds
void CL_RegisterSounds(void)
Definition: cl_parse.c:183
cl_autoskins
cvar_t * cl_autoskins
Definition: cl_main.c:43
client_static_t::disable_screen
float disable_screen
Definition: client.h:232
cl_lightlevel
cvar_t * cl_lightlevel
Definition: cl_main.c:87
adr0
cvar_t * adr0
Definition: cl_main.c:26
ca_disconnected
@ ca_disconnected
Definition: client.h:206
mapsurface_s
Definition: q_shared.h:442
CL_CheckOrDownloadFile
qboolean CL_CheckOrDownloadFile(char *filename)
Definition: cl_parse.c:69
cl_run
cvar_t * cl_run
Definition: cl_input.c:229
client_state_t::v_up
vec3_t v_up
Definition: client.h:153
CL_PingServers_f
void CL_PingServers_f(void)
Definition: cl_main.c:817
cl_add_blend
cvar_t * cl_add_blend
Definition: cl_main.c:69
map_surfaces
mapsurface_t map_surfaces[MAX_MAP_TEXINFO]
Definition: cmodel.c:69
net_message
sizebuf_t net_message
Definition: net_chan.c:82
fov
cvar_t * fov
Definition: cl_main.c:97
entity_state_s
Definition: q_shared.h:1169
cl_shownet
cvar_t * cl_shownet
Definition: cl_main.c:71
precache_model_skin
int precache_model_skin
Definition: cl_main.c:1129
cvar_s::modified
qboolean modified
Definition: q_shared.h:323
precache_tex
int precache_tex
Definition: cl_main.c:1128
client_state_t::timeoutcount
int timeoutcount
Definition: client.h:113
netchan_t::message
sizebuf_t message
Definition: qcommon.h:600
CL_SendCmd
void CL_SendCmd(void)
Definition: cl_input.c:459
ca_uninitialized
@ ca_uninitialized
Definition: client.h:205
cl_upspeed
cvar_t * cl_upspeed
Definition: cl_input.c:222
ca_connecting
@ ca_connecting
Definition: client.h:207
net_from
netadr_t net_from
Definition: net_chan.c:81
cl_drawfps
cvar_t * cl_drawfps
Definition: cl_main.c:49
Cvar_Userinfo
char * Cvar_Userinfo(void)
Definition: cvar.c:504
allow_download_maps
cvar_t * allow_download_maps
Definition: sv_main.c:41
m_side
cvar_t * m_side
Definition: cl_main.c:85
cvar_s::string
char * string
Definition: q_shared.h:320
CS_MODELS
#define CS_MODELS
Definition: q_shared.h:1136
qboolean
qboolean
Definition: q_shared.h:56
rcon_client_password
cvar_t * rcon_client_password
Definition: cl_main.c:39
client_static_t::disable_servercount
int disable_servercount
Definition: client.h:235
cl_sidespeed
cvar_t * cl_sidespeed
Definition: cl_input.c:224
cheatvar_t::value
char * value
Definition: cl_main.c:1633
VectorClear
#define VectorClear(a)
Definition: q_shared.h:159
i
int i
Definition: q_shared.c:305
host_speeds
cvar_t * host_speeds
Definition: common.c:39
cheatvars
cheatvar_t cheatvars[]
Definition: cl_main.c:1637
client_static_t::demorecording
qboolean demorecording
Definition: client.h:257
ca_active
@ ca_active
Definition: client.h:209
client_state_t::gamedir
char gamedir[MAX_QPATH]
Definition: client.h:175
Cvar_WriteVariables
void Cvar_WriteVariables(char *path)
Definition: cvar.c:429
buffer
GLenum GLfloat * buffer
Definition: qgl_win.c:151
m_forward
cvar_t * m_forward
Definition: cl_main.c:84
precache_model
byte * precache_model
Definition: cl_main.c:1131
MSG_WriteLong
void MSG_WriteLong(sizebuf_t *sb, int c)
Definition: common.c:349
NET_AdrToString
char * NET_AdrToString(netadr_t a)
Definition: net_wins.c:156
CL_PredictMovement
void CL_PredictMovement(void)
Definition: cl_pred.c:199
CL_ReadPackets
void CL_ReadPackets(void)
Definition: cl_main.c:1011
SZ_Init
void SZ_Init(sizebuf_t *buf, byte *data, int length)
Definition: common.c:904
argc
int argc
Definition: sys_win.c:54
CS_NAME
#define CS_NAME
Definition: q_shared.h:1125
CL_Disconnect
void CL_Disconnect(void)
Definition: cl_main.c:633
Cmd_Args
char * Cmd_Args(void)
Definition: cmd.c:531
sizebuf_s::data
byte * data
Definition: qcommon.h:79
client_state_t::refdef
refdef_t refdef
Definition: client.h:151
centity_t::baseline
entity_state_t baseline
Definition: client.h:77
cl_timeout
cvar_t * cl_timeout
Definition: cl_main.c:45
NA_BROADCAST
@ NA_BROADCAST
Definition: qcommon.h:533
cl_gun
cvar_t * cl_gun
Definition: cl_main.c:50
SCR_BeginLoadingPlaque
void SCR_BeginLoadingPlaque(void)
Definition: cl_scrn.c:571
Cvar_Get
cvar_t * Cvar_Get(char *var_name, char *var_value, int flags)
Definition: cvar.c:127
FS_CreatePath
void FS_CreatePath(char *path)
Definition: files.c:125
CL_RequestNextDownload
void CL_RequestNextDownload(void)
Definition: cl_main.c:1141
cvar_s
Definition: q_shared.h:317
cl_yawspeed
cvar_t * cl_yawspeed
Definition: cl_input.c:226
SZ_Clear
void SZ_Clear(sizebuf_t *buf)
Definition: common.c:911
PLAYER_MULT
#define PLAYER_MULT
Definition: cl_main.c:1133
precache_spawncount
int precache_spawncount
Definition: cl_main.c:1127
freelook
cvar_t * freelook
Definition: cl_main.c:24
CL_InitInput
void CL_InitInput(void)
Definition: cl_input.c:413
Cmd_TokenizeString
void Cmd_TokenizeString(char *text, qboolean macroExpand)
Definition: cmd.c:620
NET_StringToAdr
qboolean NET_StringToAdr(char *s, netadr_t *a)
Definition: net_wins.c:257
Cmd_Argv
char * Cmd_Argv(int arg)
Definition: cmd.c:517
va
char * va(char *format,...)
Definition: q_shared.c:1050
CL_Connect_f
void CL_Connect_f(void)
Definition: cl_main.c:511
msg
cvar_t * msg
Definition: cl_main.c:98
sizebuf_s::maxsize
int maxsize
Definition: qcommon.h:80
Cmd_Argc
int Cmd_Argc(void)
Definition: cmd.c:507
adr7
cvar_t * adr7
Definition: cl_main.c:33
client_state_t::timedemo_start
int timedemo_start
Definition: client.h:116
CS_IMAGES
#define CS_IMAGES
Definition: q_shared.h:1138
CL_ForwardToServer_f
void CL_ForwardToServer_f(void)
Definition: cl_main.c:360
SCR_RunConsole
void SCR_RunConsole(void)
Definition: cl_scrn.c:507
SCR_UpdateScreen
void SCR_UpdateScreen(void)
Definition: cl_scrn.c:1285
SZ_Print
void SZ_Print(sizebuf_t *buf, char *data)
Definition: common.c:945
cl_noskins
cvar_t * cl_noskins
Definition: cl_main.c:42
CL_Precache_f
void CL_Precache_f(void)
Definition: cl_main.c:1403
adr1
cvar_t * adr1
Definition: cl_main.c:27
userinfo_modified
qboolean userinfo_modified
Definition: cvar.c:485
cl_showmiss
cvar_t * cl_showmiss
Definition: cl_main.c:72
Info_Print
void Info_Print(char *s)
Definition: common.c:1068
skin
cvar_t * skin
Definition: cl_main.c:95
CS_MAPCHECKSUM
#define CS_MAPCHECKSUM
Definition: q_shared.h:1134
CL_SendConnectPacket
void CL_SendConnectPacket(void)
Definition: cl_main.c:435
cl_add_lights
cvar_t * cl_add_lights
Definition: cl_main.c:67
CL_Snd_Restart_f
void CL_Snd_Restart_f(void)
Definition: cl_main.c:1119
CL_Disconnect_f
void CL_Disconnect_f(void)
Definition: cl_main.c:680
cl_forwardspeed
cvar_t * cl_forwardspeed
Definition: cl_input.c:223
cl_add_entities
cvar_t * cl_add_entities
Definition: cl_main.c:68
LittleLong
int LittleLong(int l)
Definition: q_shared.c:948
client_static_t::demowaiting
qboolean demowaiting
Definition: client.h:258
CL_RunDLights
void CL_RunDLights(void)
Definition: cl_fx.c:311
CL_Userinfo_f
void CL_Userinfo_f(void)
Definition: cl_main.c:1105
CL_ClearState
void CL_ClearState(void)
Definition: cl_main.c:610
NET_SendPacket
void NET_SendPacket(netsrc_t sock, int length, void *data, netadr_t to)
Definition: net_wins.c:395
cheatvar_t
Definition: cl_main.c:1630
gender_auto
cvar_t * gender_auto
Definition: cl_main.c:101
client_static_t::servername
char servername[MAX_OSPATH]
Definition: client.h:239
M_Init
void M_Init(void)
Definition: menu.c:4019
IN_Frame
void IN_Frame(void)
Definition: in_win.c:420
CL_PrepRefresh
void CL_PrepRefresh(void)
Definition: cl_view.c:296
ENV_CNT
#define ENV_CNT
Definition: cl_main.c:1136
CL_RunLightStyles
void CL_RunLightStyles(void)
Definition: cl_fx.c:166
CL_Download_f
void CL_Download_f(void)
Definition: cl_parse.c:139
dmdl_t::version
int version
Definition: qfiles.h:140
Sys_SendKeyEvents
void Sys_SendKeyEvents(void)
Definition: sys_win.c:376
CL_WriteConfiguration
void CL_WriteConfiguration(void)
Definition: cl_main.c:1599
cl_footsteps
cvar_t * cl_footsteps
Definition: cl_main.c:44
client_static_t::connect_time
float connect_time
Definition: client.h:240
FS_ExecAutoexec
void FS_ExecAutoexec(void)
Definition: files.c:600
Cmd_AddCommand
void Cmd_AddCommand(char *cmd_name, xcommand_t function)
Definition: cmd.c:691
client_state_t::refresh_prepped
qboolean refresh_prepped
Definition: client.h:118
CS_PLAYERSKINS
#define CS_PLAYERSKINS
Definition: q_shared.h:1141
dmdl_t::num_skins
int num_skins
Definition: qfiles.h:146
FS_LoadFile
int FS_LoadFile(char *path, void **buffer)
Definition: files.c:394
PROTOCOL_VERSION
#define PROTOCOL_VERSION
Definition: qcommon.h:180
m_yaw
cvar_t * m_yaw
Definition: cl_main.c:83
lookspring
cvar_t * lookspring
Definition: cl_main.c:78
CVAR_ARCHIVE
#define CVAR_ARCHIVE
Definition: q_shared.h:309
cl_stereo_separation
cvar_t * cl_stereo_separation
Definition: cl_main.c:36
lookstrafe
cvar_t * lookstrafe
Definition: cl_main.c:79
S_Shutdown
void S_Shutdown(void)
Definition: snd_dma.c:164
cvar_s::value
float value
Definition: q_shared.h:324
Cbuf_AddText
void Cbuf_AddText(char *text)
Definition: cmd.c:90
Cvar_SetValue
void Cvar_SetValue(char *var_name, float value)
Definition: cvar.c:317
allow_download_players
cvar_t * allow_download_players
Definition: sv_main.c:38
time_before_ref
int time_before_ref
Definition: common.c:56
MAX_OSPATH
#define MAX_OSPATH
Definition: q_shared.h:74
CL_ParseStatusMessage
void CL_ParseStatusMessage(void)
Definition: cl_main.c:801
client_state_t::timedemo_frames
int timedemo_frames
Definition: client.h:115
cl_add_particles
cvar_t * cl_add_particles
Definition: cl_main.c:66
refdef_t::blend
float blend[4]
Definition: ref.h:126
Sys_AppActivate
void Sys_AppActivate(void)
Definition: sys_win.c:437
MSG_WriteString
void MSG_WriteString(sizebuf_t *sb, char *s)
Definition: common.c:375
NULL
#define NULL
Definition: q_shared.h:60
CL_Pause_f
void CL_Pause_f(void)
Definition: cl_main.c:382
refexport_t::CinematicSetPalette
void(* CinematicSetPalette)(const unsigned char *palette)
Definition: ref.h:207
MSG_WriteShort
void MSG_WriteShort(sizebuf_t *sb, int c)
Definition: common.c:335
cl_vwep
cvar_t * cl_vwep
Definition: cl_main.c:103
noudp
static cvar_t * noudp
Definition: net_wins.c:42
MSG_WriteByte
void MSG_WriteByte(sizebuf_t *sb, int c)
Definition: common.c:322
MSG_ReadStringLine
char * MSG_ReadStringLine(sizebuf_t *msg_read)
Definition: common.c:812
Com_Error
void Com_Error(int code, char *fmt,...)
Definition: common.c:203
client_state_t::playernum
int playernum
Definition: client.h:176
CL_ConnectionlessPacket
void CL_ConnectionlessPacket(void)
Definition: cl_main.c:904
CL_ParseServerMessage
void CL_ParseServerMessage(void)
Definition: cl_parse.c:664
CL_ClearTEnts
void CL_ClearTEnts(void)
Definition: cl_tent.c:229
Netchan_Process
qboolean Netchan_Process(netchan_t *chan, sizebuf_t *msg)
Definition: net_chan.c:298
client_state_t::time
int time
Definition: client.h:147
CL_Rcon_f
void CL_Rcon_f(void)
Definition: cl_main.c:550
cl_showclamp
cvar_t * cl_showclamp
Definition: cl_main.c:73
allow_download_models
cvar_t * allow_download_models
Definition: sv_main.c:39
ERR_DROP
#define ERR_DROP
Definition: qcommon.h:736
Q_stricmp
int Q_stricmp(char *s1, char *s2)
Definition: q_shared.c:1192
IN_Commands
void IN_Commands(void)
Definition: in_win.c:654
VID_Init
void VID_Init(void)
Definition: vid_dll.c:709
MSG_WriteChar
void MSG_WriteChar(sizebuf_t *sb, int c)
Definition: common.c:309
CDAudio_Init
int CDAudio_Init(void)
adr3
cvar_t * adr3
Definition: cl_main.c:29
MAX_CONFIGSTRINGS
#define MAX_CONFIGSTRINGS
Definition: q_shared.h:1143
svc_serverdata
@ svc_serverdata
Definition: qcommon.h:221
name
cvar_t * name
Definition: cl_main.c:94
MAX_EDICTS
#define MAX_EDICTS
Definition: q_shared.h:80
NET_Config
void NET_Config(qboolean multiplayer)
Definition: net_wins.c:690
netchan_t::remote_address
netadr_t remote_address
Definition: qcommon.h:585
CL_ClearEffects
void CL_ClearEffects(void)
Definition: cl_fx.c:2445
precache_check
int precache_check
Definition: cl_main.c:1126
CL_CheckForResend
void CL_CheckForResend(void)
Definition: cl_main.c:465
Netchan_Setup
void Netchan_Setup(netsrc_t sock, netchan_t *chan, netadr_t adr, int qport)
Definition: net_chan.c:152
cl_stereo
cvar_t * cl_stereo
Definition: cl_main.c:37
MAX_MSGLEN
#define MAX_MSGLEN
Definition: qcommon.h:527
netadr_t::type
netadrtype_t type
Definition: qcommon.h:540
Con_Init
void Con_Init(void)
Definition: console.c:312
CL_Stop_f
void CL_Stop_f(void)
Definition: cl_main.c:147
SV_Shutdown
void SV_Shutdown(char *finalmsg, qboolean reconnect)
Definition: sv_main.c:1035
re
refexport_t re
Definition: vid_dll.c:31
CDAudio_Update
void CDAudio_Update(void)
client_static_t::demofile
FILE * demofile
Definition: client.h:259
client_state_t::v_right
vec3_t v_right
Definition: client.h:153
info_password
cvar_t * info_password
Definition: cl_main.c:92
rate
cvar_t * rate
Definition: cl_main.c:96
NET_IsLocalAddress
qboolean NET_IsLocalAddress(netadr_t adr)
Definition: net_wins.c:277
CM_LoadMap
cmodel_t * CM_LoadMap(char *name, qboolean clientload, unsigned *checksum)
Definition: cmodel.c:548
client_static_t::download
FILE * download
Definition: client.h:249
cl_maxfps
cvar_t * cl_maxfps
Definition: cl_main.c:48
IN_Shutdown
void IN_Shutdown(void)
Definition: in_win.c:391
m_pitch
cvar_t * m_pitch
Definition: cl_main.c:82
MSG_ReadLong
int MSG_ReadLong(sizebuf_t *msg_read)
Definition: common.c:750
client_static_t::framecount
int framecount
Definition: client.h:227
adr5
cvar_t * adr5
Definition: cl_main.c:31
CL_Skins_f
void CL_Skins_f(void)
Definition: cl_main.c:881
CL_Reconnect_f
void CL_Reconnect_f(void)
Definition: cl_main.c:766
VID_CheckChanges
void VID_CheckChanges(void)
Definition: vid_dll.c:641
cheatvar_t::var
cvar_t * var
Definition: cl_main.c:1634
client_static_t::state
connstate_t state
Definition: client.h:224
NS_CLIENT
@ NS_CLIENT
Definition: qcommon.h:536
MSG_ReadString
char * MSG_ReadString(sizebuf_t *msg_read)
Definition: common.c:792
NET_GetPacket
qboolean NET_GetPacket(netsrc_t sock, netadr_t *net_from, sizebuf_t *net_message)
Definition: net_wins.c:331
netchan_t::last_received
int last_received
Definition: qcommon.h:582
FS_Gamedir
char * FS_Gamedir(void)
Definition: files.c:590
svc_configstring
@ svc_configstring
Definition: qcommon.h:222
cl_anglespeedkey
cvar_t * cl_anglespeedkey
Definition: cl_input.c:231
CL_FixCvarCheats
void CL_FixCvarCheats(void)
Definition: cl_main.c:1654
cl_timedemo
cvar_t * cl_timedemo
Definition: cl_main.c:76
netadr_t::port
unsigned short port
Definition: qcommon.h:550
cl_pitchspeed
cvar_t * cl_pitchspeed
Definition: cl_input.c:227
client_static_t::frametime
float frametime
Definition: client.h:229
Com_ServerState
int Com_ServerState(void)
Definition: common.c:275
CVAR_USERINFO
#define CVAR_USERINFO
Definition: q_shared.h:310
MAX_SOUNDS
#define MAX_SOUNDS
Definition: q_shared.h:83
Cbuf_Execute
void Cbuf_Execute(void)
Definition: cmd.c:194
info_spectator
cvar_t * info_spectator
Definition: cl_main.c:93
NA_BROADCAST_IPX
@ NA_BROADCAST_IPX
Definition: qcommon.h:533
log_stats_file
FILE * log_stats_file
Definition: common.c:37
cl_predict
cvar_t * cl_predict
Definition: cl_main.c:46
MAX_SKINNAME
#define MAX_SKINNAME
Definition: qfiles.h:93
Com_Quit
void Com_Quit(void)
Definition: common.c:255
IN_Init
void IN_Init(void)
Definition: in_win.c:346
env_suf
static const char * env_suf[6]
Definition: cl_main.c:1139
entity_state_s::modelindex
int modelindex
Definition: q_shared.h:1176
time_after_ref
int time_after_ref
Definition: common.c:57
client_state_t::configstrings
char configstrings[MAX_CONFIGSTRINGS][MAX_QPATH]
Definition: client.h:178
Netchan_Transmit
void Netchan_Transmit(netchan_t *chan, int length, byte *data)
Definition: net_chan.c:213
net_message_buffer
byte net_message_buffer[MAX_MSGLEN]
Definition: net_chan.c:83
sizebuf_s::cursize
int cursize
Definition: qcommon.h:81
SCR_RunCinematic
void SCR_RunCinematic(void)
Definition: cl_cin.c:490
Netchan_OutOfBandPrint
void Netchan_OutOfBandPrint(int net_socket, netadr_t adr, char *format,...)
Definition: net_chan.c:132
Cvar_Set
cvar_t * Cvar_Set(char *var_name, char *value)
Definition: cvar.c:278
dmdl_t::ofs_skins
int ofs_skins
Definition: qfiles.h:153
Com_DPrintf
void Com_DPrintf(char *fmt,...)
Definition: common.c:155
netadr_t
Definition: qcommon.h:538
S_StopAllSounds
void S_StopAllSounds(void)
Definition: snd_dma.c:795
FS_FreeFile
void FS_FreeFile(void *buffer)
Definition: files.c:433
SCR_Init
void SCR_Init(void)
Definition: cl_scrn.c:419
VID_Shutdown
void VID_Shutdown(void)
Definition: vid_dll.c:752
ca_connected
@ ca_connected
Definition: client.h:208
ALIAS_VERSION
#define ALIAS_VERSION
Definition: qfiles.h:87
M_AddToServerList
void M_AddToServerList(netadr_t adr, char *info)
Definition: menu.c:2281
Com_Printf
void Com_Printf(char *fmt,...)
Definition: common.c:102
CL_Changing_f
void CL_Changing_f(void)
Definition: cl_main.c:746
NET_CompareAdr
qboolean NET_CompareAdr(netadr_t a, netadr_t b)
Definition: net_wins.c:103
CL_Quit_f
void CL_Quit_f(void)
Definition: cl_main.c:399
svc_spawnbaseline
@ svc_spawnbaseline
Definition: qcommon.h:223
Sys_Milliseconds
int Sys_Milliseconds(void)
Definition: q_shwin.c:120
clc_stringcmd
@ clc_stringcmd
Definition: qcommon.h:243
IDALIASHEADER
#define IDALIASHEADER
Definition: qfiles.h:86
cls
client_static_t cls
Definition: cl_main.c:105
TEXTURE_CNT
#define TEXTURE_CNT
Definition: cl_main.c:1137
allow_download_sounds
cvar_t * allow_download_sounds
Definition: sv_main.c:40
Cvar_VariableString
char * Cvar_VariableString(char *var_name)
Definition: cvar.c:79
MSG_WriteDeltaEntity
void MSG_WriteDeltaEntity(entity_state_t *from, entity_state_t *to, sizebuf_t *msg, qboolean force, qboolean newentity)
Definition: common.c:502
hand
cvar_t * hand
Definition: cl_main.c:99
noipx
static cvar_t * noipx
Definition: net_wins.c:43
svc_stufftext
@ svc_stufftext
Definition: qcommon.h:220
cl_entities
centity_t cl_entities[MAX_EDICTS]
Definition: cl_main.c:108
cl
client_state_t cl
Definition: cl_main.c:106
M_ForceMenuOff
void M_ForceMenuOff(void)
Definition: menu.c:117
PORT_SERVER
#define PORT_SERVER
Definition: qcommon.h:186
MSG_BeginReading
void MSG_BeginReading(sizebuf_t *msg)
Definition: common.c:703
MAX_IMAGES
#define MAX_IMAGES
Definition: q_shared.h:84
CL_SendCommand
void CL_SendCommand(void)
Definition: cl_main.c:1692
S_Init
void S_Init(void)
Definition: snd_dma.c:116
Com_sprintf
void Com_sprintf(char *dest, int size, char *fmt,...)
Definition: q_shared.c:1236
S_Update
void S_Update(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up)
Definition: snd_dma.c:1037
numtexinfo
int numtexinfo
Definition: cmodel.c:68
dmdl_t
Definition: qfiles.h:137
CDAudio_Shutdown
void CDAudio_Shutdown(void)
client_static_t::quakePort
int quakePort
Definition: client.h:242
SCR_StopCinematic
void SCR_StopCinematic(void)
Definition: cl_cin.c:153
cheatvar_t::name
char * name
Definition: cl_main.c:1632
client_static_t::netchan
netchan_t netchan
Definition: client.h:244
client_static_t::realtime
int realtime
Definition: client.h:228
Cvar_VariableValue
float Cvar_VariableValue(char *var_name)
Definition: cvar.c:63