Fixup merge, both VS and nebula hooks now

This commit is contained in:
Aronai Sieyes
2021-05-27 12:25:48 -04:00
parent 3f19eafeaa
commit 124eab8aa1
6 changed files with 12 additions and 860 deletions
+8 -840
View File
@@ -284,15 +284,16 @@ var/list/gamemode_cache = list()
var/static/disable_cid_warn_popup = FALSE
// whether or not to use the nightshift subsystem to perform lighting changes
var/static/enable_night_shifts = FALSE
// How strictly the loadout enforces object species whitelists
<<<<<<< HEAD
var/static/enable_night_shifts = FALSE
// How strictly the loadout enforces object species whitelists
var/loadout_whitelist = LOADOUT_WHITELIST_LAX
var/static/vgs_access_identifier = null // VOREStation Edit - VGS
var/static/vgs_server_port = null // VOREStation Edit - VGS
var/disable_webhook_embeds = FALSE
/datum/configuration/New()
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
for (var/T in L)
@@ -1012,6 +1013,9 @@ var/list/gamemode_cache = list()
if("use_loyalty_implants")
config.use_loyalty_implants = 1
if("loadout_whitelist")
config.loadout_whitelist = text2num(value)
else
log_misc("Unknown setting in configuration: '[name]'")
@@ -1127,839 +1131,3 @@ var/list/gamemode_cache = list()
config.python_path = "/usr/bin/env python2"
else //probably windows, if not this should work anyway
config.python_path = "python"
=======
var/loadout_whitelist = LOADOUT_WHITELIST_LAX
var/disable_webhook_embeds = FALSE
/datum/configuration/New()
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
for (var/T in L)
// I wish I didn't have to instance the game modes in order to look up
// their information, but it is the only way (at least that I know of).
var/datum/game_mode/M = new T()
if (M.config_tag)
gamemode_cache[M.config_tag] = M // So we don't instantiate them repeatedly.
if(!(M.config_tag in modes)) // ensure each mode is added only once
log_misc("Adding game mode [M.name] ([M.config_tag]) to configuration.")
modes += M.config_tag
mode_names[M.config_tag] = M.name
probabilities[M.config_tag] = M.probability
player_requirements[M.config_tag] = M.required_players
player_requirements_secret[M.config_tag] = M.required_players_secret
if (M.votable)
src.votable_modes += M.config_tag
src.votable_modes += "secret"
/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
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 ("resource_urls")
config.resource_urls = splittext(value, " ")
if ("admin_legacy_system")
config.admin_legacy_system = 1
if ("ban_legacy_system")
config.ban_legacy_system = 1
if ("use_age_restriction_for_jobs")
config.use_age_restriction_for_jobs = 1
if ("use_age_restriction_for_antags")
config.use_age_restriction_for_antags = 1
if ("jobs_have_minimal_access")
config.jobs_have_minimal_access = 1
if ("use_recursive_explosions")
use_recursive_explosions = 1
if ("multi_z_explosion_scalar")
multi_z_explosion_scalar = text2num(value)
if ("log_ooc")
config.log_ooc = 1
if ("log_access")
config.log_access = 1
if ("sql_enabled")
config.sql_enabled = 1
if ("log_say")
config.log_say = 1
if ("debug_paranoid")
config.debugparanoid = 1
if ("log_admin")
config.log_admin = 1
if ("log_debug")
config.log_debug = text2num(value)
if ("log_game")
config.log_game = 1
if ("log_vote")
config.log_vote = 1
if ("log_whisper")
config.log_whisper = 1
if ("log_attack")
config.log_attack = 1
if ("log_emote")
config.log_emote = 1
if ("log_adminchat")
config.log_adminchat = 1
if ("log_adminwarn")
config.log_adminwarn = 1
if ("log_pda")
config.log_pda = 1
if ("log_world_output")
config.log_world_output = 1
if ("log_hrefs")
config.log_hrefs = 1
if ("log_runtime")
config.log_runtime = 1
if ("log_graffiti")
config.log_graffiti = 1
if ("generate_map")
config.generate_map = 1
if ("no_click_cooldown")
config.no_click_cooldown = 1
if("allow_admin_ooccolor")
config.allow_admin_ooccolor = 1
if ("allow_vote_restart")
config.allow_vote_restart = 1
if ("allow_vote_mode")
config.allow_vote_mode = 1
if ("allow_admin_jump")
config.allow_admin_jump = 1
if("allow_admin_rev")
config.allow_admin_rev = 1
if ("allow_admin_spawning")
config.allow_admin_spawning = 1
if ("allow_byond_links")
allow_byond_links = 1
if ("allow_discord_links")
allow_discord_links = 1
if ("allow_url_links")
allow_url_links = 1
if ("no_dead_vote")
config.vote_no_dead = 1
if ("default_no_vote")
config.vote_no_default = 1
if ("pregame_time")
config.pregame_time = text2num(value)
if ("vote_delay")
config.vote_delay = text2num(value)
if ("vote_period")
config.vote_period = text2num(value)
if ("vote_autotransfer_initial")
config.vote_autotransfer_initial = text2num(value)
if ("vote_autotransfer_interval")
config.vote_autotransfer_interval = text2num(value)
if ("vote_autogamemode_timeleft")
config.vote_autogamemode_timeleft = text2num(value)
if("ert_admin_only")
config.ert_admin_call_only = 1
if ("allow_ai")
config.allow_ai = 1
if ("allow_ai_shells")
config.allow_ai_shells = TRUE
if("give_free_ai_shell")
config.give_free_ai_shell = TRUE
// if ("authentication")
// config.enable_authentication = 1
if ("norespawn")
config.respawn = 0
if ("respawn_time")
var/raw_minutes = text2num(value)
config.respawn_time = raw_minutes MINUTES
if ("respawn_message")
config.respawn_message = "<span class='notice'><B>[value]</B></span>"
if ("servername")
config.server_name = value
if ("serversuffix")
config.server_suffix = 1
if ("nudge_script_path")
config.nudge_script_path = value
if ("hostedby")
config.hostedby = value
if ("serverurl")
config.serverurl = value
if ("server")
config.server = value
if ("banappeals")
config.banappeals = value
if ("wikiurl")
config.wikiurl = value
if ("wikisearchurl")
config.wikisearchurl = value
if ("forumurl")
config.forumurl = value
if ("rulesurl")
config.rulesurl = value
if ("mapurl")
config.mapurl = value
if ("githuburl")
config.githuburl = value
if ("guest_jobban")
config.guest_jobban = 1
if ("guest_ban")
config.guests_allowed = 0
if ("disable_ooc")
config.ooc_allowed = 0
config.looc_allowed = 0
if ("disable_entry")
config.enter_allowed = 0
if ("disable_dead_ooc")
config.dooc_allowed = 0
if ("disable_dsay")
config.dsay_allowed = 0
if ("disable_respawn")
config.abandon_allowed = 0
if ("usewhitelist")
config.usewhitelist = 1
if ("feature_object_spell_system")
config.feature_object_spell_system = 1
if ("allow_metadata")
config.allow_Metadata = 1
if ("traitor_scaling")
config.traitor_scaling = 1
if ("aliens_allowed")
config.aliens_allowed = 1
if ("ninjas_allowed")
config.ninjas_allowed = 1
if ("objectives_disabled")
config.objectives_disabled = 1
if("protect_roles_from_antagonist")
config.protect_roles_from_antagonist = 1
if("persistence_disabled")
config.persistence_disabled = TRUE // Previously this forcibly set persistence enabled in the saves.
if("persistence_ignore_mapload")
config.persistence_ignore_mapload = TRUE
if ("probability")
var/prob_pos = findtext(value, " ")
var/prob_name = null
var/prob_value = null
if (prob_pos)
prob_name = lowertext(copytext(value, 1, prob_pos))
prob_value = copytext(value, prob_pos + 1)
if (prob_name in config.modes)
config.probabilities[prob_name] = text2num(prob_value)
else
log_misc("Unknown game mode probability configuration definition: [prob_name].")
else
log_misc("Incorrect probability configuration definition: [prob_name] [prob_value].")
if ("required_players", "required_players_secret")
var/req_pos = findtext(value, " ")
var/req_name = null
var/req_value = null
var/is_secret_override = findtext(name, "required_players_secret") // Being extra sure we're not picking up an override for Secret by accident.
if(req_pos)
req_name = lowertext(copytext(value, 1, req_pos))
req_value = copytext(value, req_pos + 1)
if(req_name in config.modes)
if(is_secret_override)
config.player_requirements_secret[req_name] = text2num(req_value)
else
config.player_requirements[req_name] = text2num(req_value)
else
log_misc("Unknown game mode player requirement configuration definition: [req_name].")
else
log_misc("Incorrect player requirement configuration definition: [req_name] [req_value].")
if("allow_random_events")
config.allow_random_events = 1
if("enable_game_master")
config.enable_game_master = 1
if("kick_inactive")
config.kick_inactive = text2num(value)
if("show_mods")
config.show_mods = 1
if("show_devs")
config.show_devs = 1
if("show_event_managers")
config.show_event_managers = 1
if("mods_can_tempban")
config.mods_can_tempban = 1
if("mods_can_job_tempban")
config.mods_can_job_tempban = 1
if("mod_tempban_max")
config.mod_tempban_max = text2num(value)
if("mod_job_tempban_max")
config.mod_job_tempban_max = text2num(value)
if("load_jobs_from_txt")
load_jobs_from_txt = 1
if("alert_red_upto")
config.alert_desc_red_upto = value
if("alert_red_downto")
config.alert_desc_red_downto = value
if("alert_blue_downto")
config.alert_desc_blue_downto = value
if("alert_blue_upto")
config.alert_desc_blue_upto = value
if("alert_green")
config.alert_desc_green = value
if("alert_delta")
config.alert_desc_delta = value
if("forbid_singulo_possession")
forbid_singulo_possession = 1
if("popup_admin_pm")
config.popup_admin_pm = 1
if("allow_holidays")
Holiday = 1
if("use_irc_bot")
use_irc_bot = 1
if("use_node_bot")
use_node_bot = 1
if("irc_bot_port")
config.irc_bot_port = value
if("irc_bot_export")
irc_bot_export = 1
if("ticklag")
var/ticklag = text2num(value)
if(ticklag > 0)
fps = 10 / ticklag
if("tick_limit_mc_init")
tick_limit_mc_init = text2num(value)
if("allow_antag_hud")
config.antag_hud_allowed = 1
if("antag_hud_restricted")
config.antag_hud_restricted = 1
if("socket_talk")
socket_talk = text2num(value)
if("tickcomp")
Tickcomp = 1
if("humans_need_surnames")
humans_need_surnames = 1
if("tor_ban")
ToRban = 1
if("automute_on")
automute_on = 1
if("usealienwhitelist")
usealienwhitelist = 1
if("alien_player_ratio")
limitalienplayers = 1
alien_to_human_ratio = text2num(value)
if("assistant_maint")
config.assistant_maint = 1
if("gateway_delay")
config.gateway_delay = text2num(value)
if("continuous_rounds")
config.continous_rounds = 1
if("ghost_interaction")
config.ghost_interaction = 1
if("disable_player_mice")
config.disable_player_mice = 1
if("uneducated_mice")
config.uneducated_mice = 1
if("comms_password")
config.comms_password = value
if("irc_bot_host")
config.irc_bot_host = value
if("main_irc")
config.main_irc = value
if("admin_irc")
config.admin_irc = value
if("python_path")
if(value)
config.python_path = value
if("use_lib_nudge")
config.use_lib_nudge = 1
if("allow_cult_ghostwriter")
config.cult_ghostwriter = 1
if("req_cult_ghostwriter")
config.cult_ghostwriter_req_cultists = text2num(value)
if("character_slots")
config.character_slots = text2num(value)
if("loadout_slots")
config.loadout_slots = text2num(value)
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("use_overmap")
config.use_overmap = 1
if("engine_map")
config.engine_map = splittext(value, ",")
/*
if("station_levels")
using_map.station_levels = text2numlist(value, ";")
if("admin_levels")
using_map.admin_levels = text2numlist(value, ";")
if("contact_levels")
using_map.contact_levels = text2numlist(value, ";")
if("player_levels")
using_map.player_levels = text2numlist(value, ";")
*/
if("expected_round_length")
config.expected_round_length = MinutesToTicks(text2num(value))
if("disable_welder_vision")
config.welder_vision = 0
if("allow_extra_antags")
config.allow_extra_antags = 1
if("event_custom_start_mundane")
var/values = text2numlist(value, ";")
config.event_first_run[EVENT_LEVEL_MUNDANE] = list("lower" = MinutesToTicks(values[1]), "upper" = MinutesToTicks(values[2]))
if("event_custom_start_moderate")
var/values = text2numlist(value, ";")
config.event_first_run[EVENT_LEVEL_MODERATE] = list("lower" = MinutesToTicks(values[1]), "upper" = MinutesToTicks(values[2]))
if("event_custom_start_major")
var/values = text2numlist(value, ";")
config.event_first_run[EVENT_LEVEL_MAJOR] = list("lower" = MinutesToTicks(values[1]), "upper" = MinutesToTicks(values[2]))
if("event_delay_lower")
var/values = text2numlist(value, ";")
config.event_delay_lower[EVENT_LEVEL_MUNDANE] = MinutesToTicks(values[1])
config.event_delay_lower[EVENT_LEVEL_MODERATE] = MinutesToTicks(values[2])
config.event_delay_lower[EVENT_LEVEL_MAJOR] = MinutesToTicks(values[3])
if("event_delay_upper")
var/values = text2numlist(value, ";")
config.event_delay_upper[EVENT_LEVEL_MUNDANE] = MinutesToTicks(values[1])
config.event_delay_upper[EVENT_LEVEL_MODERATE] = MinutesToTicks(values[2])
config.event_delay_upper[EVENT_LEVEL_MAJOR] = MinutesToTicks(values[3])
if("starlight")
value = text2num(value)
config.starlight = value >= 0 ? value : 0
if("ert_species")
config.ert_species = splittext(value, ";")
if(!config.ert_species.len)
config.ert_species += SPECIES_HUMAN
if("law_zero")
law_zero = value
if("aggressive_changelog")
config.aggressive_changelog = 1
if("default_language_prefixes")
var/list/values = splittext(value, " ")
if(values.len > 0)
language_prefixes = values
if("radiation_lower_limit")
radiation_lower_limit = text2num(value)
if("radiation_resistance_calc_divide")
radiation_resistance_calc_mode = RAD_RESIST_CALC_DIV
if("radiation_resistance_calc_subtract")
radiation_resistance_calc_mode = RAD_RESIST_CALC_SUB
if("radiation_resistance_multiplier")
radiation_resistance_multiplier = text2num(value)
if("radiation_material_resistance_divisor")
radiation_material_resistance_divisor = text2num(value)
if("radiation_decay_rate")
radiation_decay_rate = text2num(value)
if ("panic_bunker")
config.panic_bunker = 1
if ("paranoia_logging")
config.paranoia_logging = 1
if("ip_reputation")
config.ip_reputation = 1
if("ipr_email")
config.ipr_email = value
if("ipr_block_bad_ips")
config.ipr_block_bad_ips = 1
if("ipr_bad_score")
config.ipr_bad_score = text2num(value)
if("ipr_allow_existing")
config.ipr_allow_existing = 1
if("ipr_minimum_age")
config.ipr_minimum_age = text2num(value)
if("random_submap_orientation")
config.random_submap_orientation = 1
if("autostart_solars")
config.autostart_solars = TRUE
if("sqlite_enabled")
config.sqlite_enabled = TRUE
if("sqlite_feedback")
config.sqlite_feedback = TRUE
if("sqlite_feedback_topics")
config.sqlite_feedback_topics = splittext(value, ";")
if(!config.sqlite_feedback_topics.len)
config.sqlite_feedback_topics += "General"
if("sqlite_feedback_privacy")
config.sqlite_feedback_privacy = TRUE
if("sqlite_feedback_cooldown")
config.sqlite_feedback_cooldown = text2num(value)
if("defib_timer")
config.defib_timer = text2num(value)
if("defib_braindamage_timer")
config.defib_braindamage_timer = text2num(value)
if("disable_cid_warn_popup")
config.disable_cid_warn_popup = TRUE
if("enable_night_shifts")
config.enable_night_shifts = TRUE
else
log_misc("Unknown setting in configuration: '[name]'")
else if(type == "game_options")
if(!value)
log_misc("Unknown value for setting [name] in [filename].")
value = text2num(value)
switch(name)
if("health_threshold_crit")
config.health_threshold_crit = value
if("health_threshold_softcrit")
config.health_threshold_softcrit = value
if("health_threshold_dead")
config.health_threshold_dead = value
if("show_human_death_message")
config.show_human_death_message = 1
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("organ_health_multiplier")
config.organ_health_multiplier = value / 100
if("organ_regeneration_multiplier")
config.organ_regeneration_multiplier = value / 100
if("organ_damage_spillover_multiplier")
config.organ_damage_spillover_multiplier = value / 100
if("organs_can_decay")
config.organs_decay = 1
if("default_brain_health")
config.default_brain_health = text2num(value)
if(!config.default_brain_health || config.default_brain_health < 1)
config.default_brain_health = initial(config.default_brain_health)
if("bones_can_break")
config.bones_can_break = value
if("limbs_can_break")
config.limbs_can_break = value
if("allow_headgibs")
config.allow_headgibs = TRUE
if("run_speed")
config.run_speed = value
if("walk_speed")
config.walk_speed = value
if("human_delay")
config.human_delay = value
if("robot_delay")
config.robot_delay = value
if("monkey_delay")
config.monkey_delay = value
if("alien_delay")
config.alien_delay = value
if("slime_delay")
config.slime_delay = value
if("animal_delay")
config.animal_delay = value
if("footstep_volume")
config.footstep_volume = text2num(value)
if("use_loyalty_implants")
config.use_loyalty_implants = 1
if("loadout_whitelist")
config.loadout_whitelist = text2num(value)
else
log_misc("Unknown setting in configuration: '[name]'")
/datum/configuration/proc/loadsql(filename) // -- TLE
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
switch (name)
if ("address")
sqladdress = value
if ("port")
sqlport = value
if ("database")
sqldb = value
if ("login")
sqllogin = value
if ("password")
sqlpass = value
if ("feedback_database")
sqlfdbkdb = value
if ("feedback_login")
sqlfdbklogin = value
if ("feedback_password")
sqlfdbkpass = value
if ("enable_stat_tracking")
sqllogging = 1
else
log_misc("Unknown setting in configuration: '[name]'")
/datum/configuration/proc/loadforumsql(filename) // -- TLE
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
switch (name)
if ("address")
forumsqladdress = value
if ("port")
forumsqlport = value
if ("database")
forumsqldb = value
if ("login")
forumsqllogin = value
if ("password")
forumsqlpass = value
if ("activatedgroup")
forum_activated_group = value
if ("authenticatedgroup")
forum_authenticated_group = value
else
log_misc("Unknown setting in configuration: '[name]'")
/datum/configuration/proc/pick_mode(mode_name)
// I wish I didn't have to instance the game modes in order to look up
// their information, but it is the only way (at least that I know of).
for (var/game_mode in gamemode_cache)
var/datum/game_mode/M = gamemode_cache[game_mode]
if (M.config_tag && M.config_tag == mode_name)
return M
return gamemode_cache["extended"]
/datum/configuration/proc/get_runnable_modes()
var/list/runnable_modes = list()
for(var/game_mode in gamemode_cache)
var/datum/game_mode/M = gamemode_cache[game_mode]
if(M && M.can_start() && !isnull(config.probabilities[M.config_tag]) && config.probabilities[M.config_tag] > 0)
runnable_modes |= M
return runnable_modes
/datum/configuration/proc/post_load()
//apply a default value to config.python_path, if needed
if (!config.python_path)
if(world.system_type == UNIX)
config.python_path = "/usr/bin/env python2"
else //probably windows, if not this should work anyway
config.python_path = "python"
>>>>>>> 4deffc7... Ports Nebula's Discord Webhook Integration (#8071)