X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fclient.qh;h=2d3a099b3988bc715589d9f5018fd310be1fc7f6;hp=8e8c8d71b3a5af1d0e8c17d164bae28f2f858e23;hb=5b7f9e34118d0f3b8f14b092f26baac27b0d4de5;hpb=f28bafd2da379d00bd179459e73a77620552a66f diff --git a/qcsrc/server/client.qh b/qcsrc/server/client.qh index 8e8c8d71b..2d3a099b3 100644 --- a/qcsrc/server/client.qh +++ b/qcsrc/server/client.qh @@ -1,5 +1,8 @@ #pragma once +#include "utils.qh" +#include + void ClientState_attach(entity this); IntrusiveList g_players; @@ -70,7 +73,6 @@ CLASS(Client, Object) ATTRIB(Client, parm_idlesince, int, this.parm_idlesince); ATTRIB(Client, muted, bool, this.muted); - ATTRIB(Client, killindicator_teamchange, int, this.killindicator_teamchange); ATTRIB(Client, idlekick_lasttimeleft, float, this.idlekick_lasttimeleft); ATTRIB(Client, pm_frametime, float, this.pm_frametime); ATTRIB(Client, pressedkeys, int, this.pressedkeys); @@ -83,6 +85,7 @@ CLASS(Client, Object) ATTRIB(Client, motd_actived_time, float, this.motd_actived_time); ATTRIB(Client, jointime, float, this.jointime); ATTRIB(Client, spectatortime, float, this.spectatortime); + ATTRIB(Client, startplaytime, float, this.startplaytime); ATTRIB(Client, version_nagtime, float, this.version_nagtime); ATTRIB(Client, netname_previous, string, this.netname_previous); ATTRIB(Client, allowed_timeouts, int, this.allowed_timeouts); @@ -107,7 +110,41 @@ 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, 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, autojoin_checked, bool, this.wasplayer); + + // networked cvars + + ATTRIB(Client, cvar_cl_allow_uid2name, int, this.cvar_cl_allow_uid2name); + ATTRIB(Client, cvar_cl_allow_uidtracking, int, this.cvar_cl_allow_uidtracking); + ATTRIB(Client, cvar_cl_autotaunt, float, this.cvar_cl_autotaunt); + ATTRIB(Client, cvar_cl_voice_directional, int, this.cvar_cl_voice_directional); + ATTRIB(Client, cvar_cl_voice_directional_taunt_attenuation, float, this.cvar_cl_voice_directional_taunt_attenuation); + ATTRIB(Client, cvar_cl_physics, string, this.cvar_cl_physics); + ATTRIB(Client, cvar_cl_buffs_autoreplace, bool, this.cvar_cl_buffs_autoreplace); + ATTRIB(Client, cvar_cl_nade_type, int, this.cvar_cl_nade_type); + 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_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_newusekeysupported, bool, this.cvar_cl_newusekeysupported); + ATTRIB(Client, cvar_cl_noantilag, bool, this.cvar_cl_noantilag); + ATTRIB(Client, cvar_cl_movement_track_canjump, bool, this.cvar_cl_movement_track_canjump); + 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_dodging_timeout, float, this.cvar_cl_dodging_timeout); + 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); METHOD(Client, m_unwind, bool(Client this)); @@ -148,7 +185,7 @@ CLASS(Spectator, Client) ENDCLASS(Spectator) CLASS(Player, Client) - + // custom ATTRIB(Player, dual_weapons, vector, this.dual_weapons); // TODO: actually WepSet! @@ -189,7 +226,36 @@ METHOD(Client, m_unwind, bool(Client this)) return false; } -float c1, c2, c3, c4; +/// \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); void play_countdown(entity this, float finished, Sound samp); @@ -197,5 +263,21 @@ float CalcRotRegen(float current, float regenstable, float regenfactor, float re bool Spectate(entity this, entity pl); -#define SPECTATE_COPY() [[accumulate]] void SpectateCopy(entity this, entity spectatee) +void ClientInit_Spawn(); + +void PutObserverInServer(entity this); + +void SetSpectatee(entity this, entity spectatee); +void SetSpectatee_status(entity this, int spectatee_num); + +void FixPlayermodel(entity player); + +void ClientInit_misc(entity this); + +void ClientKill_TeamChange(entity this, float targetteam); // 0 = don't change, -1 = auto, -2 = spec + +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); }