Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
client.qh File Reference
#include "utils.qh"
#include <server/intermission.qh>
#include <common/replicate.qh>
#include <common/sounds/all.qh>
Include dependency graph for client.qh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Client
class  Observer
class  Player
class  Spectator

Macros

#define GAMETYPE_DEFAULTED_SETTING(str)
#define INDEPENDENT_PLAYERS   (autocvar__independent_players ? (autocvar__independent_players > 0) : independent_players)
#define IS_INDEPENDENT_PLAYER(e)
#define MAKE_INDEPENDENT_PLAYER(e)
#define SPECTATE_COPY()
#define SPECTATE_COPYFIELD(fld)
#define UNWIND(class)

Functions

void calculate_player_respawn_time (entity this)
void ClientData_Touch (entity e, bool to_spectators_too)
void ClientInit_misc (entity this)
void ClientInit_Spawn ()
void ClientState_attach (entity this)
void FixClientCvars (entity e)
void FixPlayermodel (entity player)
int GetPlayerLimit ()
void GiveWarmupResources (entity this)
void Join (entity this, bool queued_join)
 it's assumed this isn't called for bots (campaign_bots_may_start, centreprints)
bool joinAllowed (entity this, int team_index)
int nJoinAllowed (entity this)
 Determines how many player slots are free.
void play_countdown (entity this, float finished, Sound samp)
void player_powerups_remove_all (entity this, bool allow_poweroff_sound)
void PlayerFrame (entity this)
bool PlayerInIDList (entity p, string idlist)
bool PlayerInIPList (entity p, string iplist)
bool PlayerInList (entity player, string list)
void PlayerUseKey (entity this)
void PutObserverInServer (entity this, bool is_forced, bool use_spawnpoint)
 putting a client as observer in the server
void RotRegen (entity this, entity current, float limit_mod, float regenstable, float regenfactor, float regenlinear, float regenframetime, float rotstable, float rotfactor, float rotlinear, float rotframetime)
void SendWelcomeMessage (entity this, int msg_type)
void SetSpectatee (entity this, entity spectatee)
void SetSpectatee_status (entity this, int spectatee_num)
bool Spectate (entity this, entity pl)
 STATIC_INIT (client_lists)
 void (entity this, entity player) init_for_player

Variables

float alivetime_start
int autocvar__independent_players
bool autocvar__notarget
int autocvar_g_balance_armor_start
float autocvar_g_balance_pause_armor_rot_spawn
float autocvar_g_balance_pause_fuel_rot_spawn
float autocvar_g_balance_pause_health_regen_spawn
float autocvar_g_balance_pause_health_rot_spawn
bool autocvar_g_botclip_collisions
bool autocvar_g_forced_respawn
bool autocvar_g_fullbrightplayers
int autocvar_g_maxplayers
float autocvar_g_maxplayers_spectator_blocktime
string autocvar_g_mutatormsg
bool autocvar_g_nodepthtestplayers
float autocvar_g_player_alpha
float autocvar_g_player_brightness
float autocvar_g_player_damageforcescale = 2
bool autocvar_g_playerclip_collisions
bool autocvar_g_respawn_delay_forced
float autocvar_g_respawn_delay_large
int autocvar_g_respawn_delay_large_count
float autocvar_g_respawn_delay_max
float autocvar_g_respawn_delay_small
int autocvar_g_respawn_delay_small_count
bool autocvar_g_respawn_ghosts
float autocvar_g_respawn_ghosts_alpha = 1
float autocvar_g_respawn_ghosts_fadetime = 1.5
float autocvar_g_respawn_ghosts_speed
float autocvar_g_respawn_ghosts_time = 4.5
int autocvar_g_respawn_waves
string autocvar_g_xonoticversion
float autocvar_gameversion
float autocvar_gameversion_max
float autocvar_gameversion_min
string autocvar_hostname
int autocvar_spawn_debug
bool autocvar_sv_foginterval
float autocvar_sv_maxidle
bool autocvar_sv_maxidle_alsokickspectators
int autocvar_sv_maxidle_minplayers = 2
float autocvar_sv_maxidle_playertospectator = 60
int autocvar_sv_maxidle_slots
bool autocvar_sv_maxidle_slots_countbots
string autocvar_sv_motd
int autocvar_sv_name_maxlength = 64
float autocvar_sv_player_scale
string autocvar_sv_quickmenu_file
bool autocvar_sv_servermodelsonly
bool autocvar_sv_show_entnum
bool autocvar_sv_showspectators
bool autocvar_sv_spectate
bool autocvar_sv_teamnagger
entity clientdata
float death_time
IntrusiveList g_initforplayer
IntrusiveList g_observepoints
bool independent_players
float jointime
bool just_joined
int killcount
const int MAX_SPECTATORS = 7
const int MIN_SPEC_TIME = 1
float pauseregen_finished
float pauserotarmor_finished
float pauserotfuel_finished
float pauserothealth_finished
bool player_blocked
int playerid
string playermodel
string playerskin
int pressedkeys
float respawn_countdown
const int RESPAWN_DENY = BIT(2)
int respawn_flags
const int RESPAWN_FORCE = BIT(0)
const int RESPAWN_SILENT = BIT(1)
float respawn_time
float respawn_time_max
int spectatee_status
float spectatortime
float startplaytime
const int SVC_SETVIEW = 5
int team_selected
int wants_join
string weaponorder_byimpulse
bool zoomstate

Macro Definition Documentation

◆ GAMETYPE_DEFAULTED_SETTING

