diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 97071c0bc1f..0a1786a7695 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -276,6 +276,18 @@ qdel(M) votable_modes += "secret" + Reload() + +/datum/configuration/proc/Reload() + load("config/config.txt") + load("config/game_options.txt","game_options") + loadsql("config/dbconfig.txt") + if (maprotation) + loadmaplist("config/maps.txt") + + // apply some settings from config.. + GLOB.abandon_allowed = respawn + /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) @@ -305,109 +317,109 @@ if(type == "config") switch(name) if("hub") - config.hub = 1 + hub = 1 if("admin_legacy_system") - config.admin_legacy_system = 1 + admin_legacy_system = 1 if("ban_legacy_system") - config.ban_legacy_system = 1 + ban_legacy_system = 1 if("use_age_restriction_for_jobs") - config.use_age_restriction_for_jobs = 1 + use_age_restriction_for_jobs = 1 if("use_account_age_for_jobs") - config.use_account_age_for_jobs = 1 + use_account_age_for_jobs = 1 if("lobby_countdown") - config.lobby_countdown = text2num(value) + lobby_countdown = text2num(value) if("round_end_countdown") - config.round_end_countdown = text2num(value) + round_end_countdown = text2num(value) if("log_ooc") - config.log_ooc = 1 + log_ooc = 1 if("log_access") - config.log_access = 1 + log_access = 1 if("log_say") - config.log_say = 1 + log_say = 1 if("log_admin") - config.log_admin = 1 + log_admin = 1 if("log_prayer") - config.log_prayer = 1 + log_prayer = 1 if("log_law") - config.log_law = 1 + log_law = 1 if("log_game") - config.log_game = 1 + log_game = 1 if("log_vote") - config.log_vote = 1 + log_vote = 1 if("log_whisper") - config.log_whisper = 1 + log_whisper = 1 if("log_attack") - config.log_attack = 1 + log_attack = 1 if("log_emote") - config.log_emote = 1 + log_emote = 1 if("log_adminchat") - config.log_adminchat = 1 + log_adminchat = 1 if("log_pda") - config.log_pda = 1 + log_pda = 1 if("log_hrefs") - config.log_hrefs = 1 + log_hrefs = 1 if("log_twitter") - config.log_twitter = 1 + log_twitter = 1 if("log_world_topic") - config.log_world_topic = 1 + log_world_topic = 1 if("allow_admin_ooccolor") - config.allow_admin_ooccolor = 1 + allow_admin_ooccolor = 1 if("allow_vote_restart") - config.allow_vote_restart = 1 + allow_vote_restart = 1 if("allow_vote_mode") - config.allow_vote_mode = 1 + allow_vote_mode = 1 if("no_dead_vote") - config.vote_no_dead = 1 + vote_no_dead = 1 if("default_no_vote") - config.vote_no_default = 1 + vote_no_default = 1 if("vote_delay") - config.vote_delay = text2num(value) + vote_delay = text2num(value) if("vote_period") - config.vote_period = text2num(value) + vote_period = text2num(value) if("norespawn") - config.respawn = 0 + respawn = 0 if("servername") - config.server_name = value + server_name = value if("serversqlname") - config.server_sql_name = value + server_sql_name = value if("stationname") - config.station_name = value + station_name = value if("hostedby") - config.hostedby = value + hostedby = value if("server") - config.server = value + server = value if("banappeals") - config.banappeals = value + banappeals = value if("wikiurl") - config.wikiurl = value + wikiurl = value if("forumurl") - config.forumurl = value + forumurl = value if("rulesurl") - config.rulesurl = value + rulesurl = value if("githuburl") - config.githuburl = value + githuburl = value if("githubrepoid") - config.githubrepoid = value + githubrepoid = value if("guest_jobban") - config.guest_jobban = 1 + guest_jobban = 1 if("guest_ban") GLOB.guests_allowed = 0 if("usewhitelist") - config.usewhitelist = TRUE + usewhitelist = TRUE if("allow_metadata") - config.allow_Metadata = 1 + allow_Metadata = 1 if("kick_inactive") if(value < 1) value = INACTIVITY_KICK - config.kick_inactive = value + kick_inactive = value if("load_jobs_from_txt") load_jobs_from_txt = 1 if("forbid_singulo_possession") forbid_singulo_possession = 1 if("popup_admin_pm") - config.popup_admin_pm = 1 + popup_admin_pm = 1 if("allow_holidays") - config.allow_holidays = 1 + allow_holidays = 1 if("useircbot") useircbot = 1 if("ticklag") @@ -441,42 +453,42 @@ if("medal_hub_password") global.medal_pass = value if("show_irc_name") - config.showircname = 1 + showircname = 1 if("see_own_notes") - config.see_own_notes = 1 + see_own_notes = 1 if("soft_popcap") - config.soft_popcap = text2num(value) + soft_popcap = text2num(value) if("hard_popcap") - config.hard_popcap = text2num(value) + hard_popcap = text2num(value) if("extreme_popcap") - config.extreme_popcap = text2num(value) + extreme_popcap = text2num(value) if("soft_popcap_message") - config.soft_popcap_message = value + soft_popcap_message = value if("hard_popcap_message") - config.hard_popcap_message = value + hard_popcap_message = value if("extreme_popcap_message") - config.extreme_popcap_message = value + extreme_popcap_message = value if("panic_bunker") - config.panic_bunker = 1 + panic_bunker = 1 if("notify_new_player_age") - config.notify_new_player_age = text2num(value) + notify_new_player_age = text2num(value) if("irc_first_connection_alert") - config.irc_first_connection_alert = 1 + irc_first_connection_alert = 1 if("check_randomizer") - config.check_randomizer = 1 + check_randomizer = 1 if("ipintel_email") if (value != "ch@nge.me") - config.ipintel_email = value + ipintel_email = value if("ipintel_rating_bad") - config.ipintel_rating_bad = text2num(value) + ipintel_rating_bad = text2num(value) if("ipintel_domain") - config.ipintel_domain = value + ipintel_domain = value if("ipintel_save_good") - config.ipintel_save_good = text2num(value) + ipintel_save_good = text2num(value) if("ipintel_save_bad") - config.ipintel_save_bad = text2num(value) + ipintel_save_bad = text2num(value) if("aggressive_changelog") - config.aggressive_changelog = 1 + aggressive_changelog = 1 if("log_runtimes") log_runtimes = TRUE var/newlog = file("data/logs/runtimes/runtime-[time2text(world.realtime, "YYYY-MM-DD")].log") @@ -484,39 +496,39 @@ world.log << "Now logging runtimes to data/logs/runtimes/runtime-[time2text(world.realtime, "YYYY-MM-DD")].log" GLOB.runtime_diary = newlog if("autoconvert_notes") - config.autoconvert_notes = 1 + autoconvert_notes = 1 if("allow_webclient") - config.allowwebclient = 1 + allowwebclient = 1 if("webclient_only_byond_members") - config.webclientmembersonly = 1 + webclientmembersonly = 1 if("announce_admin_logout") - config.announce_admin_logout = 1 + announce_admin_logout = 1 if("announce_admin_login") - config.announce_admin_login = 1 + announce_admin_login = 1 if("maprotation") - config.maprotation = 1 + maprotation = 1 if("allow_map_voting") - config.allow_map_voting = text2num(value) + allow_map_voting = text2num(value) if("maprotationchancedelta") - config.maprotatechancedelta = text2num(value) + maprotatechancedelta = text2num(value) if("autoadmin") - config.autoadmin = 1 + autoadmin = 1 if(value) - config.autoadmin_rank = ckeyEx(value) + autoadmin_rank = ckeyEx(value) if("generate_minimaps") - config.generate_minimaps = 1 + generate_minimaps = 1 if("client_warn_version") - config.client_warn_version = text2num(value) + client_warn_version = text2num(value) if("client_warn_message") - config.client_warn_message = value + client_warn_message = value if("client_error_version") - config.client_error_version = text2num(value) + client_error_version = text2num(value) if("client_error_message") - config.client_error_message = value + client_error_message = value if("minute_topic_limit") - config.minutetopiclimit = text2num(value) + minutetopiclimit = text2num(value) if("second_topic_limit") - config.secondtopiclimit = text2num(value) + secondtopiclimit = text2num(value) if("error_cooldown") error_cooldown = text2num(value) if("error_limit") @@ -531,75 +543,75 @@ else if(type == "game_options") switch(name) if("damage_multiplier") - config.damage_multiplier = text2num(value) + damage_multiplier = text2num(value) if("revival_pod_plants") - config.revival_pod_plants = text2num(value) + revival_pod_plants = text2num(value) if("revival_cloning") - config.revival_cloning = text2num(value) + revival_cloning = text2num(value) if("revival_brain_life") - config.revival_brain_life = text2num(value) + revival_brain_life = text2num(value) if("rename_cyborg") - config.rename_cyborg = 1 + rename_cyborg = 1 if("ooc_during_round") - config.ooc_during_round = 1 + ooc_during_round = 1 if("emojis") - config.emojis = 1 + emojis = 1 if("run_delay") - config.run_speed = text2num(value) + run_speed = text2num(value) if("walk_delay") - config.walk_speed = text2num(value) + walk_speed = text2num(value) if("human_delay") - config.human_delay = text2num(value) + human_delay = text2num(value) if("robot_delay") - config.robot_delay = text2num(value) + robot_delay = text2num(value) if("monkey_delay") - config.monkey_delay = text2num(value) + monkey_delay = text2num(value) if("alien_delay") - config.alien_delay = text2num(value) + alien_delay = text2num(value) if("slime_delay") - config.slime_delay = text2num(value) + slime_delay = text2num(value) if("animal_delay") - config.animal_delay = text2num(value) + animal_delay = text2num(value) if("alert_red_upto") - config.alert_desc_red_upto = value + alert_desc_red_upto = value if("alert_red_downto") - config.alert_desc_red_downto = value + alert_desc_red_downto = value if("alert_blue_downto") - config.alert_desc_blue_downto = value + alert_desc_blue_downto = value if("alert_blue_upto") - config.alert_desc_blue_upto = value + alert_desc_blue_upto = value if("alert_green") - config.alert_desc_green = value + alert_desc_green = value if("alert_delta") - config.alert_desc_delta = value + alert_desc_delta = value if("no_intercept_report") - config.intercept = 0 + intercept = 0 if("assistants_have_maint_access") - config.jobs_have_maint_access |= ASSISTANTS_HAVE_MAINT_ACCESS + jobs_have_maint_access |= ASSISTANTS_HAVE_MAINT_ACCESS if("security_has_maint_access") - config.jobs_have_maint_access |= SECURITY_HAS_MAINT_ACCESS + jobs_have_maint_access |= SECURITY_HAS_MAINT_ACCESS if("everyone_has_maint_access") - config.jobs_have_maint_access |= EVERYONE_HAS_MAINT_ACCESS + jobs_have_maint_access |= EVERYONE_HAS_MAINT_ACCESS if("sec_start_brig") - config.sec_start_brig = 1 + sec_start_brig = 1 if("gateway_delay") - config.gateway_delay = text2num(value) + gateway_delay = text2num(value) if("continuous") var/mode_name = lowertext(value) - if(mode_name in config.modes) - config.continuous[mode_name] = 1 + if(mode_name in modes) + continuous[mode_name] = 1 else GLOB.diary << "Unknown continuous configuration definition: [mode_name]." if("midround_antag") var/mode_name = lowertext(value) - if(mode_name in config.modes) - config.midround_antag[mode_name] = 1 + if(mode_name in modes) + midround_antag[mode_name] = 1 else GLOB.diary << "Unknown midround antagonist configuration definition: [mode_name]." if("midround_antag_time_check") - config.midround_antag_time_check = text2num(value) + midround_antag_time_check = text2num(value) if("midround_antag_life_check") - config.midround_antag_life_check = text2num(value) + midround_antag_life_check = text2num(value) if("min_pop") var/pop_pos = findtext(value, " ") var/mode_name = null @@ -608,8 +620,8 @@ if(pop_pos) mode_name = lowertext(copytext(value, 1, pop_pos)) mode_value = copytext(value, pop_pos + 1) - if(mode_name in config.modes) - config.min_pop[mode_name] = text2num(mode_value) + if(mode_name in modes) + min_pop[mode_name] = text2num(mode_value) else GLOB.diary << "Unknown minimum population configuration definition: [mode_name]." else @@ -622,28 +634,28 @@ if(pop_pos) mode_name = lowertext(copytext(value, 1, pop_pos)) mode_value = copytext(value, pop_pos + 1) - if(mode_name in config.modes) - config.max_pop[mode_name] = text2num(mode_value) + if(mode_name in modes) + max_pop[mode_name] = text2num(mode_value) else GLOB.diary << "Unknown maximum population configuration definition: [mode_name]." else GLOB.diary << "Incorrect maximum population configuration definition: [mode_name] [mode_value]." if("shuttle_refuel_delay") - config.shuttle_refuel_delay = text2num(value) + shuttle_refuel_delay = text2num(value) if("show_game_type_odds") - config.show_game_type_odds = 1 + show_game_type_odds = 1 if("ghost_interaction") - config.ghost_interaction = 1 + ghost_interaction = 1 if("traitor_scaling_coeff") - config.traitor_scaling_coeff = text2num(value) + traitor_scaling_coeff = text2num(value) if("changeling_scaling_coeff") - config.changeling_scaling_coeff = text2num(value) + changeling_scaling_coeff = text2num(value) if("security_scaling_coeff") - config.security_scaling_coeff = text2num(value) + security_scaling_coeff = text2num(value) if("abductor_scaling_coeff") - config.abductor_scaling_coeff = text2num(value) + abductor_scaling_coeff = text2num(value) if("traitor_objectives_amount") - config.traitor_objectives_amount = text2num(value) + traitor_objectives_amount = text2num(value) if("probability") var/prob_pos = findtext(value, " ") var/prob_name = null @@ -652,51 +664,51 @@ 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) + if(prob_name in modes) + probabilities[prob_name] = text2num(prob_value) else GLOB.diary << "Unknown game mode probability configuration definition: [prob_name]." else GLOB.diary << "Incorrect probability configuration definition: [prob_name] [prob_value]." if("protect_roles_from_antagonist") - config.protect_roles_from_antagonist = 1 + protect_roles_from_antagonist = 1 if("protect_assistant_from_antagonist") - config.protect_assistant_from_antagonist = 1 + protect_assistant_from_antagonist = 1 if("enforce_human_authority") - config.enforce_human_authority = 1 + enforce_human_authority = 1 if("allow_latejoin_antagonists") - config.allow_latejoin_antagonists = 1 + allow_latejoin_antagonists = 1 if("allow_random_events") - config.allow_random_events = 1 + allow_random_events = 1 if("events_min_time_mul") - config.events_min_time_mul = text2num(value) + events_min_time_mul = text2num(value) if("events_min_players_mul") - config.events_min_players_mul = text2num(value) + events_min_players_mul = text2num(value) if("minimal_access_threshold") - config.minimal_access_threshold = text2num(value) + minimal_access_threshold = text2num(value) if("jobs_have_minimal_access") - config.jobs_have_minimal_access = 1 + jobs_have_minimal_access = 1 if("humans_need_surnames") humans_need_surnames = 1 if("force_random_names") - config.force_random_names = 1 + force_random_names = 1 if("allow_ai") - config.allow_ai = 1 + allow_ai = 1 if("disable_secborg") - config.forbid_secborg = 1 + forbid_secborg = 1 if("disable_peaceborg") - config.forbid_peaceborg = 1 + forbid_peaceborg = 1 if("silent_ai") - config.silent_ai = 1 + silent_ai = 1 if("silent_borg") - config.silent_borg = 1 + silent_borg = 1 if("sandbox_autoclose") - config.sandbox_autoclose = 1 + sandbox_autoclose = 1 if("default_laws") - config.default_laws = text2num(value) + default_laws = text2num(value) if("random_laws") var/law_id = lowertext(value) lawids += law_id @@ -711,9 +723,9 @@ law_weights[lawid] = weight if("silicon_max_law_amount") - config.silicon_max_law_amount = text2num(value) + silicon_max_law_amount = text2num(value) if("join_with_mutant_race") - config.mutant_races = 1 + mutant_races = 1 if("roundstart_races") var/race_id = lowertext(value) for(var/species_id in GLOB.species_list) @@ -721,25 +733,25 @@ roundstart_races += GLOB.species_list[species_id] GLOB.roundstart_species[species_id] = GLOB.species_list[species_id] if("join_with_mutant_humans") - config.mutant_humans = 1 + mutant_humans = 1 if("assistant_cap") - config.assistant_cap = text2num(value) + assistant_cap = text2num(value) if("starlight") - config.starlight = 1 + starlight = 1 if("grey_assistants") - config.grey_assistants = 1 + grey_assistants = 1 if("lavaland_budget") - config.lavaland_budget = text2num(value) + lavaland_budget = text2num(value) if("space_budget") - config.space_budget = text2num(value) + space_budget = text2num(value) if("no_summon_guns") - config.no_summon_guns = 1 + no_summon_guns = 1 if("no_summon_magic") - config.no_summon_magic = 1 + no_summon_magic = 1 if("no_summon_events") - config.no_summon_events = 1 + no_summon_events = 1 if("reactionary_explosions") - config.reactionary_explosions = 1 + reactionary_explosions = 1 if("bombcap") var/BombCap = text2num(value) if (!BombCap) @@ -753,9 +765,9 @@ GLOB.MAX_EX_FLASH_RANGE = BombCap GLOB.MAX_EX_FLAME_RANGE = BombCap if("arrivals_shuttle_dock_window") - config.arrivals_shuttle_dock_window = max(PARALLAX_LOOP_TIME, text2num(value)) + arrivals_shuttle_dock_window = max(PARALLAX_LOOP_TIME, text2num(value)) if("arrivals_shuttle_require_safe_latejoin") - config.arrivals_shuttle_require_safe_latejoin = text2num(value) + arrivals_shuttle_require_safe_latejoin = text2num(value) else GLOB.diary << "Unknown setting in configuration: '[name]'" @@ -806,9 +818,9 @@ if ("weight","voteweight") currentmap.voteweight = text2num(data) if ("default","defaultmap") - config.defaultmap = currentmap + defaultmap = currentmap if ("endmap") - config.maplist[currentmap.map_name] = currentmap + maplist[currentmap.map_name] = currentmap currentmap = null else GLOB.diary << "Unknown command in map vote config: '[command]'" @@ -841,7 +853,7 @@ switch(name) if("sql_enabled") - config.sql_enabled = 1 + sql_enabled = 1 if("address") global.sqladdress = value if("port") @@ -911,4 +923,4 @@ if(!statclick) statclick = new/obj/effect/statclick/debug(null, "Edit", src) - stat("[name]:", statclick) \ No newline at end of file + stat("[name]:", statclick) diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 259524bb0c9..f90960b92f0 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -65,7 +65,7 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING) else init_subtypes(/datum/controller/subsystem, subsystems) Master = src - + if(!GLOB) new /datum/controller/global_vars diff --git a/code/world.dm b/code/world.dm index 618e8b3f9ef..ea6c35ebec4 100644 --- a/code/world.dm +++ b/code/world.dm @@ -35,7 +35,7 @@ GLOB.changelog_hash = md5('html/changelog.html') //used for telling if the changelog has changed recently make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once) - load_configuration() + config = new GLOB.revdata.DownloadPRDetails() load_mode() load_motd() @@ -272,18 +272,6 @@ /world/proc/load_motd() GLOB.join_motd = file2text("config/motd.txt") + "
" + GLOB.revdata.GetTestMergeInfo() -/world/proc/load_configuration() - config = new /datum/configuration() - config.load("config/config.txt") - config.load("config/game_options.txt","game_options") - config.loadsql("config/dbconfig.txt") - if (config.maprotation) - config.loadmaplist("config/maps.txt") - - // apply some settings from config.. - GLOB.abandon_allowed = config.respawn - - /world/proc/update_status() var/s = "" @@ -333,4 +321,4 @@ if (features) s += ": [jointext(features, ", ")]" - status = s \ No newline at end of file + status = s