From: Mario Date: Wed, 12 Sep 2018 23:31:09 +0000 (+1000) Subject: Add an option (enabled by default) to show a console message stating the player is... X-Git-Tag: xonotic-v0.8.5~1874 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cf7b2d7df390619cbdbf859b0a54cfc22c2dbccc;p=xonotic%2Fxonotic-data.pk3dir.git Add an option (enabled by default) to show a console message stating the player is banned when they try to join --- diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 8a19f06c6..4ba1e82c7 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -99,6 +99,7 @@ float autocvar_g_ban_sync_timeout; string autocvar_g_ban_sync_trusted_servers; bool autocvar_g_ban_sync_trusted_servers_verify; string autocvar_g_ban_sync_uri; +bool autocvar_g_ban_telluser; string autocvar_g_banned_list; bool autocvar_g_banned_list_idmode; bool autocvar_g_botclip_collisions; diff --git a/qcsrc/server/ipban.qc b/qcsrc/server/ipban.qc index 7b1f69384..7c6fcbafe 100644 --- a/qcsrc/server/ipban.qc +++ b/qcsrc/server/ipban.qc @@ -446,6 +446,8 @@ 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(autocvar_g_ban_telluser) + sprint(client, "You are banned from this server.\n"); dropclient(client); bprint(s); return true; diff --git a/xonotic-server.cfg b/xonotic-server.cfg index 7ad3ced27..92ca3647b 100644 --- a/xonotic-server.cfg +++ b/xonotic-server.cfg @@ -372,6 +372,7 @@ set sv_itemstime 1 "enable networking of time left until respawn for items such set g_ban_default_bantime 5400 "90 minutes" set g_ban_default_masksize 3 "masksize 0 means banning by UID only, 1 means banning by /8 (IPv6: /32) network, 2 means banning by /16 (IPv6: /48) network, 3 means banning by /24 (IPv6: /56) network, 4 means banning by single IP (IPv6: /64 network)" +set g_ban_telluser 1 "notify the banned player about it when they try to join" set g_banned_list "" "format: IP remainingtime IP remainingtime ..." set g_banned_list_idmode "1" "when set, the IP banning system always uses the ID over the IP address (so a user in a banned IP range can connect if they have a valid signed ID)"