#define GAMETYPE_DEFAULTED_SETTING ( str)
Value:
((gametype_setting_tmp = cvar(strcat("g_", GetGametype(), "_" #str))), \
(gametype_setting_tmp < 0) ? 0 \
: (gametype_setting_tmp == 0 || autocvar_g_respawn_delay_forced) ? max(0, autocvar_g_##str) \
: gametype_setting_tmp)
string GetGametype()
float cvar(string name)
float max(float f,...)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
bool autocvar_g_respawn_delay_forced
Definition client.qh:27

Definition at line 347 of file client.qh.

347#define GAMETYPE_DEFAULTED_SETTING(str) \
348 ((gametype_setting_tmp = cvar(strcat("g_", GetGametype(), "_" #str))), \
349 (gametype_setting_tmp < 0) ? 0 \
350 : (gametype_setting_tmp == 0 || autocvar_g_respawn_delay_forced) ? max(0, autocvar_g_##str) \
351 : gametype_setting_tmp)

Referenced by calculate_player_respawn_time().

◆ INDEPENDENT_PLAYERS

Definition at line 311 of file client.qh.

Referenced by PutPlayerInServer(), and ScoreRules_basics().

◆ IS_INDEPENDENT_PLAYER

◆ MAKE_INDEPENDENT_PLAYER

#define MAKE_INDEPENDENT_PLAYER ( e)
Value:
((e).solid = SOLID_TRIGGER, (e).frags = FRAGS_PLAYER_NONSOLID)
const int FRAGS_PLAYER_NONSOLID
independent player
Definition constants.qh:4

Definition at line 313 of file client.qh.

Referenced by PutPlayerInServer(), race_AbandonRaceCheck(), and race_SendTime().

◆ SPECTATE_COPY

#define SPECTATE_COPY ( )
Value:
ACCUMULATE void SpectateCopy(entity this, entity spectatee)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define ACCUMULATE
Definition _all.inc:31
void SpectateCopy(entity this, entity spectatee)
Definition client.qc:1798

Definition at line 410 of file client.qh.

◆ SPECTATE_COPYFIELD

#define SPECTATE_COPYFIELD ( fld)
Value:
SPECTATE_COPY() { this.(fld) = spectatee.(fld); }
#define SPECTATE_COPY()
Definition client.qh:410

Definition at line 411 of file client.qh.

◆ UNWIND

#define UNWIND ( class)
Value:
MACRO_BEGIN if (this.instanceOf##class) { METHOD_REFERENCE(class, dtorimpl)(this); } MACRO_END
#define MACRO_END
Definition macro.qh:7
#define MACRO_BEGIN
Definition macro.qh:6
#define METHOD_REFERENCE(cname, name)
Definition oo.qh:333

Referenced by Client::m_unwind().

Function Documentation

◆ calculate_player_respawn_time()

void calculate_player_respawn_time ( entity this)

Definition at line 1398 of file client.qc.

1399{
1400 if(MUTATOR_CALLHOOK(CalculateRespawnTime, this))
1401 return;
1402
1403 float gametype_setting_tmp;
1404 float sdelay_max = GAMETYPE_DEFAULTED_SETTING(respawn_delay_max);
1405 float sdelay_small = GAMETYPE_DEFAULTED_SETTING(respawn_delay_small);
1406 float sdelay_large = GAMETYPE_DEFAULTED_SETTING(respawn_delay_large);
1407 float sdelay_small_count = GAMETYPE_DEFAULTED_SETTING(respawn_delay_small_count);
1408 float sdelay_large_count = GAMETYPE_DEFAULTED_SETTING(respawn_delay_large_count);
1409 float waves = GAMETYPE_DEFAULTED_SETTING(respawn_waves);
1410
1411 float pcount = 1; // Include myself whether or not team is already set right and I'm a "player".
1412 if (teamplay)
1413 {
1414 FOREACH_CLIENT(IS_PLAYER(it) && it != this,
1415 {
1416 if(it.team == this.team)
1417 ++pcount;
1418 });
1419 if (sdelay_small_count == 0)
1420 sdelay_small_count = 1;
1421 if (sdelay_large_count == 0)
1422 sdelay_large_count = 1;
1423 }
1424 else
1425 {
1426 FOREACH_CLIENT(IS_PLAYER(it) && it != this,
1427 {
1428 ++pcount;
1429 });
1430 if (sdelay_small_count == 0)
1431 {
1432 if (IS_INDEPENDENT_PLAYER(this))
1433 {
1434 // Players play independently. No point in requiring enemies.
1435 sdelay_small_count = 1;
1436 }
1437 else
1438 {
1439 // Players play AGAINST each other. Enemies required.
1440 sdelay_small_count = 2;
1441 }
1442 }
1443 if (sdelay_large_count == 0)
1444 {
1445 if (IS_INDEPENDENT_PLAYER(this))
1446 {
1447 // Players play independently. No point in requiring enemies.
1448 sdelay_large_count = 1;
1449 }
1450 else
1451 {
1452 // Players play AGAINST each other. Enemies required.
1453 sdelay_large_count = 2;
1454 }
1455 }
1456 }
1457
1458 float sdelay;
1459
1460 if (pcount <= sdelay_small_count)
1461 sdelay = sdelay_small;
1462 else if (pcount >= sdelay_large_count)
1463 sdelay = sdelay_large;
1464 else // NOTE: this case implies sdelay_large_count > sdelay_small_count.
1465 sdelay = sdelay_small + (sdelay_large - sdelay_small) * (pcount - sdelay_small_count) / (sdelay_large_count - sdelay_small_count);
1466
1467 if(waves)
1468 this.respawn_time = ceil((time + sdelay) / waves) * waves;
1469 else
1470 this.respawn_time = time + sdelay;
1471
1472 if(sdelay < sdelay_max)
1473 this.respawn_time_max = time + sdelay_max;
1474 else
1475 this.respawn_time_max = this.respawn_time;
1476
1477 if((sdelay + waves >= 5.0) && (this.respawn_time - time > 1.75))
1478 this.respawn_countdown = 10; // first number to count down from is 10
1479 else
1480 this.respawn_countdown = -1; // do not count down
1481
1484}
#define MUTATOR_CALLHOOK(id,...)
Definition base.qh:143
#define IS_PLAYER(s)
Definition player.qh:242
float time
float ceil(float f)
float respawn_time_max
Definition client.qh:322
int respawn_flags
Definition client.qh:320
bool autocvar_g_forced_respawn
Definition client.qh:43
#define IS_INDEPENDENT_PLAYER(e)
Definition client.qh:312
float respawn_time
Definition client.qh:321
#define GAMETYPE_DEFAULTED_SETTING(str)
Definition client.qh:347
float respawn_countdown
Definition client.qh:324
const int RESPAWN_FORCE
Definition client.qh:326
bool teamplay
Definition teams.qh:59
#define FOREACH_CLIENT(cond, body)
Definition utils.qh:52

References autocvar_g_forced_respawn, ceil(), entity(), FOREACH_CLIENT, GAMETYPE_DEFAULTED_SETTING, IS_INDEPENDENT_PLAYER, IS_PLAYER, MUTATOR_CALLHOOK, respawn_countdown, respawn_flags, RESPAWN_FORCE, respawn_time, respawn_time_max, teamplay, and time.

Referenced by PlayerDamage().

◆ ClientData_Touch()

void ClientData_Touch ( entity e,
bool to_spectators_too )

Definition at line 185 of file client.qc.

186{
187 entity cd = CS(e).clientdata;
188 if (cd) cd.SendFlags = 1;
189
190 if (to_spectators_too)
191 FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != e && IS_SPEC(it) && it.enemy == e,
192 {
193 entity cd_spec = CS(it).clientdata;
194 if (cd_spec) cd_spec.SendFlags = cd.SendFlags;
195 });
196}
ClientState CS(Client this)
Definition state.qh:47
#define IS_SPEC(v)
Definition utils.qh:10
#define IS_REAL_CLIENT(v)
Definition utils.qh:17

References CS(), entity(), FOREACH_CLIENT, IS_REAL_CLIENT, and IS_SPEC.

Referenced by ignore_list_send(), race_AbandonRaceCheck(), race_SendTime(), ReadyRestart_force(), SetSpectatee(), SetSpectatee_status(), SetZoomState(), and SpectateSet().

◆ ClientInit_misc()

void ClientInit_misc ( entity this)

Definition at line 909 of file client.qc.

910{
911 int channel = MSG_ONE;
912 WriteHeader(channel, ENT_CLIENT_INIT);
913 WriteByte(channel, g_nexball_meter_period * 32);
914 WriteInt24_t(channel, compressShotOrigin(hook_shotorigin[0]));
915 WriteInt24_t(channel, compressShotOrigin(hook_shotorigin[1]));
916 WriteInt24_t(channel, compressShotOrigin(hook_shotorigin[2]));
917 WriteInt24_t(channel, compressShotOrigin(hook_shotorigin[3]));
918 WriteInt24_t(channel, compressShotOrigin(arc_shotorigin[0]));
919 WriteInt24_t(channel, compressShotOrigin(arc_shotorigin[1]));
920 WriteInt24_t(channel, compressShotOrigin(arc_shotorigin[2]));
921 WriteInt24_t(channel, compressShotOrigin(arc_shotorigin[3]));
922
923 WriteString(channel, world.fog);
924 WriteByte(channel, autocvar_sv_foginterval && world.fog != ""); // only forced if necessary
925
926 WriteByte(channel, this.count * 255.0); // g_balance_armor_blockpercent
927 WriteByte(channel, this.cnt * 255.0); // g_balance_damagepush_speedfactor
928 WriteByte(channel, serverflags);
930}
vector arc_shotorigin[4]
Definition arc.qh:108
float cnt
Definition powerups.qc:24
float count
Definition powerups.qc:22
int serverflags
Definition main.qh:211
vector hook_shotorigin[4]
Definition main.qh:205
float compressShotOrigin(vector v)
Definition util.qc:1350
WriteString(chan, ent.netname)
WriteByte(chan, ent.angles.y/DEC_FACTOR)
#define WriteHeader(to, id)
Definition net.qh:265
float MSG_ONE
Definition menudefs.qc:56
void WriteCoord(float data, float dest, float desto)
#define world
Definition post.qh:15
bool autocvar_sv_foginterval
Definition client.qh:36
float g_nexball_meter_period
Definition sv_nexball.qh:53
float autocvar_g_trueaim_minrange
Definition tracing.qh:17

References arc_shotorigin, autocvar_g_trueaim_minrange, autocvar_sv_foginterval, cnt, compressShotOrigin(), count, entity(), g_nexball_meter_period, hook_shotorigin, MSG_ONE, serverflags, world, WriteByte(), WriteCoord(), WriteHeader, and WriteString().

Referenced by ClientInit_SendEntity().

◆ ClientInit_Spawn()

void ClientInit_Spawn ( )

Definition at line 947 of file client.qc.

948{
949 entity e = new_pure(clientinit);
952
954}
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
Definition net.qh:167
#define new_pure(class)
purely logical entities (not linked to the area grid)
Definition oo.qh:66
#define setthink(e, f)
void ClientInit_CheckUpdate(entity this)
Definition client.qc:932
bool ClientInit_SendEntity(entity this, entity to, int sf)
Definition client.qc:897

References ClientInit_CheckUpdate(), ClientInit_SendEntity(), entity(), Net_LinkEntity(), new_pure, and setthink.

Referenced by spawnfunc().

◆ ClientState_attach()

void ClientState_attach ( entity this)

Definition at line 46 of file state.qc.

47{
48 this._cs = NEW(ClientState, this);
49
50 // TODO: fold all of these into ClientState
51
52 DecodeLevelParms(this);
53
57 accuracy_init(this);
58 entcs_attach(this);
59 anticheat_init(this);
60 W_HitPlotOpen(this);
63}
Purpose: common client state, usable on client and server Client: singleton representing the viewed p...
Definition state.qh:29
#define NEW(cname,...)
Definition oo.qh:120
void PlayerStats_PlayerBasic_CheckUpdate(entity joiningplayer)
void accuracy_init(entity this)
init/free
Definition accuracy.qc:50
void anticheat_init(entity this)
Definition anticheat.qc:255
void PlayerScore_Attach(entity this)
Definition scores.qc:331
void InventoryStorage_attach(PlayerState this)
void entcs_attach(entity this)
Definition ent_cs.qc:271
void ClientData_Attach(entity this)
Definition client.qc:172
void DecodeLevelParms(entity this)
Definition client.qc:987
void W_HitPlotOpen(entity this)
Definition hitplot.qc:82
ClientState _cs
Definition state.qh:42
void StatusEffectsStorage_attach(entity e)

References _cs, accuracy_init(), anticheat_init(), ClientData_Attach(), DecodeLevelParms(), entcs_attach(), entity(), InventoryStorage_attach(), NEW, PlayerScore_Attach(), PlayerStats_PlayerBasic_CheckUpdate(), StatusEffectsStorage_attach(), and W_HitPlotOpen().

Referenced by Client::Client().

◆ FixClientCvars()

void FixClientCvars ( entity e)

Definition at line 1000 of file client.qc.

1001{
1002 // send prediction settings to the client
1003 if(autocvar_g_antilag == 3) // client side hitscan
1004 stuffcmd(e, "cl_cmd settemp cl_prydoncursor_notrace 0\n");
1005 if(autocvar_sv_gentle)
1006 stuffcmd(e, "cl_cmd settemp cl_gentle 1\n");
1007
1008 stuffcmd(e, sprintf("\ncl_jumpspeedcap_min \"%s\"\n", autocvar_sv_jumpspeedcap_min));
1009 stuffcmd(e, sprintf("\ncl_jumpspeedcap_max \"%s\"\n", autocvar_sv_jumpspeedcap_max));
1010
1011 stuffcmd(e, sprintf("\ncl_shootfromfixedorigin \"%s\"\n", autocvar_g_shootfromfixedorigin));
1012
1014}
int autocvar_g_antilag
Definition antilag.qh:5
float autocvar_sv_jumpspeedcap_min
Definition player.qh:49
float autocvar_sv_jumpspeedcap_max
Definition player.qh:47
#define stuffcmd(cl,...)
Definition progsdefs.qh:23
void FixClientCvars(entity e)
Definition client.qc:1000
string autocvar_g_shootfromfixedorigin
Definition all.qh:444

References autocvar_g_antilag, autocvar_g_shootfromfixedorigin, autocvar_sv_jumpspeedcap_max, autocvar_sv_jumpspeedcap_min, entity(), FixClientCvars(), MUTATOR_CALLHOOK, and stuffcmd.

Referenced by ClientConnect(), FixClientCvars(), MapVote_Finished(), MUTATOR_HOOKABLE(), MUTATOR_HOOKFUNCTION(), and MUTATOR_HOOKFUNCTION().

◆ FixPlayermodel()

void FixPlayermodel ( entity player)

Definition at line 454 of file client.qc.

455{
456 string defaultmodel = "";
457 int defaultskin = 0;
459 {
460 if(teamplay)
461 {
462 switch(player.team)
463 {
468 }
469 }
470
471 if(defaultmodel == "")
472 {
473 defaultmodel = autocvar_sv_defaultplayermodel;
474 defaultskin = autocvar_sv_defaultplayerskin;
475 }
476
477 int n = tokenize_console(defaultmodel);
478 if(n > 0)
479 {
480 defaultmodel = argv(floor(n * CS(player).model_randomizer));
481 // However, do NOT randomize if the player-selected model is in the list.
482 for (int i = 0; i < n; ++i)
483 if ((argv(i) == player.playermodel && defaultskin == stof(player.playerskin)) || argv(i) == strcat(player.playermodel, ":", player.playerskin))
484 defaultmodel = argv(i);
485 }
486
487 int i = strstrofs(defaultmodel, ":", 0);
488 if(i >= 0)
489 {
490 defaultskin = stof(substring(defaultmodel, i+1, -1));
491 defaultmodel = substring(defaultmodel, 0, i);
492 }
493 }
494 if(autocvar_sv_defaultcharacterskin && !defaultskin)
495 {
496 if(teamplay)
497 {
498 switch(player.team)
499 {
500 case NUM_TEAM_1: defaultskin = autocvar_sv_defaultplayerskin_red; break;
501 case NUM_TEAM_2: defaultskin = autocvar_sv_defaultplayerskin_blue; break;
502 case NUM_TEAM_3: defaultskin = autocvar_sv_defaultplayerskin_yellow; break;
503 case NUM_TEAM_4: defaultskin = autocvar_sv_defaultplayerskin_pink; break;
504 }
505 }
506
507 if(!defaultskin)
508 defaultskin = autocvar_sv_defaultplayerskin;
509 }
510
511 MUTATOR_CALLHOOK(FixPlayermodel, defaultmodel, defaultskin, player);
512 defaultmodel = M_ARGV(0, string);
513 defaultskin = M_ARGV(1, int);
514
515 bool chmdl = false;
516 int oldskin;
517 if(defaultmodel != "")
518 {
519 if (defaultmodel != player.model)
520 {
521 vector m1 = player.mins;
522 vector m2 = player.maxs;
523 setplayermodel (player, defaultmodel);
524 setsize (player, m1, m2);
525 chmdl = true;
526 }
527
528 oldskin = player.skin;
529 player.skin = defaultskin;
530 }
531 else
532 {
533 if (player.playermodel != player.model || player.playermodel == "")
534 {
535 player.playermodel = CheckPlayerModel(player.playermodel); // this is never "", so no endless loop
536 vector m1 = player.mins;
537 vector m2 = player.maxs;
538 setplayermodel (player, player.playermodel);
539 setsize (player, m1, m2);
540 chmdl = true;
541 }
542
544 {
545 oldskin = player.skin;
546 player.skin = stof(player.playerskin);
547 }
548 else
549 {
550 oldskin = player.skin;
551 player.skin = defaultskin;
552 }
553 }
554
555 if(chmdl || oldskin != player.skin) // model or skin has changed
556 {
557 player.species = player_getspecies(player); // update species
559 UpdatePlayerSounds(player); // update skin sounds
560 }
561
562 if(!teamplay)
564 if(player.clientcolors != stof(autocvar_sv_defaultplayercolors))
566}
#define M_ARGV(x, type)
Definition events.qh:17
#define strstrofs
#define strlen
#define tokenize_console
void UpdatePlayerSounds(entity this)
bool autocvar_g_debug_globalsounds
Use new sound handling.
Definition globalsound.qh:9
float stof(string val,...)
string substring(string s, float start, float length)
float floor(float f)
string argv(float n)
#define setcolor
Definition pre.qh:11
vector
Definition self.qh:96
int player_getspecies(entity this)
Definition client.qc:444
float model_randomizer
Definition client.qc:453
string CheckPlayerModel(string plyermodel)
Definition client.qc:208
void FixPlayermodel(entity player)
Definition client.qc:454
void setplayermodel(entity e, string modelname)
Definition client.qc:241
string autocvar_sv_defaultplayermodel_blue
Definition player.qh:14
int autocvar_sv_defaultplayerskin_pink
Definition player.qh:9
int autocvar_sv_defaultplayerskin_yellow
Definition player.qh:11
string autocvar_sv_defaultplayermodel_yellow
Definition player.qh:17
string autocvar_sv_defaultplayermodel_red
Definition player.qh:16
string autocvar_sv_defaultplayercolors
Definition player.qh:12
bool autocvar_sv_defaultcharacter
Definition player.qh:6
int autocvar_sv_defaultplayerskin_blue
Definition player.qh:8
int autocvar_sv_defaultplayerskin_red
Definition player.qh:10
int autocvar_sv_defaultplayerskin
Definition player.qh:18
string autocvar_sv_defaultplayermodel
Definition player.qh:13
string autocvar_sv_defaultplayermodel_pink
Definition player.qh:15
bool autocvar_sv_defaultcharacterskin
Definition player.qh:7
int oldskin
const int NUM_TEAM_2
Definition teams.qh:14
const int NUM_TEAM_4
Definition teams.qh:16
const int NUM_TEAM_3
Definition teams.qh:15
const int NUM_TEAM_1
Definition teams.qh:13

References argv(), autocvar_g_debug_globalsounds, autocvar_sv_defaultcharacter, autocvar_sv_defaultcharacterskin, autocvar_sv_defaultplayercolors, autocvar_sv_defaultplayermodel, autocvar_sv_defaultplayermodel_blue, autocvar_sv_defaultplayermodel_pink, autocvar_sv_defaultplayermodel_red, autocvar_sv_defaultplayermodel_yellow, autocvar_sv_defaultplayerskin, autocvar_sv_defaultplayerskin_blue, autocvar_sv_defaultplayerskin_pink, autocvar_sv_defaultplayerskin_red, autocvar_sv_defaultplayerskin_yellow, CheckPlayerModel(), CS(), entity(), FixPlayermodel(), floor(), M_ARGV, model_randomizer, MUTATOR_CALLHOOK, NUM_TEAM_1, NUM_TEAM_2, NUM_TEAM_3, NUM_TEAM_4, oldskin, player_getspecies(), setcolor, setplayermodel(), stof(), strcat(), strlen, strstrofs, substring(), teamplay, tokenize_console, UpdatePlayerSounds(), and vector.

Referenced by FixPlayermodel(), MUTATOR_HOOKABLE(), PlayerThink(), PutObserverInServer(), and PutPlayerInServer().

◆ GetPlayerLimit()

int GetPlayerLimit ( )

Definition at line 2154 of file client.qc.

2155{
2156 if(g_duel)
2157 return 2; // TODO: this workaround is needed since the mutator hook from duel can't be activated before the gametype is loaded (e.g. switching modes via gametype vote screen)
2158
2159 // don't return map_maxplayers during intermission as it would interfere with MapHasRightSize()
2160 int player_limit = autocvar_g_maxplayers > 0 ? autocvar_g_maxplayers : maxclients;
2162 {
2163 if (autocvar_g_maxplayers == -1 && map_maxplayers > 0)
2164 player_limit = map_maxplayers;
2165 MUTATOR_CALLHOOK(GetPlayerLimit, player_limit);
2166 player_limit = M_ARGV(0, int);
2167 }
2168 return bound(0, player_limit, maxclients);
2169}
float maxclients
#define g_duel
Definition duel.qh:32
bool intermission_running
int map_maxplayers
Definition mapinfo.qh:191
float bound(float min, float value, float max)
int GetPlayerLimit()
Definition client.qc:2154
int autocvar_g_maxplayers
Definition client.qh:44

References autocvar_g_maxplayers, bound(), g_duel, GetPlayerLimit(), intermission_running, M_ARGV, map_maxplayers, maxclients, and MUTATOR_CALLHOOK.

Referenced by bot_fixcount(), GameplayMode_DelayedInit(), GetPlayerLimit(), MapHasRightSize(), MUTATOR_HOOKABLE(), MUTATOR_HOOKFUNCTION(), nJoinAllowed(), and SendWelcomeMessage().

◆ GiveWarmupResources()

void GiveWarmupResources ( entity this)

Definition at line 568 of file client.qc.

569{
570 SetResource(this, RES_SHELLS, warmup_start_ammo_shells);
571 SetResource(this, RES_BULLETS, warmup_start_ammo_nails);
572 SetResource(this, RES_ROCKETS, warmup_start_ammo_rockets);
573 SetResource(this, RES_CELLS, warmup_start_ammo_cells);
574 SetResource(this, RES_FUEL, warmup_start_ammo_fuel);
575 SetResource(this, RES_HEALTH, warmup_start_health);
577 STAT(WEAPONS, this) = WARMUP_START_WEAPONS;
578}
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have.
RES_ARMOR
Definition ent_cs.qc:155
#define STAT(...)
Definition stats.qh:94
float warmup_start_ammo_cells
Definition world.qh:104
#define WARMUP_START_WEAPONS
Definition world.qh:100
float warmup_start_ammo_rockets
Definition world.qh:103
float warmup_start_ammo_shells
Definition world.qh:101
float warmup_start_ammo_nails
Definition world.qh:102
float warmup_start_health
Definition world.qh:106
float warmup_start_ammo_fuel
Definition world.qh:105
float warmup_start_armorvalue
Definition world.qh:107

References entity(), RES_ARMOR, SetResource(), STAT, warmup_start_ammo_cells, warmup_start_ammo_fuel, warmup_start_ammo_nails, warmup_start_ammo_rockets, warmup_start_ammo_shells, warmup_start_armorvalue, warmup_start_health, and WARMUP_START_WEAPONS.

Referenced by PutPlayerInServer(), and ReadyCount().

◆ Join()

void Join ( entity this,
bool queued_join )

it's assumed this isn't called for bots (campaign_bots_may_start, centreprints)

Definition at line 2073 of file client.qc.

2074{
2075 entity player_with_dibs = NULL;
2076
2078 {
2080 ReadyRestart(true);
2082 }
2083
2084 // If teams aren't equal and a player is queued then they chose a biggest team so they can't join yet.
2085 if (queued_join && TeamBalance_AreEqual(this, true))
2086 {
2087 int clients_remaining = AVAILABLE_TEAMS;
2088 // First we must join player(s) queued for specific team(s) (they chose first)
2089 // so TeamBalance_JoinBestTeam() won't select the same team(s).
2090 // Assumes `this` was already assigned a team or is using autoselect.
2091 FOREACH_CLIENT(it != this && it.wants_join > 0,
2092 {
2093 // detect any conflict between `this` and a queued player (queuePlayer() handles other conflicts)
2094 if (this.team < 0 && this.team_selected > 0 // `this` can't have their preference
2095 && it.wants_join == this.team_selected) // `it` is the player who already chose the team `this` wanted
2096 player_with_dibs = it;
2097
2098 Join(it, false);
2099 --clients_remaining;
2100 });
2101
2102 // Second pass: queued players whose team will be autoselected
2103 // in order of strongest to weakest for optimal balance.
2104 for (; clients_remaining; --clients_remaining)
2105 {
2106 entity strongest_autoselect_client = NULL;
2107 float strongest_autoselect_client_skill = 0;
2108 FOREACH_CLIENT(it.wants_join < 0 || (it == this && it.team <= 0),
2109 {
2110 float it_skill = it.m_skill_mu ? it.m_skill_mu : server_skill_average; // average was set by TeamBalance_AreEqual()
2111 if (it_skill > strongest_autoselect_client_skill)
2112 {
2113 strongest_autoselect_client = it;
2114 strongest_autoselect_client_skill = it_skill;
2115 }
2116 });
2117 if (strongest_autoselect_client == this) // can't just Join(); return; due to player_with_dibs
2118 {
2119 entity balance = TeamBalance_CheckAllowedTeams(this);
2120 int best_team_index = TeamBalance_FindBestTeam(balance, this, true);
2121 TeamBalance_Destroy(balance);
2122 SetPlayerTeam(this, best_team_index, TEAM_CHANGE_AUTO);
2123 }
2124 else if (strongest_autoselect_client)
2125 Join(strongest_autoselect_client, false);
2126 }
2127 }
2128
2129 Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_PREVENT_JOIN);
2130
2131 TRANSMUTE(Player, this);
2132 PutClientInServer(this);
2133
2134 if(IS_PLAYER(this)) // could be false due to PutClientInServer() mutator hook
2135 {
2136 if (!teamplay)
2137 Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_JOIN_PLAY, this.netname);
2138 else if (player_with_dibs)
2139 // limitation: notifications support only 1 translated team name
2140 // so the team `this` preferred can't be mentioned, only the team they got assigned to.
2141 Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, APP_TEAM_NUM(this.team, CENTER_JOIN_PLAY_TEAM_QUEUECONFLICT), player_with_dibs.netname);
2142 else
2143 {
2144 if (this.wants_join && game_starttime < time && !warmup_stage) // No countdown running && not returning to warmup via ReadyRestart_force
2145 Send_Notification(NOTIF_ONE_ONLY, this, MSG_ANNCE, ANNCE_BEGIN); // Get queued player's attention
2146 Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, APP_TEAM_NUM(this.team, CENTER_JOIN_PLAY_TEAM));
2147 }
2148 }
2149
2150 this.team_selected = 0;
2151 this.wants_join = 0;
2152}
string netname
Definition powerups.qc:20
bool warmup_stage
Definition main.qh:120
int team
Definition main.qh:188
float game_starttime
Definition stats.qh:82
float game_stopped
Definition stats.qh:81
int wants_join
Definition ent_cs.qh:69
#define PutClientInServer
Definition _all.inc:250
bool autocvar_g_campaign
Definition menu.qc:752
s1 s2 s1 s2 FLAG s1 s2 FLAG spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 NAME CPID_PREVENT_JOIN
Definition all.inc:743
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
Definition all.qc:1500
void Kill_Notification(NOTIF broadcast, entity client, MSG net_type, CPID net_cpid)
Definition all.qc:1464
#define APP_TEAM_NUM(num, prefix)
Definition all.qh:88
#define TRANSMUTE(cname, this,...)
Definition oo.qh:139
#define NULL
Definition post.qh:14
#define AVAILABLE_TEAMS
Number of teams that exist currently.
bool campaign_bots_may_start
campaign mode: bots shall spawn but wait for the player to spawn before they do anything in other gam...
Definition campaign.qh:26
void Join(entity this, bool queued_join)
it's assumed this isn't called for bots (campaign_bots_may_start, centreprints)
Definition client.qc:2073
int team_selected
Definition client.qh:75
void ReadyRestart(bool forceWarmupEnd)
Definition vote.qc:526
void TeamBalance_Destroy(entity balance)
Destroy the team balance entity.
Definition teamplay.qc:528
bool SetPlayerTeam(entity player, int team_index, int type)
Sets the team of the player.
Definition teamplay.qc:286
entity TeamBalance_CheckAllowedTeams(entity for_whom)
Checks whether the player can join teams according to global configuration and mutator settings.
Definition teamplay.qc:424
bool TeamBalance_AreEqual(entity ignore, bool would_leave)
Definition teamplay.qc:585
int TeamBalance_FindBestTeam(entity balance, entity player, bool ignore_player)
Finds the team that will make the game most balanced if the player joins it.
Definition teamplay.qc:892
@ TEAM_CHANGE_AUTO
The team was selected by autobalance.
Definition teamplay.qh:129

References autocvar_g_campaign, AVAILABLE_TEAMS, campaign_bots_may_start, entity(), FOREACH_CLIENT, game_starttime, game_stopped, Join(), NULL, ReadyRestart(), SetPlayerTeam(), TEAM_CHANGE_AUTO, TeamBalance_AreEqual(), TeamBalance_CheckAllowedTeams(), TeamBalance_Destroy(), TeamBalance_FindBestTeam(), and time.

Referenced by ClientCommand_join(), Join(), ObserverOrSpectatorThink(), PlayerPreThink(), ReadyRestart_force(), and TeamBalance_QueuedPlayersTagIn().

◆ joinAllowed()

bool joinAllowed ( entity this,
int team_index )

Definition at line 2263 of file client.qc.

2264{
2265 if (CS(this).version_mismatch)
2266 {
2267 Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_JOIN_PREVENT_VERSIONMISMATCH);
2268 return false;
2269 }
2270 if (time < CS(this).jointime + MIN_SPEC_TIME) return false;
2271 if (teamplay && lockteams)
2272 {
2273 Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_TEAMCHANGE_LOCKED);
2274 return false;
2275 }
2276
2277 int forced_team_index = Player_GetForcedTeamIndex(this);
2278 if (forced_team_index < TEAM_FORCE_DEFAULT || (teamplay && forced_team_index > AVAILABLE_TEAMS)) // PutPlayerInServer would bug out
2279 {
2280 if (forced_team_index > AVAILABLE_TEAMS)
2281 Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, APP_TEAM_NUM(Team_IndexToTeam(forced_team_index), CENTER_TEAMCHANGE_FORCEDTEAM));
2282 else // handles !teamplay case too
2283 Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_JOIN_PREVENT_FORCEDSPEC);
2284 return false;
2285 }
2286
2287 if (!INGAME(this) && PlayerInList(this, autocvar_g_playban_list))
2288 {
2289 Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_JOIN_PLAYBAN);
2290 return false;
2291 }
2292
2293 // IS_PLAYER for most gametypes, INGAME for ca, lms, surv
2294 if (autocvar_g_maxping && !(IS_PLAYER(this) || INGAME(this)) && !this.wants_join)
2295 {
2296 if (this.ping <= 0) return false; // too soon
2297 if (this.ping > autocvar_g_maxping)
2298 {
2299 Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_JOIN_PREVENT_PING);
2300 return false;
2301 }
2302 }
2303
2304 if (QueueNeeded(this, team_index))
2305 {
2306 if (team_index == 0) // so ClientCommand_join() can check joinAllowed() before calling SetPlayerTeam() without chicken/egg problem
2307 if (ShowTeamSelection(this)) return false; // only needed by callsites other than ClientCommand_join() teamplay
2308 // queuePlayer called here so that only conditions above block queuing (g_maxplayers shouldn't)
2309 if (queuePlayer(this, team_index)) return false;
2310 if (!nJoinAllowed(this)) return false;
2311 }
2312 else
2313 {
2314 if (!nJoinAllowed(this)) return false;
2315 if (team_index == 0) // so ClientCommand_join() can check joinAllowed() before calling SetPlayerTeam() without chicken/egg problem
2316 if (ShowTeamSelection(this)) return false; // only needed by callsites other than ClientCommand_join() teamplay
2317 }
2318
2319 return true;
2320}
string autocvar_g_playban_list
Definition banning.qh:14
float ping
Definition main.qh:169
bool ShowTeamSelection(entity this)
Definition client.qc:2061
float autocvar_g_maxping
Definition client.qc:2262
bool queuePlayer(entity this, int team_index)
Definition client.qc:2214
int nJoinAllowed(entity this)
Determines how many player slots are free.
Definition client.qc:2176
bool PlayerInList(entity player, string list)
Definition client.qc:1048
const int MIN_SPEC_TIME
Definition client.qh:403
float jointime
Definition client.qh:66
#define INGAME(it)
Definition sv_rules.qh:24
bool QueueNeeded(entity client, int team_index)
Definition teamplay.qc:1254
int Player_GetForcedTeamIndex(entity player)
Returns the index of the forced team of the given player.
Definition teamplay.qc:370
@ TEAM_FORCE_DEFAULT
Don't force any team.
Definition teamplay.qh:153
bool lockteams
Definition teamplay.qh:20
int Team_IndexToTeam(int index)
Converts team index into team value.
Definition teams.qh:169

