From 5eff9f77362d5e4e55390e34c0ccd4abd2b66b93 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 16 Jul 2017 06:36:17 +1000 Subject: [PATCH] Port jointime to ClientState --- qcsrc/server/client.qc | 2 +- qcsrc/server/client.qh | 1 + qcsrc/server/command/common.qc | 2 +- qcsrc/server/g_world.qc | 2 +- qcsrc/server/mutators/mutator/gamemode_ca.qc | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 009d12995..aa19f060e 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -1230,7 +1230,7 @@ void ClientConnect(entity this) Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime); } - this.jointime = time; + CS(this).jointime = time; this.allowed_timeouts = autocvar_sv_timeout_number; if (IS_REAL_CLIENT(this)) diff --git a/qcsrc/server/client.qh b/qcsrc/server/client.qh index 0780a4a6e..510a6e271 100644 --- a/qcsrc/server/client.qh +++ b/qcsrc/server/client.qh @@ -81,6 +81,7 @@ CLASS(Client, Object) 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); METHOD(Client, m_unwind, bool(Client this)); diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index 984505ec1..936858ce4 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -808,7 +808,7 @@ void CommonCommand_who(float request, entity caller, float argc) it.netname, CS(it).ping, CS(it).ping_packetloss, - process_time(1, time - it.jointime), + process_time(1, time - CS(it).jointime), tmp_netaddress, tmp_crypto_idfp)); diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index a58a3de10..2f732956c 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -1459,7 +1459,7 @@ void DumpStats(float final) FOREACH_CLIENT(IS_REAL_CLIENT(it) || (IS_BOT_CLIENT(it) && autocvar_sv_logscores_bots), LAMBDA( s = strcat(":player:see-labels:", GetPlayerScoreString(it, 0), ":"); - s = strcat(s, ftos(rint(time - it.jointime)), ":"); + s = strcat(s, ftos(rint(time - CS(it).jointime)), ":"); if(IS_PLAYER(it) || MUTATOR_CALLHOOK(GetPlayerStatus, it)) s = strcat(s, ftos(it.team), ":"); else diff --git a/qcsrc/server/mutators/mutator/gamemode_ca.qc b/qcsrc/server/mutators/mutator/gamemode_ca.qc index 8ef0a859e..6fe4e74e3 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ca.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ca.qc @@ -188,7 +188,7 @@ MUTATOR_HOOKFUNCTION(ca, PutClientInServer) if (!allowed_to_spawn && IS_PLAYER(player)) // this is true even when player is trying to join { TRANSMUTE(Observer, player); - if (player.jointime != time && !player.caplayer) // not when connecting + if (CS(player).jointime != time && !player.caplayer) // not when connecting { player.caplayer = 0.5; Send_Notification(NOTIF_ONE_ONLY, player, MSG_INFO, INFO_CA_JOIN_LATE); -- 2.39.2