]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/client.qh
Merge branch 'k9er/strafehud-changes' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / client.qh
index 8f7b9c4f3224be1655e2b73cdaa5553e62f7957f..815e2639041f006759e05d0fd83cee3a5b7f8588 100644 (file)
@@ -7,6 +7,7 @@
 #include <common/sounds/all.qh>
 
 bool autocvar__notarget;
 #include <common/sounds/all.qh>
 
 bool autocvar__notarget;
+bool autocvar_sv_show_entnum;
 int autocvar_g_balance_armor_start;
 float autocvar_g_balance_pause_armor_rot_spawn;
 float autocvar_g_balance_pause_fuel_rot_spawn;
 int autocvar_g_balance_armor_start;
 float autocvar_g_balance_pause_armor_rot_spawn;
 float autocvar_g_balance_pause_fuel_rot_spawn;
@@ -50,11 +51,12 @@ string autocvar_hostname;
 int autocvar_spawn_debug;
 string autocvar_sv_motd;
 int autocvar_sv_name_maxlength = 64;
 int autocvar_spawn_debug;
 string autocvar_sv_motd;
 int autocvar_sv_name_maxlength = 64;
+string autocvar_sv_quickmenu_file;
 bool autocvar_sv_servermodelsonly;
 bool autocvar_sv_servermodelsonly;
-int autocvar_sv_spectate;
+bool autocvar_sv_showspectators;
+bool autocvar_sv_spectate;
 bool autocvar_sv_teamnagger;
 float autocvar_sv_player_scale;
 bool autocvar_sv_teamnagger;
 float autocvar_sv_player_scale;
-bool autocvar_sv_showspectators;
 
 // WEAPONTODO
 .string weaponorder_byimpulse;
 
 // WEAPONTODO
 .string weaponorder_byimpulse;
@@ -64,14 +66,17 @@ bool autocvar_sv_showspectators;
 .float jointime; // time of connecting
 .float startplaytime; // time of switching from spectator to player
 .float alivetime; // time of being alive
 .float jointime; // time of connecting
 .float startplaytime; // time of switching from spectator to player
 .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 wasplayer;
 
 .int spectatee_status;
 .bool zoomstate;
 
+/// > 0 is a team index, if wants_join == -1 the player can't have the team they selected (conflict)
+.int team_selected;
 .bool just_joined;
 .bool just_joined;
+/// > 0 is a team index, -1 means team selection is deferred until Join()
+.int wants_join;
 
 .int pressedkeys;
 
 
 .int pressedkeys;
 
@@ -82,9 +87,6 @@ bool autocvar_sv_showspectators;
 
 void ClientState_attach(entity this);
 
 
 void ClientState_attach(entity this);
 
-IntrusiveList g_players;
-STATIC_INIT(g_players) { g_players = IL_NEW(); }
-
 CLASS(Client, Object)
     /** Client name */
     ATTRIB(Client, netname, string, this.netname);
 CLASS(Client, Object)
     /** Client name */
     ATTRIB(Client, netname, string, this.netname);
@@ -159,8 +161,8 @@ CLASS(Client, Object)
     ATTRIB(Client, teamkill_soundtime, float, this.teamkill_soundtime);
     ATTRIB(Client, teamkill_soundsource, entity, this.teamkill_soundsource);
     ATTRIB(Client, usekeypressed, bool, this.usekeypressed);
     ATTRIB(Client, teamkill_soundtime, float, this.teamkill_soundtime);
     ATTRIB(Client, teamkill_soundsource, entity, this.teamkill_soundsource);
     ATTRIB(Client, usekeypressed, bool, this.usekeypressed);
-    ATTRIB(Client, motd_actived_time, float, this.motd_actived_time);
     ATTRIB(Client, jointime, float, this.jointime);
     ATTRIB(Client, jointime, float, this.jointime);
+    ATTRIB(Client, wants_join, int, this.wants_join);
     ATTRIB(Client, spectatortime, float, this.spectatortime);
     ATTRIB(Client, startplaytime, float, this.startplaytime);
     ATTRIB(Client, version_nagtime, float, this.version_nagtime);
     ATTRIB(Client, spectatortime, float, this.spectatortime);
     ATTRIB(Client, startplaytime, float, this.startplaytime);
     ATTRIB(Client, version_nagtime, float, this.version_nagtime);
@@ -186,7 +188,6 @@ CLASS(Client, Object)
     ATTRIB(Client, specialcommand_pos, int, this.specialcommand_pos);
     ATTRIB(Client, hitplotfh, int, this.hitplotfh);
     ATTRIB(Client, clientdata, entity, this.clientdata);
     ATTRIB(Client, specialcommand_pos, int, this.specialcommand_pos);
     ATTRIB(Client, hitplotfh, int, this.hitplotfh);
     ATTRIB(Client, clientdata, entity, this.clientdata);
-    ATTRIB(Client, cmd_floodcount, int, this.cmd_floodcount);
     ATTRIB(Client, cmd_floodtime, float, this.cmd_floodtime);
     ATTRIB(Client, wasplayer, bool, this.wasplayer);
     ATTRIB(Client, weaponorder_byimpulse, string, this.weaponorder_byimpulse);
     ATTRIB(Client, cmd_floodtime, float, this.cmd_floodtime);
     ATTRIB(Client, wasplayer, bool, this.wasplayer);
     ATTRIB(Client, weaponorder_byimpulse, string, this.weaponorder_byimpulse);
