diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index abf2c1f937..c4d8335890 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -288,6 +288,7 @@ /datum/configuration/proc/Reload() load("config/config.txt") + load("config/comms.txt", "comms") load("config/game_options.txt","game_options") load("config/policies.txt", "policies") loadsql("config/dbconfig.txt") @@ -443,27 +444,12 @@ fps = text2num(value) if("automute_on") automute_on = 1 - if("comms_key") - global.comms_key = value - if(value != "default_pwd" && length(value) > 6) //It's the default value or less than 6 characters long, warn badmins - global.comms_allowed = 1 - if("cross_server_address") - cross_address = value - if(value != "byond:\\address:port") - cross_allowed = 1 - if("cross_comms_name") - cross_name = value if("panic_server_name") if (value != "\[Put the name here\]") panic_server_name = value if("panic_server_address") if(value != "byond://address:port") panic_address = value - - if("medal_hub_address") - global.medal_hub = value - if("medal_hub_password") - global.medal_pass = value if("show_irc_name") showircname = 1 if("see_own_notes") @@ -548,8 +534,12 @@ if("irc_announce_new_game") irc_announce_new_game = TRUE else - WRITE_FILE(GLOB.config_error_log, "Unknown setting in configuration: '[name]'") - +#if DM_VERSION > 511 +#error Replace the line below with WRITE_FILE(GLOB.config_error_log, "Unknown setting in configuration: '[name]'") +#endif + HandleCommsConfig(name, value) //TODO: Deprecate this eventually + else if(type == "comms") + HandleCommsConfig(name, value) else if(type == "game_options") switch(name) if("damage_multiplier") @@ -789,6 +779,24 @@ if(fps <= 0) fps = initial(fps) +/datum/configuration/proc/HandleCommsConfig(name, value) + switch(name) + if("comms_key") + global.comms_key = value + if(value != "default_pwd" && length(value) > 6) //It's the default value or less than 6 characters long, warn badmins + global.comms_allowed = TRUE + if("cross_server_address") + cross_address = value + if(value != "byond:\\address:port") + cross_allowed = TRUE + if("cross_comms_name") + cross_name = value + if("medal_hub_address") + global.medal_hub = value + if("medal_hub_password") + global.medal_pass = value + else + WRITE_FILE(GLOB.config_error_log, "Unknown setting in configuration: '[name]'") /datum/configuration/proc/loadmaplist(filename) var/list/Lines = world.file2list(filename) diff --git a/config/comms.txt b/config/comms.txt new file mode 100644 index 0000000000..4408819f2e --- /dev/null +++ b/config/comms.txt @@ -0,0 +1,15 @@ +## Communication key for receiving data through world/Topic(), you don't want to give this out +#COMMS_KEY default_pwd + +## World address and port for server recieving cross server messages +#CROSS_SERVER_ADDRESS byond:\\address:port + +## Name that the server calls itself in communications +#CROSS_COMMS_NAME + +## Hub address for tracking stats +## example: Hubmakerckey.Hubname +#MEDAL_HUB_ADDRESS + +## Password for the hub page +#MEDAL_HUB_PASSWORD \ No newline at end of file diff --git a/config/config.txt b/config/config.txt index 7497404a89..b344482679 100644 --- a/config/config.txt +++ b/config/config.txt @@ -205,22 +205,6 @@ TICKLAG 0.5 ## Comment this out to disable automuting #AUTOMUTE_ON -## Communication key for receiving data through world/Topic(), you don't want to give this out -#COMMS_KEY default_pwd - -## World address and port for server recieving cross server messages -#CROSS_SERVER_ADDRESS byond:\\address:port - -## Name that the server calls itself in communications -#CROSS_COMMS_NAME - -## Hub address for tracking stats -## example: Hubmakerckey.Hubname -#MEDAL_HUB_ADDRESS - -## Password for the hub page -#MEDAL_HUB_PASSWORD - ## Uncomment this to let players see their own notes (they can still be set by admins only) #SEE_OWN_NOTES