]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
g_warmup -1: abort countdown if player count falls too low
authorbones_was_here <bones_was_here@xonotic.au>
Mon, 26 Sep 2022 05:23:16 +0000 (15:23 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Wed, 28 Sep 2022 20:00:46 +0000 (06:00 +1000)
Includes translatable chatcon + centreprint notification for this case.

notifications.cfg
qcsrc/client/announcer.qc
qcsrc/common/notifications/all.inc
qcsrc/server/client.qc
qcsrc/server/command/vote.qc

index 1919601d57e49a7d0e20ec0181c64ea9a613183b..440219064f9324d800429f8b5c53619a48dd32ef 100644 (file)
@@ -93,12 +93,13 @@ seta notification_ANNCE_VOTE_ACCEPT "2" "0 = disabled, 1 = enabled if gentle mod
 seta notification_ANNCE_VOTE_CALL "2" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
 seta notification_ANNCE_VOTE_FAIL "2" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
 
-// MSG_INFO notifications (count = 335):
+// MSG_INFO notifications (count = 336):
 seta notification_INFO_CA_JOIN_LATE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_CA_LEAVE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_CHAT_NOSPECTATORS "2" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_COINTOSS "2" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_CONNECTING "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_COUNTDOWN_STOP "2" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_CTF_CAPTURE_BROKEN "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_CTF_CAPTURE_NEUTRAL "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_CTF_CAPTURE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
@@ -343,7 +344,7 @@ seta notification_INFO_WEAPON_TUBA_SUICIDE "1" "0 = off, 1 = print to console, 2
 seta notification_INFO_WEAPON_VAPORIZER_MURDER "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_WEAPON_VORTEX_MURDER "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 
-// MSG_CENTER notifications (count = 242):
+// MSG_CENTER notifications (count = 243):
 seta notification_CENTER_ALONE "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_ASSAULT_ATTACKING "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_ASSAULT_DEFENDING "1" "0 = off, 1 = centerprint"
@@ -354,6 +355,7 @@ seta notification_CENTER_COUNTDOWN_BEGIN "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_COUNTDOWN_GAMESTART "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_COUNTDOWN_ROUNDSTART "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_COUNTDOWN_ROUNDSTOP "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_COUNTDOWN_STOP "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_CTF_CAPTURESHIELD_FREE "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_CTF_CAPTURESHIELD_INACTIVE "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_CTF_CAPTURESHIELD_SHIELDED "1" "0 = off, 1 = centerprint"
@@ -539,7 +541,9 @@ seta notification_CENTER_VEHICLE_STEAL "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_VEHICLE_STEAL_SELF "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_WEAPON_MINELAYER_LIMIT "1" "0 = off, 1 = centerprint"
 
-// MSG_MULTI notifications (count = 157):
+// MSG_MULTI notifications (count = 158):
+seta notification_COUNTDOWN_BEGIN "1" "Enable this multiple notification"
+seta notification_COUNTDOWN_STOP "1" "Enable this multiple notification"
 seta notification_DEATH_MURDER_BUFF "1" "Enable this multiple notification"
 seta notification_DEATH_MURDER_CHEAT "1" "Enable this multiple notification"
 seta notification_DEATH_MURDER_DROWN "1" "Enable this multiple notification"
@@ -632,7 +636,6 @@ seta notification_ITEM_WEAPON_NOAMMO "1" "Enable this multiple notification"
 seta notification_ITEM_WEAPON_PRIMORSEC "1" "Enable this multiple notification"
 seta notification_ITEM_WEAPON_UNAVAILABLE "1" "Enable this multiple notification"
 seta notification_MULTI_COINTOSS "1" "Enable this multiple notification"
-seta notification_MULTI_COUNTDOWN_BEGIN "1" "Enable this multiple notification"
 seta notification_MULTI_INSTAGIB_FINDAMMO "1" "Enable this multiple notification"
 seta notification_WEAPON_ACCORDEON_MURDER "1" "Enable this multiple notification"
 seta notification_WEAPON_ACCORDEON_SUICIDE "1" "Enable this multiple notification"
@@ -749,4 +752,4 @@ seta notification_show_sprees_info "3" "Show spree information in MSG_INFO messa
 seta notification_show_sprees_info_newline "1" "Show attacker spree information for MSG_INFO messages on a separate line than the death notification itself"
 seta notification_show_sprees_info_specialonly "1" "Don't show attacker spree information in MSG_INFO messages if it isn't an achievement"
 
-// Notification counts (total = 842): MSG_ANNCE = 80, MSG_INFO = 335, MSG_CENTER = 242, MSG_MULTI = 157, MSG_CHOICE = 28
+// Notification counts (total = 845): MSG_ANNCE = 80, MSG_INFO = 336, MSG_CENTER = 243, MSG_MULTI = 158, MSG_CHOICE = 28
index 780b582dea10d0c33ca40f1fe593071f33e28115..70834c509b3c32dcf3d4393f279d0e3386c811c3 100644 (file)
@@ -78,7 +78,7 @@ void Announcer_Countdown(entity this)
        if(countdown <= 0) // countdown has finished, starttime is now
        {
                Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_BEGIN);
-               Local_Notification(MSG_MULTI, MULTI_COUNTDOWN_BEGIN);
+               Local_Notification(MSG_MULTI, COUNTDOWN_BEGIN);
                delete(this);
                announcer_countdown = NULL;
                Announcer_ClearTitle();
index 440a5bcabc443260c54129b363da287cd68b0da1..e9ac7fb4d9c14cc4053033170949ad7cda2e6dfe 100644 (file)
@@ -258,6 +258,8 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input !=
     MSG_INFO_NOTIF(CA_JOIN_LATE,                            N_CONSOLE,  0, 0, "", "",       "",     _("^F1Round already started, you will join the game in the next round"), "")
     MSG_INFO_NOTIF(CA_LEAVE,                                N_CONSOLE,  0, 0, "", "",       "",     _("^F2You will spectate in the next round"), "")
 
+    MSG_INFO_NOTIF(COUNTDOWN_STOP,                          N_CHATCON,  0, 0, "", "",       "",     _("^F4Countdown stopped!"), "")
+
     MSG_INFO_NOTIF(DEATH_MURDER_BUFF,                       N_CONSOLE,  3, 3, "spree_inf s1 s2 f3buffname s3loc spree_end", "s2 s1",    "notify_death",         _("^BG%s%s^K1 was killed by ^BG%s^K1's ^BG%s^K1 buff ^K1%s%s"), _("^BG%s%s^K1 was scored against by ^BG%s^K1's ^BG%s^K1 buff ^K1%s%s"))
     MSG_INFO_NOTIF(DEATH_MURDER_CHEAT,                      N_CONSOLE,  3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1",               "notify_death",         _("^BG%s%s^K1 was unfairly eliminated by ^BG%s^K1%s%s"), "")
     MSG_INFO_NOTIF(DEATH_MURDER_DROWN,                      N_CONSOLE,  3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1",               "notify_water",         _("^BG%s%s^K1 was drowned by ^BG%s^K1%s%s"), "")
@@ -527,6 +529,7 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input !=
     MSG_CENTER_NOTIF(ASSAULT_DEFENDING,                 N_ENABLE,    0, 0, "",               CPID_ASSAULT_ROLE,      "0 0",  _("^BGYou are defending!"), "")
     MSG_CENTER_NOTIF(ASSAULT_OBJ_DESTROYED,             N_ENABLE,    0, 1, "f1time",         CPID_ASSAULT_ROLE,      "0 0",  _("^BGObjective destroyed in ^F4%s^BG!"), "")
 
+    MSG_CENTER_NOTIF(COUNTDOWN_STOP,                    N_ENABLE,    0, 1, "f1",             CPID_MISSING_PLAYERS,   "4 0",  strcat(BOLD(_("^F4Countdown stopped!")), "\n^BG", _("%s players are needed for this match.")), "")
     MSG_CENTER_NOTIF(COUNTDOWN_BEGIN,                   N_ENABLE,    0, 0, "",               CPID_ROUND,             "2 0",  BOLD(_("^BGBegin!")), "")
     MSG_CENTER_NOTIF(COUNTDOWN_GAMESTART,               N_ENABLE,    0, 1, "",               CPID_ROUND,             "1 f1", strcat(_("^BGGame starts in"), "\n", BOLD("^COUNT")), "")
     MSG_CENTER_NOTIF(COUNTDOWN_ROUNDSTART,              N_ENABLE,    0, 2, "f1",             CPID_ROUND,             "1 f2", strcat(_("^BGRound %s starts in"), "\n", BOLD("^COUNT")), "")
@@ -793,6 +796,9 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input !=
     MSG_MULTI_NOTIF(prefix##_PINK, defaultvalue, anncepre##PINK, infopre##PINK, centerpre##PINK)
 
 // MSG_MULTI_NOTIFICATIONS
+    MSG_MULTI_NOTIF(COUNTDOWN_BEGIN,                    N_ENABLE,  ANNCE_BEGIN,    NULL,                                   CENTER_COUNTDOWN_BEGIN)
+    MSG_MULTI_NOTIF(COUNTDOWN_STOP,                     N_ENABLE,  NULL,           INFO_COUNTDOWN_STOP,                    CENTER_COUNTDOWN_STOP)
+
     MSG_MULTI_NOTIF(DEATH_MURDER_BUFF,                  N_ENABLE,  NULL,           INFO_DEATH_MURDER_BUFF,                 NULL)
     MSG_MULTI_NOTIF(DEATH_MURDER_CHEAT,                 N_ENABLE,  NULL,           INFO_DEATH_MURDER_CHEAT,                NULL)
     MSG_MULTI_NOTIF(DEATH_MURDER_DROWN,                 N_ENABLE,  NULL,           INFO_DEATH_MURDER_DROWN,                NULL)
@@ -888,7 +894,6 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input !=
     MSG_MULTI_NOTIF(ITEM_WEAPON_UNAVAILABLE,            N_ENABLE,  NULL,           INFO_ITEM_WEAPON_UNAVAILABLE,           CENTER_ITEM_WEAPON_UNAVAILABLE)
 
     MSG_MULTI_NOTIF(MULTI_COINTOSS,                     N_ENABLE,  NULL,           INFO_COINTOSS,                          CENTER_COINTOSS)
-    MSG_MULTI_NOTIF(MULTI_COUNTDOWN_BEGIN,              N_ENABLE,  ANNCE_BEGIN,    NULL,                                   CENTER_COUNTDOWN_BEGIN)
     MSG_MULTI_NOTIF(MULTI_INSTAGIB_FINDAMMO,            N_ENABLE,  ANNCE_NUM_10,   NULL,                                   CENTER_INSTAGIB_FINDAMMO_FIRST)
 
     MSG_MULTI_NOTIF(WEAPON_ACCORDEON_MURDER,            N_ENABLE,  NULL,           INFO_WEAPON_ACCORDEON_MURDER,           NULL)
index 17893200dbfc3a5b9a14d7c648fe2e5ea8a9f51f..eb2ba1dcf7234831965879998894cedc3b0d13d6 100644 (file)
@@ -256,7 +256,7 @@ void PutObserverInServer(entity this, bool is_forced, bool use_spawnpoint)
                {
                        if (vote_called) { VoteCount(false); }
                        this.ready = false;
-                       if (warmup_stage) recount_ready = true;
+                       if (warmup_stage || game_starttime > time) recount_ready = true;
                }
                entcs_update_players(this);
        }
@@ -1241,7 +1241,7 @@ void ClientDisconnect(entity this)
        if (this.personal) delete(this.personal);
 
        this.playerid = 0;
-       if (warmup_stage) ReadyCount();
+       if (warmup_stage || game_starttime > time) ReadyCount();
        if (vote_called && IS_REAL_CLIENT(this)) VoteCount(false);
 
        player_powerups_remove_all(this); // stop powerup sound
index ecadba2ea83722417ec8c10bbc8b6e563026b10b..372b370f0a1e8faa542e0d8094b8238ef2159f43 100644 (file)
@@ -526,7 +526,12 @@ void ReadyCount()
 
        if (t_players < map_minplayers) // map_minplayers will only be set if g_warmup -1 at worldspawn
        {
-               // TODO: handle player spectating/disconnecting during countdown
+               if (game_starttime > time) // someone bailed during countdown, back to warmup
+               {
+                       warmup_stage = -1; // CAN change it AFTER calling Nagger_ReadyCounted() this frame
+                       game_starttime = time;
+                       Send_Notification(NOTIF_ALL, NULL, MSG_MULTI, COUNTDOWN_STOP, map_minplayers);
+               }
                if (warmup_limit > 0)
                        warmup_limit = -1;
                return; // don't ReadyRestart if players are ready but too few