References APP_TEAM_NUM, autocvar_g_maxping, autocvar_g_playban_list, AVAILABLE_TEAMS, CS(), entity(), INGAME, IS_PLAYER, jointime, lockteams, MIN_SPEC_TIME, nJoinAllowed(), ping, Player_GetForcedTeamIndex(), PlayerInList(), QueueNeeded(), queuePlayer(), Send_Notification(), ShowTeamSelection(), TEAM_FORCE_DEFAULT, Team_IndexToTeam(), teamplay, time, and wants_join.

Referenced by ClientCommand_join(), ObserverOrSpectatorThink(), and PlayerPreThink().

◆ nJoinAllowed()

int nJoinAllowed ( entity this)

Determines how many player slots are free.

This depends on cvar g_maxplayers and other limits that apply to all clients which aren't specifically excepted.

Returns
int number of free slots for players, 0 if none

Definition at line 2176 of file client.qc.

2177{
2178 if(!this)
2179 // this is called that way when checking if anyone may be able to join (to build qcstatus)
2180 // so report 0 free slots if restricted
2181 {
2182 if(autocvar_g_forced_team_otherwise == "spectate"
2183 || autocvar_g_forced_team_otherwise == "spectator"
2184 || (teamplay && lockteams))
2185 return 0;
2186 }
2187
2188 int totalClients = 0;
2189 int currentlyPlaying = 0;
2190 FOREACH_CLIENT(it != this,
2191 {
2192 ++totalClients;
2193 if(IS_PLAYER(it) || INGAME(it))
2194 ++currentlyPlaying;
2195 });
2196
2197 int player_limit = GetPlayerLimit();
2198
2199 int free_slots = max(0, player_limit - currentlyPlaying);
2200 if (this || maxclients - totalClients) // don't add bot slots in the getstatus case if nobody can connect
2201 free_slots += bots_would_leave;
2202 if (!this) // getstatus case
2203 free_slots = min(free_slots, maxclients - totalClients);
2204
2205 if(this && !free_slots)
2206 Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_JOIN_PREVENT_MAXPLAYERS, player_limit);
2207
2208 return free_slots;
2209}
int bots_would_leave
how many bots would leave so humans can replace them
Definition api.qh:101
float min(float f,...)
string autocvar_g_forced_team_otherwise
Definition teamplay.qh:16

