Hosts can lock config options from admins (#31254)

* Hosts can lock config options from admins

* Optimization of LoadEntries

a very very very small one
This commit is contained in:
JJRcop
2017-10-05 08:58:55 +13:00
committed by oranges
parent 12b845fcd4
commit f8951911b1
2 changed files with 15 additions and 0 deletions
@@ -74,6 +74,10 @@ GLOBAL_PROTECT(config_dir)
if(copytext(L, 1, 2) == "#")
continue
var/lockthis = copytext(L, 1, 2) == "@"
if(lockthis)
L = copytext(L, 2)
var/pos = findtext(L, " ")
var/entry = null
var/value = null
@@ -96,6 +100,9 @@ GLOBAL_PROTECT(config_dir)
log_config("Found [entry] in [filename] when it should have been in [E.resident_file]! Ignoring.")
continue
if(lockthis)
E.protection |= CONFIG_ENTRY_LOCKED
var/validated = E.ValidateAndSet(value)
if(!validated)
log_config("Failed to validate setting \"[value]\" for [entry]")