X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fclient.qh;h=2ad2d8f8d2c66d3048d1a0d7d2991cb550399fd1;hb=969dc49d01d650a812706aba16c765af488605d0;hp=605b78ff913b38b13aeb55dfe42cfbdb48b14762;hpb=23a3837422cea42aa657984500da071b31bda24c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/client.qh b/qcsrc/server/client.qh index 605b78ff9..2ad2d8f8d 100644 --- a/qcsrc/server/client.qh +++ b/qcsrc/server/client.qh @@ -98,7 +98,7 @@ CLASS(Client, Object) ATTRIB(Client, zoomstate, bool, this.zoomstate); ATTRIB(Client, just_joined, bool, this.just_joined); ATTRIB(Client, race_completed, bool, this.race_completed); - ATTRIBARRAY(Client, msg_choice_choices, int, 50); // TODO: actually NOTIF_CHOICE_MAX + ATTRIBARRAY(Client, msg_choice_choices, int, 20); // TODO: actually NOTIF_CHOICE_MAX ATTRIB(Client, latency_sum, float, this.latency_sum); ATTRIB(Client, latency_cnt, int, this.latency_cnt); ATTRIB(Client, latency_time, float, this.latency_time); @@ -114,7 +114,7 @@ CLASS(Client, Object) ATTRIB(Client, cmd_floodtime, float, this.cmd_floodtime); ATTRIB(Client, wasplayer, bool, this.wasplayer); ATTRIB(Client, weaponorder_byimpulse, string, this.weaponorder_byimpulse); - ATTRIB(Client, autojoin_checked, bool, this.wasplayer); + ATTRIB(Client, autojoin_checked, int, this.wasplayer); // networked cvars @@ -139,13 +139,17 @@ CLASS(Client, Object) ATTRIB(Client, cvar_cl_weaponimpulsemode, int, this.cvar_cl_weaponimpulsemode); 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_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); ATTRIB(Client, cvar_cl_accuracy_data_share, bool, this.cvar_cl_accuracy_data_share); ATTRIB(Client, cvar_cl_accuracy_data_receive, bool, this.cvar_cl_accuracy_data_receive); ATTRIBARRAY(Client, cvar_cl_weaponpriorities, string, 10); ATTRIB(Client, cvar_cl_weaponpriority, string, this.cvar_cl_weaponpriority); ATTRIB(Client, cvar_cl_cts_noautoswitch, bool, this.cvar_cl_cts_noautoswitch); + ATTRIB(Client, cvar_cl_weapon_switch_reload, bool, this.cvar_cl_weapon_switch_reload); + ATTRIB(Client, cvar_cl_weapon_switch_fallback_to_impulse, bool, this.cvar_cl_weapon_switch_fallback_to_impulse); METHOD(Client, m_unwind, bool(Client this)); @@ -227,8 +231,52 @@ METHOD(Client, m_unwind, bool(Client this)) return false; } +//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; +.float respawn_time; +.float respawn_time_max; + +.float respawn_countdown; // next number to count + +// g__str: +// If 0, default is used. +// If <0, 0 is used. +// Otherwise, g_str (default value) is used. +// For consistency, negative values there are mapped to zero too. +#define GAMETYPE_DEFAULTED_SETTING(str) \ + ((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) + +void calculate_player_respawn_time(entity this); + bool PlayerInList(entity player, string list); +void ClientData_Touch(entity e); + +int nJoinAllowed(entity this, entity ignore); + +void FixIntermissionClient(entity e); + +void checkSpectatorBlock(entity this); + +void PlayerUseKey(entity this); + +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. @@ -262,7 +310,7 @@ void DebugPrintToChatTeam(int team_num, string text); void play_countdown(entity this, float finished, Sound samp); -float CalcRotRegen(float current, float regenstable, float regenfactor, float regenlinear, float regenframetime, float rotstable, float rotfactor, float rotlinear, float rotframetime, float limit); +void RotRegen(entity this, float current, float regenstable, float regenfactor, float regenlinear, float regenframetime, float rotstable, float rotfactor, float rotlinear, float rotframetime, float limit_mod); bool Spectate(entity this, entity pl); @@ -279,8 +327,11 @@ void ClientInit_misc(entity this); int GetPlayerLimit(); +const int MIN_SPEC_TIME = 1; bool joinAllowed(entity this); 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);