References autocvar_g_forced_team_otherwise, bots_would_leave, entity(), FOREACH_CLIENT, GetPlayerLimit(), INGAME, IS_PLAYER, lockteams, max(), maxclients, min(), Send_Notification(), and teamplay.

Referenced by joinAllowed(), and WinningConditionHelper().

◆ play_countdown()

void play_countdown ( entity this,
float finished,
Sound samp )

Definition at line 1531 of file client.qc.

1532{
1533 TC(Sound, samp);
1534 float time_left = finished - time;
1535 if(IS_REAL_CLIENT(this) && time_left < 6 && floor(time_left - frametime) != floor(time_left))
1536 sound(this, CH_INFO, samp, VOL_BASE, ATTEN_NORM);
1537}
float frametime
#define TC(T, sym)
Definition _all.inc:82
const float VOL_BASE
Definition sound.qh:36
const int CH_INFO
Definition sound.qh:6
const float ATTEN_NORM
Definition sound.qh:30
#define sound(e, c, s, v, a)
Definition sound.qh:52

References ATTEN_NORM, CH_INFO, entity(), floor(), frametime, IS_REAL_CLIENT, sound, TC, time, and VOL_BASE.

Referenced by player_powerups().

◆ player_powerups_remove_all()

void player_powerups_remove_all ( entity this,
bool allow_poweroff_sound )

Definition at line 1540 of file client.qc.