@@ -208,7 +209,8 @@ CLASS(Client, Object)
     ATTRIB(Client, cvar_cl_pokenade_type, string, this.cvar_cl_pokenade_type);
     ATTRIB(Client, cvar_cl_spawn_near_teammate, bool, this.cvar_cl_spawn_near_teammate);
     ATTRIB(Client, cvar_cl_gunalign, int, this.cvar_cl_gunalign);
     ATTRIB(Client, cvar_cl_pokenade_type, string, this.cvar_cl_pokenade_type);
     ATTRIB(Client, cvar_cl_spawn_near_teammate, bool, this.cvar_cl_spawn_near_teammate);
     ATTRIB(Client, cvar_cl_gunalign, int, this.cvar_cl_gunalign);
-    ATTRIB(Client, cvar_cl_handicap, float, this.cvar_cl_handicap);
+    ATTRIB(Client, cvar_cl_handicap_damage_given, float, this.cvar_cl_handicap_damage_given);
+    ATTRIB(Client, cvar_cl_handicap_damage_taken, float, this.cvar_cl_handicap_damage_taken);
     ATTRIB(Client, cvar_cl_clippedspectating, bool, this.cvar_cl_clippedspectating);
     ATTRIB(Client, cvar_cl_autoscreenshot, int, this.cvar_cl_autoscreenshot);
     ATTRIB(Client, cvar_cl_jetpack_jump, bool, this.cvar_cl_jetpack_jump);
     ATTRIB(Client, cvar_cl_clippedspectating, bool, this.cvar_cl_clippedspectating);
     ATTRIB(Client, cvar_cl_autoscreenshot, int, this.cvar_cl_autoscreenshot);
     ATTRIB(Client, cvar_cl_jetpack_jump, bool, this.cvar_cl_jetpack_jump);
@@ -279,10 +281,8 @@ CLASS(Player, Client)
 
     INIT(Player) {
         this.classname = STR_PLAYER;
 
     INIT(Player) {
         this.classname = STR_PLAYER;
-        IL_PUSH(g_players, this);
     }
     DESTRUCTOR(Player) {
     }
     DESTRUCTOR(Player) {
-        IL_REMOVE(g_players, this);
     }
 ENDCLASS(Player)
 
     }
 ENDCLASS(Player)
 
@@ -316,9 +316,7 @@ bool independent_players;
 
 .int killcount;
 
 
 .int killcount;
 
-//flood fields
-.float nickspamtime; // time of last nick change
-.float nickspamcount;
+void SendWelcomeMessage(entity this, int msg_type);
 
 // respawning
 .int respawn_flags;
 
 // respawning
 .int respawn_flags;
@@ -331,7 +329,6 @@ const int RESPAWN_FORCE = BIT(0);
 const int RESPAWN_SILENT = BIT(1);
 const int RESPAWN_DENY = BIT(2);
 
 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;
 .float spectatortime; // point in time since the client is spectating or observing
 
 .bool player_blocked;
@@ -359,9 +356,11 @@ void calculate_player_respawn_time(entity this);
 
 bool PlayerInList(entity player, string list);
 
 
 bool PlayerInList(entity player, string list);
 
-void ClientData_Touch(entity e);
+bool PlayerInIDList(entity p, string idlist);
 
 
-int nJoinAllowed(entity this, entity ignore);
+bool PlayerInIPList(entity p, string iplist);
+
+void ClientData_Touch(entity e);
 
 void PlayerUseKey(entity this);
 
 
 void PlayerUseKey(entity this);
 
@@ -385,20 +384,25 @@ bool Spectate(entity this, entity pl);
 
 void ClientInit_Spawn();
 
 
 void ClientInit_Spawn();
 
-void PutObserverInServer(entity this, bool is_forced);
+void PutObserverInServer(entity this, bool is_forced, bool use_spawnpoint);
 
 void SetSpectatee(entity this, entity spectatee);
 void SetSpectatee_status(entity this, int spectatee_num);
 
 void FixPlayermodel(entity player);
 
 
 void SetSpectatee(entity this, entity spectatee);
 void SetSpectatee_status(entity this, int spectatee_num);
 
 void FixPlayermodel(entity player);
 
+void GiveWarmupResources(entity this);
+
 void ClientInit_misc(entity this);
 
 int GetPlayerLimit();
 
 const int MIN_SPEC_TIME = 1;
 void ClientInit_misc(entity this);
 
 int GetPlayerLimit();
 
 const int MIN_SPEC_TIME = 1;
-bool joinAllowed(entity this);
-void Join(entity this);
+void Join(entity this, bool queued_join);
+int nJoinAllowed(entity this, entity ignore);
+bool joinAllowed(entity this, int team_index);
+
+void PlayerFrame (entity this);
 
 #define SPECTATE_COPY() ACCUMULATE void SpectateCopy(entity this, entity spectatee)
 #define SPECTATE_COPYFIELD(fld) SPECTATE_COPY() { this.(fld) = spectatee.(fld); }
 
 #define SPECTATE_COPY() ACCUMULATE void SpectateCopy(entity this, entity spectatee)
 #define SPECTATE_COPYFIELD(fld) SPECTATE_COPY() { this.(fld) = spectatee.(fld); }