]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
join: display translated notifications for relevant failures
authorbones_was_here <bones_was_here@xonotic.au>
Fri, 28 Jun 2024 10:06:40 +0000 (20:06 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Mon, 5 Aug 2024 16:26:28 +0000 (02:26 +1000)
notifications.cfg
qcsrc/common/notifications/all.inc
qcsrc/server/client.qc

index ee486bd42eee834f8e6bcc945ee8791532ae4b4d..bc2693c21545253aaa91e6d302f424f457faf3e2 100644 (file)
@@ -499,6 +499,7 @@ seta notification_CENTER_JOIN_PREVENT_MINIGAME "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_JOIN_PREVENT_QUEUE "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_JOIN_PREVENT_QUEUE_TEAM_CONFLICT "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_JOIN_PREVENT_QUEUE_TEAM "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_JOIN_PREVENT_VERSIONMISMATCH "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_KEEPAWAY_DROPPED "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_KEEPAWAY_PICKUP "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_KEEPAWAY_PICKUP_SELF "1" "0 = off, 1 = centerprint"
index 23cf5e3e735808a29afef23d10ca247e2ac01565..60a9e24498c4a4ebad69531b2b1d999bf04efd07 100644 (file)
@@ -724,6 +724,7 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input !=
     MSG_CENTER_NOTIF(ITEM_WEAPON_PRIMORSEC,             N_ENABLE,    0, 3, "item_wepname f2primsec f3primsec",   CPID_ITEM, "item_centime 0", _("^F1%s %s^BG is unable to fire, but its ^F1%s^BG can"), "")
     MSG_CENTER_NOTIF(ITEM_WEAPON_UNAVAILABLE,           N_ENABLE,    0, 1, "item_wepname",                       CPID_ITEM, "item_centime 0", _("^F1%s^BG is ^F4not available^BG on this map"), "")
 
+    MSG_CENTER_NOTIF(JOIN_PREVENT_VERSIONMISMATCH,      N_ENABLE,    0, 0, "",               CPID_PREVENT_JOIN,      "0 0",  _("^K1Your Xonotic version is incompatible with the server's version!"), "")
     MSG_CENTER_NOTIF(JOIN_NOSPAWNS,                     N_ENABLE,    0, 0, "",               CPID_PREVENT_JOIN,      "0 0",  _("^K1No spawnpoints available!\nHope your team can fix it..."), "")
     MSG_CENTER_NOTIF(JOIN_PLAYBAN,                      N_ENABLE,    0, 0, "",               CPID_PREVENT_JOIN,      "0 0",  BOLD(_("^K1You aren't allowed to play because you are banned in this server")), "")
     MSG_CENTER_NOTIF(JOIN_PREVENT,                      N_ENABLE,    0, 1, "f1",             CPID_PREVENT_JOIN,      "0 0",  _("^K1You may not join the game at this time.\nThis match is limited to ^F2%s^BG players."), "")
index dbb62150a0aa88e44989e189355f9731e1517b85..b259481422a222cc25071766c3827257aa1ca23a 100644 (file)
@@ -2227,9 +2227,17 @@ bool queuePlayer(entity this, int team_index)
 
 bool joinAllowed(entity this, int team_index)
 {
-       if (CS(this).version_mismatch) return false;
+       if (CS(this).version_mismatch)
+       {
+               Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_JOIN_PREVENT_VERSIONMISMATCH);
+               return false;
+       }
        if (time < CS(this).jointime + MIN_SPEC_TIME) return false;
-       if (teamplay && lockteams) return false;
+       if (teamplay && lockteams)
+       {
+               Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_TEAMCHANGE_LOCKED);
+               return false;
+       }
 
        if (QueueNeeded(this))
        {