1541{
1543 {
1544 // don't play the poweroff sound when the game restarts or the player disconnects
1545 if (allow_poweroff_sound && time > game_starttime + 1 && IS_CLIENT(this)
1547 sound(this, CH_INFO, SND_POWEROFF, VOL_BASE, ATTEN_NORM);
1548
1550 stopsound(this, CH_TRIGGER_SINGLE); // get rid of the pickup sound
1551
1553 }
1554}
const int IT_SUPERWEAPON
Definition item.qh:41
const int IT_UNLIMITED_AMMO
Definition item.qh:23
const int IT_UNLIMITED_SUPERWEAPONS
Definition item.qh:24
int items
Definition player.qh:226
#define IS_CLIENT(s)
Definition player.qh:241
const int CH_TRIGGER_SINGLE
Definition sound.qh:13
void stopsound(entity e, int chan)
Definition all.qc:109
int start_items
Definition world.qh:82

References ATTEN_NORM, CH_INFO, CH_TRIGGER_SINGLE, entity(), game_starttime, IS_CLIENT, IT_SUPERWEAPON, IT_UNLIMITED_AMMO, IT_UNLIMITED_SUPERWEAPONS, items, sound, start_items, stopsound(), time, and VOL_BASE.

Referenced by ClientDisconnect(), player_powerups(), PutObserverInServer(), and reset_map().

◆ PlayerFrame()

void PlayerFrame ( entity this)

Definition at line 2863 of file client.qc.

2864{
2865 Physics_UpdateStats(this);
2866
2867 // Don't accumulate alivetime whilst afk as xonstat skill ratings are based on score per second.
2868 // Time accumulated so far (including the 30s) is retained in the event of a move to spec, disconnect, etc.
2869 if (this.alivetime_start && time - CS(this).parm_idlesince >= 30)
2870 this.alivetime_start += frametime;
2871
2872// formerly PreThink code
2873
2874 if (this.score_frame_dmg)
2875 {
2877 GameRules_scoring_add(this, DMG, this.score_frame_dmg);
2878 this.score_frame_dmg = 0;
2879 }
2880 if (this.score_frame_dmgtaken)
2881 {
2883 GameRules_scoring_add(this, DMGTAKEN, this.score_frame_dmgtaken);
2884 this.score_frame_dmgtaken = 0;
2885 }
2886
2887 STAT(GUNALIGN, this) = CS_CVAR(this).cvar_cl_gunalign; // TODO
2888 STAT(MOVEVARS_CL_TRACK_CANJUMP, this) = CS_CVAR(this).cvar_cl_movement_track_canjump;
2889
2890 // physics frames: update anticheat stuff
2891 anticheat_prethink(this);
2892
2893 // Check if spectating is allowed
2894 // cvar hook/callback TODO: make this event-driven
2896 && (IS_SPEC(this) || IS_OBSERVER(this)) && !INGAME(this))
2897 {
2898 float cutoff = CS(this).spectatortime + autocvar_g_maxplayers_spectator_blocktime;
2899 if (time > cutoff + MIN_SPEC_TIME * 0.5 // sv_spectate was disabled recently (or the server was stalled far too long)
2900 || CS(this).autojoin_checked == 0) // or too soon to have tried to autojoin
2901 {
2902 CS(this).spectatortime = time; // reset the grace period
2903 if (CS(this).autojoin_checked) // only notify when sv_spectate was disabled recently, to prevent spam
2904 Send_Notification(NOTIF_ONE_ONLY, this, MSG_MULTI, SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime);
2905 }
2906 else if (time > cutoff)
2907 if (dropclient_schedule(this))
2908 Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_QUIT_KICK_SPECTATING);
2909 }
2910
2911 // Check for nameless players
2912 if (this.netname == "" || this.netname != CS(this).netname_previous)
2913 {
2914 bool assume_unchanged = (CS(this).netname_previous == "");
2915 if (autocvar_sv_name_maxlength > 0 && strlennocol(this.netname) > autocvar_sv_name_maxlength)
2916 {
2917 int new_length = textLengthUpToLength(this.netname, autocvar_sv_name_maxlength, strlennocol);
2918 this.netname = strzone(strcat(substring(this.netname, 0, new_length), "^7"));
2919 sprint(this, sprintf("Warning: your name is longer than %d characters, it has been truncated.\n", autocvar_sv_name_maxlength));
2920 assume_unchanged = false;
2921 // stuffcmd(this, strcat("name ", this.netname, "\n")); // maybe?
2922 }
2923 if (isInvisibleString(this.netname))
2924 {
2925 this.netname = strzone(sprintf("Player#%d", this.playerid));
2926 sprint(this, "Warning: invisible names are not allowed.\n");
2927 assume_unchanged = false;
2928 // stuffcmd(this, strcat("name ", this.netname, "\n")); // maybe?
2929 }
2930 if (!assume_unchanged && autocvar_sv_eventlog)
2931 GameLogEcho(strcat(":name:", ftos(this.playerid), ":", playername(this.netname, this.team, false)));
2932 strcpy(CS(this).netname_previous, this.netname);
2933 }
2934
2935 // version nagging
2936 if (CS(this).version_nagtime && CS_CVAR(this).cvar_g_xonoticversion && time > CS(this).version_nagtime)
2937 {
2938 CS(this).version_nagtime = 0;
2939 if (strstrofs(CS_CVAR(this).cvar_g_xonoticversion, "git", 0) >= 0 || strstrofs(CS_CVAR(this).cvar_g_xonoticversion, "autobuild", 0) >= 0)
2940 {
2941 // git client
2942 }
2943 else if (strstrofs(autocvar_g_xonoticversion, "git", 0) >= 0 || strstrofs(autocvar_g_xonoticversion, "autobuild", 0) >= 0)
2944 {
2945 // git server
2946 Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_VERSION_BETA, autocvar_g_xonoticversion, CS_CVAR(this).cvar_g_xonoticversion);
2947 }
2948 else
2949 {
2950 int r = vercmp(CS_CVAR(this).cvar_g_xonoticversion, autocvar_g_xonoticversion);
2951 if (r < 0) // old client
2952 Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_VERSION_OUTDATED, autocvar_g_xonoticversion, CS_CVAR(this).cvar_g_xonoticversion);
2953 else if (r > 0) // old server
2954 Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_VERSION_OLD, autocvar_g_xonoticversion, CS_CVAR(this).cvar_g_xonoticversion);
2955 }
2956 }
2957
2958 if (this.ignore_list_send_time > 0 && time > this.ignore_list_send_time)
2959 ignore_list_send(this);
2960
2961 // GOD MODE info
2962 if (!(this.flags & FL_GODMODE) && this.max_armorvalue)
2963 {
2964 Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_GODMODE_OFF, this.max_armorvalue);
2965 this.max_armorvalue = 0;
2966 }
2967
2968 // Vehicles
2969 if(autocvar_g_vehicles_enter && (time > this.last_vehiclecheck) && !game_stopped && !this.vehicle)
2970 if(IS_PLAYER(this) && !STAT(FROZEN, this) && !StatusEffects_active(STATUSEFFECT_Frozen, this) && !IS_DEAD(this) && !IS_INDEPENDENT_PLAYER(this))
2971 {
2973 {
2974 if (!head.owner)
2975 {
2976 if (!head.team || SAME_TEAM(this, head))
2977 Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_VEHICLE_ENTER);
2978 else if (autocvar_g_vehicles_steal)
2979 Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_VEHICLE_ENTER_STEAL);
2980 }
2981 else if ((head.vehicle_flags & VHF_MULTISLOT) && SAME_TEAM(head.owner, this))
2982 Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_VEHICLE_ENTER_GUNNER);
2983 }
2984
2985 this.last_vehiclecheck = time + 1;
2986 }
2987
2988
2989
2990// formerly PostThink code
2992 if (IS_REAL_CLIENT(this))
2994 if (!intermission_running) // NextLevel() kills all centerprints after setting this true
2995 {
2996 int totalClients = 0;
2998 {
2999 // maxidle disabled in local matches by not counting clients (totalClients 0)
3001 {
3003 {
3004 ++totalClients;
3005 });
3006 if (maxclients - totalClients > autocvar_sv_maxidle_slots)
3007 totalClients = 0;
3008 }
3009 }
3010 else if ((IS_PLAYER(this) || this.wants_join) && autocvar_sv_maxidle_playertospectator > 0)
3011 {
3013 {
3014 ++totalClients;
3015 });
3016 }
3017
3018 if (totalClients < autocvar_sv_maxidle_minplayers)
3019 {
3020 // idle kick disabled
3021 CS(this).parm_idlesince = time;
3022 }
3023 else if (time - CS(this).parm_idlesince < 1) // instead of (time == this.parm_idlesince) to support sv_maxidle <= 10
3024 {
3025 if (CS(this).idlekick_lasttimeleft)
3026 {
3027 CS(this).idlekick_lasttimeleft = 0;
3028 Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_IDLING);
3029 }
3030 }
3031 else
3032 {
3033 float maxidle_time = autocvar_sv_maxidle;
3034 if ((IS_PLAYER(this) || this.wants_join)
3037 float timeleft = ceil(maxidle_time - (time - CS(this).parm_idlesince));
3038 float countdown_time = max(min(10, maxidle_time - 1), ceil(maxidle_time * 0.33)); // - 1 to support maxidle_time <= 10
3039 if (timeleft == countdown_time && !CS(this).idlekick_lasttimeleft)
3040 {
3042 {
3043 if (!this.wants_join) // no countdown centreprint when getting kicked off the join queue
3044 Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_MOVETOSPEC_IDLING, timeleft);
3045 }
3046 else
3047 Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_DISCONNECT_IDLING, timeleft);
3048 }
3049 if (timeleft <= 0)
3050 {
3051 if ((IS_PLAYER(this) || this.wants_join)
3053 {
3054 if (this.wants_join)
3055 Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_MOVETOSPEC_IDLING_QUEUE, this.netname, maxidle_time);
3056 else
3057 Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_MOVETOSPEC_IDLING, this.netname, maxidle_time);
3058 PutObserverInServer(this, true, true);
3059 // Can't do this in PutObserverInServer() or SetPlayerTeam() cos it causes
3060 // mouse2 (change spectate mode) to kick the player off the join queue.
3061 this.wants_join = 0;
3062 this.team_selected = 0;
3063 // when the player is kicked off the server, these are called in ClientDisconnect()
3067 }
3068 else
3069 {
3070 if (dropclient_schedule(this))
3071 Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_KICK_IDLING, this.netname, maxidle_time);
3072 }
3073 return;
3074 }
3075 else if (timeleft <= countdown_time
3076 && !this.wants_join) // no countdown bangs when getting kicked off the join queue
3077 {
3078 if (timeleft != CS(this).idlekick_lasttimeleft)
3079 play2(this, SND(TALK2));
3080 CS(this).idlekick_lasttimeleft = timeleft;
3081 }
3082 }
3083 }
3084
3085 CheatFrame(this);
3086
3087 if (game_stopped)
3088 {
3089 this.solid = SOLID_NOT;
3090 this.takedamage = DAMAGE_NO;
3092 CS(this).teamkill_complain = 0;
3093 CS(this).teamkill_soundtime = 0;
3094 CS(this).teamkill_soundsource = NULL;
3095 }
3096
3098 float hp = healtharmor_maxdamage(GetResource(this, RES_HEALTH), GetResource(this, RES_ARMOR), autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id).x;
3100 }
3101}
void anticheat_prethink(entity this)
Definition anticheat.qc:172
float CheatFrame(entity this)
Definition cheats.qc:708
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
void ignore_list_send(entity this)
Definition cmd.qc:168
float ignore_list_send_time
Definition cmd.qh:9
void Physics_UpdateStats(entity this)
Definition player.qc:44
#define IS_DEAD(s)
Definition player.qh:244
string playername(string thename, int teamid, bool team_colorize)
Definition util.qc:2180
vector healtharmor_maxdamage(float h, float a, float armorblock, int deathtype)
Definition util.qc:1391
float textLengthUpToLength(string theText, int maxLength, textLengthUpToLength_lenFunction_t w)
Definition util.qc:920
const int FL_GODMODE
Definition constants.qh:67
float flags
const float SOLID_NOT
vector origin
float solid
float autocvar_g_balance_armor_blockpercent
Definition damage.qh:21
void GameLogEcho(string s)
Definition gamelog.qc:15
bool autocvar_sv_eventlog
Definition gamelog.qh:3
float Handicap_GetTotalHandicap(entity player, bool receiving)
Returns the total handicap of the player.
Definition handicap.qc:96
float handicap_avg_taken_sum
Definition handicap.qh:72
float handicap_avg_given_sum
Definition handicap.qh:71
entity WarpZone_SearchInRadius(vector org, float rad, float nomonsters, WarpZone_FindRadius_cond_callback_t cb)
Modified findradius aware of warpzones, that only includes entities that meet the "cb" criteria.
Definition common.qc:684
#define MOVE_NOTHING
Definition common.qh:35
void sprint(float clientnum, string text,...)
string ftos(float f)
string strzone(string s)
void set_movetype(entity this, int mt)
Definition movetypes.qc:4
const int MOVETYPE_NONE
Definition movetypes.qh:133
s1 s2 s1 s2 FLAG s1 s2 FLAG spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 CPID_IDLING
Definition all.inc:696
void PutObserverInServer(entity this, bool is_forced, bool use_spawnpoint)
putting a client as observer in the server
Definition client.qc:261
bool Vehicle_Enter_cond(entity e)
Definition client.qc:2850
float last_vehiclecheck
Definition client.qc:2690
float autocvar_sv_maxidle
Definition client.qh:37
string autocvar_g_xonoticversion
Definition client.qh:46
int playerid
Definition client.qh:82
bool autocvar_sv_spectate
Definition client.qh:57
int autocvar_sv_maxidle_minplayers
Definition client.qh:38
float autocvar_sv_maxidle_playertospectator
Definition client.qh:39
float autocvar_g_maxplayers_spectator_blocktime
Definition client.qh:45
bool autocvar_sv_maxidle_slots_countbots
Definition client.qh:42
int autocvar_sv_name_maxlength
Definition client.qh:53
int autocvar_sv_maxidle_slots
Definition client.qh:41
bool autocvar_sv_maxidle_alsokickspectators
Definition client.qh:40
float alivetime_start
Definition client.qh:68
float max_armorvalue
Definition items.qh:26
bool dropclient_schedule(entity this)
Schedules dropclient for a player and returns true; if dropclient is already scheduled (for that play...
Definition main.qc:44
float score_frame_dmgtaken
Definition player.qh:26
float score_frame_dmg
Definition player.qh:25
void play2(entity e, string filename)
Definition all.qc:116
#define SND(id)
Definition all.qh:35
#define CS_CVAR(this)
Definition state.qh:51
bool StatusEffects_active(StatusEffect this, entity actor)
ERASEABLE int vercmp(string v1, string v2)
Definition string.qh:563
#define strcpy(this, s)
Definition string.qh:51
ERASEABLE bool isInvisibleString(string s)
Definition string.qh:392
const int DAMAGE_NO
Definition subs.qh:79
float takedamage
Definition subs.qh:78
#define GameRules_scoring_add(client, fld, value)
Definition sv_rules.qh:85
entity vehicle
float autocvar_g_vehicles_enter_radius
bool TeamBalance_QueuedPlayersTagIn(entity ignore)
Joins queued player(s) to team(s) with a shortage, this should be more robust than only replacing the...
Definition teamplay.qc:694
void TeamBalance_RemoveExcessPlayers(entity ignore)
Definition teamplay.qc:631
bool autocvar_g_balance_teams_remove
Definition teamplay.qh:10
#define SAME_TEAM(a, b)
Definition teams.qh:241
#define IS_OBSERVER(v)
Definition utils.qh:11
const int VHF_MULTISLOT
Vehicle has multiple player slots.
Definition vehicle.qh:106
void WaypointSprite_UpdateHealth(entity e, float f)
entity waypointsprite_attachedforcarrier
bool autocvar_sv_dedicated
Definition world.qh:41

References alivetime_start, anticheat_prethink(), autocvar_g_balance_armor_blockpercent, autocvar_g_balance_teams_remove, autocvar_g_maxplayers_spectator_blocktime, autocvar_g_vehicles_enter_radius, autocvar_g_xonoticversion, autocvar_sv_dedicated, autocvar_sv_eventlog, autocvar_sv_maxidle, autocvar_sv_maxidle_alsokickspectators, autocvar_sv_maxidle_minplayers, autocvar_sv_maxidle_playertospectator, autocvar_sv_maxidle_slots, autocvar_sv_maxidle_slots_countbots, autocvar_sv_name_maxlength, autocvar_sv_spectate, ceil(), CheatFrame(), CPID_IDLING, CS(), CS_CVAR, DAMAGE_NO, dropclient_schedule(), entity(), FL_GODMODE, flags, FOREACH_CLIENT, frametime, ftos(), game_stopped, GameLogEcho(), GameRules_scoring_add, GetResource(), handicap_avg_given_sum, handicap_avg_taken_sum, Handicap_GetTotalHandicap(), healtharmor_maxdamage(), ignore_list_send(), ignore_list_send_time, INGAME, intermission_running, IS_DEAD, IS_INDEPENDENT_PLAYER, IS_OBSERVER, IS_PLAYER, IS_REAL_CLIENT, IS_SPEC, isInvisibleString(), Kill_Notification(), last_vehiclecheck, max(), max_armorvalue, maxclients, min(), MIN_SPEC_TIME, MOVE_NOTHING, MOVETYPE_NONE, netname, NULL, origin, Physics_UpdateStats(), play2(), playerid, playername(), PutObserverInServer(), RES_ARMOR, SAME_TEAM, score_frame_dmg, score_frame_dmgtaken, Send_Notification(), set_movetype(), SND, solid, SOLID_NOT, sprint(), STAT, StatusEffects_active(), strcat(), strcpy, strstrofs, strzone(), substring(), takedamage, team, team_selected, TeamBalance_QueuedPlayersTagIn(), TeamBalance_RemoveExcessPlayers(), textLengthUpToLength(), time, vehicle, Vehicle_Enter_cond(), vercmp(), VHF_MULTISLOT, wants_join, WarpZone_SearchInRadius(), waypointsprite_attachedforcarrier, and WaypointSprite_UpdateHealth().

Referenced by StartFrame().

◆ PlayerInIDList()

bool PlayerInIDList ( entity p,
string idlist )

Definition at line 1039 of file client.qc.

1040{
1041 // NOTE: we do NOT check crypto_idfp_signed here, an unsigned ID is fine too for this
1042 if(!p.crypto_idfp)
1043 return false;
1044
1045 return findinlist_abbrev(p.crypto_idfp, idlist);
1046}
bool findinlist_abbrev(string tofind, string list)
Definition client.qc:1016

References entity(), and findinlist_abbrev().

Referenced by BanCommand_mute(), BanCommand_playban(), BanCommand_voteban(), MUTATOR_HOOKFUNCTION(), and PlayerInList().

◆ PlayerInIPList()

bool PlayerInIPList ( entity p,
string iplist )

Definition at line 1030 of file client.qc.

1031{
1032 // some safety checks (never allow local?)
1033 if(p.netaddress == "local" || p.netaddress == "" || !IS_REAL_CLIENT(p))
1034 return false;
1035
1036 return findinlist_abbrev(p.netaddress, iplist);
1037}

References entity(), findinlist_abbrev(), and IS_REAL_CLIENT.

Referenced by BanCommand_mute(), BanCommand_playban(), BanCommand_voteban(), MUTATOR_HOOKFUNCTION(), and PlayerInList().

◆ PlayerInList()

bool PlayerInList ( entity player,
string list )

Definition at line 1048 of file client.qc.

1049{
1050 if (list == "")
1051 return false;
1052 return boolean(PlayerInIDList(player, list) || PlayerInIPList(player, list));
1053}
#define boolean(value)
Definition bool.qh:9
bool PlayerInIDList(entity p, string idlist)
Definition client.qc:1039
bool PlayerInIPList(entity p, string iplist)
Definition client.qc:1030

References boolean, entity(), PlayerInIDList(), and PlayerInIPList().

Referenced by ClientCommand_minigame(), ClientConnect(), ignore_playerindb(), invite_minigame(), joinAllowed(), MUTATOR_HOOKFUNCTION(), Player_GetForcedTeamIndex(), VoteCommand_abstain(), VoteCommand_call(), VoteCommand_no(), and VoteCommand_yes().

◆ PlayerUseKey()

void PlayerUseKey ( entity this)

Definition at line 2634 of file client.qc.

2635{
2636 if (!IS_PLAYER(this))
2637 return;
2638
2639 if(this.vehicle)
2640 {
2641 if(!game_stopped)
2642 {
2644 return;
2645 }
2646 }
2647 else if(autocvar_g_vehicles_enter)
2648 {
2649 if(!game_stopped && !STAT(FROZEN, this) && !StatusEffects_active(STATUSEFFECT_Frozen, this) && !IS_DEAD(this) && !IS_INDEPENDENT_PLAYER(this))
2650 {
2653 entity closest = NULL;
2654 float head_dist2, closest_dist2 = 0;
2655 for (; head; head = head.chain) // find the closest acceptable target to enter
2656 {
2657 head_dist2 = vlen2(this.origin - WarpZone_UnTransformOrigin(head, head.origin));
2658 if (!closest || head_dist2 < closest_dist2) // new closest
2659 {
2660 closest_dist2 = head_dist2;
2661 closest = head;
2662 }
2663 }
2664
2665 if (closest)
2666 {
2667 vehicles_enter(this, closest);
2668 return;
2669 }
2670 }
2671 }
2672
2673 // a use key was pressed; call handlers
2675}
const float MOVE_NOMONSTERS
vector WarpZone_UnTransformOrigin(entity wz, vector org)
Transforms origin org backwards through warpzone wz, as the inverse of WarpZone_TransformOrigin.
Definition common.qc:530
noref entity WarpZone_SearchInRadius_otherent
Free to use in the callback.
Definition common.qh:71
void PlayerUseKey(entity this)
Definition client.qc:2634
bool PlayerUseKey_EnterVehicle_cond(entity e)
Definition client.qc:2629
void vehicles_enter(entity pl, entity veh)
void vehicles_exit(entity vehic, bool eject)
const int VHEF_NORMAL
User pressed exit key.
#define vlen2(v)
Definition vector.qh:4

References autocvar_g_vehicles_enter_radius, entity(), game_stopped, IS_DEAD, IS_INDEPENDENT_PLAYER, IS_PLAYER, MOVE_NOMONSTERS, MUTATOR_CALLHOOK, NULL, origin, PlayerUseKey(), PlayerUseKey_EnterVehicle_cond(), STAT, StatusEffects_active(), vehicle, vehicles_enter(), vehicles_exit(), VHEF_NORMAL, vlen2, WarpZone_SearchInRadius(), WarpZone_SearchInRadius_otherent, and WarpZone_UnTransformOrigin().

Referenced by IMPULSE(), MUTATOR_HOOKABLE(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), PlayerPreThink(), and PlayerUseKey().

◆ PutObserverInServer()

void PutObserverInServer ( entity this,
bool is_forced,
bool use_spawnpoint )

putting a client as observer in the server

Definition at line 261 of file client.qc.

262{
263 bool mutator_returnvalue = MUTATOR_CALLHOOK(MakePlayerObserver, this, is_forced);
264 bool recount_ready = false;
265 PlayerState_detach(this);
266
267 bool was_player = false;
268 if (IS_PLAYER(this))
269 {
270 if(GetResource(this, RES_HEALTH) >= 1)
271 {
272 // despawn effect
273 Send_Effect(EFFECT_SPAWN, this.origin, '0 0 0', 1);
274 }
275
276 // was a player, recount votes and ready status
277 if(IS_REAL_CLIENT(this))
278 {
279 if (vote_called) { VoteCount(false); }
280 this.ready = false;
281 if (warmup_stage || game_starttime > time) /* warmup OR countdown */ recount_ready = true;
282 }
284 was_player = true;
285 }
286
287 if (use_spawnpoint)
288 {
289 // first try to find a random "nice" location to view from
290 entity spot = SelectObservePoint(this);
291 bool is_observepoint = (spot != NULL);
292 if(!spot) // otherwise just use the player spawn points
293 spot = SelectSpawnPoint(this, true);
294 if (!spot) LOG_FATAL("No spawnpoints for observers?!?");
295
296 this.angles = vec2(spot.angles);
297 // offset it so that the spectator spawns higher off the ground, looks better this way
298 setorigin(this, spot.origin + (is_observepoint ? '0 0 0' : autocvar_sv_player_viewoffset));
299 }
300 else // change origin to restore previous view origin
301 setorigin(this, this.origin + STAT(PL_VIEW_OFS, this) - STAT(PL_CROUCH_VIEW_OFS, this));
302 this.fixangle = true;
303
304 if (IS_REAL_CLIENT(this))
305 {
306 msg_entity = this;
308 WriteEntity(MSG_ONE, this);
309 }
310 // give the spectator some space between walls for MOVETYPE_FLY_WORLDONLY
311 // so that your view doesn't go into the ceiling with MOVETYPE_FLY_WORLDONLY, previously "PL_VIEW_OFS"
313 {
314 // needed for player sounds
315 this.model = "";
316 FixPlayermodel(this);
317 }
318 setmodel(this, MDL_Null);
319 setsize(this, STAT(PL_CROUCH_MIN, this), STAT(PL_CROUCH_MAX, this));
320 this.view_ofs = '0 0 0';
321
323 Portal_ClearAll(this);
324 SetSpectatee(this, NULL);
325
326 if (this.alivetime_start)
327 {
328 if (!warmup_stage)
330 this.alivetime_start = 0;
331 }
332
333 if (this.vehicle) vehicles_exit(this.vehicle, VHEF_RELEASE);
334
335 TRANSMUTE(Observer, this);
336
338 accuracy_resend(this);
339
341 Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_CHAT_NOSPECTATORS);
342
343 CS(this).spectatortime = time;
344 if (!autocvar_sv_spectate && CS(this).autojoin_checked) // unnecessary if autojoin succeeds, on failure it notifies
345 Send_Notification(NOTIF_ONE_ONLY, this, MSG_MULTI, SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime);
346
347 if(this.bot_attack)
349 this.bot_attack = false;
350 if(this.monster_attack)
352 this.monster_attack = false;
353 STAT(HUD, this) = HUD_NORMAL;
354 this.iscreature = false;
356 if(this.damagedbycontents)
358 this.damagedbycontents = false;
359 SetResourceExplicit(this, RES_HEALTH, FRAGS_SPECTATOR);
360 SetSpectatee_status(this, etof(this));
361 this.takedamage = DAMAGE_NO;
362 this.solid = SOLID_NOT;
363 set_movetype(this, MOVETYPE_FLY_WORLDONLY); // user preference is controlled by playerprethink
364 this.flags = FL_CLIENT | FL_NOTARGET;
365 this.effects = 0;
367 this.pauserotarmor_finished = 0;
369 this.pauseregen_finished = 0;
370 this.damageforcescale = 0;
371 this.death_time = 0;
372 this.respawn_flags = 0;
373 this.respawn_time = 0;
374 STAT(RESPAWN_TIME, this) = 0;
375 this.alpha = 0;
376 this.scale = 0;
377 this.fade_time = 0;
378 this.pain_finished = 0;
379 STAT(AIR_FINISHED, this) = 0;
380 //this.dphitcontentsmask = 0;
384 this.pushltime = 0;
385 this.istypefrag = 0;
386 setthink(this, func_null);
387 this.nextthink = 0;
388 this.deadflag = DEAD_NO;
389 UNSET_DUCKED(this);
390 this.draggable = drag_undraggable;
391
392 player_powerups_remove_all(this, was_player);
393 this.items = 0;
394 STAT(WEAPONS, this) = '0 0 0';
395 this.drawonlytoclient = this;
396
397 this.viewloc = NULL;
398
399 //this.spawnpoint_targ = NULL; // keep it so they can return to where they were?
400
401 this.weaponmodel = "";
402 for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
403 {
404 this.weaponentities[slot] = NULL;
405 }
407 CS(this).killcount = FRAGS_SPECTATOR;
408 this.velocity = '0 0 0';
409 this.avelocity = '0 0 0';
410 this.punchangle = '0 0 0';
411 this.punchvector = '0 0 0';
412 this.oldvelocity = this.velocity;
413 this.event_damage = func_null;
414 this.event_heal = func_null;
415
416 for(int slot = 0; slot < MAX_AXH; ++slot)
417 {
418 entity axh = this.(AuxiliaryXhair[slot]);
419 this.(AuxiliaryXhair[slot]) = NULL;
420
421 if(axh.owner == this && axh != NULL && !wasfreed(axh))
422 delete(axh);
423 }
424
425 if (mutator_returnvalue)
426 {
427 // mutator prevents resetting teams+score
428 }
429 else
430 {
431 SetPlayerTeam(this, -1, TEAM_CHANGE_SPECTATOR); // clears scores too in gametypes without teams
432 this.frags = FRAGS_SPECTATOR;
433 }
434
436
437 if (CS(this).just_joined)
438 CS(this).just_joined = false;
439
440 if (recount_ready)
441 ReadyCount(); // must be called after SetPlayerTeam() and TRANSMUTE(Observer
442}
void accuracy_resend(entity e)
force a resend of a player's accuracy stats
Definition accuracy.qc:80
float bot_attack
Definition api.qh:38
IntrusiveList g_bot_targets
Definition api.qh:149
void bot_relinkplayerlist()
Definition bot.qc:424
bool drag_undraggable(entity draggee, entity dragger)
Definition cheats.qc:901
vector punchangle
float pain_finished
const int MAX_AXH
entity AuxiliaryXhair[MAX_AXH]
float alpha
Definition items.qc:13
bool ready
Definition main.qh:88
#define setmodel(this, m)
Definition model.qh:26
vector autocvar_sv_player_viewoffset
Definition player.qh:337
#define UNSET_DUCKED(s)
Definition player.qh:214
const int FL_CLIENT
Definition constants.qh:64
const int FL_NOTARGET
Definition constants.qh:68
const int HUD_NORMAL
Definition constants.qh:48
const int FRAGS_SPECTATOR
engine expects this value
Definition constants.qh:5
float DPCONTENTS_SOLID
vector avelocity
vector velocity
float effects
float DPCONTENTS_PLAYERCLIP
float nextthink
float dphitcontentsmask
float death_time
float damagedbycontents
Definition damage.qh:45
IntrusiveList g_damagedbycontents
Definition damage.qh:143
float damageforcescale
entity drawonlytoclient
vector punchvector
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
Definition all.qc:155
ent angles
Definition ent_cs.qc:146
model
Definition ent_cs.qc:164
SetResourceExplicit(ent, RES_ARMOR, ReadByte() *DEC_FACTOR)) ENTCS_PROP(NAME
void entcs_update_players(entity player)
Definition ent_cs.qc:208
int frags
Definition ent_cs.qh:67
ERASEABLE void IL_REMOVE(IntrusiveList this, entity it)
Remove any element, anywhere in the list.
float pushltime
Definition jumppads.qh:21
bool istypefrag
Definition jumppads.qh:22
#define LOG_FATAL(...)
Definition log.qh:50
entity viewloc
Definition viewloc.qh:13
void WriteEntity(entity data, float dest, float desto)
#define etof(e)
Definition misc.qh:25
const int MOVETYPE_FLY_WORLDONLY
Definition movetypes.qh:147
var void func_null()
const string PLAYERSTATS_ALIVETIME
#define PlayerStats_GameReport_Event_Player(ent, eventid, val)
void Portal_ClearAll(entity own)
Definition portals.qc:586
entity msg_entity
Definition progsdefs.qc:63
vector view_ofs
Definition progsdefs.qc:151
float DEAD_NO
Definition progsdefs.qc:274
float fixangle
Definition progsdefs.qc:160
float deadflag
Definition progsdefs.qc:149
string weaponmodel
Definition progsdefs.qc:140
float scale
Definition projectile.qc:14
#define CHAT_NOSPECTATORS()
Definition chat.qh:30
void player_powerups_remove_all(entity this, bool allow_poweroff_sound)
Definition client.qc:1540
entity SelectObservePoint(entity this)
Definition client.qc:250
void SetSpectatee_status(entity this, int spectatee_num)
Definition client.qc:1903
void SetSpectatee(entity this, entity spectatee)
Definition client.qc:1938
int killcount
Definition client.qh:315
bool just_joined
Definition client.qh:76
int autocvar_g_balance_armor_start
Definition client.qh:11
bool autocvar_g_playerclip_collisions
Definition client.qh:18
float pauseregen_finished
Definition client.qh:337
float pauserothealth_finished
Definition client.qh:338
const int SVC_SETVIEW
Definition client.qh:334
float pauserotarmor_finished
Definition client.qh:339
void ReadyCount()
Definition vote.qc:553
void VoteCount(float first_count)
Definition vote.qc:220
int vote_called
Definition vote.qh:45
void RemoveGrapplingHooks(entity pl)
Definition hook.qc:30
vector oldvelocity
Definition main.qh:42
bool iscreature
Definition main.qh:46
entity SelectSpawnPoint(entity this, bool anypoint)
float fade_time
Definition common.qh:35
void PlayerState_detach(entity this)
Definition state.qc:22
bool monster_attack
indicates whether an entity can be attacked by monsters
IntrusiveList g_monster_targets
const int VHEF_RELEASE
Release ownership, client possibly allready dissconnected / went spec / changed team / used "kill" (n...
@ TEAM_CHANGE_SPECTATOR
Player is joining spectators. //TODO: Remove?
Definition teamplay.qh:131
float teleportable
const int TELEPORT_SIMPLE
#define vec2(...)
Definition vector.qh:95
void WaypointSprite_PlayerDead(entity this)
entity exteriorweaponentity
Definition all.qh:403
const int MAX_WEAPONSLOTS
Definition weapon.qh:16
entity weaponentities[MAX_WEAPONSLOTS]
Definition weapon.qh:17

References accuracy_resend(), alivetime_start, alpha, angles, autocvar_g_balance_armor_start, autocvar_g_debug_globalsounds, autocvar_g_maxplayers_spectator_blocktime, autocvar_g_playerclip_collisions, autocvar_sv_player_viewoffset, autocvar_sv_spectate, AuxiliaryXhair, avelocity, bot_attack, bot_relinkplayerlist(), CHAT_NOSPECTATORS, CS(), DAMAGE_NO, damagedbycontents, damageforcescale, DEAD_NO, deadflag, death_time, DPCONTENTS_PLAYERCLIP, DPCONTENTS_SOLID, dphitcontentsmask, drag_undraggable(), drawonlytoclient, effects, entcs_update_players(), entity(), etof, exteriorweaponentity, fade_time, fixangle, FixPlayermodel(), FL_CLIENT, FL_NOTARGET, flags, frags, FRAGS_SPECTATOR, func_null(), g_bot_targets, g_damagedbycontents, g_monster_targets, game_starttime, game_stopped, GetResource(), HUD_NORMAL, IL_REMOVE(), IS_PLAYER, IS_REAL_CLIENT, iscreature, istypefrag, items, just_joined, killcount, LOG_FATAL, max(), MAX_AXH, MAX_WEAPONSLOTS, model, monster_attack, MOVETYPE_FLY_WORLDONLY, msg_entity, MSG_ONE, MUTATOR_CALLHOOK, nextthink, NULL, oldvelocity, origin, pain_finished, pauseregen_finished, pauserotarmor_finished, pauserothealth_finished, player_powerups_remove_all(), PlayerState_detach(), PLAYERSTATS_ALIVETIME, PlayerStats_GameReport_Event_Player, Portal_ClearAll(), punchangle, punchvector, pushltime, ready, ReadyCount(), RemoveGrapplingHooks(), RES_ARMOR, respawn_flags, respawn_time, scale, SelectObservePoint(), SelectSpawnPoint(), Send_Effect(), Send_Notification(), set_movetype(), setmodel, SetPlayerTeam(), SetResourceExplicit(), SetSpectatee(), SetSpectatee_status(), setthink, solid, SOLID_NOT, STAT, SVC_SETVIEW, takedamage, TEAM_CHANGE_SPECTATOR, TELEPORT_SIMPLE, teleportable, time, TRANSMUTE, UNSET_DUCKED, vec2, vehicle, vehicles_exit(), velocity, VHEF_RELEASE, view_ofs, viewloc, vote_called, VoteCount(), warmup_stage, WaypointSprite_PlayerDead(), weaponentities, weaponmodel, WriteByte(), and WriteEntity().

Referenced by BanCommand_playban(), ClientKill_Now_TeamChange(), GameCommand_allspec(), GameCommand_moveplayer(), MatchEnd_RestoreSpectatorAndTeamStatus(), minigame_addplayer(), MUTATOR_HOOKFUNCTION(), ObserverOrSpectatorThink(), PlayerFrame(), PutClientInServer(), Remove_Countdown(), SpectateSet(), and TeamBalance_RemoveExcessPlayers().

◆ RotRegen()

void RotRegen ( entity this,
entity current,
float limit_mod,
float regenstable,
float regenfactor,
float regenlinear,
float regenframetime,
float rotstable,
float rotfactor,
float rotlinear,
float rotframetime )

References entity().

◆ SendWelcomeMessage()

void SendWelcomeMessage ( entity this,
int msg_type )

Definition at line 1078 of file client.qc.

1079{
1080 if (boolean(autocvar_g_campaign))
1081 {
1082 WriteByte(msg_type, 1);
1083 WriteByte(msg_type, Campaign_GetLevelNum());
1084 return;
1085 }
1086
1087 int flags = 0;
1088 if (CS(this).version_mismatch)
1089 flags |= 2;
1090 if (CS(this).version < autocvar_gameversion)
1091 flags |= 4;
1093 if (MapInfo_Map_author != "")
1094 flags |= 8;
1095 WriteByte(msg_type, flags);
1096
1097 WriteString(msg_type, autocvar_hostname);
1099
1101 if (flags & 8)
1104
1106 WriteByte(msg_type, GetPlayerLimit());
1107
1108 MUTATOR_CALLHOOK(BuildMutatorsPrettyString, "");
1109 string modifications = M_ARGV(0, string);
1110
1111 if (g_weaponarena_type == WEPARENA_OFF && cvar("g_balance_blaster_weaponstartoverride") == 0)
1112 modifications = strcat(modifications, ", No start weapons");
1113 if(cvar("sv_gravity") < stof(cvar_defstring("sv_gravity")))
1114 modifications = strcat(modifications, ", Low gravity");
1115 if(g_weapon_stay && !g_cts)
1116 modifications = strcat(modifications, ", Weapons stay");
1118 modifications = strcat(modifications, ", Jetpack");
1119 modifications = substring(modifications, 2, strlen(modifications) - 2);
1120
1121 WriteString(msg_type, modifications);
1122
1123 WriteByte(msg_type, g_weaponarena_type);
1126
1128 {
1131 }
1132
1133 WriteString(msg_type, cache_mutatormsg);
1134
1135 WriteString(msg_type, strreplace("\\n", "\n", autocvar_sv_motd));
1136}
string mi_shortname
Definition util.qh:133
#define g_cts
Definition cts.qh:36
int MapInfo_Get_ByName(string pFilename, float pAllowGenerate, Gametype pGametypeToSet)
Definition mapinfo.qc:1387
void MapInfo_ClearTemps()
Definition mapinfo.qc:1635
int map_minplayers
Definition mapinfo.qh:190
string MapInfo_Map_author
Definition mapinfo.qh:10
string MapInfo_Map_titlestring
Definition mapinfo.qh:8
const string cvar_defstring(string name)
int Campaign_GetLevelNum()
Definition campaign.qc:44
string autocvar_sv_motd
Definition client.qh:52
string autocvar_g_mutatormsg
Definition client.qh:35
string autocvar_hostname
Definition client.qh:50
float autocvar_gameversion
Definition client.qh:47
void WriteWepSet(float dst, WepSet w)
Definition all.qc:69
@ WEPARENA_OFF
Definition weapon.qh:273
@ WEPARENA_CUSTOM
Definition weapon.qh:275
bool autocvar_g_jetpack
Definition world.qh:8
WepSet g_weaponarena_weapons
Definition world.qh:75
string cache_lastmutatormsg
Definition world.qh:70
float g_weapon_stay
Definition world.qh:108
int g_weaponarena_type
Definition world.qh:77
int autocvar_g_warmup
Definition world.qh:9
string cache_mutatormsg
Definition world.qh:69

References autocvar_g_campaign, autocvar_g_jetpack, autocvar_g_mutatormsg, autocvar_g_warmup, autocvar_g_xonoticversion, autocvar_gameversion, autocvar_hostname, autocvar_sv_motd, cache_lastmutatormsg, cache_mutatormsg, Campaign_GetLevelNum(), CS(), cvar(), cvar_defstring(), entity(), flags, g_cts, g_weapon_stay, g_weaponarena_type, g_weaponarena_weapons, GetPlayerLimit(), M_ARGV, map_minplayers, MapInfo_ClearTemps(), MapInfo_Get_ByName(), MapInfo_Map_author, MapInfo_Map_titlestring, mi_shortname, MUTATOR_CALLHOOK, NULL, stof(), strcat(), strcpy, strlen, substring(), WEPARENA_CUSTOM, WEPARENA_OFF, WriteByte(), WriteString(), and WriteWepSet().

Referenced by ScoreInfo_SendEntity().

◆ SetSpectatee()

void SetSpectatee ( entity this,
entity spectatee )

Definition at line 1938 of file client.qc.

1939{
1940 if(IS_BOT_CLIENT(this))
1941 return; // bots abuse .enemy, this code is useless to them
1942
1943 entity old_spectatee = this.enemy;
1944
1945 this.enemy = spectatee;
1946
1947 // WEAPONTODO
1948 // these are required to fix the spectator bug with arc
1949 if(old_spectatee)
1950 {
1951 for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
1952 {
1953 .entity weaponentity = weaponentities[slot];
1954 if(old_spectatee.(weaponentity).arc_beam)
1955 old_spectatee.(weaponentity).arc_beam.SendFlags |= ARC_SF_UPDATE;
1956 }
1957 }
1958 if(spectatee)
1959 {
1960 for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
1961 {
1962 .entity weaponentity = weaponentities[slot];
1963 if(spectatee.(weaponentity).arc_beam)
1964 spectatee.(weaponentity).arc_beam.SendFlags |= ARC_SF_UPDATE;
1965 }
1966 }
1967
1968 if (spectatee)
1969 SetSpectatee_status(this, etof(spectatee));
1970
1971 // needed to update spectator list
1972 if(old_spectatee)
1973 ClientData_Touch(old_spectatee, true);
1974}
const int ARC_SF_UPDATE
Definition arc.qh:124
entity arc_beam
Definition arc.qh:132
void ClientData_Touch(entity e, bool to_spectators_too)
Definition client.qc:185
entity enemy
Definition sv_ctf.qh:152
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))
Definition utils.qh:15

