Merge pull request #12520 from optimumtact/patch-2

Move autoadmin to a protected config datum
This commit is contained in:
Jordie
2015-10-21 18:42:52 +11:00
4 changed files with 12 additions and 6 deletions
+1
View File
@@ -1,4 +1,5 @@
var/datum/configuration/config = null
var/datum/protected_configuration/protected_config = null
var/host = null
var/join_motd = null
+8 -4
View File
@@ -5,6 +5,11 @@
#define SECURITY_HAS_MAINT_ACCESS 2
#define EVERYONE_HAS_MAINT_ACCESS 4
//Not accessible from usual debug controller verb
/datum/protected_configuration
var/autoadmin = 0
var/autoadmin_rank = "Game Admin"
/datum/configuration
var/server_name = null // server name (the name of the game window)
var/station_name = null // station name (the name of the station in-game)
@@ -176,8 +181,7 @@
var/maprotation = 1
var/maprotatechancedelta = 0.75
var/autoadmin = 0
var/autoadmin_rank = "Game Admin"
/datum/configuration/New()
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
@@ -374,9 +378,9 @@
if("maprotationchancedelta")
config.maprotatechancedelta = text2num(value)
if("autoadmin")
config.autoadmin = 1
protected_config.autoadmin = 1
if(value)
config.autoadmin_rank = ckeyEx(value)
protected_config.autoadmin_rank = ckeyEx(value)
else
diary << "Unknown setting in configuration: '[name]'"
+2 -2
View File
@@ -107,11 +107,11 @@ var/next_external_rsc = 0
directory[ckey] = src
//Admin Authorisation
if(config.autoadmin)
if(protected_config.autoadmin)
if(!admin_datums[ckey])
var/datum/admin_rank/autorank
for(var/datum/admin_rank/R in admin_ranks)
if(R.name == config.autoadmin_rank)
if(R.name == protected_config.autoadmin_rank)
autorank = R
break
if(!autorank)
+1
View File
@@ -190,6 +190,7 @@ var/global/list/map_transition_config = MAP_TRANSITION_CONFIG
join_motd = file2text("config/motd.txt")
/world/proc/load_configuration()
protected_config = new /datum/protected_configuration()
config = new /datum/configuration()
config.load("config/config.txt")
config.load("config/game_options.txt","game_options")