mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 21:48:39 +01:00
Merge pull request #12520 from optimumtact/patch-2
Move autoadmin to a protected config datum
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
var/datum/configuration/config = null
|
||||
var/datum/protected_configuration/protected_config = null
|
||||
|
||||
var/host = null
|
||||
var/join_motd = null
|
||||
|
||||
@@ -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]'"
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user