References arc_beam, ARC_SF_UPDATE, ClientData_Touch(), enemy, entity(), etof, IS_BOT_CLIENT, MAX_WEAPONSLOTS, SetSpectatee_status(), and weaponentities.

Referenced by ClientDisconnect(), PutClientInServer(), PutObserverInServer(), Spectate(), SpectateNext(), SpectatePrev(), and SpectateUpdate().

◆ SetSpectatee_status()

void SetSpectatee_status ( entity this,
int spectatee_num )

Definition at line 1903 of file client.qc.

1904{
1905 int oldspectatee_status = CS(this).spectatee_status;
1906 CS(this).spectatee_status = spectatee_num;
1907
1908 if (CS(this).spectatee_status != oldspectatee_status)
1909 {
1910 if (STAT(PRESSED_KEYS, this))
1911 {
1912 CS(this).pressedkeys = 0;
1913 STAT(PRESSED_KEYS, this) = 0;
1914 }
1915
1916 ClientData_Touch(this, true);
1917
1918 // init or clear race data
1919 if ((g_race || g_cts) && g_race_qualifying && IS_REAL_CLIENT(this))
1920 {
1921 msg_entity = this;
1922
1923 if (this.enemy && this.enemy.race_laptime)
1924 {
1925 // init
1927 }
1928 else
1929 {
1930 // send reset to this spectator
1931 WriteHeader(MSG_ONE, TE_CSQC_RACE);
1933 }
1934 }
1935 }
1936}
int spectatee_status
the -1 disables HUD panels before CSQC receives necessary data
Definition main.qh:197
#define g_race
Definition race.qh:48
@ RACE_NET_CHECKPOINT_CLEAR
Definition net_linked.qh:14
void race_SendNextCheckpoint(entity e, float spec)
Definition race.qc:208
int g_race_qualifying
Definition race.qh:11

