diff --git a/code/_globalvars/configuration.dm b/code/_globalvars/configuration.dm index 21155f2d2dd..f5fb1a31cc4 100644 --- a/code/_globalvars/configuration.dm +++ b/code/_globalvars/configuration.dm @@ -1,5 +1,4 @@ var/datum/configuration/config = null -var/datum/protected_configuration/protected_config = null var/host = null var/join_motd = null @@ -26,10 +25,6 @@ var/Debug2 = 0 var/global/comms_key = "default_pwd" var/global/comms_allowed = 0 //By default, the server does not allow messages to be sent to it, unless the key is strong enough (this is to prevent misconfigured servers from becoming vulnerable) -//Cross server communications -var/global/cross_address = "byond://" //This needs to be global as the message sent contains the comms key. -var/global/cross_allowed = 0 //Don't bother attempting to send if the address wasn't set. - var/global/medal_hub = null var/global/medal_pass = " " var/global/medals_enabled = TRUE //will be auto set to false if the game fails contacting the medal hub to prevent unneeded calls. diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index b081e5ae74a..b81debde7d1 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -5,20 +5,24 @@ #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/protected_configuration/vv_get_var(var_name) - return debug_variable(var_name, "SECRET", 0, src) - -/datum/protected_configuration/vv_edit_var(var_name, var_value) - return FALSE +/datum/configuration/vv_get_var(var_name) + var/static/list/banned_views = list("autoadmin", "autoadmin_rank") + if(var_name in banned_views) + return debug_variable(var_name, "SECRET", 0, src) + return ..() + +/datum/configuration/vv_edit_var(var_name, var_value) + var/static/list/banned_edits = list("cross_address", "cross_allowed", "autoadmin", "autoadmin_rank") + if(var_name in banned_edits) + return FALSE + return ..() /datum/configuration var/name = "Configuration" // datum name + var/autoadmin = 0 + var/autoadmin_rank = "Game Admin" + var/server_name = null // server name (the name of the game window) var/server_sql_name = null // short form server name used for the DB var/station_name = null // station name (the name of the station in-game) @@ -236,6 +240,8 @@ var/client_error_message = "Your version of byond is too old, may have issues, and is blocked from accessing this server." var/cross_name = "Other server" + var/cross_address = "byond://" + var/cross_allowed = FALSE var/showircname = 0 var/list/gamemode_cache = null @@ -415,9 +421,9 @@ 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") - global.cross_address = value + cross_address = value if(value != "byond:\\address:port") - global.cross_allowed = 1 + cross_allowed = 1 if("cross_comms_name") cross_name = value if("panic_server_name") @@ -488,9 +494,9 @@ if("maprotationchancedelta") config.maprotatechancedelta = text2num(value) if("autoadmin") - protected_config.autoadmin = 1 + config.autoadmin = 1 if(value) - protected_config.autoadmin_rank = ckeyEx(value) + config.autoadmin_rank = ckeyEx(value) if("generate_minimaps") config.generate_minimaps = 1 if("client_warn_version") @@ -895,4 +901,4 @@ if(!statclick) statclick = new/obj/effect/statclick/debug("Edit", src) - stat("[name]:", statclick) + stat("[name]:", statclick) \ No newline at end of file diff --git a/code/controllers/subsystem/garbage.dm b/code/controllers/subsystem/garbage.dm index 1c49673ed89..dc28f4cb50d 100644 --- a/code/controllers/subsystem/garbage.dm +++ b/code/controllers/subsystem/garbage.dm @@ -394,7 +394,6 @@ var/datum/controller/subsystem/garbage_collector/SSgarbage SearchVar(WALLITEMS_INVERSE) SearchVar(sortInstance) SearchVar(config) - SearchVar(protected_config) SearchVar(host) SearchVar(join_motd) SearchVar(station_name) @@ -412,8 +411,6 @@ var/datum/controller/subsystem/garbage_collector/SSgarbage SearchVar(Debug2) SearchVar(comms_key) SearchVar(comms_allowed) - SearchVar(cross_address) - SearchVar(cross_allowed) SearchVar(medal_hub) SearchVar(medal_pass) SearchVar(medals_enabled) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 3635626045c..55d778ad946 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -513,7 +513,7 @@ var/datum/controller/subsystem/ticker/ticker CHECK_TICK - if(cross_allowed) + if(config.cross_allowed) send_news_report() CHECK_TICK diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 7ce09f04a68..12e725eb222 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -455,7 +455,7 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12 if (src.authenticated==2) dat += "

Captain Functions" dat += "
\[ Make a Captain's Announcement \]" - if(cross_allowed) + if(config.cross_allowed) dat += "
\[ Send a message to an allied station \]" dat += "
\[ Purchase Shuttle \]" dat += "
\[ Change Alert Level \]" diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index a5df3d20834..ac4a80bc1ea 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -167,7 +167,7 @@ return /proc/send2otherserver(source,msg,type = "Ahelp") - if(global.cross_allowed) + if(config.cross_allowed) var/list/message = list() message["message_sender"] = source message["message"] = msg @@ -175,7 +175,7 @@ message["key"] = global.comms_key message["crossmessage"] = type - world.Export("[global.cross_address]?[list2params(message)]") + world.Export("[config.cross_address]?[list2params(message)]") /proc/ircadminwho() diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 9b89cd17643..e806743bdbe 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -166,11 +166,11 @@ var/next_external_rsc = 0 if(localhost_rank) var/datum/admins/localhost_holder = new(localhost_rank, ckey) localhost_holder.associate(src) - if(protected_config.autoadmin) + if(config.autoadmin) if(!admin_datums[ckey]) var/datum/admin_rank/autorank for(var/datum/admin_rank/R in admin_ranks) - if(R.name == protected_config.autoadmin_rank) + if(R.name == config.autoadmin_rank) autorank = R break if(!autorank) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 87dcfae22ad..b8dbdeb5fb5 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -64,7 +64,7 @@ var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER verbs += /mob/dead/observer/proc/dead_tele - if(global.cross_allowed) + if(config.cross_allowed) verbs += /mob/dead/observer/proc/server_hop ghostimage = image(src.icon,src,src.icon_state) @@ -606,16 +606,20 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set desc= "Jump to the other server" if(notransform) return - if (alert(src, "Jump to server running at [global.cross_address]?", "Server Hop", "Yes", "No") != "Yes") + if(!config.cross_allowed) + verbs -= /mob/dead/observer/proc/server_hop + src << "Server Hop has been disabled." + return + if (alert(src, "Jump to server running at [config.cross_address]?", "Server Hop", "Yes", "No") != "Yes") return 0 - if (client && global.cross_allowed) - src << "Sending you to [global.cross_address]." + if (client && config.cross_allowed) + src << "Sending you to [config.cross_address]." new /obj/screen/splash(client) notransform = TRUE sleep(29) //let the animation play notransform = FALSE winset(src, null, "command=.options") //other wise the user never knows if byond is downloading resources - client << link(global.cross_address + "?server_hop=[key]") + client << link(config.cross_address + "?server_hop=[key]") else src << "There is no other server configured!" diff --git a/code/world.dm b/code/world.dm index 51f9cefee69..678caeac143 100644 --- a/code/world.dm +++ b/code/world.dm @@ -274,7 +274,6 @@ join_motd = file2text("config/motd.txt") + "
" + revdata.GetTestMergeInfo() /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")