System configuration

This commit is contained in:
AffectedArc07
2021-05-16 16:03:33 +01:00
parent 7a3d535132
commit 400a25dc01
8 changed files with 43 additions and 53 deletions
@@ -31,6 +31,8 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new())
var/datum/configuration_section/overflow_configuration/overflow
/// Holder for the ruins configuration datum
var/datum/configuration_section/ruin_configuration/ruins
/// Holder for the system configuration datum
var/datum/configuration_section/system_configuration/system
/// Holder for the voting configuration datum
var/datum/configuration_section/vote_configuration/vote
@@ -60,6 +62,7 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new())
mc = new()
overflow = new()
ruins = new()
system = new()
vote = new()
// Load our stuff up
@@ -83,6 +86,7 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new())
mc.load_data(raw_config_data["mc_configuration"])
overflow.load_data(raw_config_data["overflow_configuration"])
ruins.load_data(raw_config_data["ruin_configuration"])
system.load_data(raw_config_data["system_configuration"])
vote.load_data(raw_config_data["voting_configuration"])
// And report the load
@@ -0,0 +1,23 @@
/// Config holder for stuff relating to server backend management and secrets
/datum/configuration_section/system_configuration
// NO EDITS OR READS TO THIS WHAT SOEVER
protection_state = PROTECTION_PRIVATE
/// Password for authorising world/Topic requests
var/topic_key = null
/// Medal hub address for lavaland stats
var/medal_hub_address = null
/// Medal hub password for lavaland stats
var/medal_hub_password = null
/// Do we want the server to kill on reboot instead of keeping the same DD session
var/shutdown_on_reboot = FALSE
/// If above is true, you can run a shell command
var/shutdown_shell_command = null
/datum/configuration_section/system_configuration/load_data(list/data)
// Use the load wrappers here. That way the default isnt made 'null' if you comment out the config line
CONFIG_LOAD_BOOL(shutdown_on_reboot, data["shutdown_on_reboot"])
CONFIG_LOAD_STR(topic_key, data["communications_password"])
CONFIG_LOAD_STR(medal_hub_address, data["medal_hub_address"])
CONFIG_LOAD_STR(medal_hub_password, data["medal_hub_password"])
CONFIG_LOAD_STR(shutdown_shell_command, data["shutdown_shell_command"])