diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index f9aba1efc1b..3e51b97ba44 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -309,7 +309,7 @@ #define ROUND_TIME (SSticker.round_start_time ? (world.time - SSticker.round_start_time) : 0) // Macro that returns true if it's too early in a round to freely ghost out -#define TOO_EARLY_TO_GHOST (config && (ROUND_TIME < (config.round_abandon_penalty_period))) +#define TOO_EARLY_TO_GHOST (ROUND_TIME < (GLOB.configuration.general.cryo_penalty_period)) // Used by radios to indicate that they have sent a message via something other than subspace #define RADIO_CONNECTION_FAIL 0 diff --git a/code/__HELPERS/_logging.dm b/code/__HELPERS/_logging.dm index 7d73cb536a7..94a181b555a 100644 --- a/code/__HELPERS/_logging.dm +++ b/code/__HELPERS/_logging.dm @@ -32,7 +32,8 @@ GLOBAL_PROTECT(log_end) rustg_log_write(GLOB.world_game_log, "ADMIN: [text][GLOB.log_end]") /proc/log_debug(text) - if(GLOB.configuration.logging.debug_logging) + // This has presence checks as this may be called before GLOB has loaded + if(GLOB?.configuration?.logging.debug_logging) rustg_log_write(GLOB.world_game_log, "DEBUG: [text][GLOB.log_end]") for(var/client/C in GLOB.admins) @@ -122,7 +123,7 @@ GLOBAL_PROTECT(log_end) /proc/log_world(text) SEND_TEXT(world.log, text) // This has to be presence checked as log_world() is used before world/New(). - if(GLOB?.configuration?.logging?.world_logging) + if(GLOB?.configuration?.logging.world_logging) rustg_log_write(GLOB.world_game_log, "WORLD: [html_decode(text)][GLOB.log_end]") /proc/log_runtime_txt(text) // different from /tg/'s log_runtime because our error handler has a log_runtime proc already that does other stuff diff --git a/code/_globalvars/configuration.dm b/code/_globalvars/configuration.dm index 2b939dd9e5f..3b7d061ace3 100644 --- a/code/_globalvars/configuration.dm +++ b/code/_globalvars/configuration.dm @@ -1,37 +1,30 @@ -GLOBAL_REAL(config, /datum/configuration) - -GLOBAL_VAR(host) +/// Join MOTD for the server GLOBAL_VAR(join_motd) +GLOBAL_PROTECT(join_motd) // Takes up a lot of space in VV +/// Join TOS for the server GLOBAL_VAR(join_tos) -GLOBAL_VAR_INIT(game_version, "ParaCode") +GLOBAL_PROTECT(join_tos) // Takes up a lot of space. Also dont touch this shit + +/// The current game year GLOBAL_VAR_INIT(game_year, (text2num(time2text(world.realtime, "YYYY")) + 544)) -GLOBAL_VAR_INIT(aliens_allowed, 1) -GLOBAL_VAR_INIT(traitor_scaling, 1) -//GLOBAL_VAR_INIT(goonsay_allowed, 0) -GLOBAL_VAR_INIT(dna_ident, 1) -GLOBAL_VAR_INIT(abandon_allowed, 0) -GLOBAL_VAR_INIT(enter_allowed, 1) -GLOBAL_VAR_INIT(guests_allowed, 1) -GLOBAL_VAR_INIT(shuttle_frozen, 0) -GLOBAL_VAR_INIT(shuttle_left, 0) -GLOBAL_VAR_INIT(tinted_weldhelh, 1) -GLOBAL_VAR_INIT(mouse_respawn_time, 5) //Amount of time that must pass between a player dying as a mouse and repawning as a mouse. In minutes. +/// Allow new players to enter the game? +GLOBAL_VAR_INIT(enter_allowed, TRUE) -// Debug is used exactly once (in living.dm) but is commented out in a lot of places. It is not set anywhere and only checked. -// Debug2 is used in conjunction with a lot of admin verbs and therefore is actually legit. -GLOBAL_VAR_INIT(debug, 0) // global debug switch -GLOBAL_VAR_INIT(debug2, 1) // enables detailed job debug file in secrets +/// Is OOC currently enabled? +GLOBAL_VAR_INIT(ooc_enabled, TRUE) -//This was a define, but I changed it to a variable so it can be changed in-game.(kept the all-caps definition because... code...) -Errorage -GLOBAL_VAR_INIT(max_ex_devastation_range, 3) -GLOBAL_VAR_INIT(max_ex_heavy_range, 7) -GLOBAL_VAR_INIT(max_ex_light_range, 14) -GLOBAL_VAR_INIT(max_ex_flash_range, 14) -GLOBAL_VAR_INIT(max_ex_flame_range, 14) +/// Is LOOC currently enabled? +GLOBAL_VAR_INIT(looc_enabled, TRUE) -//Random event stuff, apparently used -GLOBAL_VAR_INIT(eventchance, 10) //% per 5 mins -GLOBAL_VAR_INIT(event, 0) -GLOBAL_VAR_INIT(hadevent, 0) -GLOBAL_VAR_INIT(blobevent, 0) +/// Is OOC currently enabled for dead people? +GLOBAL_VAR_INIT(dooc_enabled, TRUE) + +/// Is deadchat currently enabled? +GLOBAL_VAR_INIT(dsay_enabled, TRUE) + +/// Amount of time (in minutes) that must pass between a player dying as a mouse and repawning as a mouse +GLOBAL_VAR_INIT(mouse_respawn_time, 5) + +/// Enable debugging of things such as job starts and other things +GLOBAL_VAR_INIT(debug2, TRUE) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm deleted file mode 100644 index aab334af825..00000000000 --- a/code/controllers/configuration.dm +++ /dev/null @@ -1,287 +0,0 @@ -/datum/configuration - var/server_name = null // server name (for world name / status) - var/server_tag_line = null // server tagline (for showing on hub entry) - var/server_extra_features = null // server-specific extra features (for hub entry) - var/server_suffix = 0 // generate numeric suffix based on server port - - var/minimum_client_build = 1421 // Build 1421 due to the middle mouse button exploit - - var/pregame_timestart = 240 // Time it takes for the server to start the game - -// var/enable_authentication = 0 // goon authentication - var/allow_Metadata = 0 // Metadata is supported. - var/popup_admin_pm = 0 //adminPMs to non-admins show in a pop-up 'reply' window when set to 1. - var/antag_hud_allowed = 0 // Ghosts can turn on Antagovision to see a HUD of who is the bad guys this round. - var/antag_hud_restricted = 0 // Ghosts that turn on Antagovision cannot rejoin the round. - - var/respawn = 0 - var/guest_jobban = 1 - var/panic_bunker_threshold = 150 // above this player count threshold, never-before-seen players are blocked from connecting - var/usewhitelist = 0 - var/automute_on = 0 //enables automuting/spam prevention - var/round_abandon_penalty_period = 30 MINUTES // Time from round start during which ghosting out is penalized - - var/reactionary_explosions = 0 //If we use reactionary explosions, explosions that react to walls and doors - - var/ssd_warning = 0 - - var/list_afk_minimum = 5 // How long people have to be AFK before it's listed on the "List AFK players" verb - - var/max_maint_drones = 5 //This many drones can spawn, - var/allow_drone_spawn = 1 //assuming the admin allow them to. - var/drone_build_time = 1200 //A drone will become available every X ticks since last drone spawn. Default is 2 minutes. - - var/forbid_singulo_possession = 0 - - var/check_randomizer = 0 - - //game_options.txt configs - - var/bones_can_break = 1 - - var/revival_pod_plants = 1 - var/revival_cloning = 1 - var/revival_brain_life = -1 - - var/auto_toggle_ooc_during_round = 0 - - var/shuttle_refuel_delay = 12000 - - var/ban_legacy_system = 0 //Defines whether the server uses the legacy banning system with the files in /data or the SQL system. Config option in config.txt - - var/simultaneous_pm_warning_timeout = 100 - - var/ghost_interaction = 0 - - - var/default_laws = 0 //Controls what laws the AI spawns with. - - var/starlight = 0 // Whether space turfs have ambient light or not - var/allow_holidays = 0 - - var/ooc_allowed = 1 - var/looc_allowed = 1 - var/dooc_allowed = 1 - var/dsay_allowed = 1 - - var/disable_lobby_music = 0 // Disables the lobby music - var/disable_cid_warn_popup = 0 //disables the annoying "You have already logged in this round, disconnect or be banned" popup, because it annoys the shit out of me when testing. - - var/max_loadout_points = 5 // How many points can be spent on extra items in character setup - - var/disable_ooc_emoji = 0 // prevents people from using emoji in OOC - - var/disable_karma = 0 // Disable all karma functions and unlock karma jobs by default - - // Nightshift - var/randomize_shift_time = FALSE - var/enable_night_shifts = FALSE - - // Developer - var/developer_express_start = 0 - - //Start now warning - var/start_now_confirmation = 0 - - //cube monkey limit - var/cubemonkeycap = 20 - - /// BYOND account age limit for notifcations of new accounts (Any accounts older than this value will not send notifications on first join) - var/byond_account_age_threshold = 7 - - - /// Max amount of CIDs that one ckey can have attached to them before they trip a warning - var/max_client_cid_history = 3 - - /// Enable auto profiler of rounds - var/auto_profile = FALSE - -/datum/configuration/proc/load(filename, type = "config") //the type can also be game_options, in which case it uses a different switch. not making it separate to not copypaste code - Urist - if(IsAdminAdvancedProcCall()) - to_chat(usr, "Config reload blocked: Advanced ProcCall detected.") - message_admins("[key_name(usr)] attempted to reload configuration via advanced proc-call") - log_admin("[key_name(usr)] attempted to reload configuration via advanced proc-call") - return - var/list/Lines = file2list(filename) - - for(var/t in Lines) - if(!t) continue - - t = trim(t) - if(length(t) == 0) - continue - else if(copytext(t, 1, 2) == "#") - continue - - var/pos = findtext(t, " ") - var/name = null - var/value = null - - if(pos) - name = lowertext(copytext(t, 1, pos)) - value = copytext(t, pos + 1) - else - name = lowertext(t) - - if(!name) - continue - - if(type == "config") - switch(name) - if("ban_legacy_system") - config.ban_legacy_system = 1 - - if("ssd_warning") - config.ssd_warning = 1 - - if("list_afk_minimum") - config.list_afk_minimum = text2num(value) - - if("pregame_timestart") - config.pregame_timestart = text2num(value) - - if("norespawn") - config.respawn = 0 - - if("servername") - config.server_name = value - - if("server_tag_line") - config.server_tag_line = value - - if("server_extra_features") - config.server_extra_features = value - - if("serversuffix") - config.server_suffix = 1 - - if("minimum_client_build") - config.minimum_client_build = text2num(value) - - if("guest_ban") - #warn AA clear this up - GLOB.guests_allowed = 0 - - if("panic_bunker_threshold") - config.panic_bunker_threshold = text2num(value) - - if("usewhitelist") - config.usewhitelist = 1 - - if("allow_metadata") - config.allow_Metadata = 1 - - if("forbid_singulo_possession") - forbid_singulo_possession = 1 - - if("check_randomizer") - check_randomizer = 1 - - if("popup_admin_pm") - config.popup_admin_pm = 1 - - if("allow_holidays") - config.allow_holidays = 1 - - if("allow_antag_hud") - config.antag_hud_allowed = 1 - - if("antag_hud_restricted") - config.antag_hud_restricted = 1 - - if("automute_on") - automute_on = 1 - - if("ghost_interaction") - config.ghost_interaction = 1 - - if("allow_drone_spawn") - config.allow_drone_spawn = text2num(value) - - if("drone_build_time") - config.drone_build_time = text2num(value) - - if("max_maint_drones") - config.max_maint_drones = text2num(value) - - if("starlight") - config.starlight = 1 - - if("disable_lobby_music") - config.disable_lobby_music = 1 - - if("disable_cid_warn_popup") - config.disable_cid_warn_popup = 1 - - if("max_loadout_points") - config.max_loadout_points = text2num(value) - - if("round_abandon_penalty_period") - config.round_abandon_penalty_period = text2num(value) MINUTES - - if("disable_ooc_emoji") - config.disable_ooc_emoji = 1 - - if("disable_karma") - config.disable_karma = 1 - - if("start_now_confirmation") - config.start_now_confirmation = 1 - - if("developer_express_start") - config.developer_express_start = 1 - if("byond_account_age_threshold") - config.byond_account_age_threshold = text2num(value) - - if("max_client_cid_history") - max_client_cid_history = text2num(value) - if("enable_auto_profiler") - auto_profile = TRUE - else - log_config("Unknown setting in configuration: '[name]'") - - - else if(type == "game_options") - value = text2num(value) - - switch(name) - if("revival_pod_plants") - config.revival_pod_plants = value - if("revival_cloning") - config.revival_cloning = value - if("revival_brain_life") - config.revival_brain_life = value - if("auto_toggle_ooc_during_round") - config.auto_toggle_ooc_during_round = 1 - if("bones_can_break") - config.bones_can_break = value - if("shuttle_refuel_delay") - config.shuttle_refuel_delay = text2num(value) - if("reactionary_explosions") - config.reactionary_explosions = 1 - if("bombcap") - var/BombCap = text2num(value) - if(!BombCap) - continue - if(BombCap < 4) - BombCap = 4 - if(BombCap > 128) - BombCap = 128 - - #warn AA clear this up - GLOB.max_ex_devastation_range = round(BombCap/4) - GLOB.max_ex_heavy_range = round(BombCap/2) - GLOB.max_ex_light_range = BombCap - GLOB.max_ex_flash_range = BombCap - GLOB.max_ex_flame_range = BombCap - if("default_laws") - config.default_laws = text2num(value) - if("randomize_shift_time") - config.randomize_shift_time = TRUE - if("enable_night_shifts") - config.enable_night_shifts = TRUE - if("cubemonkey_cap") - config.cubemonkeycap = text2num(value) - else - log_config("Unknown setting in configuration: '[name]'") - diff --git a/code/controllers/configuration/configuration_core.dm b/code/controllers/configuration/configuration_core.dm index b029a642d98..f9fdbb7d476 100644 --- a/code/controllers/configuration/configuration_core.dm +++ b/code/controllers/configuration/configuration_core.dm @@ -21,6 +21,8 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new()) var/datum/configuration_section/gamemode_configuration/gamemode /// Holder for the gateway configuration datum var/datum/configuration_section/gateway_configuration/gateway + /// Holder for the general configuration datum + var/datum/configuration_section/general_configuration/general /// Holder for the IPIntel configuration datum var/datum/configuration_section/ipintel_configuration/ipintel /// Holder for the job configuration datum @@ -63,6 +65,7 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new()) event = new() gamemode = new() gateway = new() + general = new() ipintel = new() jobs = new() logging = new() @@ -90,6 +93,7 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new()) event.load_data(raw_config_data["event_configuration"]) gamemode.load_data(raw_config_data["gamemode_configuration"]) gateway.load_data(raw_config_data["gateway_configuration"]) + general.load_data(raw_config_data["general_configuration"]) ipintel.load_data(raw_config_data["ipintel_configuration"]) jobs.load_data(raw_config_data["job_configuration"]) logging.load_data(raw_config_data["logging_configuration"]) @@ -103,7 +107,6 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new()) // And report the load DIRECT_OUTPUT(world.log, "Config loaded in [stop_watch(start)]s") - pass() // Breakpoint here. If I left thing in, scream at me. /datum/configuration_section diff --git a/code/controllers/configuration/sections/database_configuration.dm b/code/controllers/configuration/sections/database_configuration.dm index 2c01bcc07e3..d95aedcf193 100644 --- a/code/controllers/configuration/sections/database_configuration.dm +++ b/code/controllers/configuration/sections/database_configuration.dm @@ -14,9 +14,9 @@ /// SQL password var/password = "root" // Dont do this in prod. Please...... /// Database name - var/db = "feedback" // TODO: Rename to paradise_gamedb + var/db = "feedback" // AA TODO: Rename to paradise_gamedb /// Table prefix - var/table_prefix = "erro_" // TODO: Remove table prefixes + var/table_prefix = "erro_" // AA TODO: Remove table prefixes /// Time in seconds for async queries to time out var/async_query_timeout = 10 /// Thread limit for async queries diff --git a/code/controllers/configuration/sections/general_configuration.dm b/code/controllers/configuration/sections/general_configuration.dm new file mode 100644 index 00000000000..296304c28b7 --- /dev/null +++ b/code/controllers/configuration/sections/general_configuration.dm @@ -0,0 +1,137 @@ +/// Config holder for all general/misc things +/datum/configuration_section/general_configuration + /// Server name for the BYOND hub + var/server_name = "Paradise Station" + /// Tagline for the hub entry + var/server_tag_line = "The perfect mix of RP & action" + /// Server features in a newline + var/server_features = "Medium RP, varied species/jobs" + /// Should bans be stored in the DB + var/use_database_bans = FALSE + /// Allow character OOC notes + var/allow_character_metadata = TRUE + /// Time in seconds for the pregame lobby + var/lobby_time = 240 + /// Ban all Guest BYOND accounts + var/guest_ban = TRUE + /// Player threshold to automatically enable panic bunker + var/panic_bunker_threshold = 150 + /// Allow players to use AntagHUD? + var/allow_antag_hud = TRUE + /// Forbid players from rejoining if they use AntagHUD? + var/restrict_antag_hud_rejoin = TRUE + /// Enable respanws by default? + var/respawn_enabled = FALSE + /// Enable karma? Disable to lockout awarding and unlock everything + var/enable_karma = TRUE + /// Enable CID randomiser buster? + var/enabled_cid_randomiser_buster = FALSE + /// Forbid admins from posessing and flying the singulo round + var/forbid_singulo_possession = FALSE + /// Force open a PM window when replied to? This is very annoying + var/popup_admin_pm = FALSE + /// Announce holidays (christmas, halloween, etc etc) + var/allow_holidays = TRUE + /// Enable auto muting in all chat channels + var/enable_auto_mute = FALSE + /// Show a warning to players to make them accept touching an SSD + var/ssd_warning = TRUE + /// Allow ghosts to spin chairs round + var/ghost_interaction = FALSE + /// Enable/disable starlight to light up space + var/starlight = TRUE + /// Disable lobby music? + var/disable_lobby_music = FALSE + /// Disable a popup if 2 users are on the same CID? + var/disable_cid_warning_popup = FALSE + /// Amount of loadout points non-donors should get + var/base_loadout_points = 5 + /// Respawnability loss penalty for eary cryoing (minutes) + var/cryo_penalty_period = 30 + /// Enable OOC emojis? + var/enable_ooc_emoji = TRUE + /// Auto start the game if on a local test server + var/developer_express_start = FALSE + /// Minimum client build. Keep above 1421 due to exploits + var/minimum_client_build = 1421 + /// Give a confirm button for the "Start Now" verb + var/start_now_confirmation = TRUE + /// BYOND account age threshold for first join alerts + var/byond_account_age_threshold = 3 + /// Max CIDs a client can have history of before a warning is thrown + var/max_client_cid_history = 20 + /// Enable automatic profiling to profile.json + var/enable_auto_profiler = TRUE + /// Auto disable OOC on roundstart? + var/auto_disable_ooc = TRUE + /// Do we want to allow bones to break? + var/breakable_bones = TRUE + /// Enable/disable revival pod plants + var/enable_revival_pod_plants = TRUE + /// Enable/disable cloning + var/enable_cloning = TRUE + /// Randomise shift time instead of it always being 12:00? + var/randomise_shift_time = TRUE + /// Enable night-shift lighting? + var/enable_night_shifts = TRUE + /// Cap for monkey cube monkey spawns + var/monkey_cube_cap = 32 + /// Enable to make explosions react to obstacles instead of ignoring them + var/reactionary_explosions = TRUE + /// Bomb cap (Devastation) Other values will be calculated around this + var/bomb_cap = 20 + /// Time for a brain to keep its spark of life (deciseconds) + var/revival_brain_life = 10 MINUTES + /// Enable random AI lawsets from the default=TRUE pool + var/random_ai_lawset = TRUE + +/datum/configuration_section/general_configuration/load_data(list/data) + // Use the load wrappers here. That way the default isnt made 'null' if you comment out the config line + + // A lot of bools + CONFIG_LOAD_BOOL(use_database_bans, data["use_database_bans"]) + CONFIG_LOAD_BOOL(allow_character_metadata, data["allow_character_metadata"]) + CONFIG_LOAD_BOOL(guest_ban, data["guest_ban"]) + CONFIG_LOAD_BOOL(allow_antag_hud, data["allow_antag_hud"]) + CONFIG_LOAD_BOOL(restrict_antag_hud_rejoin, data["restrict_antag_hud_rejoin"]) + CONFIG_LOAD_BOOL(respawn_enabled, data["respawn_enabled"]) + CONFIG_LOAD_BOOL(enable_karma, data["enable_karma"]) + CONFIG_LOAD_BOOL(enabled_cid_randomiser_buster, data["enable_cid_randomiser_buster"]) + CONFIG_LOAD_BOOL(forbid_singulo_possession, data["prevent_admin_singlo_possession"]) + CONFIG_LOAD_BOOL(popup_admin_pm, data["popup_admin_pm"]) + CONFIG_LOAD_BOOL(allow_holidays, data["allow_holidays"]) + CONFIG_LOAD_BOOL(enable_auto_mute, data["enable_auto_mute"]) + CONFIG_LOAD_BOOL(ssd_warning, data["ssd_warning"]) + CONFIG_LOAD_BOOL(ghost_interaction, data["ghost_interaction"]) + CONFIG_LOAD_BOOL(starlight, data["starlight"]) + CONFIG_LOAD_BOOL(disable_lobby_music, data["disable_lobby_music"]) + CONFIG_LOAD_BOOL(disable_cid_warning_popup, data["disable_cid_warning_popup"]) + CONFIG_LOAD_BOOL(enable_ooc_emoji, data["enable_ooc_emoji"]) + CONFIG_LOAD_BOOL(developer_express_start, data["developer_express_start"]) + CONFIG_LOAD_BOOL(start_now_confirmation, data["start_now_confirmation"]) + CONFIG_LOAD_BOOL(enable_auto_profiler, data["enable_auto_profiler"]) + CONFIG_LOAD_BOOL(auto_disable_ooc, data["auto_disable_ooc"]) + CONFIG_LOAD_BOOL(breakable_bones, data["breakable_bones"]) + CONFIG_LOAD_BOOL(enable_revival_pod_plants, data["enable_revival_pod_plants"]) + CONFIG_LOAD_BOOL(enable_cloning, data["enable_cloning"]) + CONFIG_LOAD_BOOL(randomise_shift_time, data["randomise_shift_time"]) + CONFIG_LOAD_BOOL(enable_night_shifts, data["enable_night_shifts"]) + CONFIG_LOAD_BOOL(reactionary_explosions, data["reactionary_explosions"]) + CONFIG_LOAD_BOOL(random_ai_lawset, data["random_ai_lawset"]) + + // Numbers + CONFIG_LOAD_NUM(lobby_time, data["lobby_time"]) + CONFIG_LOAD_NUM(panic_bunker_threshold, data["panic_bunker_threshold"]) + CONFIG_LOAD_NUM(base_loadout_points, data["base_loadout_points"]) + CONFIG_LOAD_NUM(cryo_penalty_period, data["cryo_penalty_period"]) + CONFIG_LOAD_NUM(minimum_client_build, data["minimum_client_build"]) + CONFIG_LOAD_NUM(byond_account_age_threshold, data["byond_account_age_threshold"]) + CONFIG_LOAD_NUM(max_client_cid_history, data["max_client_cid_history"]) + CONFIG_LOAD_NUM(monkey_cube_cap, data["monkey_cube_cap"]) + CONFIG_LOAD_NUM(bomb_cap, data["bomb_cap"]) + CONFIG_LOAD_NUM(revival_brain_life, data["revival_brain_life"]) + + // Strings + CONFIG_LOAD_STR(server_name, data["server_name"]) + CONFIG_LOAD_STR(server_tag_line, data["server_tag_line"]) + CONFIG_LOAD_STR(server_features, data["server_features"]) diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 6403a77b17f..133b26dcbf0 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -206,8 +206,8 @@ GLOBAL_REAL(Master, /datum/controller/master) = new log_startup_progress("Initializations complete within [time] second[time == 1 ? "" : "s"]!") - if(config.developer_express_start & SSticker.current_state == GAME_STATE_PREGAME) - SSticker.current_state = GAME_STATE_SETTING_UP + if(GLOB.configuration.general.developer_express_start) + SSticker.force_start = TRUE if(!current_runlevel) SetRunLevel(1) diff --git a/code/controllers/subsystem/changelog.dm b/code/controllers/subsystem/changelog.dm index d633708a7a5..3a35488e562 100644 --- a/code/controllers/subsystem/changelog.dm +++ b/code/controllers/subsystem/changelog.dm @@ -266,11 +266,11 @@ SUBSYSTEM_DEF(changelog) usr.client.github() // Takes a PR number as argument if(href_list["openPR"]) - if(GLOB?.configuration?.url.github_url) + if(GLOB.configuration.url.github_url) if(alert("This will open PR #[href_list["openPR"]] in your browser. Are you sure?",,"Yes","No")=="No") return // If the github URL in the config has a trailing slash, it doesnt matter here, thankfully github accepts having a double slash: https://github.com/org/repo//pull/1 - var/url = "[GLOB?.configuration?.url.github_url]/pull/[href_list["openPR"]]" + var/url = "[GLOB.configuration.url.github_url]/pull/[href_list["openPR"]]" usr << link(url) else to_chat(usr, "The GitHub URL is not set in the server configuration. PRs cannot be opened from changelog view. Please inform the server host.") diff --git a/code/controllers/subsystem/holiday.dm b/code/controllers/subsystem/holiday.dm index ddde9cd62be..e9b254b1269 100644 --- a/code/controllers/subsystem/holiday.dm +++ b/code/controllers/subsystem/holiday.dm @@ -5,7 +5,7 @@ SUBSYSTEM_DEF(holiday) var/list/holidays /datum/controller/subsystem/holiday/Initialize(start_timeofday) - if(!config.allow_holidays) + if(!GLOB.configuration.general.allow_holidays) return ..() //Holiday stuff was not enabled in the config! var/YY = text2num(time2text(world.timeofday, "YY")) // get the current year diff --git a/code/controllers/subsystem/lighting.dm b/code/controllers/subsystem/lighting.dm index 6761e9647d9..e12c6be07df 100644 --- a/code/controllers/subsystem/lighting.dm +++ b/code/controllers/subsystem/lighting.dm @@ -13,7 +13,7 @@ SUBSYSTEM_DEF(lighting) /datum/controller/subsystem/lighting/Initialize(timeofday) if(!initialized) - if(config.starlight) + if(GLOB.configuration.general.starlight) for(var/I in GLOB.all_areas) var/area/A = I if(A.dynamic_lighting == DYNAMIC_LIGHTING_IFSTARLIGHT) diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index b790deb7795..06b6d39bcb8 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -70,8 +70,8 @@ SUBSYSTEM_DEF(mapping) GLOB.map_name = "Unknown" // World name - if(config && config.server_name) - world.name = "[config.server_name]: [station_name()]" + if(GLOB.configuration.general.server_name) + world.name = "[GLOB.configuration.general.server_name]: [station_name()]" else world.name = station_name() diff --git a/code/controllers/subsystem/nightshift.dm b/code/controllers/subsystem/nightshift.dm index deffcb6bddf..fe5d17dccd4 100644 --- a/code/controllers/subsystem/nightshift.dm +++ b/code/controllers/subsystem/nightshift.dm @@ -14,9 +14,9 @@ SUBSYSTEM_DEF(nightshift) var/high_security_mode = FALSE /datum/controller/subsystem/nightshift/Initialize() - if(!config.enable_night_shifts) + if(!GLOB.configuration.general.enable_night_shifts) can_fire = FALSE - if(config.randomize_shift_time) + if(GLOB.configuration.general.randomise_shift_time) GLOB.gametime_offset = rand(0, 23) HOURS return ..() diff --git a/code/controllers/subsystem/profiler.dm b/code/controllers/subsystem/profiler.dm index 418af664d92..2d30360edb1 100644 --- a/code/controllers/subsystem/profiler.dm +++ b/code/controllers/subsystem/profiler.dm @@ -13,7 +13,7 @@ SUBSYSTEM_DEF(profiler) ..("F:[round(fetch_cost, 1)]ms | W:[round(write_cost, 1)]ms") /datum/controller/subsystem/profiler/Initialize() - if(!config.auto_profile) + if(!GLOB.configuration.general.enable_auto_profiler) StopProfiling() //Stop the early start profiler if we dont want it on in the config flags |= SS_NO_FIRE return ..() @@ -22,7 +22,7 @@ SUBSYSTEM_DEF(profiler) DumpFile() /datum/controller/subsystem/profiler/Shutdown() - if(config.auto_profile) + if(GLOB.configuration.general.enable_auto_profiler) DumpFile() return ..() diff --git a/code/controllers/subsystem/shuttles.dm b/code/controllers/subsystem/shuttles.dm index c86f988bcd4..94267596ee0 100644 --- a/code/controllers/subsystem/shuttles.dm +++ b/code/controllers/subsystem/shuttles.dm @@ -1,4 +1,6 @@ #define CALL_SHUTTLE_REASON_LENGTH 12 +/// Time elapsed from roundstart before shuttle calls are allowed +#define SHUTTLE_REFUEL_DELAY 20 MINUTES SUBSYSTEM_DEF(shuttle) name = "Shuttle" @@ -42,6 +44,8 @@ SUBSYSTEM_DEF(shuttle) var/sold_atoms = "" var/list/hidden_shuttle_turfs = list() //all turfs hidden from navigation computers associated with a list containing the image hiding them and the type of the turf they are pretending to be var/list/hidden_shuttle_turf_images = list() //only the images from the above list + /// Default refuel delay + var/refuel_delay = SHUTTLE_REFUEL_DELAY /datum/controller/subsystem/shuttle/Initialize(start_timeofday) ordernum = rand(1,9000) @@ -97,7 +101,7 @@ SUBSYSTEM_DEF(shuttle) /datum/controller/subsystem/shuttle/proc/secondsToRefuel() var/elapsed = world.time - SSticker.round_start_time - var/remaining = round((config.shuttle_refuel_delay - elapsed) / 10) + var/remaining = round((refuel_delay - elapsed) / 10) return remaining > 0 ? remaining : 0 /datum/controller/subsystem/shuttle/proc/requestEvac(mob/user, call_reason) @@ -115,7 +119,7 @@ SUBSYSTEM_DEF(shuttle) emergency = backup_shuttle if(secondsToRefuel()) - to_chat(user, "The emergency shuttle is refueling. Please wait another [abs(round(((world.time - SSticker.round_start_time) - config.shuttle_refuel_delay)/600))] minutes before trying again.") + to_chat(user, "The emergency shuttle is refueling. Please wait another [abs(round(((world.time - SSticker.round_start_time) - refuel_delay)/600))] minutes before trying again.") return switch(emergency.mode) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 17956b934b2..127794727c4 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -77,9 +77,9 @@ SUBSYSTEM_DEF(ticker) switch(current_state) if(GAME_STATE_STARTUP) // This is ran as soon as the MC starts firing, and should only run ONCE, unless startup fails - round_start_time = world.time + (config.pregame_timestart * 10) + round_start_time = world.time + (GLOB.configuration.general.lobby_time * 10) to_chat(world, "Welcome to the pre-game lobby!") - to_chat(world, "Please, setup your character and select ready. Game will start in [config.pregame_timestart] seconds") + to_chat(world, "Please, setup your character and select ready. Game will start in [GLOB.configuration.general.lobby_time] seconds") current_state = GAME_STATE_PREGAME fire() // TG says this is a good idea for(var/mob/new_player/N in GLOB.player_list) @@ -280,6 +280,8 @@ SUBSYSTEM_DEF(ticker) else log_debug("Playercount: [playercount] versus trigger: [highpop_trigger] - keeping standard job config") + SSnightshift.check_nightshift() + #ifdef UNIT_TESTS RunUnitTests() #endif diff --git a/code/controllers/subsystem/tickets/tickets.dm b/code/controllers/subsystem/tickets/tickets.dm index 26e3809b15d..d5eb31117e2 100644 --- a/code/controllers/subsystem/tickets/tickets.dm +++ b/code/controllers/subsystem/tickets/tickets.dm @@ -220,10 +220,10 @@ SUBSYSTEM_DEF(tickets) "Man Up" = "Man Up", ) - if(GLOB?.configuration?.url.banappeals_url) + if(GLOB.configuration.url.banappeals_url) response_phrases["Appeal on the Forums"] = "Appealing a ban must occur on the forums. Privately messaging, or adminhelping about your ban will not resolve it. To appeal your ban, please head to [GLOB.configuration.url.banappeals_url]" - if(GLOB?.configuration?.url.github_url) + if(GLOB.configuration.url.github_url) response_phrases["Github Issue Report"] = "To report a bug, please go to our Github page. Then go to 'Issues'. Then 'New Issue'. Then fill out the report form. If the report would reveal current-round information, file it after the round ends." var/sorted_responses = list() diff --git a/code/controllers/subsystem/vote.dm b/code/controllers/subsystem/vote.dm index 02e18707320..b1a8ceb887e 100644 --- a/code/controllers/subsystem/vote.dm +++ b/code/controllers/subsystem/vote.dm @@ -53,9 +53,9 @@ SUBSYSTEM_DEF(vote) voting.Cut() current_votes.Cut() - if(auto_muted && !config.ooc_allowed && !(config.auto_toggle_ooc_during_round && SSticker.current_state == GAME_STATE_PLAYING)) + if(auto_muted && !GLOB.ooc_enabled && !(GLOB.configuration.general.auto_disable_ooc && SSticker.current_state == GAME_STATE_PLAYING)) auto_muted = 0 - config.ooc_allowed = !( config.ooc_allowed ) + GLOB.ooc_enabled = TRUE to_chat(world, "The OOC channel has been automatically enabled due to vote end.") log_admin("OOC was toggled automatically due to vote end.") message_admins("OOC has been toggled on automatically.") @@ -257,21 +257,21 @@ SUBSYSTEM_DEF(vote) if(mode == "gamemode" && SSticker.ticker_going) SSticker.ticker_going = FALSE to_chat(world, "Round start has been delayed.") - if(mode == "crew_transfer" && config.ooc_allowed) - auto_muted = 1 - config.ooc_allowed = !( config.ooc_allowed ) + if(mode == "crew_transfer" && GLOB.ooc_enabled) + auto_muted = TRUE + GLOB.ooc_enabled = FALSE to_chat(world, "The OOC channel has been automatically disabled due to a crew transfer vote.") log_admin("OOC was toggled automatically due to crew_transfer vote.") message_admins("OOC has been toggled off automatically.") - if(mode == "gamemode" && config.ooc_allowed) - auto_muted = 1 - config.ooc_allowed = !( config.ooc_allowed ) + if(mode == "gamemode" && GLOB.ooc_enabled) + auto_muted = TRUE + GLOB.ooc_enabled = FALSE to_chat(world, "The OOC channel has been automatically disabled due to the gamemode vote.") log_admin("OOC was toggled automatically due to gamemode vote.") message_admins("OOC has been toggled off automatically.") - if(mode == "custom" && config.ooc_allowed) - auto_muted = 1 - config.ooc_allowed = !( config.ooc_allowed ) + if(mode == "custom" && GLOB.ooc_enabled) + auto_muted = TRUE + GLOB.ooc_enabled = FALSE to_chat(world, "The OOC channel has been automatically disabled due to a custom vote.") log_admin("OOC was toggled automatically due to custom vote.") message_admins("OOC has been toggled off automatically.") diff --git a/code/controllers/verbs.dm b/code/controllers/verbs.dm index 33183cacbf0..244b32125b0 100644 --- a/code/controllers/verbs.dm +++ b/code/controllers/verbs.dm @@ -28,7 +28,7 @@ return switch(controller) if("Configuration") - debug_variables(config) + debug_variables(GLOB.configuration) SSblackbox.record_feedback("tally", "admin_verb", 1, "Debug Config") if("pAI") debug_variables(GLOB.paiController) diff --git a/code/datums/revision.dm b/code/datums/revision.dm index 13f17f5a42d..10d5ee1d09d 100644 --- a/code/datums/revision.dm +++ b/code/datums/revision.dm @@ -93,7 +93,7 @@ GLOBAL_PROTECT(revision_info) // Dont mess with this msg += "Round ID: [GLOB.round_id ? GLOB.round_id : "NULL"]" // Commit info - if(GLOB.revision_info.commit_hash && GLOB.revision_info.commit_date && GLOB?.configuration?.url.github_url) + if(GLOB.revision_info.commit_hash && GLOB.revision_info.commit_date && GLOB.configuration.url.github_url) msg += "Server Commit: [GLOB.revision_info.commit_hash] (Date: [GLOB.revision_info.commit_date])" if(GLOB.revision_info.origin_commit && (GLOB.revision_info.commit_hash != GLOB.revision_info.origin_commit)) msg += "Origin Commit: [GLOB.revision_info.origin_commit]" diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 6565779e14b..325c02bc6ce 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -96,7 +96,7 @@ else if(dynamic_lighting != DYNAMIC_LIGHTING_IFSTARLIGHT) dynamic_lighting = DYNAMIC_LIGHTING_DISABLED if(dynamic_lighting == DYNAMIC_LIGHTING_IFSTARLIGHT) - dynamic_lighting = config.starlight ? DYNAMIC_LIGHTING_ENABLED : DYNAMIC_LIGHTING_DISABLED + dynamic_lighting = GLOB.configuration.general.starlight ? DYNAMIC_LIGHTING_ENABLED : DYNAMIC_LIGHTING_DISABLED . = ..() diff --git a/code/game/gamemodes/nuclear/nuclear_challenge.dm b/code/game/gamemodes/nuclear/nuclear_challenge.dm index 5e11a78888d..6234e7b8525 100644 --- a/code/game/gamemodes/nuclear/nuclear_challenge.dm +++ b/code/game/gamemodes/nuclear/nuclear_challenge.dm @@ -59,7 +59,7 @@ // No. of player - Min. Player to dec, divided by player per bonus, then multipled by TC per bonus. Rounded. total_tc = CHALLENGE_TELECRYSTALS + round((((GLOB.player_list.len - CHALLENGE_MIN_PLAYERS)/CHALLENGE_SCALE_PLAYER) * CHALLENGE_SCALE_BONUS)) share_telecrystals() - config.shuttle_refuel_delay = CHALLENGE_SHUTTLE_DELAY + SSshuttle.refuel_delay = CHALLENGE_SHUTTLE_DELAY qdel(src) /obj/item/nuclear_challenge/proc/share_telecrystals() diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 934c4ffd7e8..e2af68b3074 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -85,7 +85,8 @@ announce(H) /datum/job/proc/get_access() - if(!config) //Needed for robots. + if(!GLOB?.configuration?.jobs) //Needed for robots. + // AA TOOD: Remove this once mulebots and stuff use Initialize() return src.minimal_access.Copy() if(GLOB.configuration.jobs.jobs_have_minimal_access) diff --git a/code/game/jobs/whitelist.dm b/code/game/jobs/whitelist.dm index 0e4ec27cad7..b327da6390f 100644 --- a/code/game/jobs/whitelist.dm +++ b/code/game/jobs/whitelist.dm @@ -1,8 +1,6 @@ /proc/is_job_whitelisted(mob/M, rank) if(guest_jobbans(rank)) - if(!config.usewhitelist) - return TRUE - if(config.disable_karma) + if(!GLOB.configuration.general.enable_karma) return TRUE if(check_rights(R_ADMIN, 0, M)) return TRUE @@ -35,7 +33,7 @@ return TRUE /proc/is_alien_whitelisted(mob/M, species) - if(config.disable_karma) + if(!GLOB.configuration.general.enable_karma) return TRUE if(species == "human" || species == "Human") return TRUE diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index f2a76b15f58..77c78506676 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -338,7 +338,7 @@ set_temp("Error: Not enough biomass.", "danger") else if(pod.mess) set_temp("Error: The cloning pod is malfunctioning.", "danger") - else if(!config.revival_cloning) + else if(!GLOB.configuration.general.enable_cloning) set_temp("Error: Unable to initiate cloning cycle.", "danger") else cloneresult = pod.growclone(C) diff --git a/code/game/objects/effects/effect_system/effects_other.dm b/code/game/objects/effects/effect_system/effects_other.dm index d28367a1489..bb33bfe15fa 100644 --- a/code/game/objects/effects/effect_system/effects_other.dm +++ b/code/game/objects/effects/effect_system/effects_other.dm @@ -45,15 +45,15 @@ var/light = -1 var/flash = -1 - // Clamp all values to MAX_EXPLOSION_RANGE + // We dont need to clamp here. It gets clamped inside explosion() if(round(amount/12) > 0) - devastation = min (GLOB.max_ex_devastation_range, devastation + round(amount/12)) + devastation += round(amount/12) if(round(amount/6) > 0) - heavy = min (GLOB.max_ex_heavy_range, heavy + round(amount/6)) + heavy += round(amount/6) if(round(amount/3) > 0) - light = min (GLOB.max_ex_light_range, light + round(amount/3)) + light += round(amount/3) if(flashing && flashing_factor) flash += (round(amount/4) * flashing_factor) diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index 4e4eefbe9cb..69074e479a9 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -24,11 +24,11 @@ if(!ignorecap) // Clamp all values to MAX_EXPLOSION_RANGE - devastation_range = min (GLOB.max_ex_devastation_range, devastation_range) - heavy_impact_range = min (GLOB.max_ex_heavy_range, heavy_impact_range) - light_impact_range = min (GLOB.max_ex_light_range, light_impact_range) - flash_range = min (GLOB.max_ex_flash_range, flash_range) - flame_range = min (GLOB.max_ex_flame_range, flame_range) + devastation_range = min (GLOB.configuration.general.bomb_cap / 4, devastation_range) + heavy_impact_range = min (GLOB.configuration.general.bomb_cap / 2, heavy_impact_range) + light_impact_range = min (GLOB.configuration.general.bomb_cap, light_impact_range) + flash_range = min (GLOB.configuration.general.bomb_cap, flash_range) + flame_range = min (GLOB.configuration.general.bomb_cap, flame_range) var/max_range = max(devastation_range, heavy_impact_range, light_impact_range, flame_range) @@ -118,7 +118,7 @@ var/list/affected_turfs = spiral_range_turfs(max_range, epicenter) - if(config.reactionary_explosions) + if(GLOB.configuration.general.reactionary_explosions) for(var/A in affected_turfs) // we cache the explosion block rating of every turf in the explosion area var/turf/T = A cached_exp_block[T] = 0 @@ -136,7 +136,7 @@ continue var/dist = HYPOTENUSE(T.x, T.y, x0, y0) - if(config.reactionary_explosions) + if(GLOB.configuration.general.reactionary_explosions) var/turf/Trajectory = T while(Trajectory != epicenter) Trajectory = get_step_towards(Trajectory, epicenter) diff --git a/code/game/objects/items/weapons/dice.dm b/code/game/objects/items/weapons/dice.dm index 6395b55a3b1..adda05615e6 100644 --- a/code/game/objects/items/weapons/dice.dm +++ b/code/game/objects/items/weapons/dice.dm @@ -179,12 +179,11 @@ addtimer(CALLBACK(src, .proc/boom, user, result), 4 SECONDS) /obj/item/dice/d20/e20/proc/boom(mob/user, result) - var/capped = FALSE + var/capped = TRUE var/actual_result = result - if(result != 20) - capped = TRUE - result = min(result, GLOB.max_ex_light_range) // Apply the bombcap - else // Rolled a nat 20, screw the bombcap + // Rolled a nat 20, screw the bombcap + if(result == 20) + capped = FALSE result = 24 var/turf/epicenter = get_turf(src) diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index 256376d30a7..0387f73a456 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -121,7 +121,7 @@ set category = "Object" set src in oview(1) - if(config.ghost_interaction) + if(GLOB.configuration.general.ghost_interaction) setDir(turn(dir, 90)) handle_rotation() return diff --git a/code/game/sound.dm b/code/game/sound.dm index a836aba710f..5d438268775 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -178,7 +178,7 @@ falloff_distance - Distance at which falloff begins. Sound is at peak volume (in SEND_SOUND(src, S) /client/proc/playtitlemusic() - if(!SSticker || !SSticker.login_music || config.disable_lobby_music) + if(!SSticker || !SSticker.login_music || GLOB.configuration.general.disable_lobby_music) return if(prefs.sound & SOUND_LOBBY) SEND_SOUND(src, sound(SSticker.login_music, repeat = 0, wait = 0, volume = 85 * prefs.get_channel_volume(CHANNEL_LOBBYMUSIC), channel = CHANNEL_LOBBYMUSIC)) // MAD JAMS diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index 66ce0bedcac..a107250f18d 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -54,7 +54,7 @@ S.apply_transition(src) /turf/space/proc/update_starlight() - if(config.starlight) + if(GLOB.configuration.general.starlight) for(var/t in RANGE_TURFS(1,src)) //RANGE_TURFS is in code\__HELPERS\game.dm if(isspaceturf(t)) //let's NOT update this that much pls diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm index 5f7bdc35e49..fcc413bd05b 100644 --- a/code/game/verbs/ooc.dm +++ b/code/game/verbs/ooc.dm @@ -19,10 +19,10 @@ GLOBAL_VAR_INIT(admin_ooc_colour, "#b82e00") return if(!check_rights(R_ADMIN|R_MOD, 0)) - if(!config.ooc_allowed) + if(!GLOB.ooc_enabled) to_chat(src, "OOC is globally muted.") return - if(!config.dooc_allowed && (mob.stat == DEAD)) + if(!GLOB.dooc_enabled && (mob.stat == DEAD)) to_chat(usr, "OOC for dead mobs has been turned off.") return if(prefs.muted & MUTE_OOC) @@ -41,7 +41,7 @@ GLOBAL_VAR_INIT(admin_ooc_colour, "#b82e00") return if(!check_rights(R_ADMIN|R_MOD,0)) - if(!config.ooc_allowed) + if(!GLOB.ooc_enabled) to_chat(src, "OOC is globally muted.") return if(handle_spam_prevention(msg, MUTE_OOC, OOC_COOLDOWN)) @@ -92,20 +92,20 @@ GLOBAL_VAR_INIT(admin_ooc_colour, "#b82e00") else display_name = holder.fakekey - if(!config.disable_ooc_emoji) + if(GLOB.configuration.general.enable_ooc_emoji) msg = "[msg]" to_chat(C, "OOC: [display_name]: [msg]") /proc/toggle_ooc() - config.ooc_allowed = ( !config.ooc_allowed ) - if(config.ooc_allowed) + GLOB.ooc_enabled = (!GLOB.ooc_enabled) + if(GLOB.ooc_enabled) to_chat(world, "The OOC channel has been globally enabled!") else to_chat(world, "The OOC channel has been globally disabled!") /proc/auto_toggle_ooc(on) - if(config.auto_toggle_ooc_during_round && config.ooc_allowed != on) + if(GLOB.configuration.general.auto_disable_ooc && GLOB.ooc_enabled != on) toggle_ooc() /client/proc/set_ooc(newColor as color) @@ -175,10 +175,10 @@ GLOBAL_VAR_INIT(admin_ooc_colour, "#b82e00") return if(!check_rights(R_ADMIN|R_MOD,0)) - if(!config.looc_allowed) + if(!GLOB.looc_enabled) to_chat(src, "LOOC is globally muted.") return - if(!config.dooc_allowed && (mob.stat == DEAD)) + if(!GLOB.dooc_enabled && (mob.stat == DEAD)) to_chat(usr, "LOOC for dead mobs has been turned off.") return if(prefs.muted & MUTE_OOC) diff --git a/code/game/world.dm b/code/game/world.dm index 9afb0b46b64..465090569d7 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -20,8 +20,8 @@ GLOBAL_LIST_INIT(map_transition_config, MAP_TRANSITION_CONFIG) //temporary file used to record errors with loading config and the database, moved to log directory once logging is set up GLOB.config_error_log = GLOB.world_game_log = GLOB.world_runtime_log = GLOB.sql_log = "data/logs/config_error.log" - load_configuration() GLOB.configuration.load_configuration() + load_files() // Loads up the MOTD (Welcome message players see when joining the server), TOS and gamemode // Right off the bat, load up the DB SSdbcore.CheckSchemaVersion() // This doesnt just check the schema version, it also connects to the db! This needs to happen super early! I cannot stress this enough! @@ -46,10 +46,6 @@ GLOBAL_LIST_INIT(map_transition_config, MAP_TRANSITION_CONFIG) if(byond_version < MIN_COMPILER_VERSION || byond_build < MIN_COMPILER_BUILD) log_world("Your server's byond version does not meet the recommended requirements for this code. Please update BYOND") - if(config && config.server_name != null && config.server_suffix && world.port > 0) - // dumb and hardcoded but I don't care~ - config.server_name += " #[(world.port % 1000) / 100]" - GLOB.timezoneOffset = text2num(time2text(0, "hh")) * 36000 startup_procs() // Call procs that need to occur on startup (Generate lists, load MOTD, etc) @@ -77,8 +73,6 @@ GLOBAL_LIST_INIT(map_transition_config, MAP_TRANSITION_CONFIG) /world/proc/startup_procs() LoadBans() // Load up who is banned and who isnt. DONT PUT THIS IN A SUBSYSTEM IT WILL TAKE TOO LONG TO BE CALLED jobban_loadbanfile() // Load up jobbans. Again, DO NOT PUT THIS IN A SUBSYSTEM IT WILL TAKE TOO LONG TO BE CALLED - load_motd() // Loads up the MOTD (Welcome message players see when joining the server) - load_mode() // Loads up the gamemode investigate_reset() // This is part of the admin investigate system. PLEASE DONT SS THIS EITHER /// List of all world topic spam prevention handlers. See code/modules/world_topic/_spam_prevention_handler.dm @@ -130,7 +124,7 @@ GLOBAL_LIST_EMPTY(world_topic_handlers) to_chat(world, "Rebooting world immediately due to host request") rustg_log_close_all() // Past this point, no logging procs can be used, at risk of data loss. // Now handle a reboot - if(GLOB?.configuration?.system.shutdown_on_reboot) + if(GLOB.configuration.system.shutdown_on_reboot) sleep(0) if(GLOB.configuration.system.shutdown_shell_command) shell(GLOB.configuration.system.shutdown_shell_command) @@ -159,12 +153,12 @@ GLOBAL_LIST_EMPTY(world_topic_handlers) // Send the reboot banner to all players for(var/client/C in GLOB.clients) C << output(list2params(list(secs_before_auto_reconnect)), "browseroutput:reboot") - if(GLOB?.configuration?.url.server_url) // If you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite + if(GLOB.configuration?.url.server_url) // If you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite C << link("byond://[GLOB.configuration.url.server_url]") // And begin the real shutdown rustg_log_close_all() // Past this point, no logging procs can be used, at risk of data loss. - if(GLOB?.configuration?.system.shutdown_on_reboot) + if(GLOB.configuration.system.shutdown_on_reboot) sleep(0) if(GLOB.configuration.system.shutdown_shell_command) shell(GLOB.configuration.system.shutdown_shell_command) @@ -188,36 +182,26 @@ GLOBAL_LIST_EMPTY(world_topic_handlers) fdel(F) F << the_mode -/world/proc/load_motd() +/world/proc/load_files() GLOB.join_motd = file2text("config/motd.txt") GLOB.join_tos = file2text("config/tos.txt") - -/proc/load_configuration() - config = new /datum/configuration() - config.load("config/config.txt") - config.load("config/game_options.txt","game_options") - // apply some settings from config.. + load_mode() /world/proc/update_status() status = get_status_text() -/proc/get_world_status_text() - return world.get_status_text() - /world/proc/get_status_text() var/s = "" - if(config && config.server_name) - s += "[config.server_name] — " + if(GLOB.configuration.general.server_name) + s += "[GLOB.configuration.general.server_name] — " s += "[station_name()] " - if(GLOB?.configuration?.url.github_url) - s+= "([GLOB.game_version])" // TODO: Redo the MOTD - if(config && config.server_tag_line) - s += "
[config.server_tag_line]" + if(GLOB.configuration.general.server_tag_line) + s += "
[GLOB.configuration.general.server_tag_line]" if(SSticker && ROUND_TIME > 0) - s += "
[round(ROUND_TIME / 36000)]:[add_zero(num2text(ROUND_TIME / 600 % 60), 2)], " + capitalize(get_security_level()) + s += "
[round(ROUND_TIME / 36000)]:[add_zero(num2text(ROUND_TIME / 600 % 60), 2)], [capitalize(get_security_level())]" else s += "
STARTING" @@ -227,16 +211,16 @@ GLOBAL_LIST_EMPTY(world_topic_handlers) if(!GLOB.enter_allowed) features += "closed" - if(config && config.server_extra_features) - features += config.server_extra_features + if(GLOB.configuration.general.server_features) + features += GLOB.configuration.general.server_features - if(GLOB?.configuration?.vote.allow_restart_votes) + if(GLOB.configuration.vote.allow_restart_votes) features += "vote" - if(GLOB?.configuration?.url.wiki_url) + if(GLOB.configuration.url.wiki_url) features += "Wiki" - if(GLOB.abandon_allowed) + if(GLOB.configuration.general.respawn_enabled) features += "respawn" if(features) diff --git a/code/modules/admin/IsBanned.dm b/code/modules/admin/IsBanned.dm index 03e70a21408..4682b36d742 100644 --- a/code/modules/admin/IsBanned.dm +++ b/code/modules/admin/IsBanned.dm @@ -28,7 +28,7 @@ admin = 1 //Guest Checking - if(!GLOB.guests_allowed && IsGuestKey(key)) + if(GLOB.configuration.general.guest_ban && IsGuestKey(key)) log_adminwarn("Failed Login: [key] [computer_id] [address] - Guests not allowed") // message_admins("Failed Login: [key] - Guests not allowed") INVOKE_ASYNC(GLOBAL_PROC, .proc/log_connection, ckey(key), address, computer_id, CONNECTION_TYPE_DROPPED_BANNED) @@ -38,13 +38,13 @@ if(check_ipintel && GLOB.configuration.ipintel.contact_email && GLOB.configuration.ipintel.whitelist_mode && ipintel_is_banned(key, address)) log_adminwarn("Failed Login: [key] [computer_id] [address] - Proxy/VPN") var/mistakemessage = "" - if(GLOB?.configuration?.url.banappeals_url) + if(GLOB.configuration.url.banappeals_url) mistakemessage = "\nIf you have to use one, request whitelisting at: [GLOB.configuration.url.banappeals_url]" INVOKE_ASYNC(GLOBAL_PROC, .proc/log_connection, ckey(key), address, computer_id, CONNECTION_TYPE_DROPPED_IPINTEL) return list("reason"="using proxy or vpn", "desc"="\nReason: Proxies/VPNs are not allowed here. [mistakemessage]") - if(config.ban_legacy_system) + if(!GLOB.configuration.general.use_database_bans) //Ban Checking . = CheckBan(ckey(key), computer_id, address) if(.) @@ -116,7 +116,7 @@ expires = " The ban is for [duration] minutes and expires on [expiration] (server time)." else var/appealmessage = "" - if(GLOB?.configuration?.url.banappeals_url) + if(GLOB.configuration.url.banappeals_url) appealmessage = " You may appeal it at [GLOB.configuration.url.banappeals_url]." expires = " This ban does not expire automatically and must be appealed.[appealmessage]" diff --git a/code/modules/admin/NewBan.dm b/code/modules/admin/NewBan.dm index b491f91aff4..ebdb46d2110 100644 --- a/code/modules/admin/NewBan.dm +++ b/code/modules/admin/NewBan.dm @@ -10,7 +10,7 @@ GLOBAL_PROTECT(banlist_savefile) // Obvious reasons . = list() var/appeal - if(GLOB?.configuration?.url.banappeals_url) + if(GLOB.configuration.url.banappeals_url) appeal = "\nFor more information on your ban, or to appeal, head to [GLOB.configuration.url.banappeals_url]" GLOB.banlist_savefile.cd = "/base" if( "[ckey][id]" in GLOB.banlist_savefile.dir ) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 123247da027..aaf71d0ccef 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -91,8 +91,8 @@ GLOBAL_VAR_INIT(nologevent, 0) else body += "\[[M.client.holder ? M.client.holder.rank : "Player"]\] " body += "\[" + M.client.get_exp_type(EXP_TYPE_CREW) + " as [EXP_TYPE_CREW]\]" - body += "
BYOND account registration date: [M.client.byondacc_date || "ERROR"] [M.client.byondacc_age <= config.byond_account_age_threshold ? "" : ""]([M.client.byondacc_age] days old)[M.client.byondacc_age <= config.byond_account_age_threshold ? "" : ""]" - body += "
Global Ban DB Lookup: [GLOB?.configuration?.url.centcom_ban_db_url ? "Lookup" : "Disabled"]" + body += "
BYOND account registration date: [M.client.byondacc_date || "ERROR"] [M.client.byondacc_age <= GLOB.configuration?.general.byond_account_age_threshold ? "" : ""]([M.client.byondacc_age] days old)[M.client.byondacc_age <= GLOB.configuration.general.byond_account_age_threshold ? "" : ""]" + body += "
Global Ban DB Lookup: [GLOB.configuration?.url.centcom_ban_db_url ? "Lookup" : "Disabled"]" body += "
" @@ -127,7 +127,7 @@ GLOBAL_VAR_INIT(nologevent, 0) body += "Appearance Ban | " body += "Notes | " body += "View Karma | " - if(GLOB?.configuration?.url.forum_playerinfo_url) + if(GLOB.configuration.url.forum_playerinfo_url) body += "WebInfo | " if(M.client) if(check_watchlist(M.client.ckey)) @@ -462,8 +462,8 @@ GLOBAL_VAR_INIT(nologevent, 0) if(!check_rights(R_ADMIN)) return - config.looc_allowed = !(config.looc_allowed) - if(config.looc_allowed) + GLOB.looc_enabled = !(GLOB.looc_enabled) + if(GLOB.looc_enabled) to_chat(world, "The LOOC channel has been globally enabled!") else to_chat(world, "The LOOC channel has been globally disabled!") @@ -478,8 +478,8 @@ GLOBAL_VAR_INIT(nologevent, 0) if(!check_rights(R_ADMIN)) return - config.dsay_allowed = !(config.dsay_allowed) - if(config.dsay_allowed) + GLOB.dsay_enabled = !(GLOB.dsay_enabled) + if(GLOB.dsay_enabled) to_chat(world, "Deadchat has been globally enabled!") else to_chat(world, "Deadchat has been globally disabled!") @@ -495,7 +495,7 @@ GLOBAL_VAR_INIT(nologevent, 0) if(!check_rights(R_ADMIN)) return - config.dooc_allowed = !( config.dooc_allowed ) + GLOB.dooc_enabled = !(GLOB.dooc_enabled) log_admin("[key_name(usr)] toggled Dead OOC.") message_admins("[key_name_admin(usr)] toggled Dead OOC.", 1) SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Dead OOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -508,7 +508,7 @@ GLOBAL_VAR_INIT(nologevent, 0) if(!check_rights(R_ADMIN)) return - config.disable_ooc_emoji = !(config.disable_ooc_emoji) + GLOB.configuration.general.enable_ooc_emoji = !(GLOB.configuration.general.enable_ooc_emoji) log_admin("[key_name(usr)] toggled OOC Emoji.") message_admins("[key_name_admin(usr)] toggled OOC Emoji.", 1) SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle OOC Emoji") @@ -525,7 +525,7 @@ GLOBAL_VAR_INIT(nologevent, 0) alert("Unable to start the game as it is not set up.") return - if(config.start_now_confirmation) + if(GLOB.configuration.general.start_now_confirmation) if(alert(usr, "This is a live server. Are you sure you want to start now?", "Start game", "Yes", "No") != "Yes") return @@ -587,13 +587,13 @@ GLOBAL_VAR_INIT(nologevent, 0) if(!check_rights(R_SERVER)) return - GLOB.abandon_allowed = !( GLOB.abandon_allowed ) - if(GLOB.abandon_allowed) + GLOB.configuration.general.respawn_enabled = !(GLOB.configuration.general.respawn_enabled) + if(GLOB.configuration.general.respawn_enabled) to_chat(world, "You may now respawn.") else - to_chat(world, "You may no longer respawn :(") - message_admins("[key_name_admin(usr)] toggled respawn to [GLOB.abandon_allowed ? "On" : "Off"].", 1) - log_admin("[key_name(usr)] toggled respawn to [GLOB.abandon_allowed ? "On" : "Off"].") + to_chat(world, "You may no longer respawn") + message_admins("[key_name_admin(usr)] toggled respawn to [GLOB.configuration.general.respawn_enabled ? "On" : "Off"].", 1) + log_admin("[key_name(usr)] toggled respawn to [GLOB.configuration.general.respawn_enabled ? "On" : "Off"].") world.update_status() SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Respawn") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -725,13 +725,13 @@ GLOBAL_VAR_INIT(nologevent, 0) if(!check_rights(R_SERVER)) return - GLOB.guests_allowed = !( GLOB.guests_allowed ) - if(!( GLOB.guests_allowed )) + GLOB.configuration.general.guest_ban = !(GLOB.configuration?.general.guest_ban) + if(GLOB.configuration.general.guest_ban) to_chat(world, "Guests may no longer enter the game.") else to_chat(world, "Guests may now enter the game.") - log_admin("[key_name(usr)] toggled guests game entering [GLOB.guests_allowed ? "" : "dis"]allowed.") - message_admins("[key_name_admin(usr)] toggled guests game entering [GLOB.guests_allowed ? "" : "dis"]allowed.", 1) + log_admin("[key_name(usr)] toggled guests game entering [GLOB.configuration?.general.guest_ban ? "dis" : ""]allowed.") + message_admins("[key_name_admin(usr)] toggled guests game entering [GLOB.configuration?.general.guest_ban ? "dis" : ""]allowed.", 1) SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Guests") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/admins/proc/output_ai_laws() diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index b11e173e152..6a05cee73ea 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -137,7 +137,6 @@ GLOBAL_LIST_INIT(admin_verbs_server, list( /client/proc/toggle_antagHUD_restrictions, /client/proc/set_ooc, /client/proc/reset_ooc, - /client/proc/toggledrones )) GLOBAL_LIST_INIT(admin_verbs_debug, list( /client/proc/cmd_admin_list_open_jobs, @@ -395,7 +394,7 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list( if(!check_rights(R_BAN)) return - if(config.ban_legacy_system) + if(!GLOB.configuration.general.use_database_bans) holder.unbanpanel() else holder.DB_ban_panel() @@ -758,13 +757,13 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list( if(!check_rights(R_SERVER)) return - if(config) - if(GLOB.configuration.logging.href_logging) - GLOB.configuration.logging.href_logging = FALSE - to_chat(src, "Stopped logging hrefs") - else - GLOB.configuration.logging.href_logging = TRUE - to_chat(src, "Started logging hrefs") + // Why would we ever turn this off? + if(GLOB.configuration.logging.href_logging) + GLOB.configuration.logging.href_logging = FALSE + to_chat(src, "Stopped logging hrefs") + else + GLOB.configuration.logging.href_logging = TRUE + to_chat(src, "Started logging hrefs") /client/proc/check_ai_laws() set name = "Check AI Laws" @@ -941,17 +940,6 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list( else to_chat(usr, "You now will get admin ticket messages.") -/client/proc/toggledrones() - set name = "Toggle Maintenance Drones" - set category = "Server" - - if(!check_rights(R_SERVER)) - return - - config.allow_drone_spawn = !(config.allow_drone_spawn) - log_admin("[key_name(usr)] has [config.allow_drone_spawn ? "enabled" : "disabled"] maintenance drones.") - message_admins("[key_name_admin(usr)] has [config.allow_drone_spawn ? "enabled" : "disabled"] maintenance drones.") - /client/proc/toggledebuglogs() set name = "Toggle Debug Log Messages" set category = "Preferences" diff --git a/code/modules/admin/banappearance.dm b/code/modules/admin/banappearance.dm index 480eb841f78..75816c22c43 100644 --- a/code/modules/admin/banappearance.dm +++ b/code/modules/admin/banappearance.dm @@ -40,8 +40,9 @@ DEBUG appearance_loadbanfile() */ // AA 2020-11-25: This entire proc isnt even called. What the actual fuck. +// AA 2021-05-23: This entire proc STILL isnt even called. I am going to screan. /proc/appearance_loadbanfile() - if(config.ban_legacy_system) + if(!GLOB.configuration.general.use_database_bans) var/savefile/S=new("data/appearance_full.ban") S["keys[0]"] >> GLOB.appearance_keylist log_admin("Loading appearance_rank") @@ -53,7 +54,7 @@ DEBUG else if(!SSdbcore.IsConnected()) log_world("Database connection failed. Reverting to the legacy ban system.") - config.ban_legacy_system = 1 + GLOB.configuration.general.use_database_bans = FALSE appearance_loadbanfile() return diff --git a/code/modules/admin/banjob.dm b/code/modules/admin/banjob.dm index 79ca68680be..6751a511bf6 100644 --- a/code/modules/admin/banjob.dm +++ b/code/modules/admin/banjob.dm @@ -17,7 +17,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## return GLOB.jobban_keylist.Add(text("[M.ckey] - [rank] ## [reason]")) jobban_assoc_insert(M.ckey, rank, reason) - if(config.ban_legacy_system) + if(!GLOB.configuration.general.use_database_bans) jobban_savebanfile() /proc/jobban_client_fullban(ckey, rank) @@ -25,7 +25,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## return GLOB.jobban_keylist.Add(text("[ckey] - [rank]")) jobban_assoc_insert(ckey, rank) - if(config.ban_legacy_system) + if(!GLOB.configuration.general.use_database_bans) jobban_savebanfile() //returns a reason if M is banned from rank, returns 0 otherwise @@ -33,7 +33,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## if(!M || !rank) return 0 - if(config.guest_jobban && guest_jobbans(rank)) + if(GLOB.configuration.jobs.guest_job_ban && guest_jobbans(rank)) if(IsGuestKey(M.key)) return "Guest Job-ban" @@ -46,7 +46,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## if(!ckey || !rank) return null - if(config.guest_jobban && guest_jobbans(rank)) + if(GLOB.configuration.jobs.guest_job_ban && guest_jobbans(rank)) if(IsGuestKey(ckey)) return "Guest Job-ban" @@ -56,7 +56,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## return null /proc/jobban_loadbanfile() - if(config.ban_legacy_system) + if(!GLOB.configuration.general.use_database_bans) var/savefile/S=new("data/job_full.ban") S["keys[0]"] >> GLOB.jobban_keylist log_admin("Loading jobban_rank") @@ -74,7 +74,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## else if(!SSdbcore.IsConnected()) log_world("Database connection failed. Reverting to the legacy ban system.") - config.ban_legacy_system = 1 + GLOB.configuration.general.use_database_bans = FALSE jobban_loadbanfile() return @@ -136,7 +136,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## else log_runtime(EXCEPTION("Failed to remove malformed job ban from associative list: [X]")) GLOB.jobban_keylist.Remove(GLOB.jobban_keylist[i]) - if(config.ban_legacy_system) + if(!GLOB.configuration.general.use_database_bans) jobban_savebanfile() return 1 return 0 @@ -148,7 +148,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## if(!client || !ckey) return - if(config.ban_legacy_system) + if(!GLOB.configuration.general.use_database_bans) //using the legacy .txt ban system to_chat(src, "The server is using the legacy ban system. Ask an administrator for help!") @@ -186,7 +186,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ## qdel(select_query) if(is_actually_banned) - if(GLOB?.configuration?.url.banappeals_url) + if(GLOB.configuration.url.banappeals_url) to_chat(src, "You can appeal the bans at: [GLOB.configuration.url.banappeals_url]") else to_chat(src, "You have no active jobbans!") diff --git a/code/modules/admin/centcom_ban_db.dm b/code/modules/admin/centcom_ban_db.dm index af0c22c0d4e..83d8c192d88 100644 --- a/code/modules/admin/centcom_ban_db.dm +++ b/code/modules/admin/centcom_ban_db.dm @@ -14,7 +14,7 @@ */ /datum/admins/proc/create_ccbdb_lookup(ckey) // Bail if disabled - if(!GLOB?.configuration?.url.centcom_ban_db_url) + if(!GLOB.configuration.url.centcom_ban_db_url) to_chat(usr, "The CentCom Ban DB lookup is disabled. Please inform a maintainer or server host.") return // Bail if no ckey is supplied diff --git a/code/modules/admin/sql_notes.dm b/code/modules/admin/sql_notes.dm index 737efd1480d..4bbef9829ec 100644 --- a/code/modules/admin/sql_notes.dm +++ b/code/modules/admin/sql_notes.dm @@ -54,8 +54,8 @@ adminckey = ckey(adminckey) if(!server) - if(config && config.server_name) - server = config.server_name + if(GLOB.configuration.general.server_name) + server = GLOB.configuration.general.server_name // Force cast this to 1/0 incase someone tries to feed bad data automated = !!automated diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index ab2c36ad982..52164e35c28 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -541,7 +541,7 @@ to_chat(M, "You have been appearance banned by [usr.client.ckey].") to_chat(M, "The reason is: [reason]") to_chat(M, "Appearance ban can be lifted only upon request.") - if(GLOB?.configuration?.url.banappeals_url) + if(GLOB.configuration.url.banappeals_url) to_chat(M, "To try to resolve this matter head to [GLOB.configuration.url.banappeals_url]") else to_chat(M, "No ban appeals URL has been set.") @@ -880,7 +880,7 @@ if(notbannedlist.len) //at least 1 unbanned job exists in joblist so we have stuff to ban. switch(alert("Temporary Ban of [M.ckey]?",,"Yes","No", "Cancel")) if("Yes") - if(config.ban_legacy_system) + if(!GLOB.configuration.general.use_database_bans) to_chat(usr, "Your server is using the legacy banning system, which does not support temporary job bans. Consider upgrading. Aborting ban.") return var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null @@ -933,7 +933,7 @@ //Unbanning joblist //all jobs in joblist are banned already OR we didn't give a reason (implying they shouldn't be banned) if(joblist.len) //at least 1 banned job exists in joblist so we have stuff to unban. - if(!config.ban_legacy_system) + if(GLOB.configuration.general.use_database_bans) to_chat(usr, "Unfortunately, database based unbanning cannot be done through this panel") DB_ban_panel(M.ckey) return @@ -1008,7 +1008,7 @@ else if(href_list["webtools"]) var/target_ckey = href_list["webtools"] - if(GLOB?.configuration?.url.forum_playerinfo_url) + if(GLOB.configuration.url.forum_playerinfo_url) var/url_to_open = "[GLOB.configuration.url.forum_playerinfo_url][target_ckey]" if(alert("Open [url_to_open]",,"Yes","No")=="Yes") usr.client << link(url_to_open) @@ -1091,7 +1091,7 @@ to_chat(M, "This ban does not expire automatically and must be appealed.") if(M.client) M.client.link_forum_account(TRUE) - if(GLOB?.configuration?.url.banappeals_url) + if(GLOB.configuration.url.banappeals_url) to_chat(M, "To try to resolve this matter head to [GLOB.configuration.url.banappeals_url]") else to_chat(M, "No ban appeals URL has been set.") @@ -3019,21 +3019,16 @@ if("togglebombcap") SSblackbox.record_feedback("tally", "admin_secrets_fun_used", 1, "Bomb Cap") - var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be between 4 and 128)", "New Bomb Cap", GLOB.max_ex_light_range) as num|null + var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be between 4 and 128)", "New Bomb Cap", GLOB.configuration.general.bomb_cap) as num|null if(newBombCap < 4) return if(newBombCap > 128) newBombCap = 128 - GLOB.max_ex_devastation_range = round(newBombCap/4) - GLOB.max_ex_heavy_range = round(newBombCap/2) - GLOB.max_ex_light_range = newBombCap - //I don't know why these are their own variables, but fuck it, they are. - GLOB.max_ex_flash_range = newBombCap - GLOB.max_ex_flame_range = newBombCap + GLOB.configuration.general.bomb_cap = newBombCap - message_admins("[key_name_admin(usr)] changed the bomb cap to [GLOB.max_ex_devastation_range], [GLOB.max_ex_heavy_range], [GLOB.max_ex_light_range]") - log_admin("[key_name(usr)] changed the bomb cap to [GLOB.max_ex_devastation_range], [GLOB.max_ex_heavy_range], [GLOB.max_ex_light_range]") + message_admins("[key_name_admin(usr)] changed the bomb cap to [GLOB.configuration.general.bomb_cap / 4], [GLOB.configuration.general.bomb_cap / 2], [GLOB.configuration.general.bomb_cap]") + log_admin("[key_name(usr)] changed the bomb cap to [GLOB.configuration.general.bomb_cap / 4], [GLOB.configuration.general.bomb_cap / 2], [GLOB.configuration.general.bomb_cap]") if("flicklights") SSblackbox.record_feedback("tally", "admin_secrets_fun_used", 1, "Flicker Lights") @@ -3310,7 +3305,7 @@ var/val = alert(usr, "What do you want to set night shift to? This will override the automatic system until set to automatic again.", "Night Shift", "On", "Off", "Automatic") switch(val) if("Automatic") - if(config.enable_night_shifts) + if(GLOB.configuration.general.enable_night_shifts) SSnightshift.can_fire = TRUE SSnightshift.fire() else diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 87009e78b52..d03344da2a1 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -142,7 +142,7 @@ C.adminhelped = 0 //AdminPM popup for ApocStation and anybody else who wants to use it. Set it with POPUP_ADMIN_PM in config.txt ~Carn - if(config.popup_admin_pm) + if(GLOB.configuration.general.popup_admin_pm) spawn(0) //so we don't hold the caller proc up var/sender = src var/sendername = key diff --git a/code/modules/admin/verbs/possess.dm b/code/modules/admin/verbs/possess.dm index 76287e1da17..45e93ce8c47 100644 --- a/code/modules/admin/verbs/possess.dm +++ b/code/modules/admin/verbs/possess.dm @@ -6,7 +6,7 @@ return if(istype(O,/obj/singularity)) - if(config.forbid_singulo_possession) + if(GLOB.configuration.general.forbid_singulo_possession) // I love how this needs to exist to_chat(usr, "It is forbidden to possess singularities.") return diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 507a5da0cb9..d2b1d53b49a 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -203,7 +203,7 @@ /proc/cmd_admin_mute(mob/M as mob, mute_type, automute = 0) if(automute) - if(!config.automute_on) + if(!GLOB.configuration.general.enable_auto_mute) return else if(!usr || !usr.client) @@ -276,24 +276,24 @@ return var/action="" - if(config.antag_hud_allowed) + if(GLOB.configuration.general.allow_antag_hud) for(var/mob/dead/observer/g in get_ghosts()) if(!g.client.holder) //Remove the verb from non-admin ghosts g.verbs -= /mob/dead/observer/verb/toggle_antagHUD if(g.antagHUD) g.antagHUD = FALSE // Disable it on those that have it enabled g.has_enabled_antagHUD = 2 // We'll allow them to respawn - to_chat(g, "The Administrator has disabled AntagHUD ") - config.antag_hud_allowed = 0 + to_chat(g, "The Administrators have disabled AntagHUD ") + GLOB.configuration.general.allow_antag_hud = FALSE to_chat(src, "AntagHUD usage has been disabled") action = "disabled" else for(var/mob/dead/observer/g in get_ghosts()) if(!g.client.holder) // Add the verb back for all non-admin ghosts g.verbs += /mob/dead/observer/verb/toggle_antagHUD - to_chat(g, "The Administrator has enabled AntagHUD ")// Notify all observers they can now use AntagHUD + to_chat(g, "The Administrators have enabled AntagHUD ")// Notify all observers they can now use AntagHUD - config.antag_hud_allowed = 1 + GLOB.configuration.general.allow_antag_hud = TRUE action = "enabled" to_chat(src, "AntagHUD usage has been enabled") @@ -310,11 +310,11 @@ return var/action="" - if(config.antag_hud_restricted) + if(GLOB.configuration.general.restrict_antag_hud_rejoin) for(var/mob/dead/observer/g in get_ghosts()) to_chat(g, "The administrator has lifted restrictions on joining the round if you use AntagHUD") action = "lifted restrictions" - config.antag_hud_restricted = 0 + GLOB.configuration.general.restrict_antag_hud_rejoin = FALSE to_chat(src, "AntagHUD restrictions have been lifted") else for(var/mob/dead/observer/g in get_ghosts()) @@ -323,7 +323,7 @@ g.antagHUD = FALSE g.has_enabled_antagHUD = 0 action = "placed restrictions" - config.antag_hud_restricted = 1 + GLOB.configuration.general.restrict_antag_hud_rejoin = TRUE to_chat(src, "AntagHUD restrictions have been enabled") log_admin("[key_name(usr)] has [action] on joining the round if they use AntagHUD") @@ -1029,7 +1029,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(H.client == null || H.stat == DEAD) // No clientless or dead continue mins_afk = round(H.client.inactivity / 600) - if(mins_afk < config.list_afk_minimum) + if(mins_afk < 5) continue if(H.job) job_string = H.job diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 1efd85dd1e3..b1d64f9abf9 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -126,7 +126,8 @@ log_href("[src] (usr:[usr]\[[COORD(usr)]\]) : [hsrc ? "[hsrc] " : ""][href]") if(href_list["karmashop"]) - if(config.disable_karma) + if(!GLOB.configuration.general.enable_karma) + to_chat(src, "Karma is disabled on this server.") return switch(href_list["karmashop"]) @@ -218,7 +219,7 @@ to_chat(src, "You are sending messages to quickly. Please wait [wait_time] [wait_time == 1 ? "second" : "seconds"] before sending another message.") return 1 last_message_time = world.time - if(config.automute_on && !check_rights(R_ADMIN, 0) && last_message == message) + if(GLOB.configuration.general.enable_auto_mute && !check_rights(R_ADMIN, 0) && last_message == message) last_message_count++ if(last_message_count >= SPAM_TRIGGER_AUTOMUTE) to_chat(src, "You have exceeded the spam filter limit for identical messages. An auto-mute was applied.") @@ -259,7 +260,7 @@ return null if(byond_version < MIN_CLIENT_VERSION) // Too out of date to play at all. Unfortunately, we can't send them a message here. version_blocked = TRUE - if(byond_build < config.minimum_client_build) + if(byond_build < GLOB.configuration.general.minimum_client_build) version_blocked = TRUE var/show_update_prompt = FALSE @@ -306,10 +307,6 @@ spawn() // Goonchat does some non-instant checks in start() chatOutput.start() - if( (world.address == address || !address) && !GLOB.host ) - GLOB.host = key - world.update_status() - if(holder) on_holder_add() add_admin_verbs() @@ -383,7 +380,7 @@ playercount += 1 // Update the state of the panic bunker based on current playercount - var/threshold = config.panic_bunker_threshold + var/threshold = GLOB.configuration.general.panic_bunker_threshold if((playercount > threshold) && (GLOB.panic_bunker_enabled == FALSE)) GLOB.panic_bunker_enabled = TRUE @@ -465,7 +462,7 @@ /client/proc/donor_loadout_points() if(donator_level > 0 && prefs) - prefs.max_gear_slots = config.max_loadout_points + 5 + prefs.max_gear_slots = GLOB.configuration.general.base_loadout_points + 5 /client/proc/log_client_to_db(connectiontopic) set waitfor = FALSE // This needs to run async because any sleep() inside /client/New() breaks stuff badly @@ -567,8 +564,9 @@ //New player!! Need to insert all the stuff // Check new peeps for panic bunker + // AA TODO: Move this to world.IsBanned() if(GLOB.panic_bunker_enabled) - var/threshold = config.panic_bunker_threshold + var/threshold = GLOB.configuration.general.panic_bunker_threshold src << "Server is not accepting connections from never-before-seen players until player count is less than [threshold]. Please try again later." qdel(src) return // Dont insert or they can just go in again @@ -614,11 +612,11 @@ if(ip_intel >= GLOB.configuration.ipintel.bad_rating) var/detailsurl = GLOB.configuration.ipintel.details_url ? "(IP Info)" : "" if(GLOB.configuration.ipintel.whitelist_mode) - // TODO: move this check to world.IsBanned() + // AA TODO: move this check to world.IsBanned() spawn(40) // This is necessary because without it, they won't see the message, and addtimer cannot be used because the timer system may not have initialized yet message_admins("IPIntel: [key_name_admin(src)] on IP [address] was rejected. [detailsurl]") var/blockmsg = "Error: proxy/VPN detected. Proxy/VPN use is not allowed here. Deactivate it before you reconnect." - if(GLOB?.configuration?.url.banappeals_url) + if(GLOB.configuration.url.banappeals_url) blockmsg += "\nIf you are not actually using a proxy/VPN, or have no choice but to use one, request whitelisting at: [GLOB.configuration.url.banappeals_url]" to_chat(src, blockmsg) qdel(src) @@ -627,7 +625,7 @@ /client/proc/check_forum_link() - if(!GLOB?.configuration?.url.forum_link_url || !prefs || prefs.fuid) + if(!GLOB.configuration.url.forum_link_url || !prefs || prefs.fuid) return if(GLOB.configuration.jobs.enable_exp_tracking) var/living_hours = get_exp_type_num(EXP_TYPE_LIVING) / 60 @@ -663,7 +661,7 @@ return tokenstr /client/proc/link_forum_account(fromban) - if(!GLOB?.configuration?.url.forum_link_url) + if(!GLOB.configuration.url.forum_link_url) return if(IsGuestKey(key)) to_chat(src, "Guest keys cannot be linked.") @@ -709,7 +707,7 @@ if(connection != "seeker") //Invalid connection type. return null topic = params2list(topic) - if(!config.check_randomizer) + if(!GLOB.configuration.general.enabled_cid_randomiser_buster) return // Stash o' ckeys var/static/cidcheck = list() @@ -842,7 +840,7 @@ //Send resources to the client. /client/proc/send_resources() // Change the way they should download resources. - if(GLOB?.configuration?.url.rsc_urls) + if(length(GLOB.configuration.url.rsc_urls)) preload_rsc = pick(GLOB.configuration.url.rsc_urls) else preload_rsc = 1 // If config.resource_urls is not set, preload like normal. @@ -949,7 +947,7 @@ void.UpdateGreed(actualview[1],actualview[2]) /client/proc/send_ssd_warning(mob/M) - if(!config.ssd_warning) + if(!GLOB.configuration.general.ssd_warning) return FALSE if(ssd_warning_acknowledged) return FALSE @@ -1102,7 +1100,7 @@ qdel(query_age) // Notify admins on new clients connecting, if the byond account age is less than a config value - if(notify && (byondacc_age < config.byond_account_age_threshold)) + if(notify && (byondacc_age < GLOB.configuration.general.byond_account_age_threshold)) message_admins("[key] has just connected for the first time. BYOND account registered on [byondacc_date] ([byondacc_age] days old)") /client/proc/show_update_notice() @@ -1149,7 +1147,7 @@ */ /client/proc/cid_count_check() // If the config is 0, disable this - if(config.max_client_cid_history == 0) + if(GLOB.configuration.general.max_client_cid_history == 0) return // If we have no DB, dont even bother @@ -1169,7 +1167,7 @@ cidcount = query_cidcheck.item[1] qdel(query_cidcheck) - if(cidcount > config.max_client_cid_history) + if(cidcount > GLOB.configuration.general.max_client_cid_history) // Check their notes for CID tracking in the past var/has_note = FALSE var/note_text = "" diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index 777cfca0cae..3881c7b7409 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -212,7 +212,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts parent = C b_type = pick(4;"O-", 36;"O+", 3;"A-", 28;"A+", 1;"B-", 20;"B+", 1;"AB-", 5;"AB+") - max_gear_slots = config.max_loadout_points + max_gear_slots = GLOB.configuration.general.base_loadout_points var/loaded_preferences_successfully = FALSE if(istype(C)) if(!IsGuestKey(C.key)) @@ -470,7 +470,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts dat += "Ghost PDA: [(toggles & PREFTOGGLE_CHAT_GHOSTPDA) ? "All PDA Messages" : "No PDA Messages"]
" if(check_rights(R_ADMIN,0)) dat += "OOC Color:     Change
" - if(config.allow_Metadata) + if(GLOB.configuration.general.allow_character_metadata) dat += "OOC Notes: Edit
" dat += "Parallax (Fancy Space): " switch (parallax) @@ -1099,7 +1099,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts ResetJobs() SetChoices(user) if("learnaboutselection") - if(GLOB?.configuration?.url.wiki_url) + if(GLOB.configuration.url.wiki_url) if(alert("Would you like to open the Job selection info in your browser?", "Open Job Selection", "Yes", "No") == "Yes") user << link("[GLOB.configuration.url.wiki_url]/index.php/Job_Selection_and_Assignment") else diff --git a/code/modules/error_handler/error_viewer.dm b/code/modules/error_handler/error_viewer.dm index 96a228a8bff..7c28ff890d0 100644 --- a/code/modules/error_handler/error_viewer.dm +++ b/code/modules/error_handler/error_viewer.dm @@ -115,8 +115,7 @@ GLOBAL_DATUM(error_cache, /datum/ErrorViewer/ErrorCache) // Show the error to admins with debug messages turned on, but only if one // from the same source hasn't been shown too recently - // (Also, make sure config is initialized, or log_debug will runtime) - if(config && error_source.next_message_at <= world.time) + if(error_source.next_message_at <= world.time) var/const/viewtext = "\[view]" // Nesting these in other brackets went poorly log_debug("Runtime in [e.file],[e.line]: [html_encode(e.name)] [error_entry.makeLink(viewtext)]") error_source.next_message_at = world.time + ERROR_MSG_DELAY diff --git a/code/modules/events/event.dm b/code/modules/events/event.dm index 309f85a963c..b2d744b9e34 100644 --- a/code/modules/events/event.dm +++ b/code/modules/events/event.dm @@ -40,11 +40,6 @@ return clamp((weight + job_weight) * weight_mod, min_weight, max_weight) -/datum/event_meta/alien/get_weight(list/active_with_role) - if(GLOB.aliens_allowed) - return ..(active_with_role) - return 0 - /*/datum/event_meta/ninja/get_weight(var/list/active_with_role) if(toggle_space_ninja) return ..(active_with_role) diff --git a/code/modules/food_and_drinks/food/foods/meat.dm b/code/modules/food_and_drinks/food/foods/meat.dm index a9f0ab3d684..31cdb6fd331 100644 --- a/code/modules/food_and_drinks/food/foods/meat.dm +++ b/code/modules/food_and_drinks/food/foods/meat.dm @@ -293,9 +293,9 @@ return 1 /obj/item/reagent_containers/food/snacks/monkeycube/proc/Expand() - if(LAZYLEN(SSmobs.cubemonkeys) >= config.cubemonkeycap) + if(LAZYLEN(SSmobs.cubemonkeys) >= GLOB.configuration.general.monkey_cube_cap) if(fingerprintslast) - to_chat(get_mob_by_ckey(fingerprintslast), "Bluespace harmonics prevent the spawning of more than [config.cubemonkeycap] monkeys on the station at one time!") + to_chat(get_mob_by_ckey(fingerprintslast), "Bluespace harmonics prevent the spawning of more than [GLOB.configuration.general.monkey_cube_cap] monkeys on the station at one time!") else visible_message("[src] fails to expand!") return diff --git a/code/modules/hydroponics/grown/replicapod.dm b/code/modules/hydroponics/grown/replicapod.dm index 75d091a7f52..e3592346271 100644 --- a/code/modules/hydroponics/grown/replicapod.dm +++ b/code/modules/hydroponics/grown/replicapod.dm @@ -58,7 +58,7 @@ var/obj/machinery/hydroponics/parent = loc var/make_podman = 0 var/ckey_holder = null - if(config.revival_pod_plants) + if(GLOB.configuration.general.enable_revival_pod_plants) if(ckey) for(var/mob/M in GLOB.player_list) if(isobserver(M)) diff --git a/code/modules/karma/karma.dm b/code/modules/karma/karma.dm index de8b42f04ae..373de4e7bcb 100644 --- a/code/modules/karma/karma.dm +++ b/code/modules/karma/karma.dm @@ -78,7 +78,7 @@ GLOBAL_LIST_EMPTY(karma_spenders) if(!client) to_chat(src, "You can't award karma without being connected.") return FALSE - if(config.disable_karma) + if(!GLOB.configuration.general.enable_karma) to_chat(src, "Karma is disabled.") return FALSE if(!SSticker || !GLOB.player_list.len || (SSticker.current_state == GAME_STATE_PREGAME)) @@ -150,7 +150,7 @@ GLOBAL_LIST_EMPTY(karma_spenders) if(!M) to_chat(usr, "Please right click a mob to award karma directly, or use the 'Award Karma' verb to select a player from the player listing.") return - if(config.disable_karma) // this is here because someone thought it was a good idea to add an alert box before checking if they can even give a mob karma + if(!GLOB.configuration.general.enable_karma) // this is here because someone thought it was a good idea to add an alert box before checking if they can even give a mob karma to_chat(usr, "Karma is disabled.") return if(alert("Give [M.name] good karma?", "Karma", "Yes", "No") != "Yes") @@ -171,6 +171,7 @@ GLOBAL_LIST_EMPTY(karma_spenders) special_role = M.mind.special_role if(M.mind.assigned_role) assigned_role = M.mind.assigned_role + // AA TODO: Make this use proper RUSTG logging. Why is this a normal file write these are so expensive aaaaaaaaa karma_diary << "[M.name] ([M.key]) [assigned_role]/[special_role]: [M.client.karma] - [time2text(world.timeofday, "hh:mm:ss")] given by [key]" sql_report_karma(src, M) @@ -180,7 +181,7 @@ GLOBAL_LIST_EMPTY(karma_spenders) set desc = "Reports how much karma you have accrued." set category = "Special Verbs" - if(config.disable_karma) + if(!GLOB.configuration.general.enable_karma) to_chat(src, "Karma is disabled.") return @@ -216,7 +217,7 @@ GLOBAL_LIST_EMPTY(karma_spenders) set desc = "Spend your hard-earned karma here" set hidden = TRUE - if(config.disable_karma) + if(!GLOB.configuration.general.enable_karma) to_chat(src, "Karma is disabled.") return karmashopmenu() diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 08324fb937a..d9f73d19a0d 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -162,7 +162,7 @@ Works together with spawning an observer, noted above. else GLOB.non_respawnable_keys[ckey] = 1 ghost.key = key - if(!(ghost.client && ghost.client.holder) && !config.antag_hud_allowed) // For new ghosts we remove the verb from even showing up if it's not allowed. + if(!(ghost.client && ghost.client.holder) && !GLOB.configuration.general.allow_antag_hud) // For new ghosts we remove the verb from even showing up if it's not allowed. ghost.verbs -= /mob/dead/observer/verb/toggle_antagHUD // Poor guys, don't know what they are missing! return ghost @@ -354,7 +354,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set category = "Ghost" set name = "Toggle AntagHUD" set desc = "Toggles AntagHUD allowing you to see who is the antagonist" - if(!config.antag_hud_allowed && !client.holder) + if(!GLOB.configuration.general.allow_antag_hud && !client.holder) to_chat(src, "Admins have disabled this for this round.") return if(!client) @@ -363,7 +363,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(jobban_isbanned(M, "AntagHUD")) to_chat(src, "You have been banned from using this feature") return - if(config.antag_hud_restricted && !M.has_enabled_antagHUD && !check_rights(R_ADMIN|R_MOD,0)) + if(GLOB.configuration.general.restrict_antag_hud_rejoin && !M.has_enabled_antagHUD && !check_rights(R_ADMIN|R_MOD,0)) var/response = alert(src, "If you turn this on, you will not be able to take any part in the round.","Are you sure you want to turn this feature on?","Yes","No") if(response == "No") return M.can_reenter_corpse = 0 diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm index 05d34a4e301..beb9564ef86 100644 --- a/code/modules/mob/emote.dm +++ b/code/modules/mob/emote.dm @@ -116,7 +116,7 @@ return if(!src.client.holder) - if(!config.dsay_allowed) + if(!GLOB.dsay_enabled) to_chat(src, "Deadchat is globally muted") return diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index b188c7bac72..271524ad61d 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -13,7 +13,7 @@ /mob/living/carbon/brain/Life() . = ..() if(.) - if(!container && (world.time - timeofhostdeath) > config.revival_brain_life) + if(!container && (world.time - timeofhostdeath) > GLOB.configuration.general.revival_brain_life) death() /mob/living/carbon/brain/breathe() diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 8877281fd39..1519cd7524f 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1126,8 +1126,6 @@ so that different stomachs can handle things in different ways VB*/ //to recalculate and update the mob's total tint from tinted equipment it's wearing. /mob/living/carbon/proc/update_tint() - if(!GLOB.tinted_weldhelh) - return var/tinttotal = get_total_tint() if(tinttotal >= TINT_BLIND) overlay_fullscreen("tint", /obj/screen/fullscreen/blind) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index e7e16827ab3..af08d497944 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -520,14 +520,14 @@ return -/mob/living/proc/Examine_OOC() +/mob/living/verb/Examine_OOC() set name = "Examine Meta-Info (OOC)" set category = "OOC" set src in view() - if(config.allow_Metadata) + if(GLOB.configuration.general.allow_character_metadata) if(client) - to_chat(usr, "[src]'s Metainfo:
[client.prefs.metadata]") + to_chat(usr, "[src]'s Metainfo:
[sanitize(client.prefs.metadata)]") else to_chat(usr, "[src] does not have any stored infomation!") else diff --git a/code/modules/mob/living/silicon/laws.dm b/code/modules/mob/living/silicon/laws.dm index 038a121a042..046c215f969 100644 --- a/code/modules/mob/living/silicon/laws.dm +++ b/code/modules/mob/living/silicon/laws.dm @@ -125,11 +125,10 @@ laws.sort_laws() /mob/living/silicon/proc/make_laws() - switch(config.default_laws) - if(0) - laws = new /datum/ai_laws/crewsimov() - else - laws = get_random_lawset() + if(GLOB.configuration.general.random_ai_lawset) + laws = get_random_lawset() + else + laws = new /datum/ai_laws/crewsimov() /mob/living/silicon/proc/get_random_lawset() var/list/law_options[0] diff --git a/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm b/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm index f4e7e140be9..19b9b8e8ab2 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm @@ -1,3 +1,6 @@ +#define DRONE_BUILD_TIME 2 MINUTES +#define MAX_MAINT_DRONES 5 + /obj/machinery/drone_fabricator name = "drone fabricator" desc = "A large automated factory for producing maintenance drones." @@ -37,14 +40,14 @@ icon_state = "drone_fab_active" var/elapsed = world.time - time_last_drone - drone_progress = round((elapsed / config.drone_build_time) * 100) + drone_progress = round((elapsed / DRONE_BUILD_TIME) * 100) if(drone_progress >= 100) visible_message("[src] voices a strident beep, indicating a drone chassis is prepared.") /obj/machinery/drone_fabricator/examine(mob/user) . = ..() - if(produce_drones && drone_progress >= 100 && isobserver(user) && config.allow_drone_spawn && count_drones() < config.max_maint_drones) + if(produce_drones && drone_progress >= 100 && isobserver(user) && count_drones() < MAX_MAINT_DRONES) . += "
A drone is prepared. Select 'Join As Drone' from the Ghost tab to spawn as a maintenance drone." /obj/machinery/drone_fabricator/proc/count_drones() @@ -58,7 +61,7 @@ if(stat & NOPOWER) return - if(!produce_drones || !config.allow_drone_spawn || count_drones() >= config.max_maint_drones) + if(!produce_drones || count_drones() >= MAX_MAINT_DRONES) return if(!player || !isobserver(player.mob)) @@ -80,10 +83,6 @@ set name = "Join As Drone" set desc = "If there is a powered, enabled fabricator in the game world with a prepared chassis, join as a maintenance drone." - if(!(config.allow_drone_spawn)) - to_chat(src, "That verb is not currently permitted.") - return - if(stat != DEAD) return @@ -141,7 +140,7 @@ if(DF.stat & NOPOWER || !DF.produce_drones) continue - if(DF.count_drones() >= config.max_maint_drones) + if(DF.count_drones() >= MAX_MAINT_DRONES) to_chat(src, "There are too many active drones in the world for you to spawn.") return @@ -150,3 +149,6 @@ return to_chat(src, "There are no available drone spawn points, sorry.") + +#undef DRONE_BUILD_TIME +#undef MAX_MAINT_DRONES diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 06c62d569c3..aeb51e55d8c 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -139,12 +139,22 @@ update_controls() /mob/living/simple_animal/bot/New() + /* + HEY! LISTEN! + + I see you're poking the the bot/New() proc + Assuming you are converting this to Initialize() [yay], please see my note in + code\game\jobs\job\job.dm | /datum/job/proc/get_access() + + Theres a useless check that bugs me but needs to exist because these things New() + -AA07 + */ ..() GLOB.bots_list += src icon_living = icon_state icon_dead = icon_state access_card = new /obj/item/card/id(src) -//This access is so bots can be immediately set to patrol and leave Robotics, instead of having to be let out first. + //This access is so bots can be immediately set to patrol and leave Robotics, instead of having to be let out first. access_card.access += ACCESS_ROBOTICS set_custom_texts() Radio = new/obj/item/radio/headset/bot(src) diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 01a7a0f167a..493fbff4615 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -16,7 +16,7 @@ if( (M.computer_id == client.computer_id) ) if(matches) matches += " and " matches += "ID ([client.computer_id])" - if(!config.disable_cid_warn_popup) + if(!GLOB.configuration.general.disable_cid_warning_popup) spawn() alert("You have logged in already with another key this round, please log out of this one NOW or risk being banned!") if(matches) if(M.client) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 601b73a3a38..fa5a45b80f6 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -749,7 +749,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ set name = "Respawn" set category = "OOC" - if(!GLOB.abandon_allowed) + if(!GLOB.configuration.general.respawn_enabled) to_chat(usr, "Respawning is disabled.") return @@ -1003,7 +1003,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ // this function displays the station time in the status panel /mob/proc/show_stat_station_time() - stat(null, "Round Time: [worldtime2text()]") + stat(null, "Round Time: [worldtime2text()]") // AA TODO: Make this do "Game Time" and "Round Time" with the ROUND_TIME macro stat(null, "Station Time: [station_time_timestamp()]") // this function displays the shuttles ETA in the status panel if the shuttle has been called diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 146f5562c54..df8c8380307 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -79,7 +79,7 @@ /proc/cannotPossess(A) var/mob/dead/observer/G = A - if(G.has_enabled_antagHUD == 1 && config.antag_hud_restricted) + if(G.has_enabled_antagHUD == 1 && GLOB.configuration.general.restrict_antag_hud_rejoin) return 1 return 0 diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 97878b63200..20b50d39178 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -192,7 +192,7 @@ client.prefs.real_name = random_name(client.prefs.gender,client.prefs.species) observer.real_name = client.prefs.real_name observer.name = observer.real_name - if(!client.holder && !config.antag_hud_allowed) // For new ghosts we remove the verb from even showing up if it's not allowed. + if(!client.holder && !GLOB.configuration.general.allow_antag_hud) // For new ghosts we remove the verb from even showing up if it's not allowed. observer.verbs -= /mob/dead/observer/verb/toggle_antagHUD // Poor guys, don't know what they are missing! observer.key = key QDEL_NULL(mind) diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index 2ebf4708e83..e199e81eb69 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -47,7 +47,7 @@ /mob/proc/say_dead(message) if(client) if(!client.holder) - if(!config.dsay_allowed) + if(!GLOB.dsay_enabled) to_chat(src, "Deadchat is globally muted.") return diff --git a/code/modules/newscaster/obj/newspaper.dm b/code/modules/newscaster/obj/newspaper.dm index 20645ccfd9c..aa7eb1bf2bf 100644 --- a/code/modules/newscaster/obj/newspaper.dm +++ b/code/modules/newscaster/obj/newspaper.dm @@ -115,7 +115,7 @@ dat+= "
Previous Page
" else // No trailing punctuation so that it's easy to copy and paste the address - if(GLOB?.configuration?.url.github_url) + if(GLOB.configuration.url.github_url) dat += "We're sorry to break your immersion, but there has been an error with the newscaster. Please report this error, along with any more information you have, to [GLOB.configuration.url.github_url]/issues/new?template=bug_report.md" else dat += "We're sorry to break your immersion, but there has been an error with the newscaster. Unfortunately there is no GitHub URL set in the config. This is really bad." diff --git a/code/modules/research/xenobiology/xenobio_camera.dm b/code/modules/research/xenobiology/xenobio_camera.dm index 52b220b866b..af140aa0ced 100644 --- a/code/modules/research/xenobiology/xenobio_camera.dm +++ b/code/modules/research/xenobiology/xenobio_camera.dm @@ -233,8 +233,8 @@ var/obj/machinery/computer/camera_advanced/xenobio/X = target if(GLOB.cameranet.checkTurfVis(remote_eye.loc)) - if(LAZYLEN(SSmobs.cubemonkeys) >= config.cubemonkeycap) - to_chat(owner, "Bluespace harmonics prevent the spawning of more than [config.cubemonkeycap] monkeys on the station at one time!") + if(LAZYLEN(SSmobs.cubemonkeys) >= GLOB.configuration.general.monkey_cube_cap) + to_chat(owner, "Bluespace harmonics prevent the spawning of more than [GLOB.configuration.general.monkey_cube_cap] monkeys on the station at one time!") return else if(X.monkeys >= 1) var/mob/living/carbon/human/monkey/food = new /mob/living/carbon/human/monkey(remote_eye.loc) diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm index ee2ee4a6e76..1f6dde3146a 100644 --- a/code/modules/surgery/organs/organ_external.dm +++ b/code/modules/surgery/organs/organ_external.dm @@ -400,7 +400,7 @@ Note that amputating the affected organ does in fact remove the infection from t //Updates brute_damn and burn_damn from wound damages. Updates BLEEDING status. /obj/item/organ/external/proc/check_fracture(damage_inflicted) - if(config.bones_can_break && brute_dam > min_broken_damage && !is_robotic()) + if(GLOB.configuration.general.breakable_bones && brute_dam > min_broken_damage && !is_robotic()) if(prob(damage_inflicted)) fracture() diff --git a/code/modules/world_topic/status.dm b/code/modules/world_topic/status.dm index dfdac284a29..21ae580b546 100644 --- a/code/modules/world_topic/status.dm +++ b/code/modules/world_topic/status.dm @@ -6,7 +6,7 @@ var/list/admins = list() status_info["version"] = GLOB.revision_info.commit_hash status_info["mode"] = GLOB.master_mode - status_info["respawn"] = GLOB.abandon_allowed + status_info["respawn"] = GLOB.configuration.general.respawn_enabled status_info["enter"] = GLOB.enter_allowed status_info["vote"] = GLOB.configuration.vote.allow_mode_votes status_info["ai"] = GLOB.configuration.jobs.allow_ai diff --git a/config/example/config.toml b/config/example/config.toml index 6be4ab1fc30..f15b043d1d1 100644 --- a/config/example/config.toml +++ b/config/example/config.toml @@ -368,8 +368,8 @@ monkey_cube_cap = 32 reactionary_explosions = true # Bomb cap for explosions (Outer devastation. Other values calculate from this) bomb_cap = 20 -# Amount of time (in hundreths of a second [why]) for a brain to keep its "spark of life". Set to -1 to disable. -revival_brain_life = 60000 # 10 minutes +# Amount of time (deciseconds) for a brain to keep its "spark of life". Set to -1 to disable. +revival_brain_life = 6000 # 10 minutes # Enable random silicon lawset (If said lawset has default = TRUE in the code). Disable for always crewsimov random_ai_lawset = true diff --git a/interface/interface.dm b/interface/interface.dm index 0388d62973f..ebb73e820a9 100644 --- a/interface/interface.dm +++ b/interface/interface.dm @@ -3,7 +3,7 @@ set name = "wiki" set desc = "Type what you want to know about. This will open the wiki in your web browser." set hidden = 1 - if(GLOB?.configuration?.url.wiki_url) + if(GLOB.configuration.url.wiki_url) var/query = stripped_input(src, "Enter Search:", "Wiki Search", "Homepage") if(query == "Homepage") src << link(GLOB.configuration.url.wiki_url) @@ -18,9 +18,9 @@ set name = "forum" set desc = "Visit the forum." set hidden = 1 - if(GLOB?.configuration?.url.forum_url) + if(GLOB.configuration.url.forum_url) if(alert("Open the forum in your browser?", null, "Yes", "No") == "Yes") - if(GLOB?.configuration?.url.forum_link_url && prefs && !prefs.fuid) + if(GLOB.configuration.url.forum_link_url && prefs && !prefs.fuid) link_forum_account() src << link(GLOB.configuration.url.forum_url) else @@ -30,7 +30,7 @@ set name = "Rules" set desc = "View the server rules." set hidden = 1 - if(GLOB?.configuration?.url.rules_url) + if(GLOB.configuration.url.rules_url) if(alert("This will open the rules in your browser. Are you sure?", null, "Yes", "No") == "No") return src << link(GLOB.configuration.url.rules_url) @@ -41,7 +41,7 @@ set name = "GitHub" set desc = "Visit the GitHub page." set hidden = 1 - if(GLOB?.configuration?.url.github_url) + if(GLOB.configuration.url.github_url) if(alert("This will open our GitHub repository in your browser. Are you sure?", null, "Yes", "No") == "No") return src << link(GLOB.configuration.url.github_url) @@ -55,11 +55,11 @@ var/durl // Use normal URL - if(GLOB?.configuration?.url.discord_url) + if(GLOB.configuration.url.discord_url) durl = GLOB.configuration.url.discord_url // Use forums URL if set - if(GLOB?.configuration?.url.forum_link_url && GLOB?.configuration?.url.discord_forum_url && prefs?.fuid) + if(GLOB.configuration.url.forum_link_url && GLOB.configuration?.url.discord_forum_url && prefs?.fuid) durl = GLOB.configuration.url.discord_forum_url if(!durl) @@ -73,7 +73,7 @@ set name = "Donate" set desc = "Donate to help with hosting costs." set hidden = 1 - if(GLOB?.configuration?.url.donations_url) + if(GLOB.configuration.url.donations_url) if(alert("This will open the donation page in your browser. Are you sure?", null, "Yes", "No") == "No") return src << link(GLOB.configuration.url.donations_url) diff --git a/paradise.dme b/paradise.dme index ba08f990e36..2592dbf72ff 100644 --- a/paradise.dme +++ b/paradise.dme @@ -176,7 +176,6 @@ #include "code\_onclick\hud\screen_objects.dm" #include "code\_onclick\hud\slime.dm" #include "code\_onclick\hud\swarmer.dm" -#include "code\controllers\configuration.dm" #include "code\controllers\controller.dm" #include "code\controllers\failsafe.dm" #include "code\controllers\globals.dm" @@ -193,6 +192,7 @@ #include "code\controllers\configuration\sections\event_configuration.dm" #include "code\controllers\configuration\sections\gamemode_configuration.dm" #include "code\controllers\configuration\sections\gateway_configuration.dm" +#include "code\controllers\configuration\sections\general_configuration.dm" #include "code\controllers\configuration\sections\ipintel_configuration.dm" #include "code\controllers\configuration\sections\job_configuration.dm" #include "code\controllers\configuration\sections\logging_configuration.dm"