]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/client.qh
Obey strict sorting when comparing player scores, fixes #1469
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / client.qh
index 83de3f024d619746f1072302da47beead46a6047..efe336d1f6913d81102492b484daf51601c2908e 100644 (file)
@@ -1,40 +1,60 @@
 #pragma once
 
 #include "utils.qh"
+#include <server/intermission.qh>
+#include <common/replicate.qh>
 #include <common/sounds/all.qh>
 
-// replicated cvars TODO: needs better organisation!
-.float cvar_cl_handicap;
-.int cvar_cl_gunalign;
-.float cvar_cl_clippedspectating;
-.float cvar_cl_autoscreenshot;
-.float cvar_cl_jetpack_jump;
-.float cvar_cl_movement_track_canjump;
-.float cvar_cl_newusekeysupported;
-.float cvar_cl_cts_noautoswitch;
-.bool cvar_cl_weapon_switch_reload;
-.bool cvar_cl_weapon_switch_fallback_to_impulse;
-
-.string cvar_g_xonoticversion;
-.string cvar_cl_weaponpriority;
-.string cvar_cl_weaponpriorities[10];
-.float cvar_cl_noantilag;
+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_fullbrightplayers;
+bool autocvar_g_playerclip_collisions;
+float autocvar_g_player_alpha;
+float autocvar_g_player_brightness;
+float autocvar_g_player_damageforcescale = 2;
+float autocvar_g_respawn_delay_small;
+int autocvar_g_respawn_delay_small_count;
+float autocvar_g_respawn_delay_large;
+int autocvar_g_respawn_delay_large_count;
+float autocvar_g_respawn_delay_max;
+bool autocvar_g_respawn_delay_forced;
+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_time = 4.5;
+float autocvar_g_respawn_ghosts_speed;
+int autocvar_g_respawn_waves;
+bool autocvar_g_nodepthtestplayers;
+string autocvar_g_mutatormsg;
+float autocvar_sv_foginterval;
+float autocvar_sv_maxidle;
+bool autocvar_sv_maxidle_spectatorsareidle;
+int autocvar_sv_maxidle_slots;
+bool autocvar_sv_maxidle_slots_countbots;
+bool autocvar_g_forced_respawn;
+int autocvar_g_maxplayers;
+float autocvar_g_maxplayers_spectator_blocktime;
+string autocvar_g_xonoticversion;
+float autocvar_gameversion;
+float autocvar_gameversion_min;
+float autocvar_gameversion_max;
+string autocvar_hostname;
+int autocvar_spawn_debug;
+string autocvar_sv_motd;
+int autocvar_sv_name_maxlength = 64;
+bool autocvar_sv_servermodelsonly;
+int autocvar_sv_spectate;
+bool autocvar_sv_teamnagger;
+float autocvar_sv_player_scale;
+bool autocvar_sv_showspectators;
 
 // WEAPONTODO
-.float autoswitch;
 .string weaponorder_byimpulse;
-.float cvar_cl_weaponimpulsemode;
-
-.float cvar_cl_allow_uid2name;
-.float cvar_cl_allow_uidtracking;
-.bool cvar_cl_allow_uidranking;
-
-.string cvar_cl_physics;
-
-// autotaunt system
-.float cvar_cl_autotaunt;
-.float cvar_cl_voice_directional;
-.float cvar_cl_voice_directional_taunt_attenuation;
 
 .entity clientdata;
 
 .float alivetime; // time of being alive
 .float motd_actived_time; // used for both motd and campaign_message
 
+.bool wasplayer;
+
+.int spectatee_status;
+.bool zoomstate;
+
+.bool just_joined;
+
+.int pressedkeys;
+
+.int playerid;
+
+.string playermodel;
+.string playerskin;
+
 void ClientState_attach(entity this);
 
 IntrusiveList g_players;
@@ -180,6 +214,7 @@ CLASS(Client, Object)
     ATTRIB(Client, cvar_g_xonoticversion, string, this.cvar_g_xonoticversion);
     ATTRIB(Client, autoswitch, bool, this.autoswitch);
     ATTRIB(Client, cvar_cl_casings, bool, this.cvar_cl_casings);
+    ATTRIB(Client, cvar_r_drawviewmodel, bool, this.cvar_r_drawviewmodel);
     ATTRIB(Client, cvar_cl_dodging_timeout, float, this.cvar_cl_dodging_timeout);
     ATTRIB(Client, cvar_cl_dodging, float, this.cvar_cl_dodging);
     ATTRIB(Client, cvar_cl_multijump, bool, this.cvar_cl_multijump);