References ClientData_Touch(), CS(), enemy, entity(), g_cts, g_race, g_race_qualifying, IS_REAL_CLIENT, msg_entity, MSG_ONE, RACE_NET_CHECKPOINT_CLEAR, race_SendNextCheckpoint(), spectatee_status, STAT, WriteByte(), and WriteHeader.

Referenced by PutObserverInServer(), PutPlayerInServer(), and SetSpectatee().

◆ Spectate()

bool Spectate ( entity this,
entity pl )

Definition at line 1976 of file client.qc.

1977{
1978 if(MUTATOR_CALLHOOK(SpectateSet, this, pl))
1979 return false;
1980 pl = M_ARGV(1, entity);
1981
1982 SetSpectatee(this, pl);
1983 return SpectateSet(this);
1984}
bool SpectateSet(entity this)
Definition client.qc:1884

References entity(), M_ARGV, MUTATOR_CALLHOOK, SetSpectatee(), and SpectateSet().

Referenced by ClientCommand_spectate(), and superspec_Spectate().

◆ STATIC_INIT()

STATIC_INIT ( client_lists )

Definition at line 372 of file client.qh.

373{
376}
#define IL_NEW()
IntrusiveList g_observepoints
Definition client.qh:371
IntrusiveList g_initforplayer
Definition client.qh:370

