Moves comms settings into a new config file

This commit is contained in:
CitadelStationBot
2017-08-29 17:01:16 -05:00
parent 3a015fc2f0
commit 6882163ef6
3 changed files with 40 additions and 33 deletions

View File

@@ -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)

15
config/comms.txt Normal file
View File

@@ -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

View File

@@ -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