From d10d634ef6ae169e83745dd01391d3b6f94e5d68 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 18 Jan 2017 16:43:34 +1000 Subject: [PATCH] Block anonymous records from the CTS leaderboard --- .gitlab-ci.yml | 2 +- notifications.cfg | 5 +++-- qcsrc/common/notifications/all.inc | 1 + qcsrc/server/race.qc | 6 ++++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1488aef2b..9e42b44c4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,7 +30,7 @@ test_sv_game: - wget -O data/maps/g-23.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/g-23.waypoints.cache - wget -O data/maps/g-23.waypoints.hardwired https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/g-23.waypoints.hardwired - make - - EXPECT=49ace70f31418e5580127461d853fcef + - EXPECT=86720b1d38512b4e92183d30662bab41 - HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg | tee /dev/stderr | grep '^:' diff --git a/notifications.cfg b/notifications.cfg index 3e6b009d0..feb9b871b 100644 --- a/notifications.cfg +++ b/notifications.cfg @@ -102,7 +102,7 @@ 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 = 328): +// MSG_INFO notifications (count = 329): 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)" @@ -269,6 +269,7 @@ seta notification_INFO_RACE_FAIL_UNRANKED "1" "0 = off, 1 = print to console, 2 seta notification_INFO_RACE_FINISHED "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" seta notification_INFO_RACE_NEW_BROKEN "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" seta notification_INFO_RACE_NEW_IMPROVED "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" +seta notification_INFO_RACE_NEW_MISSING_NAME "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" seta notification_INFO_RACE_NEW_MISSING_UID "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" seta notification_INFO_RACE_NEW_SET "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" seta notification_INFO_ROUND_OVER "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" @@ -743,4 +744,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 = 833): MSG_ANNCE = 89, MSG_INFO = 328, MSG_CENTER = 235, MSG_MULTI = 153, MSG_CHOICE = 28 +// Notification counts (total = 834): MSG_ANNCE = 89, MSG_INFO = 329, MSG_CENTER = 235, MSG_MULTI = 153, MSG_CHOICE = 28 diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index c25c19443..fa7112e55 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -415,6 +415,7 @@ MSG_INFO_NOTIF(RACE_NEW_BROKEN, 1, 2, 3, "s1 s2 race_col f1ord race_col f2race_time race_diff", "s1 f2race_time", "race_newrankyellow", _("^BG%s^BG broke %s^BG's %s%s^BG place record with %s%s %s"), "") MSG_INFO_NOTIF(RACE_NEW_IMPROVED, 1, 1, 3, "s1 race_col f1ord race_col f2race_time race_diff", "s1 f2race_time", "race_newtime", _("^BG%s^BG improved their %s%s^BG place record with %s%s %s"), "") MSG_INFO_NOTIF(RACE_NEW_MISSING_UID, 1, 1, 1, "s1 f1race_time", "s1 f1race_time", "race_newfail", _("^BG%s^BG scored a new record with ^F2%s^BG, but unfortunately lacks a UID and will be lost."), "") + MSG_INFO_NOTIF(RACE_NEW_MISSING_NAME, 1, 1, 1, "s1 f1race_time", "s1 f1race_time", "race_newfail", _("^BG%s^BG scored a new record with ^F2%s^BG, but is anonymous and will be lost."), "") MSG_INFO_NOTIF(RACE_NEW_SET, 1, 1, 2, "s1 race_col f1ord race_col f2race_time", "s1 f2race_time", "race_newrecordserver", _("^BG%s^BG set the %s%s^BG place record with %s%s"), "") MULTIICON_INFO(MINIGAME_INVITE, 1, 2, 0, "s2 minigame1_name s1", "s2", "minigame1_d", "minigames/%s/icon_notif", _("^F4You have been invited by ^BG%s^F4 to join their game of ^F2%s^F4 (^F1%s^F4)"), "") diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index a3cbc685f..a90ef8f95 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -285,6 +285,12 @@ void race_setTime(string map, float t, string myuid, string mynetname, entity e) return; } + if(uid2name(myuid) == "^1Unregistered Player") + { + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_RACE_NEW_MISSING_NAME, mynetname, t); + return; + } + oldrec = race_readTime(GetMapname(), newpos); oldrec_holder = race_readName(GetMapname(), newpos); -- 2.39.2