From cdc255e87a18bd5c9099babe4c18b7406acb4fe0 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Sat, 17 Apr 2021 21:35:17 +1000 Subject: [PATCH] sv_maxidle: Improve CHATCON messages MOVETOSPEC_IDLING and QUIT_KICK_IDLING and QUIT_SPECTATE --- qcsrc/common/notifications/all.inc | 8 ++++---- qcsrc/server/client.qc | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index fd3f7ae07..f30dade81 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -414,11 +414,11 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input != MSG_INFO_NOTIF(POWERUP_STRENGTH, N_CONSOLE, 1, 0, "s1", "s1", "strength", _("^BG%s^K1 picked up Strength"), "") MSG_INFO_NOTIF(QUIT_DISCONNECT, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 disconnected"), "") - MSG_INFO_NOTIF(QUIT_KICK_IDLING, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 was kicked for idling"), "") - MSG_INFO_NOTIF(MOVETOSPEC_IDLING, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 was moved to spectator for idling"), "") + MSG_INFO_NOTIF(QUIT_KICK_IDLING, N_CHATCON, 1, 1, "s1 f1", "", "", _("^BG%s^F3 was kicked after idling for %s seconds"), "") + MSG_INFO_NOTIF(MOVETOSPEC_IDLING, N_CHATCON, 1, 1, "s1 f1", "", "", _("^BG%s^F3 was moved to^BG spectators^F3 after idling for %s seconds"), "") MSG_INFO_NOTIF(QUIT_KICK_SPECTATING, N_CONSOLE, 0, 0, "", "", "", _("^F2You were kicked from the server because you are a spectator and spectators aren't allowed at the moment."), "") MSG_INFO_NOTIF(QUIT_KICK_TEAMKILL, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 was kicked for excessive teamkilling"), "") - MSG_INFO_NOTIF(QUIT_SPECTATE, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 is now spectating"), "") + MSG_INFO_NOTIF(QUIT_SPECTATE, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 is now^BG spectating"), "") MSG_INFO_NOTIF(RACE_ABANDONED, N_CONSOLE, 1, 0, "s1", "", "", _("^BG%s^BG has abandoned the race"), "") MSG_INFO_NOTIF(RACE_FAIL_RANKED, N_CONSOLE, 1, 3, "s1 race_col f1ord race_col f3race_time race_diff", "s1 f3race_time", "race_newfail", _("^BG%s^BG couldn't break their %s%s^BG place record of %s%s %s"), "") @@ -658,7 +658,7 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input != MSG_CENTER_NOTIF(DEATH_TEAMKILL_FRAGGED, N_ENABLE, 1, 0, "s1", CPID_Null, "0 0", _("^K1You were fragged by ^BG%s^K1, a team mate"), _("^K1You were scored against by ^BG%s^K1, a team mate")) MSG_CENTER_NOTIF(DISCONNECT_IDLING, N_ENABLE, 0, 1, "", CPID_IDLING, "1 f1", _("^K1Stop idling!\n^BGDisconnecting in ^COUNT..."), "") - MSG_CENTER_NOTIF(MOVETOSPEC_IDLING, N_ENABLE, 0, 1, "", CPID_IDLING, "1 f1", _("^K1Stop idling!\n^BGMoving to spectator in ^COUNT..."), "") + MSG_CENTER_NOTIF(MOVETOSPEC_IDLING, N_ENABLE, 0, 1, "", CPID_IDLING, "1 f1", _("^K1Stop idling!\n^BGMoving to spectators in ^COUNT..."), "") MSG_CENTER_NOTIF(DOOR_LOCKED_NEED, N_ENABLE, 1, 0, "s1", CPID_Null, "0 0", _("^BGYou need %s^BG!"), "") MSG_CENTER_NOTIF(DOOR_LOCKED_ALSONEED, N_ENABLE, 1, 0, "s1", CPID_Null, "0 0", _("^BGYou also need %s^BG!"), "") diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index b5bdc3075..d752eea36 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -2740,14 +2740,14 @@ void PlayerPostThink (entity this) if (timeleft <= 0) { if (IS_PLAYER(this) && autocvar_sv_maxidle_playertospectator > 0) { - Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_MOVETOSPEC_IDLING, this.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_MOVETOSPEC_IDLING, this.netname, maxidle_time); if (this.caplayer) this.caplayer = 0; PutObserverInServer(this); } else { - Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_KICK_IDLING, this.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_KICK_IDLING, this.netname, maxidle_time); dropclient(this); } return; -- 2.39.2