upstream-merge-16484 [MDB IGNORE] (#9289)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
Selis
2024-10-25 21:39:18 +02:00
committed by GitHub
parent b32c1ed032
commit 026253a175
277 changed files with 471452 additions and 36179 deletions

View File

@@ -6,9 +6,9 @@ var/datum/controller/transfer_controller/transfer_controller
var/shift_hard_end = 0 //VOREStation Edit
var/shift_last_vote = 0 //VOREStation Edit
/datum/controller/transfer_controller/New()
timerbuffer = CONFIG_GET(number/vote_autotransfer_initial) // CHOMPEdit
timerbuffer = CONFIG_GET(number/vote_autotransfer_initial)
shift_hard_end = CONFIG_GET(number/vote_autotransfer_initial) + (CONFIG_GET(number/vote_autotransfer_interval) * 2) //CHOMPStation Edit //Change this "1" to how many extend votes you want there to be. //Note: Fuck you whoever just slapped a number here instead of using the FUCKING CONFIG LIKE ALL THE OTHER NUMBERS HERE
shift_last_vote = shift_hard_end - CONFIG_GET(number/vote_autotransfer_interval) //VOREStation Edit // CHOMPEdit
shift_last_vote = shift_hard_end - CONFIG_GET(number/vote_autotransfer_interval) //VOREStation Edit
START_PROCESSING(SSprocessing, src)
/datum/controller/transfer_controller/Destroy()
@@ -23,9 +23,9 @@ var/datum/controller/transfer_controller/transfer_controller
to_world(span_world(span_notice("Warning: This upcoming round-extend vote will be your last chance to vote for shift extension. Wrap up your scenes in the next 60 minutes if the round is extended."))) //CHOMPStation Edit
if (round_duration_in_ds >= shift_hard_end - 1 MINUTE)
init_shift_change(null, 1)
shift_hard_end = timerbuffer + CONFIG_GET(number/vote_autotransfer_interval) //If shuttle somehow gets recalled, let's force it to call again next time a vote would occur. // CHOMPEdit
timerbuffer = timerbuffer + CONFIG_GET(number/vote_autotransfer_interval) //Just to make sure a vote doesn't occur immediately afterwords. // CHOMPEdit
shift_hard_end = timerbuffer + CONFIG_GET(number/vote_autotransfer_interval) //If shuttle somehow gets recalled, let's force it to call again next time a vote would occur.
timerbuffer = timerbuffer + CONFIG_GET(number/vote_autotransfer_interval) //Just to make sure a vote doesn't occur immediately afterwords.
else if (round_duration_in_ds >= timerbuffer - 1 MINUTE)
SSvote.start_vote(new /datum/vote/crew_transfer)
//VOREStation Edit END
timerbuffer = timerbuffer + CONFIG_GET(number/vote_autotransfer_interval) // CHOMPEdit
timerbuffer = timerbuffer + CONFIG_GET(number/vote_autotransfer_interval)

View File

@@ -46,8 +46,8 @@
/datum/config_entry/number/max_concurrent_queries/ValidateAndSet(str_val)
. = ..()
if (.)
SSdbcore.max_concurrent_queries = config_entry_value
//if (.) TODO: ENABLE THIS IN FUTURE DB PRs
//SSdbcore.max_concurrent_queries = config_entry_value TODO: ENABLE THIS IN FUTURE DB PRs
/// The exe for mariadbd.exe.
/// Shouldn't really be set on production servers, primarily for EZDB.

View File

@@ -12,12 +12,10 @@
/datum/config_entry/flag/limbs_can_break
/datum/config_entry/number/organ_health_multiplier
integer = FALSE
default = 1.0
default = 1
/datum/config_entry/number/organ_regeneration_multiplier
integer = FALSE
default = 1.0
default = 1
// FIXME: Unused
///datum/config_entry/flag/revival_pod_plants

View File

@@ -51,6 +51,9 @@
/// logs world.log to a file
/datum/config_entry/flag/log_runtime
/// logs sql stuff
/datum/config_entry/flag/log_sql
/// log to_world_log(messages)
/datum/config_entry/flag/log_world_output
@@ -571,7 +574,7 @@
/// 0 / RAD_RESIST_CALC_DIV = Each turf absorbs some fraction of the working radiation level
/// 1 / RAD_RESIST_CALC_SUB = Each turf absorbs a fixed amount of radiation
/datum/config_entry/flag/radiation_resistance_calc_mode
default = RAD_RESIST_CALC_DIV
default = RAD_RESIST_CALC_DIV // CHOMPEdit
/datum/config_entry/flag/radiation_resistance_calc_mode/ValidateAndSet(str_val)
if(!VASProcCallGuard(str_val))

View File

@@ -34,7 +34,7 @@
/// Hours
/datum/config_entry/number/pto_cap
default = 200
default = 200 // CHOMPEdit
protection = CONFIG_ENTRY_LOCKED
/datum/config_entry/flag/require_flavor

View File

@@ -1,125 +0,0 @@
// Making this file to allow us to easily understand the location of any modifications to the config file made by Chompers and to try and prevent any conflicts happening in the future.
// Basically a copy pasta from virgo's configuration.dm file but it'll make life easer for us to just toggle on/off.
/datum/configuration
var/discord_restriction = FALSE
var/use_jobwhitelist = TRUE
var/emojis = FALSE
var/vorefootstep_volume = 75 //In future see about making a function to adjust volume serverside in config.txt, easy to do with reenable values. - Jack
var/nodebot_enabled = 0 //So, nodebot is a supplement to the TGS discord bot pretty much. For things likes faxes and the manifest it's very helpful because it's able to render html into an image and post it.
var/nodebot_location //We need to print the manifest to this location so nodebot can render it to chat. //NOTE: TO BE REPLACED BY BETTER CODE FOR FETCHING MANIFEST
//These are for tgs4 channels, for discord chatbots used in TGS.
var/ahelp_channel_tag
var/fax_channel_tag
var/role_request_channel_tag
//These are for the role request TGS discord bot. Role IDs to ping.
var/role_request_id_command
var/role_request_id_security
var/role_request_id_engineering
var/role_request_id_medical
var/role_request_id_research
var/role_request_id_supply
var/role_request_id_service
var/role_request_id_expedition
var/role_request_id_silicon
var/discord_faxes_autoprint = 0 //Only turn this on if you're not using the nodebot.
var/discord_faxes_disabled = 0 //Turn this off if you don't want the TGS bot sending you messages whenever a fax is sent to central.
var/discord_ahelps_disabled = 0 //Turn this off if you don't want the TGS bot sending you messages whenever an ahelp ticket is created.
var/discord_ahelps_all = 0 //Turn this on if you want all admin-PMs to go to be sent to discord, and not only the first message of a ticket.
var/list/ip_whitelist = list()
/hook/startup/proc/read_ch_config()
var/list/Lines = file2list("config/config.txt")
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
switch (name)
if ("discord_restriction")
config.discord_restriction = 1
if ("use_jobwhitelist")
config.use_jobwhitelist = 1
if ("disable_emojis")
config.emojis = 0
if ("nodebot_enabled")
config.nodebot_enabled = 1
if ("discord_faxes_autoprint")
config.discord_faxes_autoprint = 1
if ("discord_faxes_disabled")
config.discord_faxes_disabled = 1
if ("discord_ahelps_disabled")
config.discord_ahelps_disabled = 1
if ("discord_ahelps_all")
config.discord_ahelps_all = 1
if ("nodebot_location")
config.nodebot_location = value
if ("ahelp_channel_tag")
config.ahelp_channel_tag = value
if ("fax_channel_tag")
config.fax_channel_tag = value
if ("role_request_channel_tag")
config.role_request_channel_tag = value
if ("role_request_id_command")
config.role_request_id_command = value
if ("role_request_id_security")
config.role_request_id_security = value
if ("role_request_id_engineering")
config.role_request_id_engineering = value
if ("role_request_id_medical")
config.role_request_id_medical = value
if ("role_request_id_research")
config.role_request_id_research = value
if ("role_request_id_supply")
config.role_request_id_supply = value
if ("role_request_id_service")
config.role_request_id_service = value
if ("role_request_id_expedition")
config.role_request_id_expedition = value
if ("role_request_id_silicon")
config.role_request_id_silicon = value
if("job_camp_time_limit")
config.job_camp_time_limit = value MINUTES
var/list/ip_whitelist_lines = file2list("config/ip_whitelist.txt")
var/increment = 1
for(var/t in ip_whitelist_lines)
if (!t) continue
t = trim(t)
if (length(t) == 0)
continue
else if (copytext(t, 1, 2) == "#")
continue
var/ip_address = splittext(t, ",")
for (var/name in ip_address)
config.ip_whitelist[name] = increment
increment += 1
return 1

View File

@@ -205,7 +205,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
var/start_timeofday = REALTIMEOFDAY
// Initialize subsystems.
current_ticklimit = CONFIG_GET(number/tick_limit_mc_init) // CHOMPEdit
current_ticklimit = CONFIG_GET(number/tick_limit_mc_init)
for (var/datum/controller/subsystem/SS in subsystems)
if (SS.flags & SS_NO_INIT)
continue
@@ -226,7 +226,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
if (!current_runlevel)
SetRunLevel(RUNLEVEL_LOBBY)
// GLOB.revdata = new // It can load revdata now, from tgs or .git or whatever // CHOMPEDIT
// GLOB.revdata = new // It can load revdata now, from tgs or .git or whatever
// Sort subsystems by display setting for easy access.
sortTim(subsystems, GLOBAL_PROC_REF(cmp_subsystem_display))
@@ -236,7 +236,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
#else
world.sleep_offline = 1
#endif
world.change_fps(CONFIG_GET(number/fps)) // CHOMPEdit
world.change_fps(CONFIG_GET(number/fps))
var/initialized_tod = REALTIMEOFDAY
sleep(1)
initializations_finished_with_no_players_logged_in = initialized_tod < REALTIMEOFDAY - 10
@@ -725,9 +725,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
for(var/datum/controller/subsystem/SS as anything in subsystems)
SS.StopLoadingMap()
// CHOMPEdit Begin
/datum/controller/master/proc/OnConfigLoad()
for (var/thing in subsystems)
var/datum/controller/subsystem/SS = thing
SS.OnConfigLoad()
// CHOMPEdit End

View File

@@ -224,10 +224,10 @@
if(SS_SLEEPING)
state = SS_PAUSING
// CHOMPEdit Start
/// Called after the config has been loaded or reloaded.
/datum/controller/subsystem/proc/OnConfigLoad()
// CHOMPEdit Start
/**
* Used to initialize the subsystem. This is expected to be overriden by subtypes.
*/

View File

@@ -6,9 +6,9 @@ SUBSYSTEM_DEF(assets)
var/list/preload = list()
var/datum/asset_transport/transport = new()
/datum/controller/subsystem/assets/OnConfigLoad() // CHOMPEdit
/datum/controller/subsystem/assets/OnConfigLoad()
var/newtransporttype = /datum/asset_transport
switch (CONFIG_GET(string/asset_transport)) // CHOMPEdit
switch (CONFIG_GET(string/asset_transport))
if ("webroot")
newtransporttype = /datum/asset_transport/webroot

View File

@@ -6,7 +6,7 @@ SUBSYSTEM_DEF(inactivity)
var/number_kicked = 0
/datum/controller/subsystem/inactivity/fire(resumed = FALSE)
if (!CONFIG_GET(number/kick_inactive)) // CHOMPEdit
if (!CONFIG_GET(number/kick_inactive))
can_fire = FALSE
return
if (!resumed)
@@ -15,8 +15,8 @@ SUBSYSTEM_DEF(inactivity)
while(client_list.len)
var/client/C = client_list[client_list.len]
client_list.len--
if(C.is_afk(CONFIG_GET(number/kick_inactive) MINUTES) && can_kick(C)) // CHOMPEdit
to_chat_immediate(C, world.time, span_warning("You have been inactive for more than [CONFIG_GET(number/kick_inactive)] minute\s and have been disconnected.")) // CHOMPEdit
if(C.is_afk(CONFIG_GET(number/kick_inactive) MINUTES) && can_kick(C))
to_chat_immediate(C, world.time, span_warning("You have been inactive for more than [CONFIG_GET(number/kick_inactive)] minute\s and have been disconnected."))
var/information
if(C.mob)

View File

@@ -20,7 +20,7 @@ SUBSYSTEM_DEF(lighting)
/datum/controller/subsystem/lighting/Initialize() // CHOMPEdit
if(!subsystem_initialized)
if (CONFIG_GET(flag/starlight)) // CHOMPEdit
if (CONFIG_GET(flag/starlight))
for(var/area/A in world)
if (A.dynamic_lighting == DYNAMIC_LIGHTING_IFSTARLIGHT)
A.luminosity = 0

View File

@@ -18,7 +18,7 @@ SUBSYSTEM_DEF(mapping)
world.max_z_changed() // This is to set up the player z-level list, maxz hasn't actually changed (probably)
load_map_templates()
if(CONFIG_GET(flag/generate_map)) // CHOMPEdit
if(CONFIG_GET(flag/generate_map))
// Map-gen is still very specific to the map, however putting it here should ensure it loads in the correct order.
using_map.perform_map_generation()
@@ -50,8 +50,8 @@ SUBSYSTEM_DEF(mapping)
// Choose an engine type
var/datum/map_template/engine/chosen_type = null
if (LAZYLEN(CONFIG_GET(str_list/engine_map))) // CHOMPEdit
var/chosen_name = pick(CONFIG_GET(str_list/engine_map)) // CHOMPEdit
if (LAZYLEN(CONFIG_GET(str_list/engine_map)))
var/chosen_name = pick(CONFIG_GET(str_list/engine_map))
chosen_type = map_templates[chosen_name]
if(!istype(chosen_type))
error("Configured engine map [chosen_name] is not a valid engine map name!")

View File

@@ -19,7 +19,7 @@ SUBSYSTEM_DEF(media_tracks)
return SS_INIT_SUCCESS // CHOMPEdit
/datum/controller/subsystem/media_tracks/proc/load_tracks()
for(var/filename in CONFIG_GET(str_list/jukebox_track_files)) // CHOMPEdit
for(var/filename in CONFIG_GET(str_list/jukebox_track_files))
report_progress("Loading jukebox track: [filename]")
if(!fexists(filename))

View File

@@ -11,7 +11,7 @@ SUBSYSTEM_DEF(nightshift)
var/high_security_mode = FALSE
/datum/controller/subsystem/nightshift/Initialize()
if(!CONFIG_GET(flag/enable_night_shifts)) // CHOMPEdit
if(!CONFIG_GET(flag/enable_night_shifts))
can_fire = FALSE
/*
if(config.randomize_shift_time)

View File

@@ -16,7 +16,7 @@ SUBSYSTEM_DEF(persist)
// Do PTO Accruals
/datum/controller/subsystem/persist/proc/update_department_hours(var/resumed = FALSE)
if(!CONFIG_GET(flag/time_off)) // CHOMPEdit
if(!CONFIG_GET(flag/time_off))
return
establish_db_connection()
@@ -78,7 +78,7 @@ SUBSYSTEM_DEF(persist)
play_hours[department_earning] = wait_in_hours
// Cap it
dept_hours[department_earning] = min(CONFIG_GET(number/pto_cap), dept_hours[department_earning]) // CHOMPEdit
dept_hours[department_earning] = min(CONFIG_GET(number/pto_cap), dept_hours[department_earning])
// Okay we figured it out, lets update database!
var/sql_ckey = sql_sanitize_text(C.ckey)

View File

@@ -27,7 +27,7 @@ SUBSYSTEM_DEF(persistence)
/datum/controller/subsystem/persistence/proc/track_value(var/atom/value, var/track_type)
if(CONFIG_GET(flag/persistence_disabled)) //if the config is set to persistence disabled, nothing will save or load. // CHOMPEdit
if(CONFIG_GET(flag/persistence_disabled)) //if the config is set to persistence disabled, nothing will save or load.
return
var/turf/T = get_turf(value)

View File

@@ -24,7 +24,7 @@ SUBSYSTEM_DEF(radiation)
if(QDELETED(S))
sources -= S
else if(S.decay)
S.update_rad_power(S.rad_power - CONFIG_GET(number/radiation_decay_rate)) // COMPEdit
S.update_rad_power(S.rad_power - CONFIG_GET(number/radiation_decay_rate))
if (MC_TICK_CHECK)
return
@@ -93,12 +93,12 @@ SUBSYSTEM_DEF(radiation)
origin.calc_rad_resistance()
if(origin.cached_rad_resistance)
if(CONFIG_GET(flag/radiation_resistance_calc_mode) == RAD_RESIST_CALC_DIV) // CHOMPEdit
working = round((working / (origin.cached_rad_resistance * CONFIG_GET(number/radiation_resistance_multiplier))), 0.01) // CHOMPEdit
else if(CONFIG_GET(flag/radiation_resistance_calc_mode) == RAD_RESIST_CALC_SUB) // CHOMPEdit
working = round((working - (origin.cached_rad_resistance * CONFIG_GET(number/radiation_resistance_multiplier))), 0.01) // CHOMPEdit
if(CONFIG_GET(flag/radiation_resistance_calc_mode) == RAD_RESIST_CALC_DIV)
working = round((working / (origin.cached_rad_resistance * CONFIG_GET(number/radiation_resistance_multiplier))), 0.01)
else if(CONFIG_GET(flag/radiation_resistance_calc_mode) == RAD_RESIST_CALC_SUB)
working = round((working - (origin.cached_rad_resistance * CONFIG_GET(number/radiation_resistance_multiplier))), 0.01)
if(working <= CONFIG_GET(number/radiation_lower_limit)) // Too far from this source // CHOMPEdit
if(working <= CONFIG_GET(number/radiation_lower_limit)) // Too far from this source
working = 0 // May as well be 0
break
@@ -106,7 +106,7 @@ SUBSYSTEM_DEF(radiation)
// Shouldn't really ever have practical uses, but standing in a room literally made from uranium is more dangerous than standing next to a single uranium vase
. += working / (dist ** 2)
if(. <= CONFIG_GET(number/radiation_lower_limit)) // CHOMPEdit
if(. <= CONFIG_GET(number/radiation_lower_limit))
. = 0
// Add a radiation source instance to the repository. It will override any existing source on the same turf.

View File

@@ -14,7 +14,7 @@ SUBSYSTEM_DEF(sqlite)
return SS_INIT_SUCCESS // CHOMPEdit
/datum/controller/subsystem/sqlite/proc/connect()
if(!CONFIG_GET(flag/sqlite_enabled)) // CHOMPEdit
if(!CONFIG_GET(flag/sqlite_enabled))
return
if(!sqlite_db)
@@ -104,17 +104,17 @@ SUBSYSTEM_DEF(sqlite)
return !sqlite_check_for_errors(query, "Insert Feedback")
/datum/controller/subsystem/sqlite/proc/can_submit_feedback(client/C)
if(!CONFIG_GET(flag/sqlite_enabled)) // CHOMPEdit
if(!CONFIG_GET(flag/sqlite_enabled))
return FALSE
if(CONFIG_GET(number/sqlite_feedback_min_age) && !is_old_enough(C)) // CHOMPEdit
if(CONFIG_GET(number/sqlite_feedback_min_age) && !is_old_enough(C))
return FALSE
if(CONFIG_GET(number/sqlite_feedback_cooldown) > 0 && get_feedback_cooldown(C.key, CONFIG_GET(number/sqlite_feedback_cooldown), sqlite_db) > 0) // CHOMPEdit
if(CONFIG_GET(number/sqlite_feedback_cooldown) > 0 && get_feedback_cooldown(C.key, CONFIG_GET(number/sqlite_feedback_cooldown), sqlite_db) > 0)
return FALSE
return TRUE
// Returns TRUE if the player is 'old' enough, according to the config.
/datum/controller/subsystem/sqlite/proc/is_old_enough(client/C)
if(get_player_age(C.key) < CONFIG_GET(number/sqlite_feedback_min_age)) // CHOMPEdit
if(get_player_age(C.key) < CONFIG_GET(number/sqlite_feedback_min_age))
return FALSE
return TRUE

View File

@@ -51,8 +51,8 @@ var/global/datum/controller/subsystem/ticker/ticker
global.ticker = src // TODO - Remove this! Change everything to point at SSticker intead
/datum/controller/subsystem/ticker/Initialize()
pregame_timeleft = CONFIG_GET(number/pregame_time) // CHOMPEdit
send2mainirc("Server lobby is loaded and open at byond://[CONFIG_GET(string/serverurl) ? CONFIG_GET(string/serverurl) : (CONFIG_GET(string/server) ? CONFIG_GET(string/server) : "[world.address]:[world.port]")]") // CHOMPEdit
pregame_timeleft = CONFIG_GET(number/pregame_time)
send2mainirc("Server lobby is loaded and open at byond://[CONFIG_GET(string/serverurl) ? CONFIG_GET(string/serverurl) : (CONFIG_GET(string/server) ? CONFIG_GET(string/server) : "[world.address]:[world.port]")]")
SSwebhooks.send(
WEBHOOK_ROUNDPREP,
list(
@@ -108,7 +108,7 @@ var/global/datum/controller/subsystem/ticker/ticker
round_start_time = world.time // otherwise round_start_time would be 0 for the signals
if(!setup_choose_gamemode())
// It failed, go back to lobby state and re-send the welcome message
pregame_timeleft = CONFIG_GET(number/pregame_time) // CHOMPEdit
pregame_timeleft = CONFIG_GET(number/pregame_time)
// SSvote.gamemode_vote_called = FALSE // Allow another autogamemode vote
current_state = GAME_STATE_PREGAME
Master.SetRunLevel(RUNLEVEL_LOBBY)
@@ -135,8 +135,8 @@ var/global/datum/controller/subsystem/ticker/ticker
if(!src.mode)
var/list/weighted_modes = list()
for(var/datum/game_mode/GM in runnable_modes)
weighted_modes[GM.config_tag] = CONFIG_GET(keyed_list/probabilities)[GM.config_tag] // CHOMPEdit
src.mode = config.gamemode_cache[pickweight(weighted_modes)] // CHOMPEdit
weighted_modes[GM.config_tag] = CONFIG_GET(keyed_list/probabilities)[GM.config_tag]
src.mode = config.gamemode_cache[pickweight(weighted_modes)]
else
src.mode = config.pick_mode(master_mode)
@@ -150,7 +150,7 @@ var/global/datum/controller/subsystem/ticker/ticker
job_master.DivideOccupations() // Apparently important for new antagonist system to register specific job antags properly.
if(!src.mode.can_start())
to_world(span_danger(span_bold("Unable to start [mode.name].") + " Not enough players readied, [CONFIG_GET(keyed_list/player_requirements)[mode.config_tag]] players needed. Reverting to pregame lobby.")) // CHOMPEdit
to_world(span_filter_system(span_bold("Unable to start [mode.name].") + " Not enough players readied, [CONFIG_GET(keyed_list/player_requirements)[mode.config_tag]] players needed. Reverting to pregame lobby."))
mode.fail_setup()
mode = null
job_master.ResetOccupations()
@@ -198,7 +198,7 @@ var/global/datum/controller/subsystem/ticker/ticker
current_state = GAME_STATE_PLAYING
Master.SetRunLevel(RUNLEVEL_GAME)
if(CONFIG_GET(flag/sql_enabled)) // CHOMPEdit
if(CONFIG_GET(flag/sql_enabled))
statistic_cycle() // Polls population totals regularly and stores them in an SQL DB -- TLE
return 1
@@ -214,7 +214,7 @@ var/global/datum/controller/subsystem/ticker/ticker
// Calculate if game and/or mode are finished (Complicated by the continuous_rounds config option)
var/game_finished = FALSE
var/mode_finished = FALSE
if (CONFIG_GET(flag/continuous_rounds)) // Game keeps going after mode ends. // CHOMPEdit
if (CONFIG_GET(flag/continuous_rounds)) // Game keeps going after mode ends.
game_finished = (emergency_shuttle.returned() || mode.station_was_nuked)
mode_finished = ((end_game_state >= END_GAME_MODE_FINISHED) || mode.check_finished()) // Short circuit if already finished.
else // Game ends when mode does