@@ -271,14 +306,17 @@ METHOD(Client, m_unwind, bool(Client this))
     return false;
 }
 
+int autocvar__independent_players;
+bool independent_players;
+#define INDEPENDENT_PLAYERS (autocvar__independent_players ? (autocvar__independent_players > 0) : independent_players)
+#define IS_INDEPENDENT_PLAYER(e) ((e).solid == SOLID_TRIGGER)
+#define MAKE_INDEPENDENT_PLAYER(e) (((e).solid = SOLID_TRIGGER), ((e).frags = FRAGS_PLAYER_OUT_OF_GAME))
+
+.int killcount;
+
 //flood fields
 .float nickspamtime; // time of last nick change
 .float nickspamcount;
-.float floodcontrol_chat;
-.float floodcontrol_chatteam;
-.float floodcontrol_chattell;
-.float floodcontrol_voice;
-.float floodcontrol_voiceteam;
 
 // respawning
 .int respawn_flags;
@@ -287,21 +325,23 @@ METHOD(Client, m_unwind, bool(Client this))
 
 .float respawn_countdown; // next number to count
 
+const int RESPAWN_FORCE = BIT(0);
+const int RESPAWN_SILENT = BIT(1);
+const int RESPAWN_DENY = BIT(2);
+
 float blockSpectators; // if set, new or existing spectators or observers will be removed unless they become a player within g_maxplayers_spectator_blocktime seconds
 .float spectatortime; // point in time since the client is spectating or observing
 
+.bool player_blocked;
+
+const int SVC_SETVIEW = 5; // TODO: move to dpdefs where this belongs!
+
 // TODO: standardise resource regeneration
 .float pauseregen_finished;
 .float pauserothealth_finished;
 .float pauserotarmor_finished;
 .float pauserotfuel_finished;
 
-// idle kicking
-float sv_maxidle;
-float sv_maxidle_spectatorsareidle;
-int sv_maxidle_slots;
-bool sv_maxidle_slots_countbots;
-
 // g_<gametype>_str:
 // If 0, default is used.
 // If <0, 0 is used.
@@ -321,8 +361,6 @@ void ClientData_Touch(entity e);
 
 int nJoinAllowed(entity this, entity ignore);
 
-void FixIntermissionClient(entity e);
-
 void checkSpectatorBlock(entity this);
 
 void PlayerUseKey(entity this);
@@ -332,36 +370,8 @@ void FixClientCvars(entity e);
 // called when a client connects, useful for updating sounds and such of static objects
 .void(entity this, entity player) init_for_player;
 
-/// \brief Print the string to the client's chat.
-/// \param[in] client Client to print to.
-/// \param[in] text Text to print.
-void PrintToChat(entity client, string text);
-
-/// \brief Print the string to the client's chat if the server cvar "developer"
-/// is not 0.
-/// \param[in] client Client to print to.
-/// \param[in] text Text to print.
-void DebugPrintToChat(entity client, string text);
-
-/// \brief Prints the string to all clients' chat.
-/// \param[in] text Text to print.
-void PrintToChatAll(string text);
-
-/// \brief Prints the string to all clients' chat if the server cvar "developer"
-/// is not 0.
-/// \param[in] text Text to print.
-void DebugPrintToChatAll(string text);
-
-/// \brief Print the string to chat of all clients of the specified team.
-/// \param[in] team_num Team to print to. See NUM_TEAM constants.
-/// \param[in] text Text to print.
-void PrintToChatTeam(int team_num, string text);
-
-/// \brief Print the string to chat of all clients of the specified team if the
-/// server cvar "developer" is not 0.
-/// \param[in] team_num Team to print to. See NUM_TEAM constants.
-/// \param[in] text Text to print.
-void DebugPrintToChatTeam(int team_num, string text);
+IntrusiveList g_initforplayer;
+STATIC_INIT(g_initforplayer) { g_initforplayer = IL_NEW(); }
 
 void play_countdown(entity this, float finished, Sound samp);
 
@@ -389,4 +399,4 @@ void Join(entity this);
 #define SPECTATE_COPY() ACCUMULATE void SpectateCopy(entity this, entity spectatee)
 #define SPECTATE_COPYFIELD(fld) SPECTATE_COPY() { this.(fld) = spectatee.(fld); }
 
-int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodcontrol);
+const int MAX_SPECTATORS = 7;