From: packer Date: Tue, 17 Mar 2020 17:55:31 +0000 (+0100) Subject: Bans: Do not print IP of banned clients. Add crypto_idfp to log format. X-Git-Tag: xonotic-v0.8.5~1133^2~18^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=275fa6e6b25d5375138984c939bb5b5a0b333d0b;p=xonotic%2Fxonotic-data.pk3dir.git Bans: Do not print IP of banned clients. Add crypto_idfp to log format. --- diff --git a/qcsrc/server/ipban.qc b/qcsrc/server/ipban.qc index 9d74477b4..a7786f6b6 100644 --- a/qcsrc/server/ipban.qc +++ b/qcsrc/server/ipban.qc @@ -453,11 +453,16 @@ bool Ban_MaybeEnforceBan(entity client) { if (Ban_IsClientBanned(client, -1)) { - string s = sprintf("^1NOTE:^7 banned client %s just tried to enter\n", client.netaddress); + if (!client.crypto_idfp) + LOG_INFOF("^1NOTE:^7 banned client %s just tried to enter\n", + client.netaddress); + else + LOG_INFOF("^1NOTE:^7 banned client %s (%s) just tried to enter\n", + client.netaddress, client.crypto_idfp); + if(autocvar_g_ban_telluser) sprint(client, "You are banned from this server.\n"); dropclient(client); - bprint(s); return true; } return false; @@ -489,7 +494,7 @@ string Ban_Enforce(float j, string reason) reason = strcat(reason, ", "); reason = strcat(reason, it.netname); } - s = strcat(s, "^1NOTE:^7 banned client ", it.netaddress, "^7 has to go\n"); + s = strcat(s, "^1NOTE:^7 banned client ", it.netname, "^7 has to go\n"); dropclient(it); } });