References g_initforplayer, g_observepoints, and IL_NEW.

◆ void()

void ( entity this,
entity player )

References entity().

Variable Documentation

◆ alivetime_start

float alivetime_start

Definition at line 68 of file client.qh.

Referenced by PlayerDamage(), PlayerFrame(), PutObserverInServer(), and PutPlayerInServer().

◆ autocvar__independent_players

int autocvar__independent_players

Definition at line 309 of file client.qh.

◆ autocvar__notarget

bool autocvar__notarget

Definition at line 9 of file client.qh.

Referenced by PutPlayerInServer().

◆ autocvar_g_balance_armor_start

int autocvar_g_balance_armor_start

Definition at line 11 of file client.qh.

Referenced by PutObserverInServer().

◆ autocvar_g_balance_pause_armor_rot_spawn

float autocvar_g_balance_pause_armor_rot_spawn

Definition at line 12 of file client.qh.

Referenced by PutPlayerInServer().

◆ autocvar_g_balance_pause_fuel_rot_spawn

float autocvar_g_balance_pause_fuel_rot_spawn

Definition at line 13 of file client.qh.

Referenced by PutPlayerInServer().

◆ autocvar_g_balance_pause_health_regen_spawn

float autocvar_g_balance_pause_health_regen_spawn

Definition at line 14 of file client.qh.

Referenced by PutPlayerInServer().

◆ autocvar_g_balance_pause_health_rot_spawn

float autocvar_g_balance_pause_health_rot_spawn

Definition at line 15 of file client.qh.

Referenced by PutPlayerInServer().

◆ autocvar_g_botclip_collisions

bool autocvar_g_botclip_collisions

Definition at line 16 of file client.qh.

Referenced by PutPlayerInServer().

◆ autocvar_g_forced_respawn

bool autocvar_g_forced_respawn

Definition at line 43 of file client.qh.

Referenced by calculate_player_respawn_time().

◆ autocvar_g_fullbrightplayers

bool autocvar_g_fullbrightplayers

◆ autocvar_g_maxplayers

int autocvar_g_maxplayers

Definition at line 44 of file client.qh.

Referenced by GameplayMode_DelayedInit(), GetPlayerLimit(), and PlayerStats_GetGametype().

◆ autocvar_g_maxplayers_spectator_blocktime

float autocvar_g_maxplayers_spectator_blocktime

Definition at line 45 of file client.qh.

Referenced by ClientKill_Now_TeamChange(), PlayerFrame(), and PutObserverInServer().

◆ autocvar_g_mutatormsg

string autocvar_g_mutatormsg

Definition at line 35 of file client.qh.

Referenced by SendWelcomeMessage().

◆ autocvar_g_nodepthtestplayers

bool autocvar_g_nodepthtestplayers

◆ autocvar_g_player_alpha

float autocvar_g_player_alpha

Definition at line 19 of file client.qh.

Referenced by SetDefaultAlpha().

◆ autocvar_g_player_brightness

float autocvar_g_player_brightness

Definition at line 20 of file client.qh.

Referenced by PutPlayerInServer().

◆ autocvar_g_player_damageforcescale

float autocvar_g_player_damageforcescale = 2

Definition at line 21 of file client.qh.

Referenced by PutPlayerInServer().

◆ autocvar_g_playerclip_collisions

bool autocvar_g_playerclip_collisions

Definition at line 18 of file client.qh.

Referenced by PutObserverInServer(), PutPlayerInServer(), and vehicle_initialize().

◆ autocvar_g_respawn_delay_forced

bool autocvar_g_respawn_delay_forced

Definition at line 27 of file client.qh.

◆ autocvar_g_respawn_delay_large

float autocvar_g_respawn_delay_large

Definition at line 24 of file client.qh.

◆ autocvar_g_respawn_delay_large_count

int autocvar_g_respawn_delay_large_count

Definition at line 25 of file client.qh.

◆ autocvar_g_respawn_delay_max

float autocvar_g_respawn_delay_max

Definition at line 26 of file client.qh.

◆ autocvar_g_respawn_delay_small

float autocvar_g_respawn_delay_small

Definition at line 22 of file client.qh.

◆ autocvar_g_respawn_delay_small_count

int autocvar_g_respawn_delay_small_count

Definition at line 23 of file client.qh.

◆ autocvar_g_respawn_ghosts

bool autocvar_g_respawn_ghosts

Definition at line 28 of file client.qh.

Referenced by respawn().

◆ autocvar_g_respawn_ghosts_alpha

float autocvar_g_respawn_ghosts_alpha = 1

Definition at line 29 of file client.qh.

Referenced by respawn().

◆ autocvar_g_respawn_ghosts_fadetime

float autocvar_g_respawn_ghosts_fadetime = 1.5

Definition at line 30 of file client.qh.

Referenced by respawn().

◆ autocvar_g_respawn_ghosts_speed

float autocvar_g_respawn_ghosts_speed

Definition at line 32 of file client.qh.

Referenced by respawn().

◆ autocvar_g_respawn_ghosts_time

float autocvar_g_respawn_ghosts_time = 4.5

Definition at line 31 of file client.qh.

Referenced by respawn().

◆ autocvar_g_respawn_waves

int autocvar_g_respawn_waves

Definition at line 33 of file client.qh.

◆ autocvar_g_xonoticversion

string autocvar_g_xonoticversion

Definition at line 46 of file client.qh.

Referenced by PlayerFrame(), SendWelcomeMessage(), and WinningConditionHelper().

◆ autocvar_gameversion

float autocvar_gameversion

Definition at line 47 of file client.qh.

Referenced by SendWelcomeMessage().

◆ autocvar_gameversion_max

float autocvar_gameversion_max

Definition at line 49 of file client.qh.

Referenced by ClientCommand_clientversion().

◆ autocvar_gameversion_min

float autocvar_gameversion_min

Definition at line 48 of file client.qh.

Referenced by ClientCommand_clientversion().

◆ autocvar_hostname

◆ autocvar_spawn_debug

int autocvar_spawn_debug

Definition at line 51 of file client.qh.

Referenced by PutPlayerInServer(), SelectSpawnPoint(), and StartItem().

◆ autocvar_sv_foginterval

bool autocvar_sv_foginterval

Definition at line 36 of file client.qh.

Referenced by ClientInit_misc().

◆ autocvar_sv_maxidle

float autocvar_sv_maxidle

Definition at line 37 of file client.qh.

Referenced by DecodeLevelParms(), and PlayerFrame().

◆ autocvar_sv_maxidle_alsokickspectators

bool autocvar_sv_maxidle_alsokickspectators

Definition at line 40 of file client.qh.

Referenced by PlayerFrame().

◆ autocvar_sv_maxidle_minplayers

int autocvar_sv_maxidle_minplayers = 2

Definition at line 38 of file client.qh.

Referenced by PlayerFrame().

◆ autocvar_sv_maxidle_playertospectator

float autocvar_sv_maxidle_playertospectator = 60

Definition at line 39 of file client.qh.

Referenced by PlayerFrame(), and SetPlayerTeam().

◆ autocvar_sv_maxidle_slots

int autocvar_sv_maxidle_slots

Definition at line 41 of file client.qh.

Referenced by PlayerFrame().

◆ autocvar_sv_maxidle_slots_countbots

bool autocvar_sv_maxidle_slots_countbots

Definition at line 42 of file client.qh.

Referenced by PlayerFrame().

◆ autocvar_sv_motd

string autocvar_sv_motd

Definition at line 52 of file client.qh.

Referenced by SendWelcomeMessage().

◆ autocvar_sv_name_maxlength

int autocvar_sv_name_maxlength = 64

Definition at line 53 of file client.qh.

Referenced by PlayerFrame().

◆ autocvar_sv_player_scale

float autocvar_sv_player_scale

Definition at line 59 of file client.qh.

Referenced by PutPlayerInServer().

◆ autocvar_sv_quickmenu_file

string autocvar_sv_quickmenu_file

Definition at line 54 of file client.qh.

Referenced by ClientConnect().

◆ autocvar_sv_servermodelsonly

bool autocvar_sv_servermodelsonly

Definition at line 55 of file client.qh.

Referenced by CheckPlayerModel().

◆ autocvar_sv_show_entnum

bool autocvar_sv_show_entnum

Definition at line 10 of file client.qh.

Referenced by ObserverOrSpectatorThink(), and PlayerThink().

◆ autocvar_sv_showspectators

bool autocvar_sv_showspectators

Definition at line 56 of file client.qh.

Referenced by ClientData_Send().

◆ autocvar_sv_spectate

◆ autocvar_sv_teamnagger

bool autocvar_sv_teamnagger

Definition at line 58 of file client.qh.

Referenced by ClientData_Send(), ReadyCount(), and TeamBalance_FindBestTeams().

◆ clientdata

entity clientdata

Definition at line 64 of file client.qh.

Referenced by ClientData_Attach().

◆ death_time

float death_time

Definition at line 69 of file client.qh.

◆ g_initforplayer

IntrusiveList g_initforplayer

Definition at line 370 of file client.qh.

Referenced by ClientConnect(), func_breakable_setup(), spawnfunc(), spawnfunc(), and STATIC_INIT().

◆ g_observepoints

IntrusiveList g_observepoints

Definition at line 371 of file client.qh.

Referenced by SelectObservePoint(), spawnfunc(), and STATIC_INIT().

◆ independent_players

bool independent_players

◆ jointime

◆ just_joined

bool just_joined

Definition at line 76 of file client.qh.

Referenced by PutObserverInServer(), and SetPlayerTeam().

◆ killcount

◆ MAX_SPECTATORS

const int MAX_SPECTATORS = 7

Definition at line 413 of file client.qh.

◆ MIN_SPEC_TIME

const int MIN_SPEC_TIME = 1

◆ pauseregen_finished

◆ pauserotarmor_finished

float pauserotarmor_finished

◆ pauserotfuel_finished

float pauserotfuel_finished

Definition at line 340 of file client.qh.

Referenced by CheatImpulse(), GiveItems(), player_regen(), and PutPlayerInServer().

◆ pauserothealth_finished

float pauserothealth_finished

◆ player_blocked

bool player_blocked

Definition at line 332 of file client.qh.

Referenced by ClientKill(), PlayerJump(), and PM_check_blocked().

◆ playerid

◆ playermodel

string playermodel

Definition at line 84 of file client.qh.

◆ playerskin

string playerskin

Definition at line 85 of file client.qh.

◆ pressedkeys

int pressedkeys

Definition at line 80 of file client.qh.

◆ respawn_countdown

float respawn_countdown

Definition at line 324 of file client.qh.

Referenced by calculate_player_respawn_time(), and ShowRespawnCountdown().

◆ RESPAWN_DENY

const int RESPAWN_DENY = BIT(2)

Definition at line 328 of file client.qh.

Referenced by PlayerThink().

◆ respawn_flags

int respawn_flags

◆ RESPAWN_FORCE

◆ RESPAWN_SILENT

const int RESPAWN_SILENT = BIT(1)

◆ respawn_time

◆ respawn_time_max

float respawn_time_max

Definition at line 322 of file client.qh.

Referenced by calculate_player_respawn_time(), and PlayerThink().

◆ spectatee_status

int spectatee_status

Definition at line 71 of file client.qh.

◆ spectatortime

float spectatortime

Definition at line 330 of file client.qh.

Referenced by PlayerPreThink().

◆ startplaytime

float startplaytime

Definition at line 67 of file client.qh.

Referenced by TeamBalance_RemoveExcessPlayers().

◆ SVC_SETVIEW

const int SVC_SETVIEW = 5

Definition at line 334 of file client.qh.

Referenced by PutClientInServer(), PutObserverInServer(), and SpectateSet().

◆ team_selected

int team_selected

0 is a team index, if wants_join == -1 the player can't have the team they selected (conflict)

Definition at line 75 of file client.qh.

Referenced by ClientKill_TeamChange(), PlayerFrame(), and ShowTeamSelection().

◆ wants_join

int wants_join

0 is a team index, -1 means team selection is deferred until Join()

Definition at line 78 of file client.qh.

◆ weaponorder_byimpulse

string weaponorder_byimpulse

◆ zoomstate

bool zoomstate

Definition at line 72 of file client.qh.

Referenced by ClientData_Send(), SetZoomState(), and SpectateCopy().