From 6ab0344bb6972b648b262c506a015a08b402a8d7 Mon Sep 17 00:00:00 2001 From: AffectedArc07 Date: Sun, 3 Mar 2019 11:37:49 +0000 Subject: [PATCH] Config option for the paranoid --- code/controllers/configuration.dm | 5 +++++ code/modules/client/client procs.dm | 7 ++++--- config/example/config.txt | 5 ++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 197a648b315..b26ac90921e 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -213,6 +213,9 @@ // Developer var/developer_express_start = 0 + // Automatic localhost admin disable + var/disable_localhost_admin = 0 + /datum/configuration/New() for(var/T in subtypesof(/datum/game_mode)) var/datum/game_mode/M = T @@ -645,6 +648,8 @@ config.disable_high_pop_mc_mode_amount = text2num(value) if("developer_express_start") config.developer_express_start = 1 + if("disable_localhost_admin") + config.disable_localhost_admin = 1 else log_config("Unknown setting in configuration: '[name]'") diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 614367d20d0..99dfdee8dbf 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -311,9 +311,10 @@ //Admin Authorisation // Automatically makes localhost connection an admin - var/localhost_addresses = list("127.0.0.1", "::1") // Adresses - if(!isnull(address) && address in localhost_addresses) - new /datum/admins("!LOCALHOST!", R_HOST, ckey) // Makes localhost rank + if(!config.disable_localhost_admin) + var/localhost_addresses = list("127.0.0.1", "::1") // Adresses + if(!isnull(address) && address in localhost_addresses) + new /datum/admins("!LOCALHOST!", R_HOST, ckey) // Makes localhost rank holder = admin_datums[ckey] if(holder) GLOB.admins += src diff --git a/config/example/config.txt b/config/example/config.txt index 426d38f6a87..ae6f9fefaa7 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -393,4 +393,7 @@ HIGH_POP_MC_MODE_AMOUNT 65 DISABLE_HIGH_POP_MC_MODE_AMOUNT 60 ##Uncomment to enable developer start. Auto starts the server after initialization -##DEVELOPER_EXPRESS_START \ No newline at end of file +##DEVELOPER_EXPRESS_START + +## Uncomment to disable automatic admin for localhost +#DISABLE_LOCALHOST_ADMIN \ No newline at end of file