Ports the TG globals controller and converts globals. (#18057)

* SDQL2 update

* fix that verb

* cl

* fix that

* toworld

* this is pointless

* update info

* siiiiick..

* vv edit update

* fix that

* fix editing vars

* fix VV

* Port the /TG/ globals controller.

* part 1

* part 2

* oops

* part 3

* Hollow Purple

* sadas

* bsbsdb

* muda na agaki ta

* ids 1-15

* 16-31

* 41-75

* bring me back to how things used to be before i lost it all

* the strength of mayhem

* final touches

* cl

* protect some vars

* update sdql2 to use glob

* stuff?

* forgot that is not defined there

* whoops

* observ

* but it never gets better

* a

---------

Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
Matt Atlas
2023-12-26 01:16:02 +00:00
committed by GitHub
co-authored by Matt Atlas
parent 19292f01d3
commit cadd19beac
966 changed files with 4785 additions and 4784 deletions
+178 -178
View File
@@ -1,4 +1,4 @@
var/list/gamemode_cache = list()
GLOBAL_LIST_EMPTY(gamemode_cache)
/datum/configuration
var/server_name = null // server name (for world name / status)
@@ -487,7 +487,7 @@ GENERAL_PROTECT_DATUM(/datum/configuration)
// 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.
GLOB.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_DEBUG("Adding game mode [M.name] ([M.config_tag]) to configuration.")
src.modes += M.config_tag
@@ -526,179 +526,179 @@ GENERAL_PROTECT_DATUM(/datum/configuration)
if(type == "config")
switch (name)
if ("auto_local_admin")
config.auto_local_admin = TRUE
GLOB.config.auto_local_admin = TRUE
if ("admin_legacy_system")
config.admin_legacy_system = 1
GLOB.config.admin_legacy_system = 1
if ("ban_legacy_system")
config.ban_legacy_system = 1
GLOB.config.ban_legacy_system = 1
if ("use_age_restriction_for_jobs")
config.use_age_restriction_for_jobs = 1
GLOB.config.use_age_restriction_for_jobs = 1
if ("use_age_restriction_for_antags")
config.use_age_restriction_for_antags = 1
GLOB.config.use_age_restriction_for_antags = 1
if ("load_age_restrictions_from_file")
config.age_restrictions_from_file = 1
GLOB.config.age_restrictions_from_file = 1
if ("jobs_have_minimal_access")
config.jobs_have_minimal_access = 1
GLOB.config.jobs_have_minimal_access = 1
if ("use_spreading_explosions")
use_spreading_explosions = 1
GLOB.config.use_spreading_explosions = 1
if ("sql_enabled")
config.sql_enabled = 1
GLOB.config.sql_enabled = 1
if ("debug_paranoid")
config.debugparanoid = 1
GLOB.config.debugparanoid = 1
if ("dungeon_chance")
config.dungeon_chance = text2num(value)
GLOB.config.dungeon_chance = text2num(value)
if ("generate_asteroid")
config.generate_asteroid = 1
GLOB.config.generate_asteroid = 1
if ("no_click_cooldown")
config.no_click_cooldown = 1
GLOB.config.no_click_cooldown = 1
if("allow_admin_ooccolor")
config.allow_admin_ooccolor = 1
GLOB.config.allow_admin_ooccolor = 1
if ("allow_vote_restart")
config.allow_vote_restart = 1
GLOB.config.allow_vote_restart = 1
if ("allow_vote_mode")
config.allow_vote_mode = 1
GLOB.config.allow_vote_mode = 1
if ("allow_admin_jump")
config.allow_admin_jump = 1
GLOB.config.allow_admin_jump = 1
if ("allow_admin_rev")
config.allow_admin_rev = 1
GLOB.config.allow_admin_rev = 1
if ("allow_admin_spawning")
config.allow_admin_spawning = 1
GLOB.config.allow_admin_spawning = 1
if ("no_dead_vote")
config.vote_no_dead = 1
GLOB.config.vote_no_dead = 1
if ("default_no_vote")
config.vote_no_default = 1
GLOB.config.vote_no_default = 1
if ("vote_delay")
config.vote_delay = text2num(value)
GLOB.config.vote_delay = text2num(value)
if ("vote_period")
config.vote_period = text2num(value)
GLOB.config.vote_period = text2num(value)
if ("vote_autotransfer_initial")
config.vote_autotransfer_initial = text2num(value)
GLOB.config.vote_autotransfer_initial = text2num(value)
if ("vote_autotransfer_interval")
config.vote_autotransfer_interval = text2num(value)
GLOB.config.vote_autotransfer_interval = text2num(value)
if ("vote_autogamemode_timeleft")
config.vote_autogamemode_timeleft = text2num(value)
GLOB.config.vote_autogamemode_timeleft = text2num(value)
if ("transfer_timeout")
config.transfer_timeout = text2num(value)
GLOB.config.transfer_timeout = text2num(value)
if ("restart_timeout")
config.restart_timeout = text2num(value)
GLOB.config.restart_timeout = text2num(value)
if("ert_admin_only")
config.ert_admin_call_only = 1
GLOB.config.ert_admin_call_only = 1
if ("allow_ai")
config.allow_ai = 1
GLOB.config.allow_ai = 1
if ("respawn_delay")
config.respawn_delay = text2num(value)
GLOB.config.respawn_delay = text2num(value)
if ("hacked_drones_limit")
config.hacked_drones_limit = text2num(value)
GLOB.config.hacked_drones_limit = text2num(value)
if ("servername")
config.server_name = value
GLOB.config.server_name = value
if ("serversuffix")
config.server_suffix = 1
GLOB.config.server_suffix = 1
if ("hostedby")
config.hostedby = value
GLOB.config.hostedby = value
if ("server")
config.server = value
GLOB.config.server = value
if ("banappeals")
config.banappeals = value
GLOB.config.banappeals = value
if ("wikiurl")
config.wikiurl = value
GLOB.config.wikiurl = value
if ("forumurl")
config.forumurl = value
GLOB.config.forumurl = value
if ("forum_passphrase")
config.forum_passphrase = value
GLOB.config.forum_passphrase = value
if ("githuburl")
config.githuburl = value
GLOB.config.githuburl = value
if ("ghosts_can_possess_animals")
config.ghosts_can_possess_animals = value
GLOB.config.ghosts_can_possess_animals = value
if ("observe_restriction")
config.observe_restriction = text2num(value)
GLOB.config.observe_restriction = text2num(value)
if ("guest_jobban")
config.guest_jobban = 1
GLOB.config.guest_jobban = 1
if ("guest_ban")
config.guests_allowed = 0
GLOB.config.guests_allowed = 0
if ("disable_ooc")
config.ooc_allowed = 0
config.looc_allowed = 0
GLOB.config.ooc_allowed = 0
GLOB.config.looc_allowed = 0
if ("disable_entry")
config.enter_allowed = 0
GLOB.config.enter_allowed = 0
if ("disable_dead_ooc")
config.dooc_allowed = 0
GLOB.config.dooc_allowed = 0
if ("disable_dead_looc")
config.dead_looc_allowed = FALSE
GLOB.config.dead_looc_allowed = FALSE
if ("disable_dsay")
config.dsay_allowed = 0
GLOB.config.dsay_allowed = 0
if ("disable_respawn")
config.abandon_allowed = 0
GLOB.config.abandon_allowed = 0
if ("usewhitelist")
config.usewhitelist = 1
GLOB.config.usewhitelist = 1
if ("feature_object_spell_system")
config.feature_object_spell_system = 1
GLOB.config.feature_object_spell_system = 1
if ("allow_metadata")
config.allow_Metadata = 1
GLOB.config.allow_Metadata = 1
if ("traitor_scaling")
config.traitor_scaling = 1
GLOB.config.traitor_scaling = 1
if ("ninjas_allowed")
config.ninjas_allowed = 1
GLOB.config.ninjas_allowed = 1
if ("objectives_disabled")
config.objectives_disabled = 1
GLOB.config.objectives_disabled = 1
if("protect_roles_from_antagonist")
config.protect_roles_from_antagonist = 1
GLOB.config.protect_roles_from_antagonist = 1
if ("probability")
var/list/chunks = splittext(value, " ")
@@ -710,71 +710,71 @@ GENERAL_PROTECT_DATUM(/datum/configuration)
prob_type = lowertext(chunks[1])
prob_name = lowertext(chunks[2])
prob_value = text2num(chunks[3])
if (prob_name in config.modes)
if (prob_name in GLOB.config.modes)
// S adds a mode to standard secret rotation
// MS adds a mode to mixed secret rotation
if (prob_type == "s")
config.probabilities_secret[prob_name] = prob_value
GLOB.config.probabilities_secret[prob_name] = prob_value
else if (prob_type == "ms")
config.probabilities_mixed_secret[prob_name] = prob_value
GLOB.config.probabilities_mixed_secret[prob_name] = prob_value
else
log_config("Unknown game mode probability configuration definition: [prob_name].")
else
log_config("Incorrect probability configuration definition: [prob_name] [prob_value].")
if("allow_random_events")
config.allow_random_events = 1
GLOB.config.allow_random_events = 1
if("kick_inactive")
config.kick_inactive = text2num(value)
GLOB.config.kick_inactive = text2num(value)
if("show_mods")
config.show_mods = 1
GLOB.config.show_mods = 1
if("show_mentors")
config.show_mentors = 1
GLOB.config.show_mentors = 1
if("mods_can_tempban")
config.mods_can_tempban = 1
GLOB.config.mods_can_tempban = 1
if("mods_can_job_tempban")
config.mods_can_job_tempban = 1
GLOB.config.mods_can_job_tempban = 1
if("mod_tempban_max")
config.mod_tempban_max = text2num(value)
GLOB.config.mod_tempban_max = text2num(value)
if("mod_job_tempban_max")
config.mod_job_tempban_max = text2num(value)
GLOB.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
GLOB.config.alert_desc_red_upto = value
if("alert_red_downto")
config.alert_desc_red_downto = value
GLOB.config.alert_desc_red_downto = value
if("alert_blue_downto")
config.alert_desc_blue_downto = value
GLOB.config.alert_desc_blue_downto = value
if("alert_blue_upto")
config.alert_desc_blue_upto = value
GLOB.config.alert_desc_blue_upto = value
if("alert_green")
config.alert_desc_green = value
GLOB.config.alert_desc_green = value
if("alert_yellow")
config.alert_desc_yellow_to = value
GLOB.config.alert_desc_yellow_to = value
if("alert_delta")
config.alert_desc_delta = value
GLOB.config.alert_desc_delta = value
if("forbid_singulo_possession")
forbid_singulo_possession = 1
if("popup_admin_pm")
config.popup_admin_pm = 1
GLOB.config.popup_admin_pm = 1
if("allow_holidays")
Holiday = 1
@@ -783,9 +783,9 @@ GENERAL_PROTECT_DATUM(/datum/configuration)
Ticklag = text2num(value)
if("allow_antag_hud")
config.antag_hud_allowed = 1
GLOB.config.antag_hud_allowed = 1
if("antag_hud_restricted")
config.antag_hud_restricted = 1
GLOB.config.antag_hud_restricted = 1
if("ipc_timelock_active")
ipc_timelock_active = TRUE
@@ -807,137 +807,137 @@ GENERAL_PROTECT_DATUM(/datum/configuration)
alien_to_human_ratio = text2num(value)
if("assistant_maint")
config.assistant_maint = 1
GLOB.config.assistant_maint = 1
if("gateway_delay")
config.gateway_delay = text2num(value)
GLOB.config.gateway_delay = text2num(value)
if("ghost_interaction")
config.ghost_interaction = 1
GLOB.config.ghost_interaction = 1
if("time_offset")
config.time_offset = text2num(value)
GLOB.config.time_offset = text2num(value)
if("disable_player_rats")
config.disable_player_rats = 1
GLOB.config.disable_player_rats = 1
if("uneducated_rats")
config.uneducated_rats = 1
GLOB.config.uneducated_rats = 1
if("use_discord_pins")
config.use_discord_pins = 1
GLOB.config.use_discord_pins = 1
if("python_path")
if(value)
config.python_path = value
GLOB.config.python_path = value
if("allow_cult_ghostwriter")
config.cult_ghostwriter = 1
GLOB.config.cult_ghostwriter = 1
if("req_cult_ghostwriter")
config.cult_ghostwriter_req_cultists = text2num(value)
GLOB.config.cult_ghostwriter_req_cultists = text2num(value)
if("character_slots")
config.character_slots = text2num(value)
GLOB.config.character_slots = text2num(value)
if("loadout_slots")
config.loadout_slots = text2num(value)
GLOB.config.loadout_slots = text2num(value)
if("allow_drone_spawn")
config.allow_drone_spawn = text2num(value)
GLOB.config.allow_drone_spawn = text2num(value)
if("drone_build_time")
config.drone_build_time = text2num(value)
GLOB.config.drone_build_time = text2num(value)
if("max_maint_drones")
config.max_maint_drones = text2num(value)
GLOB.config.max_maint_drones = text2num(value)
if("expected_round_length")
config.expected_round_length = MinutesToTicks(text2num(value))
GLOB.config.expected_round_length = MinutesToTicks(text2num(value))
if("disable_welder_vision")
config.welder_vision = 0
GLOB.config.welder_vision = 0
if("allow_extra_antags")
config.allow_extra_antags = 1
GLOB.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]))
GLOB.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]))
GLOB.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]))
GLOB.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])
GLOB.config.event_delay_lower[EVENT_LEVEL_MUNDANE] = MinutesToTicks(values[1])
GLOB.config.event_delay_lower[EVENT_LEVEL_MODERATE] = MinutesToTicks(values[2])
GLOB.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])
GLOB.config.event_delay_upper[EVENT_LEVEL_MUNDANE] = MinutesToTicks(values[1])
GLOB.config.event_delay_upper[EVENT_LEVEL_MODERATE] = MinutesToTicks(values[2])
GLOB.config.event_delay_upper[EVENT_LEVEL_MAJOR] = MinutesToTicks(values[3])
if("starlight")
value = text2num(value)
config.starlight = value >= 0 ? value : 0
GLOB.config.starlight = value >= 0 ? value : 0
if("openturf_starlight")
openturf_starlight_permitted = TRUE
if("ert_species")
config.ert_species = text2list(value, ";")
if(!config.ert_species.len)
config.ert_species += SPECIES_HUMAN
GLOB.config.ert_species = text2list(value, ";")
if(!GLOB.config.ert_species.len)
GLOB.config.ert_species += SPECIES_HUMAN
if("law_zero")
law_zero = value
if("aggressive_changelog")
config.aggressive_changelog = 1
GLOB.config.aggressive_changelog = 1
if("sql_whitelists")
config.sql_whitelists = 1
GLOB.config.sql_whitelists = 1
if("show_auxiliary_roles")
config.show_auxiliary_roles = 1
GLOB.config.show_auxiliary_roles = 1
if("webint_url")
config.webint_url = value
GLOB.config.webint_url = value
if("sql_saves")
config.sql_saves = 1
GLOB.config.sql_saves = 1
if("sql_ccia_logs")
config.sql_ccia_logs = 1
GLOB.config.sql_ccia_logs = 1
if("client_error_version")
config.client_error_version = text2num(value)
GLOB.config.client_error_version = text2num(value)
if("client_error_message")
config.client_error_message = value
GLOB.config.client_error_message = value
if("client_warn_version")
config.client_warn_version = text2num(value)
GLOB.config.client_warn_version = text2num(value)
if("client_warn_message")
config.client_warn_message = value
GLOB.config.client_warn_message = value
if("client_blacklist_version")
config.client_blacklist_version = splittext(value, ";")
GLOB.config.client_blacklist_version = splittext(value, ";")
if("allow_chat_markup")
config.allow_chat_markup = 1
GLOB.config.allow_chat_markup = 1
if("sql_stats")
config.sql_stats = 1
GLOB.config.sql_stats = 1
if("default_language_prefixes")
var/list/values = text2list(value, " ")
@@ -945,19 +945,19 @@ GENERAL_PROTECT_DATUM(/datum/configuration)
language_prefixes = values
if("delist_when_no_admins")
config.delist_when_no_admins = 1
GLOB.config.delist_when_no_admins = 1
if("antag_contest_enabled")
config.antag_contest_enabled = 1
GLOB.config.antag_contest_enabled = 1
if("api_rate_limit")
config.api_rate_limit = text2num(value)
GLOB.config.api_rate_limit = text2num(value)
if("api_rate_limit_whitelist")
config.api_rate_limit_whitelist = text2list(value, ";")
GLOB.config.api_rate_limit_whitelist = text2list(value, ";")
if("mc_ticklimit_init")
config.mc_init_tick_limit = text2num(value) || TICK_LIMIT_MC_INIT_DEFAULT
GLOB.config.mc_init_tick_limit = text2num(value) || TICK_LIMIT_MC_INIT_DEFAULT
if("ipintel_email")
if (value != "ch@nge.me")
@@ -991,13 +991,13 @@ GENERAL_PROTECT_DATUM(/datum/configuration)
LOG_DEBUG("Fastboot is ENABLED.")
if("merchant_chance")
config.merchant_chance = text2num(value)
GLOB.config.merchant_chance = text2num(value)
if("time_to_call_emergency_shuttle")
config.time_to_call_emergency_shuttle = text2num(value)
GLOB.config.time_to_call_emergency_shuttle = text2num(value)
if("current_space_sector")
config.current_space_sector = value
GLOB.config.current_space_sector = value
if("force_map")
override_map = value
@@ -1012,7 +1012,7 @@ GENERAL_PROTECT_DATUM(/datum/configuration)
iterative_explosives_z_subtraction = text2num(value)
if("show_game_type_odd")
config.show_game_type_odd = 1
GLOB.config.show_game_type_odd = 1
if ("ticket_reminder_period")
ticket_reminder_period = text2num(value)
@@ -1098,65 +1098,65 @@ GENERAL_PROTECT_DATUM(/datum/configuration)
switch(name)
if("health_threshold_softcrit")
config.health_threshold_softcrit = value
GLOB.config.health_threshold_softcrit = value
if("health_threshold_dead")
config.health_threshold_dead = value
GLOB.config.health_threshold_dead = value
if("revival_pod_plants")
config.revival_pod_plants = value
GLOB.config.revival_pod_plants = value
if("revival_cloning")
config.revival_cloning = value
GLOB.config.revival_cloning = value
if("revival_brain_life")
config.revival_brain_life = value
GLOB.config.revival_brain_life = value
if("organ_health_multiplier")
config.organ_health_multiplier = value / 100
GLOB.config.organ_health_multiplier = value / 100
if("organ_regeneration_multiplier")
config.organ_regeneration_multiplier = value / 100
GLOB.config.organ_regeneration_multiplier = value / 100
if("organ_damage_spillover_multiplier")
config.organ_damage_spillover_multiplier = value / 100
GLOB.config.organ_damage_spillover_multiplier = value / 100
if("organs_can_decay")
config.organs_decay = 1
GLOB.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)
GLOB.config.default_brain_health = text2num(value)
if(!GLOB.config.default_brain_health || GLOB.config.default_brain_health < 1)
GLOB.config.default_brain_health = initial(GLOB.config.default_brain_health)
if("bones_can_break")
config.bones_can_break = value
GLOB.config.bones_can_break = value
if("limbs_can_break")
config.limbs_can_break = value
GLOB.config.limbs_can_break = value
if("walk_speed")
config.walk_speed = value
GLOB.config.walk_speed = value
// These should never go to 0 or below. So, we clamp them.
if("walk_delay_multiplier")
config.walk_delay_multiplier = max(0.1, value)
GLOB.config.walk_delay_multiplier = max(0.1, value)
if("run_delay_multiplier")
config.run_delay_multiplier = max(0.1, value)
GLOB.config.run_delay_multiplier = max(0.1, value)
if("vehicle_delay_multiplier")
config.vehicle_delay_multiplier = max(0.1, value)
GLOB.config.vehicle_delay_multiplier = max(0.1, value)
if("human_delay")
config.human_delay = value
GLOB.config.human_delay = value
if("robot_delay")
config.robot_delay = value
GLOB.config.robot_delay = value
if("monkey_delay")
config.monkey_delay = value
GLOB.config.monkey_delay = value
if("alien_delay")
config.alien_delay = value
GLOB.config.alien_delay = value
if("slime_delay")
config.slime_delay = value
GLOB.config.slime_delay = value
if("animal_delay")
config.animal_delay = value
GLOB.config.animal_delay = value
if("use_loyalty_implants")
config.use_loyalty_implants = 1
GLOB.config.use_loyalty_implants = 1
if ("sunlight_accuracy")
config.sun_accuracy = value
GLOB.config.sun_accuracy = value
if ("sunlight_z")
config.sun_target_z = value
GLOB.config.sun_target_z = value
else
log_config("Unknown setting in configuration: '[name]'")
@@ -1187,8 +1187,8 @@ GENERAL_PROTECT_DATUM(/datum/configuration)
load_exoplanets_config()
/datum/configuration/proc/save_logging_config()
rustg_file_write(json_encode(config.logsettings), "config/logging.json")
rustg_file_write(json_encode(config.logfiles), "config/logging_files.json")
rustg_file_write(json_encode(GLOB.config.logsettings), "config/logging.json")
rustg_file_write(json_encode(GLOB.config.logfiles), "config/logging_files.json")
/*#############################################
JSON loading configs functions section
@@ -1227,28 +1227,28 @@ GENERAL_PROTECT_DATUM(/datum/configuration)
/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]
for (var/game_mode in GLOB.gamemode_cache)
var/datum/game_mode/M = GLOB.gamemode_cache[game_mode]
if (M.config_tag && M.config_tag == mode_name)
return M
return gamemode_cache["extended"]
return GLOB.gamemode_cache["extended"]
/datum/configuration/proc/get_runnable_modes(secret_type = ROUNDTYPE_STR_SECRET)
log_game("GAMEMODE: Checking runnable modes with secret_type set to [secret_type]...")
var/list/probabilities = config.probabilities_secret
var/list/probabilities = GLOB.config.probabilities_secret
if (secret_type == ROUNDTYPE_STR_MIXED_SECRET)
probabilities = config.probabilities_mixed_secret
probabilities = GLOB.config.probabilities_mixed_secret
else if (secret_type == ROUNDTYPE_STR_RANDOM)
// Random picks from EVERYTHING. Need to use Copy() as to not pollute the
// original list. PBRef is /great/.
probabilities = config.probabilities_secret.Copy()
probabilities |= config.probabilities_mixed_secret
probabilities = GLOB.config.probabilities_secret.Copy()
probabilities |= GLOB.config.probabilities_mixed_secret
var/list/runnable_modes = list()
for(var/game_mode in gamemode_cache)
var/datum/game_mode/M = gamemode_cache[game_mode]
for(var/game_mode in GLOB.gamemode_cache)
var/datum/game_mode/M = GLOB.gamemode_cache[game_mode]
if(!M)
log_config("GAMEMODE: ERROR: [M] does not exist!")
continue
@@ -1275,14 +1275,14 @@ GENERAL_PROTECT_DATUM(/datum/configuration)
/datum/configuration/proc/post_load()
// Apply a default value to config.python_path, if needed
if (!config.python_path)
if (!GLOB.config.python_path)
if(world.system_type == UNIX)
config.python_path = "/usr/bin/env python2"
GLOB.config.python_path = "/usr/bin/env python2"
else //probably windows, if not this should work anyway
config.python_path = "python"
GLOB.config.python_path = "python"
// If we are running the unit tests, turn every logging to on
#if defined(UNIT_TEST)
for(var/k in config.logsettings)
config.logsettings[k] = TRUE
for(var/k in GLOB.config.logsettings)
GLOB.config.logsettings[k] = TRUE
#endif
+4
View File
@@ -3,6 +3,10 @@
// The object used for the clickable stat() button.
var/obj/effect/statclick/statclick
/datum/controller/Destroy()
QDEL_NULL(statclick)
return ..()
/datum/controller/proc/Initialize()
//cleanup actions
+58
View File
@@ -0,0 +1,58 @@
GLOBAL_REAL(GLOB, /datum/controller/global_vars)
/datum/controller/global_vars
name = "Global Variables"
var/static/list/gvars_datum_protected_varlist
var/list/gvars_datum_in_built_vars
var/list/gvars_datum_init_order
/datum/controller/global_vars/New()
if(GLOB)
CRASH("Multiple instances of global variable controller created")
GLOB = src
var/datum/controller/exclude_these = new
gvars_datum_in_built_vars = exclude_these.vars + list(NAMEOF(src, gvars_datum_protected_varlist), NAMEOF(src, gvars_datum_in_built_vars), NAMEOF(src, gvars_datum_init_order))
QDEL_IN(exclude_these, 0) //signal logging isn't ready
Initialize()
/datum/controller/global_vars/Destroy(force)
// This is done to prevent an exploit where admins can get around protected vars
SHOULD_CALL_PARENT(FALSE)
return QDEL_HINT_IWILLGC
/datum/controller/global_vars/stat_entry(msg)
msg = "Edit"
return msg
/datum/controller/global_vars/vv_edit_var(var_name, var_value)
if(gvars_datum_protected_varlist[var_name])
return FALSE
return ..()
/datum/controller/global_vars/Initialize()
gvars_datum_init_order = list()
gvars_datum_protected_varlist = list(NAMEOF(src, gvars_datum_protected_varlist) = TRUE)
var/list/global_procs = typesof(/datum/controller/global_vars/proc)
var/expected_len = vars.len - gvars_datum_in_built_vars.len
if(global_procs.len != expected_len)
warning("Unable to detect all global initialization procs! Expected [expected_len] got [global_procs.len]!")
if(global_procs.len)
var/list/expected_global_procs = vars - gvars_datum_in_built_vars
for(var/I in global_procs)
expected_global_procs -= replacetext("[I]", "InitGlobal", "")
log_world("Missing procs: [expected_global_procs.Join(", ")]")
for(var/I in global_procs)
var/start_tick = world.time
call(src, I)()
var/end_tick = world.time
if(end_tick - start_tick)
warning("Global [replacetext("[I]", "InitGlobal", "")] slept during initialization!")
// Someone make it so this call isn't necessary.
// No, really, it's really bad.
makeDatumRefLists()
+3 -1
View File
@@ -70,6 +70,8 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
else
init_subtypes(/datum/controller/subsystem, subsystems)
Master = src
if(!GLOB)
new /datum/controller/global_vars
/datum/controller/master/Destroy()
..()
@@ -225,7 +227,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
#endif
world.TgsInitializationComplete()
world.change_tick_lag(config.Ticklag)
world.change_tick_lag(GLOB.config.Ticklag)
var/initialized_tod = REALTIMEOFDAY
+1 -1
View File
@@ -9,7 +9,7 @@ SUBSYSTEM_DEF(assets)
/datum/controller/subsystem/assets/Initialize()
var/newtransporttype = /datum/asset_transport
switch (config.asset_transport)
switch (GLOB.config.asset_transport)
if ("webroot")
newtransporttype = /datum/asset_transport/webroot
+12 -12
View File
@@ -70,10 +70,10 @@ SUBSYSTEM_DEF(cargo)
supply_account = SSeconomy.get_department_account("Operations")
//Load in the cargo items config
if(config.cargo_load_items_from == "sql")
if(GLOB.config.cargo_load_items_from == "sql")
log_subsystem_cargo("SScargo: Attempting to Load from SQL")
load_from_sql()
else if(config.cargo_load_items_from == "json")
else if(GLOB.config.cargo_load_items_from == "json")
log_subsystem_cargo("SScargo: Attempting to Load from JSON")
load_from_json()
else
@@ -103,7 +103,7 @@ SUBSYSTEM_DEF(cargo)
//Load the cargo data from SQL
/datum/controller/subsystem/cargo/proc/load_from_sql()
if(!establish_db_connection(dbcon))
if(!establish_db_connection(GLOB.dbcon))
log_subsystem_cargo("SQL ERROR - Failed to connect. - Falling back to JSON")
return load_from_json()
else
@@ -111,7 +111,7 @@ SUBSYSTEM_DEF(cargo)
reset_cargo()
//Load the categories
var/DBQuery/category_query = dbcon.NewQuery("SELECT id, name, display_name, description, icon, price_modifier FROM ss13_cargo_categories WHERE deleted_at IS NULL ORDER BY order_by ASC")
var/DBQuery/category_query = GLOB.dbcon.NewQuery("SELECT id, name, display_name, description, icon, price_modifier FROM ss13_cargo_categories WHERE deleted_at IS NULL ORDER BY order_by ASC")
category_query.Execute()
while(category_query.NextRow())
CHECK_TICK
@@ -122,7 +122,7 @@ SUBSYSTEM_DEF(cargo)
category_query.item[5],
text2num(category_query.item[6]))
//Load the suppliers
var/DBQuery/supplier_query = dbcon.NewQuery("SELECT id, short_name, name, description, tag_line, shuttle_time, shuttle_price, available, price_modifier FROM ss13_cargo_suppliers WHERE deleted_at is NULL")
var/DBQuery/supplier_query = GLOB.dbcon.NewQuery("SELECT id, short_name, name, description, tag_line, shuttle_time, shuttle_price, available, price_modifier FROM ss13_cargo_suppliers WHERE deleted_at is NULL")
supplier_query.Execute()
while(supplier_query.NextRow())
CHECK_TICK
@@ -136,7 +136,7 @@ SUBSYSTEM_DEF(cargo)
supplier_query.item[8],
supplier_query.item[9])
//Load the items
var/DBQuery/item_query = dbcon.NewQuery("SELECT id, name, supplier, description, categories, price, items, access, container_type, groupable, item_mul FROM ss13_cargo_items WHERE deleted_at IS NULL AND approved_at IS NOT NULL AND supplier IS NOT NULL ORDER BY order_by ASC, name ASC, supplier ASC")
var/DBQuery/item_query = GLOB.dbcon.NewQuery("SELECT id, name, supplier, description, categories, price, items, access, container_type, groupable, item_mul FROM ss13_cargo_items WHERE deleted_at IS NULL AND approved_at IS NOT NULL AND supplier IS NOT NULL ORDER BY order_by ASC, name ASC, supplier ASC")
item_query.Execute()
while(item_query.NextRow())
CHECK_TICK
@@ -155,7 +155,7 @@ SUBSYSTEM_DEF(cargo)
item_query.item[11])
if(error_message && istext(error_message))
log_subsystem_cargo("SScargo: Error when loading item [item_id] from sql: [error_message]")
var/DBQuery/item_error_query = dbcon.NewQuery("UPDATE ss13_cargo_items SET error_message = :error_message: WHERE id = :id:")
var/DBQuery/item_error_query = GLOB.dbcon.NewQuery("UPDATE ss13_cargo_items SET error_message = :error_message: WHERE id = :id:")
item_error_query.Execute(list("id"=item_id,"error_message"=error_message))
@@ -739,21 +739,21 @@ SUBSYSTEM_DEF(cargo)
if(dumped_orders)
log_subsystem_cargo("Order Data Dump Aborted - Orders already dumped")
return
if(config.cargo_load_items_from != "sql")
if(GLOB.config.cargo_load_items_from != "sql")
log_subsystem_cargo("Order Data Dump Aborted - Cargo not loaded from database")
return
if(!establish_db_connection(dbcon))
if(!establish_db_connection(GLOB.dbcon))
log_subsystem_cargo("SQL ERROR - Failed to connect. - Unable to dump order data")
return
dumped_orders = TRUE
// Loop through all the orders and dump them all
var/DBQuery/dump_query = dbcon.NewQuery("INSERT INTO `ss13_cargo_orderlog` (`game_id`, `order_id`, `status`, `price`, `ordered_by_id`, `ordered_by`, `authorized_by_id`, `authorized_by`, `received_by_id`, `received_by`, `paid_by_id`, `paid_by`, `time_submitted`, `time_approved`, `time_shipped`, `time_delivered`, `time_paid`, `reason`) \
var/DBQuery/dump_query = GLOB.dbcon.NewQuery("INSERT INTO `ss13_cargo_orderlog` (`game_id`, `order_id`, `status`, `price`, `ordered_by_id`, `ordered_by`, `authorized_by_id`, `authorized_by`, `received_by_id`, `received_by`, `paid_by_id`, `paid_by`, `time_submitted`, `time_approved`, `time_shipped`, `time_delivered`, `time_paid`, `reason`) \
VALUES (:game_id:, :order_id:, :status:, :price:, :ordered_by_id:, :ordered_by:, :authorized_by_id:, :authorized_by:, :received_by_id:, :received_by:, :paid_by_id:, :paid_by:, :time_submitted:, :time_approved:, :time_shipped:, :time_delivered:, :time_paid:, :reason:)")
var/DBQuery/dump_item_query = dbcon.NewQuery("INSERT INTO `ss13_cargo_orderlog_items` (`cargo_orderlog_id`, `cargo_item_id`, `amount`) \
var/DBQuery/dump_item_query = GLOB.dbcon.NewQuery("INSERT INTO `ss13_cargo_orderlog_items` (`cargo_orderlog_id`, `cargo_item_id`, `amount`) \
VALUES (:cargo_orderlog_id:, :cargo_item_id:, :amount:)")
var/DBQuery/log_id = dbcon.NewQuery("SELECT LAST_INSERT_ID() AS log_id")
var/DBQuery/log_id = GLOB.dbcon.NewQuery("SELECT LAST_INSERT_ID() AS log_id")
for(var/datum/cargo_order/co in all_orders)
//Iterate over the items in the order and build the a list with the item count
var/list/itemcount = list()
+5 -5
View File
@@ -45,7 +45,7 @@ SUBSYSTEM_DEF(discord)
return ..()
/datum/controller/subsystem/discord/Initialize()
config.load("config/discord.txt", "discord")
GLOB.config.load("config/discord.txt", "discord")
update_channels()
/datum/controller/subsystem/discord/stat_entry(msg)
@@ -65,7 +65,7 @@ SUBSYSTEM_DEF(discord)
log_subsystem_discord("UpdateChannels - Failed - Discord bot is not active")
return 1
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
log_subsystem_discord("UpdateChannels - Failed - Unable to connect to database")
return 2
@@ -73,7 +73,7 @@ SUBSYSTEM_DEF(discord)
channels_to_group.Cut()
channels.Cut()
var/DBQuery/channel_query = dbcon.NewQuery("SELECT channel_group, channel_id, pin_flag, server_id FROM discord_channels")
var/DBQuery/channel_query = GLOB.dbcon.NewQuery("SELECT channel_group, channel_id, pin_flag, server_id FROM discord_channels")
channel_query.Execute()
while (channel_query.NextRow())
@@ -507,12 +507,12 @@ SUBSYSTEM_DEF(discord)
/hook/roundstart/proc/alert_no_admins()
var/admins_number = 0
for (var/C in clients)
for (var/C in GLOB.clients)
var/client/cc = C
if (cc.holder && (cc.holder.rights & (R_MOD|R_ADMIN)))
admins_number++
post_webhook_event(WEBHOOK_ROUNDSTART, list("playercount"=clients.len))
post_webhook_event(WEBHOOK_ROUNDSTART, list("playercount"=GLOB.clients.len))
if (!admins_number)
post_webhook_event(WEBHOOK_ALERT_NO_ADMINS, list())
if (!SSdiscord)
+4 -4
View File
@@ -15,10 +15,10 @@ SUBSYSTEM_DEF(docs)
/datum/controller/subsystem/docs/Initialize(timeofday)
//Load in the docs config
if(config.docs_load_docs_from == "sql")
if(GLOB.config.docs_load_docs_from == "sql")
log_subsystem_documents("Attempting to Load from SQL")
load_from_sql()
else if(config.docs_load_docs_from == "json")
else if(GLOB.config.docs_load_docs_from == "json")
log_subsystem_documents("Attempting to Load from JSON")
load_from_json()
else
@@ -104,7 +104,7 @@ SUBSYSTEM_DEF(docs)
//Load the document data from SQL
/datum/controller/subsystem/docs/proc/load_from_sql()
if(!establish_db_connection(dbcon))
if(!establish_db_connection(GLOB.dbcon))
log_subsystem_documents("SQL ERROR - Failed to connect. - Falling back to JSON")
return load_from_json()
else
@@ -112,7 +112,7 @@ SUBSYSTEM_DEF(docs)
reset_docs()
//Load the categories
var/DBQuery/document_query = dbcon.NewQuery("SELECT name, title, chance, content, tags FROM ss13_documents WHERE deleted_at IS NULL")
var/DBQuery/document_query = GLOB.dbcon.NewQuery("SELECT name, title, chance, content, tags FROM ss13_documents WHERE deleted_at IS NULL")
document_query.Execute()
while(document_query.NextRow())
CHECK_TICK
+2 -2
View File
@@ -19,7 +19,7 @@ SUBSYSTEM_DEF(economy)
create_station_account()
for(var/account in department_funds)
for(var/account in GLOB.department_funds)
create_department_account(account)
..()
@@ -74,7 +74,7 @@ SUBSYSTEM_DEF(economy)
department_account.account_number = next_account_number
next_account_number += rand(1,500)
department_account.remote_access_pin = rand(1111, 111111)
department_account.money = department_funds[department]
department_account.money = GLOB.department_funds[department]
//create an entry in the account transaction log for when it was created
var/datum/transaction/T = new()
@@ -82,7 +82,7 @@ var/datum/evacuation_controller/evacuation_controller
state = EVAC_PREPPING
switch(evacuation_type)
if(TRANSFER_EMERGENCY)
for(var/area/A in all_areas)
for(var/area/A in GLOB.all_areas)
if(istype(A, /area/hallway))
A.readyalert()
if(!skip_announce)
@@ -112,7 +112,7 @@ var/datum/evacuation_controller/evacuation_controller
switch(evacuation_type)
if(TRANSFER_EMERGENCY)
evac_recalled.Announce(current_map.emergency_shuttle_recall_message, new_sound = 'sound/AI/emergency_shuttle_recall_message.ogg')
for(var/area/A in all_areas)
for(var/area/A in GLOB.all_areas)
if(istype(A, /area/hallway))
A.readyreset()
if(TRANSFER_JUMP)
@@ -29,7 +29,7 @@
if(!isnull(evac_called_at))
return FALSE
if (!universe.OnShuttleCall(null))
if (!GLOB.universe.OnShuttleCall(null))
return FALSE
if(!forced)
+3 -3
View File
@@ -122,7 +122,7 @@ SUBSYSTEM_DEF(events)
/datum/controller/subsystem/events/proc/GetInteractWindow()
var/html = "<A align='right' href='?src=\ref[src];refresh=1'>Refresh</A>"
html += "<A align='right' href='?src=\ref[src];pause_all=[!config.allow_random_events]'>Pause All - [config.allow_random_events ? "Pause" : "Resume"]</A>"
html += "<A align='right' href='?src=\ref[src];pause_all=[!GLOB.config.allow_random_events]'>Pause All - [GLOB.config.allow_random_events ? "Pause" : "Resume"]</A>"
if(selected_event_container)
var/event_time = max(0, selected_event_container.next_event_time - world.time)
@@ -256,8 +256,8 @@ SUBSYSTEM_DEF(events)
EC.delayed = !EC.delayed
log_and_message_admins("has [EC.delayed ? "paused" : "resumed"] countdown for [severity_to_string[EC.severity]] events.")
else if(href_list["pause_all"])
config.allow_random_events = text2num(href_list["pause_all"])
log_and_message_admins("has [config.allow_random_events ? "resumed" : "paused"] countdown for all events.")
GLOB.config.allow_random_events = text2num(href_list["pause_all"])
log_and_message_admins("has [GLOB.config.allow_random_events ? "resumed" : "paused"] countdown for all events.")
else if(href_list["interval"])
var/delay = input("Enter delay modifier. A value less than one means events fire more often, higher than one less often.", "Set Interval Modifier") as num|null
if(delay && delay > 0)
+6 -6
View File
@@ -110,7 +110,7 @@ SUBSYSTEM_DEF(explosives)
vibration = 1
if (vibration)
for(var/thing in player_list)
for(var/thing in GLOB.player_list)
var/mob/M = thing
CHECK_TICK
// Double check for client
@@ -221,7 +221,7 @@ SUBSYSTEM_DEF(explosives)
var/took = (world.timeofday-start)/10
//You need to press the DebugGame verb to see these now....they were getting annoying and we've collected a fair bit of data. Just -test- changes to explosion code using this please so we can compare
if(Debug2) world.log << "## DEBUG: Explosion([x0],[y0],[z0])(d[devastation_range],h[heavy_impact_range],l[light_impact_range]): Took [took] seconds."
if(GLOB.Debug2) world.log << "## DEBUG: Explosion([x0],[y0],[z0])(d[devastation_range],h[heavy_impact_range],l[light_impact_range]): Took [took] seconds."
// All the vars used on the turf should be on unsimulated turfs too, we just don't care about those generally.
#define SEARCH_DIR(dir) \
@@ -257,11 +257,11 @@ SUBSYSTEM_DEF(explosives)
if (O.explosion_resistance)
power -= O.explosion_resistance
if (power >= config.iterative_explosives_z_threshold)
if (power >= GLOB.config.iterative_explosives_z_threshold)
if ((z_transfer & UP) && HasAbove(epicenter.z))
var/datum/explosiondata/data = new
data.epicenter = GetAbove(epicenter)
data.rec_pow = (power * config.iterative_explosives_z_multiplier) - config.iterative_explosives_z_subtraction
data.rec_pow = (power * GLOB.config.iterative_explosives_z_multiplier) - GLOB.config.iterative_explosives_z_subtraction
data.z_transfer = UP
data.spreading = TRUE
queue(data)
@@ -269,7 +269,7 @@ SUBSYSTEM_DEF(explosives)
if ((z_transfer & DOWN) && HasBelow(epicenter.z))
var/datum/explosiondata/data = new
data.epicenter = GetBelow(epicenter)
data.rec_pow = (power * config.iterative_explosives_z_multiplier) - config.iterative_explosives_z_subtraction
data.rec_pow = (power * GLOB.config.iterative_explosives_z_multiplier) - GLOB.config.iterative_explosives_z_subtraction
data.z_transfer = DOWN
data.spreading = TRUE
queue(data)
@@ -329,7 +329,7 @@ SUBSYSTEM_DEF(explosives)
var/sound/explosion_sound = sound(get_sfx(/singleton/sound_category/explosion_sound))
for (var/thing in player_list)
for (var/thing in GLOB.player_list)
var/mob/M = thing
var/reception = EXPLFX_BOTH
+6 -6
View File
@@ -13,9 +13,9 @@ SUBSYSTEM_DEF(fail2topic)
var/enabled = FALSE
/datum/controller/subsystem/fail2topic/Initialize(timeofday)
rate_limit = config.fail2topic_rate_limit
max_fails = config.fail2topic_max_fails
enabled = config.fail2topic_enabled
rate_limit = GLOB.config.fail2topic_rate_limit
max_fails = GLOB.config.fail2topic_max_fails
enabled = GLOB.config.fail2topic_enabled
DropFirewallRule() // Clear the old bans if any still remain
@@ -48,7 +48,7 @@ SUBSYSTEM_DEF(fail2topic)
/datum/controller/subsystem/fail2topic/proc/IsRateLimited(ip)
var/last_attempt = rate_limiting[ip]
if (config?.api_rate_limit_whitelist[ip])
if (GLOB.config?.api_rate_limit_whitelist[ip])
return FALSE
if (active_bans[ip])
@@ -89,7 +89,7 @@ SUBSYSTEM_DEF(fail2topic)
fail_counts -= ip
rate_limiting -= ip
. = shell("netsh advfirewall firewall add rule name=\"[config.fail2topic_rule_name]\" dir=in interface=any action=block remoteip=[ip]")
. = shell("netsh advfirewall firewall add rule name=\"[GLOB.config.fail2topic_rule_name]\" dir=in interface=any action=block remoteip=[ip]")
if (.)
log_subsystem_fail2topic("Failed to ban [ip]. Exit code: [.].")
@@ -104,7 +104,7 @@ SUBSYSTEM_DEF(fail2topic)
active_bans = list()
. = shell("netsh advfirewall firewall delete rule name=\"[config.fail2topic_rule_name]\"")
. = shell("netsh advfirewall firewall delete rule name=\"[GLOB.config.fail2topic_rule_name]\"")
if (.)
log_subsystem_fail2topic("Failed to drop firewall rule. Exit code: [.].")
+1 -1
View File
@@ -80,7 +80,7 @@ SUBSYSTEM_DEF(icon_smooth)
for (var/zlevel = 1 to world.maxz)
smooth_zlevel(zlevel, FALSE)
if (config.fastboot)
if (GLOB.config.fastboot)
LOG_DEBUG("icon_smoothing: Skipping prebake, fastboot enabled.")
return ..()
@@ -136,7 +136,7 @@ SUBSYSTEM_DEF(atlas)
)
/datum/controller/subsystem/atlas/stat_entry(msg)
msg = "W:{X:[world.maxx] Y:[world.maxy] Z:[world.maxz]} ZL:[z_levels]"
msg = "W:{X:[world.maxx] Y:[world.maxy] Z:[world.maxz]} ZL:[GLOB.z_levels]"
return ..()
/datum/controller/subsystem/atlas/Initialize(timeofday)
@@ -192,8 +192,8 @@ SUBSYSTEM_DEF(atlas)
var/chosen_sector
var/using_sector_config = FALSE
if(config.current_space_sector)
chosen_sector = config.current_space_sector
if(GLOB.config.current_space_sector)
chosen_sector = GLOB.config.current_space_sector
using_sector_config = TRUE
else
chosen_sector = current_map.default_sector
@@ -247,9 +247,9 @@ SUBSYSTEM_DEF(atlas)
CHECK_TICK
/datum/controller/subsystem/atlas/proc/get_selected_map()
if (config.override_map)
if (known_maps[config.override_map])
. = config.override_map
if (GLOB.config.override_map)
if (known_maps[GLOB.config.override_map])
. = GLOB.config.override_map
log_subsystem_atlas("Using configured map.")
else
log_config("-- WARNING: CONFIGURED MAP DOES NOT EXIST, IGNORING! --")
@@ -311,8 +311,8 @@ SUBSYSTEM_DEF(atlas)
. = current_map.station_name
var/sname
if (config && config.server_name)
sname = "[config.server_name]: [.]"
if (GLOB.config && GLOB.config.server_name)
sname = "[GLOB.config.server_name]: [.]"
else
sname = .
@@ -18,10 +18,10 @@ SUBSYSTEM_DEF(finalize)
load_space_ruin()
if(config.dungeon_chance > 0)
if(GLOB.config.dungeon_chance > 0)
place_dungeon_spawns()
if(config.generate_asteroid)
if(GLOB.config.generate_asteroid)
time = world.time
current_map.generate_asteroid()
log_subsystem_mapfinalization("Generated asteroid in [(world.time - time)/10] seconds.")
@@ -38,11 +38,11 @@ SUBSYSTEM_DEF(finalize)
..()
/proc/resort_all_areas()
all_areas = list()
GLOB.all_areas = list()
for (var/area/A in world)
all_areas += A
GLOB.all_areas += A
sortTim(all_areas, GLOBAL_PROC_REF(cmp_name_asc))
sortTim(GLOB.all_areas, GLOBAL_PROC_REF(cmp_name_asc))
/datum/controller/subsystem/finalize/proc/load_space_ruin()
maploader = new
@@ -73,11 +73,11 @@ SUBSYSTEM_DEF(finalize)
var/dungeons_placed = 0
var/dmm_suite/maploader = new
var/dungeon_chance = config.dungeon_chance
var/dungeon_chance = GLOB.config.dungeon_chance
log_subsystem_mapfinalization("Attempting to create asteroid dungeons for [length(asteroid_spawn)] different areas, with [length(files) - 1] possible dungeons, with a [dungeon_chance]% chance to spawn a dungeon per area.")
log_subsystem_mapfinalization("Attempting to create asteroid dungeons for [length(GLOB.asteroid_spawn)] different areas, with [length(files) - 1] possible dungeons, with a [dungeon_chance]% chance to spawn a dungeon per area.")
for(var/turf/spawn_location in asteroid_spawn)
for(var/turf/spawn_location in GLOB.asteroid_spawn)
if(length(files) <= 0) //Sanity
log_subsystem_mapfinalization("There aren't enough dungeon map files to fill the entire dungeon map. There may be less dungeons than expected.")
@@ -113,7 +113,7 @@ SUBSYSTEM_DEF(finalize)
if(!selected_mission)
return
var/report_text = selected_mission.get_contact_report()
for(var/obj/effect/landmark/C in landmarks_list)
for(var/obj/effect/landmark/C in GLOB.landmarks_list)
if(C.name == "Mission Paper")
var/obj/item/paper/P = new /obj/item/paper(get_turf(C))
P.name = "Icarus reading report"
@@ -40,7 +40,7 @@ SUBSYSTEM_DEF(misc_early)
// Setup ore.
for(var/oretype in subtypesof(/ore))
var/ore/OD = new oretype()
ore_data[OD.name] = OD
GLOB.ore_data[OD.name] = OD
// Setup cargo spawn lists.
setup_cargo_spawn_lists()
@@ -7,21 +7,21 @@ SUBSYSTEM_DEF(misc_late)
/datum/controller/subsystem/misc_late/Initialize(timeofday)
// Setup the teleport locs.
for(var/area/AR as anything in the_station_areas)
for(var/area/AR as anything in GLOB.the_station_areas)
if(AR.area_flags & AREA_FLAG_NO_GHOST_TELEPORT_ACCESS)
continue
var/list/area_turfs = AR.contents
if (area_turfs.len) // Check the area is mapped
ghostteleportlocs += AR.name
ghostteleportlocs[AR.name] = AR
GLOB.ghostteleportlocs += AR.name
GLOB.ghostteleportlocs[AR.name] = AR
if(current_map.use_overmap && map_overmap)
ghostteleportlocs[map_overmap.name] = map_overmap
GLOB.ghostteleportlocs[map_overmap.name] = map_overmap
sortTim(ghostteleportlocs, GLOBAL_PROC_REF(cmp_text_asc))
sortTim(GLOB.ghostteleportlocs, GLOBAL_PROC_REF(cmp_text_asc))
setupgenetics()
if (config.fastboot)
if (GLOB.config.fastboot)
admin_notice("<span class='notice'><b>Fastboot is enabled; some features may not be available.</b></span>", R_DEBUG)
populate_code_phrases()
@@ -31,12 +31,12 @@ SUBSYSTEM_DEF(misc_late)
thing.do_late_fire()
LAZYREMOVE(SSatoms.late_loaders, thing)
if (config.use_forumuser_api)
if (GLOB.config.use_forumuser_api)
update_admins_from_api(TRUE)
..(timeofday)
/proc/sorted_add_area(area/A)
all_areas += A
GLOB.all_areas += A
sortTim(all_areas, GLOBAL_PROC_REF(cmp_name_asc))
sortTim(GLOB.all_areas, GLOBAL_PROC_REF(cmp_name_asc))
@@ -54,7 +54,7 @@ SUBSYSTEM_DEF(persistent_configuration)
/datum/controller/subsystem/persistent_configuration/proc/populate_variables(list/decoded)
IF_FOUND_USE(decoded, last_gamemode)
master_mode = last_gamemode
GLOB.master_mode = last_gamemode
IF_FOUND_CONV(decoded, rounds_since_hard_restart, text2num)
IF_FOUND_USE(decoded, forced_awaymission)
+21 -21
View File
@@ -1,4 +1,4 @@
#define Debug(text) if (Debug2) {job_debug += text}
#define Debug(text) if (GLOB.Debug2) {job_debug += text}
SUBSYSTEM_DEF(jobs)
// Subsystem stuff.
@@ -57,7 +57,7 @@ SUBSYSTEM_DEF(jobs)
if(!length(bitflag_to_job["[job.department_flag]"]))
bitflag_to_job["[job.department_flag]"] = list()
bitflag_to_job["[job.department_flag]"]["[job.flag]"] = job
if (config && config.use_age_restriction_for_jobs)
if (GLOB.config && GLOB.config.use_age_restriction_for_jobs)
job.fetch_age_restriction()
return TRUE
@@ -139,7 +139,7 @@ SUBSYSTEM_DEF(jobs)
. += player
/datum/controller/subsystem/jobs/proc/ResetOccupations()
for(var/mob/abstract/new_player/player in player_list)
for(var/mob/abstract/new_player/player in GLOB.player_list)
if((player) && (player.mind))
player.mind.assigned_role = null
player.mind.special_role = null
@@ -218,7 +218,7 @@ SUBSYSTEM_DEF(jobs)
break
//Get the players who are ready
for(var/mob/abstract/new_player/player in player_list)
for(var/mob/abstract/new_player/player in GLOB.player_list)
if(player.ready && player.mind && !player.mind.assigned_role)
unassigned += player
@@ -421,10 +421,10 @@ SUBSYSTEM_DEF(jobs)
if(joined_late)
var/antag_count = 0
for(var/antag_type in SSticker.mode.antag_tags)
var/datum/antagonist/A = all_antag_types[antag_type]
var/datum/antagonist/A = GLOB.all_antag_types[antag_type]
antag_count += A.get_active_antag_count()
for(var/antag_type in SSticker.mode.antag_tags)
var/datum/antagonist/A = all_antag_types[antag_type]
var/datum/antagonist/A = GLOB.all_antag_types[antag_type]
A.update_current_antag_max()
if((A.role_type in H.client.prefs.be_special_role) && !(A.flags & ANTAG_OVERRIDE_JOB) && antag_count < A.cur_max)
A.add_antagonist(H.mind)
@@ -456,7 +456,7 @@ SUBSYSTEM_DEF(jobs)
if(spawnpos && istype(spawnpos))
to_chat(src, "<span class='warning'>You come to the sudden realization that you never left the [current_map.station_name] at all! You were in cryo the whole time!</span>")
src.forceMove(pick(spawnpos.turfs))
global_announcer.autosay("[real_name], [mind.role_alt_title], [spawnpos.msg].", "Cryogenic Oversight")
GLOB.global_announcer.autosay("[real_name], [mind.role_alt_title], [spawnpos.msg].", "Cryogenic Oversight")
var/rank= src.mind.assigned_role
SSjobs.EquipRank(src, rank, 1)
else
@@ -474,7 +474,7 @@ SUBSYSTEM_DEF(jobs)
if(spawnpos && istype(spawnpos))
to_chat(src, "<span class='warning'>You come to the sudden realization that you never left the [current_map.station_name] at all! You were in robotic storage the whole time!</span>")
src.forceMove(pick(spawnpos.turfs))
global_announcer.autosay("[real_name], [mind.role_alt_title], [spawnpos.msg].", "Robotic Oversight")
GLOB.global_announcer.autosay("[real_name], [mind.role_alt_title], [spawnpos.msg].", "Robotic Oversight")
else
SSjobs.centcomm_despawn_mob(src)
@@ -483,17 +483,17 @@ SUBSYSTEM_DEF(jobs)
// Convenience wrapper.
/datum/controller/subsystem/jobs/proc/centcomm_despawn_mob(mob/living/H)
if(ishuman(H))
global_announcer.autosay("[H.real_name], [H.mind.role_alt_title], has entered long-term storage.", "[current_map.dock_name] Cryogenic Oversight")
GLOB.global_announcer.autosay("[H.real_name], [H.mind.role_alt_title], has entered long-term storage.", "[current_map.dock_name] Cryogenic Oversight")
H.visible_message("<span class='notice'>[H.name] makes their way to the [current_map.dock_short]'s cryostorage, and departs.</span>", "<span class='notice'>You make your way into [current_map.dock_short]'s cryostorage, and depart.</span>", range = 3)
DespawnMob(H)
else
if(!isDrone(H))
global_announcer.autosay("[H.real_name], [H.mind.role_alt_title], has entered robotic storage.", "[current_map.dock_name] Robotic Oversight")
GLOB.global_announcer.autosay("[H.real_name], [H.mind.role_alt_title], has entered robotic storage.", "[current_map.dock_name] Robotic Oversight")
H.visible_message("<span class='notice'>[H.name] makes their way to the [current_map.dock_short]'s robotic storage, and departs.</span>", "<span class='notice'>You make your way into [current_map.dock_short]'s robotic storage, and depart.</span>", range = 3)
DespawnMob(H)
/datum/controller/subsystem/jobs/proc/LoadJobs(jobsfile)
if (!config.load_jobs_from_txt)
if (!GLOB.config.load_jobs_from_txt)
return FALSE
var/list/jobEntries = file2list(jobsfile)
@@ -555,7 +555,7 @@ SUBSYSTEM_DEF(jobs)
var/level3 = 0 //low
var/level4 = 0 //never
var/level5 = 0 //banned
for(var/mob/abstract/new_player/player in player_list)
for(var/mob/abstract/new_player/player in GLOB.player_list)
if(!(player.ready && player.mind && !player.mind.assigned_role))
continue //This player is not ready
if(jobban_isbanned(player, job.title))
@@ -580,14 +580,14 @@ SUBSYSTEM_DEF(jobs)
H.job = rank
if(current_map.force_spawnpoint && LAZYLEN(force_spawnpoints))
if(force_spawnpoints[rank])
H.forceMove(pick(force_spawnpoints[rank]))
if(current_map.force_spawnpoint && LAZYLEN(GLOB.force_spawnpoints))
if(GLOB.force_spawnpoints[rank])
H.forceMove(pick(GLOB.force_spawnpoints[rank]))
else
H.forceMove(pick(force_spawnpoints["Anyone"]))
H.forceMove(pick(GLOB.force_spawnpoints["Anyone"]))
else
if(job.latejoin_at_spawnpoints)
for (var/thing in landmarks_list)
for (var/thing in GLOB.landmarks_list)
var/obj/effect/landmark/L = thing
if(istype(L))
if(L.name == "LateJoin[rank]")
@@ -619,10 +619,10 @@ SUBSYSTEM_DEF(jobs)
spawnpos.after_join(H)
else
to_chat(H, "Your chosen spawnpoint ([spawnpos.display_name]) is unavailable for your chosen job. Spawning you at the Arrivals shuttle instead.")
H.forceMove(pick(latejoin))
H.forceMove(pick(GLOB.latejoin))
. = "is inbound from the [current_map.dock_name]"
else
H.forceMove(pick(latejoin))
H.forceMove(pick(GLOB.latejoin))
. = "is inbound from the [current_map.dock_name]"
H.mind.selected_faction = SSjobs.GetFaction(H)
@@ -631,7 +631,7 @@ SUBSYSTEM_DEF(jobs)
/datum/controller/subsystem/jobs/proc/DespawnMob(mob/living/carbon/human/H)
//Update any existing objectives involving this mob.
for(var/datum/objective/O in all_objectives)
for(var/datum/objective/O in GLOB.all_objectives)
// We don't want revs to get objectives that aren't for heads of staff. Letting
// them win or lose based on cryo is silly so we remove the objective.
if(O.target == H.mind)
@@ -776,7 +776,7 @@ SUBSYSTEM_DEF(jobs)
/datum/controller/subsystem/jobs/proc/get_roundstart_spawnpoint(var/rank)
var/list/loc_list = list()
for(var/obj/effect/landmark/start/sloc in landmarks_list)
for(var/obj/effect/landmark/start/sloc in GLOB.landmarks_list)
if(sloc.name != rank) continue
if(locate(/mob/living) in sloc.loc) continue
loc_list += sloc
+4 -4
View File
@@ -8,7 +8,7 @@ SUBSYSTEM_DEF(law)
var/list/high_severity = list()
/datum/controller/subsystem/law/Initialize(timeofday)
if(config.sql_enabled)
if(GLOB.config.sql_enabled)
load_from_sql()
else
load_from_code()
@@ -26,11 +26,11 @@ SUBSYSTEM_DEF(law)
laws = low_severity + med_severity + high_severity
/datum/controller/subsystem/law/proc/load_from_sql()
if(!establish_db_connection(dbcon))
if(!establish_db_connection(GLOB.dbcon))
log_subsystem_law("SQL ERROR - Failed to connect.")
return load_from_code()
var/DBQuery/law_query = dbcon.NewQuery("SELECT law_id, name, description, min_fine, max_fine, min_brig_time, max_brig_time, severity, felony FROM ss13_law WHERE deleted_at IS NULL ORDER BY law_id ASC")
var/DBQuery/law_query = GLOB.dbcon.NewQuery("SELECT law_id, name, description, min_fine, max_fine, min_brig_time, max_brig_time, severity, felony FROM ss13_law WHERE deleted_at IS NULL ORDER BY law_id ASC")
law_query.Execute()
while(law_query.NextRow())
CHECK_TICK
@@ -67,7 +67,7 @@ SUBSYSTEM_DEF(law)
/datum/controller/subsystem/law/proc/migrate_to_sql()
for(var/datum/law/L in laws)
log_subsystem_law("Migrating law [L.id] to SQL")
var/DBQuery/law_update_query = dbcon.NewQuery({"
var/DBQuery/law_update_query = GLOB.dbcon.NewQuery({"
INSERT IGNORE INTO ss13_law
(law_id, name, description, min_fine, max_fine, min_brig_time, max_brig_time, severity, felony)
VALUES
+1 -1
View File
@@ -72,7 +72,7 @@ SUBSYSTEM_DEF(lighting)
for (var/zlevel = 1 to world.maxz)
for (thing in Z_ALL_TURFS(zlevel))
T = thing
if(config.starlight)
if(GLOB.config.starlight)
var/turf/space/S = T
if(istype(S) && S.use_starlight)
S.update_starlight()
+1 -1
View File
@@ -127,7 +127,7 @@ SUBSYSTEM_DEF(machinery)
for(var/datum/powernet/powernet as anything in powernets)
qdel(powernet)
powernets.Cut()
setup_powernets_for_cables(cable_list)
setup_powernets_for_cables(GLOB.cable_list)
/datum/controller/subsystem/machinery/proc/setup_powernets_for_cables(list/cables)
for (var/obj/structure/cable/cable as anything in cables)
+6 -6
View File
@@ -58,19 +58,19 @@ SUBSYSTEM_DEF(mobs)
mtl_incorporeal = typecacheof(mtl_incorporeal)
/datum/controller/subsystem/mobs/stat_entry(msg)
msg = "P:[mob_list.len]"
msg = "P:[GLOB.mob_list.len]"
return ..()
/datum/controller/subsystem/mobs/fire(resumed = 0)
if (!resumed)
src.currentrun = mob_list.Copy()
src.currentrun = GLOB.mob_list.Copy()
src.currentrun += processing.Copy()
//Mobs might have been removed between the previous and a resumed fire, yet we want to maintain the priority to process
//the mobs that we didn't in the previous run, hence we have to pay the price of a list subtraction
//with &= we say to remove any item in the first list that is not in the second one
//of course, if we haven't resumed, this comparison would be useless, hence we skip it
var/list/currentrun = resumed ? (src.currentrun &= mob_list) : src.currentrun
var/list/currentrun = resumed ? (src.currentrun &= GLOB.mob_list) : src.currentrun
while (currentrun.len)
var/datum/thing = currentrun[currentrun.len]
@@ -90,9 +90,9 @@ SUBSYSTEM_DEF(mobs)
if (QDELETED(M))
LOG_DEBUG("SSmobs: QDELETED mob [DEBUG_REF(M)] left in processing list!")
// We can just go ahead and remove them from all the mob lists.
mob_list -= M
dead_mob_list -= M
living_mob_list -= M
GLOB.mob_list -= M
GLOB.dead_mob_list -= M
GLOB.living_mob_list -= M
if (MC_TICK_CHECK)
return
+2 -2
View File
@@ -14,7 +14,7 @@ SUBSYSTEM_DEF(news)
CreateFeedChannel("Tau Ceti Daily", "CentComm Minister of Information", 1, 1)
CreateFeedChannel("The Gibson Gazette", "Editor Carl Ritz", 1, 1)
if (config.news_use_forum_api)
if (GLOB.config.news_use_forum_api)
load_forum_news_config()
INVOKE_ASYNC(src, PROC_REF(load_from_forums))
@@ -22,7 +22,7 @@ SUBSYSTEM_DEF(news)
..()
/datum/controller/subsystem/news/proc/load_from_forums()
if (!config.forum_api_path || !global.forum_api_key)
if (!GLOB.config.forum_api_path || !global.forum_api_key)
LOG_DEBUG("SSnews: Unable to load from forums, API path or key not set up.")
return
@@ -47,7 +47,7 @@ SUBSYSTEM_DEF(nightlight)
/datum/controller/subsystem/nightlight/proc/get_apc_list(var/whitelisted_only = 1)
var/list/obj/machinery/power/apc/lighting_apcs = list()
for (var/A in all_areas)
for (var/A in GLOB.all_areas)
var/area/B = A
if (B.no_light_control || (!(B.allow_nightmode) && whitelisted_only))
continue
+3 -3
View File
@@ -133,7 +133,7 @@ SUBSYSTEM_DEF(pai)
pai_candidates.Add(candidate)
// Load the data before displaying.
if (!config.sql_saves)
if (!GLOB.config.sql_saves)
candidate.savefile_load(M)
else
M.client.prefs.load_preferences()
@@ -180,7 +180,7 @@ SUBSYSTEM_DEF(pai)
for(var/datum/paiCandidate/c in SSpai.pai_candidates)
if(c.ready)
var/found = 0
for(var/mob/abstract/observer/o in player_list)
for(var/mob/abstract/observer/o in GLOB.player_list)
if(o.key == c.key && o.MayRespawn())
found = 1
if(found)
@@ -292,7 +292,7 @@ SUBSYSTEM_DEF(pai)
/datum/controller/subsystem/pai/proc/requestRecruits(mob/user)
inquirer = user
for(var/mob/abstract/observer/O in player_list)
for(var/mob/abstract/observer/O in GLOB.player_list)
if(!O.MayRespawn())
continue
if(jobban_isbanned(O, "pAI"))
+2 -2
View File
@@ -10,13 +10,13 @@ SUBSYSTEM_DEF(ping)
var/list/currentrun = list()
/datum/controller/subsystem/ping/stat_entry(msg)
msg = "P:[clients.len]"
msg = "P:[GLOB.clients.len]"
return ..()
/datum/controller/subsystem/ping/fire(resumed = FALSE)
// Prepare the new batch of clients
if (!resumed)
src.currentrun = clients.Copy()
src.currentrun = GLOB.clients.Copy()
// De-reference the list for sanic speeds
var/list/currentrun = src.currentrun
@@ -19,8 +19,8 @@ PROCESSING_SUBSYSTEM_DEF(ntsl2)
* Builds request object meant to do certain action. Returns FALSE (0) when there was an issue.
*/
/datum/controller/subsystem/processing/ntsl2/proc/build_request(var/command, var/list/arguments, var/method = RUSTG_HTTP_METHOD_GET)
if(config.ntsl_hostname && config.ntsl_port) // Requires config to be set.
var/url = "http://[config.ntsl_hostname]:[config.ntsl_port]/[command]"
if(GLOB.config.ntsl_hostname && GLOB.config.ntsl_port) // Requires config to be set.
var/url = "http://[GLOB.config.ntsl_hostname]:[GLOB.config.ntsl_port]/[command]"
var/body = ""
switch(method)
if(RUSTG_HTTP_METHOD_GET)
@@ -113,7 +113,7 @@ PROCESSING_SUBSYSTEM_DEF(ntsl2)
/datum/controller/subsystem/processing/ntsl2/proc/attempt_connect()
if(config.ntsl_disabled)
if(GLOB.config.ntsl_disabled)
LOG_DEBUG("NTSL2++ Daemon disabled via config")
return FALSE
var/res = sync_send("clear")
@@ -101,7 +101,7 @@ SUBSYSTEM_DEF(shuttle)
try_add_landmark_tag(shuttle_landmark_tag, O)
landmarks_still_needed -= shuttle_landmark_tag
else if(istype(shuttle_landmark, /obj/effect/shuttle_landmark/automatic)) //These find their sector automatically
O = map_sectors["[shuttle_landmark.z]"]
O = GLOB.map_sectors["[shuttle_landmark.z]"]
if(O)
O.add_landmark(shuttle_landmark, shuttle_landmark.shuttle_restricted)
else
+4 -4
View File
@@ -13,19 +13,19 @@ SUBSYSTEM_DEF(profiler)
var/restart_period = 0
/datum/controller/subsystem/profiler/Initialize()
if (!config.profiler_is_enabled)
if (!GLOB.config.profiler_is_enabled)
..()
flags |= SS_NO_FIRE
return
restart_period = config.profiler_restart_period
threshold = config.profiler_timeout_threshold
restart_period = GLOB.config.profiler_restart_period
threshold = GLOB.config.profiler_timeout_threshold
..()
/datum/controller/subsystem/profiler/Shutdown()
. = ..()
if (config.profiler_is_enabled)
if (GLOB.config.profiler_is_enabled)
DumpData()
world.Profile(PROFILE_CLEAR, type="sendmaps")
+1 -1
View File
@@ -16,7 +16,7 @@ SUBSYSTEM_DEF(radiation)
if (!resumed)
current_sources = sources.Copy()
current_res_cache = resistance_cache.Copy()
listeners = living_mob_list.Copy()
listeners = GLOB.living_mob_list.Copy()
while(length(current_sources))
var/datum/radiation_source/S = current_sources[length(current_sources)]
+3 -3
View File
@@ -178,7 +178,7 @@ SUBSYSTEM_DEF(records)
return r
/datum/controller/subsystem/records/proc/build_records()
for(var/mob/living/carbon/human/H in player_list)
for(var/mob/living/carbon/human/H in GLOB.player_list)
generate_record(H)
/datum/controller/subsystem/records/proc/reset_manifest()
@@ -199,7 +199,7 @@ SUBSYSTEM_DEF(records)
if(action == "follow")
var/mob/abstract/observer/O = usr
if(istype(O))
for(var/mob/living/M in human_mob_list)
for(var/mob/living/M in GLOB.human_mob_list)
if(istype(M) && M.real_name == params["name"])
O.ManualFollow(M)
break
@@ -258,7 +258,7 @@ SUBSYSTEM_DEF(records)
// silicons are not in records, we need to add them manually
var/dept = DEPARTMENT_EQUIPMENT
for(var/mob/living/silicon/S in player_list)
for(var/mob/living/silicon/S in GLOB.player_list)
if(istype(S, /mob/living/silicon/robot))
var/mob/living/silicon/robot/R = S
if(R.scrambled_codes)
+1 -1
View File
@@ -106,7 +106,7 @@ SUBSYSTEM_DEF(distress)
good_spawner.enable()
if(picked_team.equipment_map)
var/landmark_position
for(var/obj/effect/landmark/distress_team_equipment/L in landmarks_list)
for(var/obj/effect/landmark/distress_team_equipment/L in GLOB.landmarks_list)
landmark_position = L.loc
if(landmark_position)
var/datum/map_template/distress_map = new picked_team.equipment_map
+3 -3
View File
@@ -40,7 +40,7 @@ SUBSYSTEM_DEF(skybox)
if(!skybox_cache["[z]"])
skybox_cache["[z]"] = generate_skybox(z)
if(current_map.use_overmap)
var/obj/effect/overmap/visitable/O = map_sectors["[z]"]
var/obj/effect/overmap/visitable/O = GLOB.map_sectors["[z]"]
if(istype(O))
for(var/zlevel in O.map_z)
skybox_cache["[zlevel]"] = skybox_cache["[z]"]
@@ -60,7 +60,7 @@ SUBSYSTEM_DEF(skybox)
res.overlays += base
if(current_map.use_overmap && use_overmap_details)
var/obj/effect/overmap/visitable/O = map_sectors["[z]"]
var/obj/effect/overmap/visitable/O = GLOB.map_sectors["[z]"]
if(istype(O))
var/image/overmap = image(skybox_icon)
overmap.overlays += O.generate_skybox()
@@ -81,7 +81,7 @@ SUBSYSTEM_DEF(skybox)
for(var/z in zlevels)
skybox_cache["[z]"] = generate_skybox(z)
for(var/client/C in clients)
for(var/client/C in GLOB.clients)
C.update_skybox(1)
//Update skyboxes. Called by universes, for now.
@@ -544,7 +544,7 @@ SUBSYSTEM_DEF(spatial_grid)
if(insert_clients)
var/list/turfs
if(isStationLevel(z))
turfs = station_turfs
turfs = GLOB.station_turfs
else
turfs = block(locate(1,1,z), locate(world.maxx, world.maxy, z))
+15 -15
View File
@@ -47,28 +47,28 @@ GENERAL_PROTECT_DATUM(/datum/controller/subsystem/statistics)
/datum/controller/subsystem/statistics/fire()
// Handle AFK.
if(config.kick_inactive)
var/inactivity_threshold = config.kick_inactive MINUTES
for(var/client/C in clients)
if(GLOB.config.kick_inactive)
var/inactivity_threshold = GLOB.config.kick_inactive MINUTES
for(var/client/C in GLOB.clients)
if(!isobserver(C.mob) && !C.holder)
if(C.is_afk(inactivity_threshold))
log_access("AFK: [key_name(C)]")
to_chat_immediate(C, SPAN_WARNING("You have been inactive for more than [config.kick_inactive] minute\s and have been disconnected."))
to_chat_immediate(C, SPAN_WARNING("You have been inactive for more than [GLOB.config.kick_inactive] minute\s and have been disconnected."))
qdel(C)
kicked_clients++
// Handle population polling.
if (config.sql_enabled && config.sql_stats)
var/admincount = staff.len
if (GLOB.config.sql_enabled && GLOB.config.sql_stats)
var/admincount = GLOB.staff.len
var/playercount = 0
for(var/mob/M in player_list)
for(var/mob/M in GLOB.player_list)
if(M.client)
playercount += 1
if(!establish_db_connection(dbcon))
if(!establish_db_connection(GLOB.dbcon))
log_game("SQL ERROR during population polling. Failed to connect.")
else
var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss")
var/DBQuery/query = dbcon.NewQuery("INSERT INTO `ss13_population` (`playercount`, `admincount`, `time`) VALUES ([playercount], [admincount], '[sqltime]')")
var/DBQuery/query = GLOB.dbcon.NewQuery("INSERT INTO `ss13_population` (`playercount`, `admincount`, `time`) VALUES ([playercount], [admincount], '[sqltime]')")
if(!query.Execute())
var/err = query.ErrorMsg()
log_game("SQL ERROR during population polling. Error : \[[err]\]\n")
@@ -157,16 +157,16 @@ GENERAL_PROTECT_DATUM(/datum/controller/subsystem/statistics)
if(!feedback)
return
if (!config.sql_enabled || !config.sql_stats)
if (!GLOB.config.sql_enabled || !GLOB.config.sql_stats)
return
round_end_data_gathering() //round_end time logging and some other data processing
if(!establish_db_connection(dbcon))
if(!establish_db_connection(GLOB.dbcon))
return
for(var/datum/feedback_variable/FV in feedback)
var/sql = "INSERT INTO ss13_feedback VALUES (null, Now(), \"[game_id]\", \"[FV.get_variable()]\", [FV.get_value()], \"[FV.get_details()]\")"
var/DBQuery/query_insert = dbcon.NewQuery(sql)
var/DBQuery/query_insert = GLOB.dbcon.NewQuery(sql)
query_insert.Execute()
// Sanitize inputs to avoid SQL injection attacks
@@ -235,7 +235,7 @@ GENERAL_PROTECT_DATUM(/datum/controller/subsystem/statistics)
FV.add_details(details)
/proc/sql_report_death(var/mob/living/H)
if(!config.sql_enabled || !config.sql_stats)
if(!GLOB.config.sql_enabled || !GLOB.config.sql_stats)
return
if(!H)
return
@@ -247,10 +247,10 @@ GENERAL_PROTECT_DATUM(/datum/controller/subsystem/statistics)
var/area/placeofdeath = get_area(H)
var/podname = placeofdeath ? "[placeofdeath]" : "Unknown area"
if(!establish_db_connection(dbcon))
if(!establish_db_connection(GLOB.dbcon))
log_game("SQL ERROR during death reporting. Failed to connect.")
else
var/DBQuery/query = dbcon.NewQuery("INSERT INTO ss13_death (name, ckey, char_id, job, special, pod, tod, laname, lackey, gender, bruteloss, fireloss, brainloss, oxyloss, coord) VALUES \
var/DBQuery/query = GLOB.dbcon.NewQuery("INSERT INTO ss13_death (name, ckey, char_id, job, special, pod, tod, laname, lackey, gender, bruteloss, fireloss, brainloss, oxyloss, coord) VALUES \
(:name:, :ckey:, :char_id:, :job:, :special:, :pod:, :tod:, :laname:, :lackey:, :gender:, :bruteloss:, :fireloss:, :brainloss:, :oxyloss:, :coord:')")
if(!query.Execute(list(
"name"=H.real_name,
+26 -3
View File
@@ -31,7 +31,7 @@ SUBSYSTEM_DEF(statpanels)
"Map: [current_map.name]",
"Round ID: [game_id ? game_id : "NULL"]",
"Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]",
"Current Date: [game_year]-[current_month]-[current_day]",
"Current Date: [GLOB.game_year]-[current_month]-[current_day]",
"Round Time: [get_round_duration_formatted()]",
"Ship Time: [worldtime2text()]",
"Current Space Sector: [SSatlas.current_sector.name]",
@@ -40,7 +40,7 @@ SUBSYSTEM_DEF(statpanels)
if(eta_status)
global_data += eta_status
src.currentrun = clients.Copy()
src.currentrun = GLOB.clients.Copy()
mc_data = null
var/list/currentrun = src.currentrun
@@ -66,6 +66,12 @@ SUBSYSTEM_DEF(statpanels)
if(target.stat_tab == "MC" && ((num_fires % mc_wait == 0)))
set_MC_tab(target)
if(!length(GLOB.sdql2_queries) && ("SDQL2" in target.panel_tabs))
target.stat_panel.send_message("remove_sdql2")
else if(length(GLOB.sdql2_queries) && (target.stat_tab == "SDQL2" || !("SDQL2" in target.panel_tabs)) && num_fires % default_wait == 0)
set_SDQL2_tab(target)
if(target.mob)
var/mob/target_mob = target.mob
var/update_actions = FALSE
@@ -196,6 +202,7 @@ SUBSYSTEM_DEF(statpanels)
list("CPU:", world.cpu),
list("Instances:", "[num2text(world.contents.len, 10)]"),
list("World Time:", "[world.time]"),
list("Globals:", GLOB.stat_entry(), text_ref(GLOB)),
list("Byond:", "(FPS:[world.fps]) (TickCount:[world.time/world.tick_lag]) (TickDrift:[round(Master.tickdrift,1)]([round((Master.tickdrift/(world.time/world.tick_lag))*100,0.1)]%)) (Internal Tick Usage: [round(MAPTICK_LAST_TICK_USAGE,0.1)]%)"),
list("Master Controller:", Master.stat_entry(), text_ref(Master)),
list("Failsafe Controller:", Failsafe.stat_entry(), text_ref(Failsafe)),
@@ -203,7 +210,7 @@ SUBSYSTEM_DEF(statpanels)
)
for(var/datum/controller/subsystem/sub_system in Master.subsystems)
mc_data[++mc_data.len] = list("\[[sub_system.state_letter()]][sub_system.name]", sub_system.stat_entry(), text_ref(sub_system))
mc_data[++mc_data.len] = list("Camera Net", "Cameras: [cameranet.cameras.len] | Chunks: [cameranet.chunks.len]", text_ref(cameranet))
mc_data[++mc_data.len] = list("Camera Net", "Cameras: [GLOB.cameranet.cameras.len] | Chunks: [GLOB.cameranet.chunks.len]", text_ref(GLOB.cameranet))
///immediately update the active statpanel tab of the target client
/datum/controller/subsystem/statpanels/proc/immediate_send_stat_data(client/target)
@@ -233,6 +240,22 @@ SUBSYSTEM_DEF(statpanels)
set_MC_tab(target)
return TRUE
if(!length(GLOB.sdql2_queries) && ("SDQL2" in target.panel_tabs))
target.stat_panel.send_message("remove_sdql2")
else if(length(GLOB.sdql2_queries) && target.stat_tab == "SDQL2")
set_SDQL2_tab(target)
/datum/controller/subsystem/statpanels/proc/set_SDQL2_tab(client/target)
var/list/sdql2A = list()
sdql2A[++sdql2A.len] = list("", "Access Global SDQL2 List", ref(GLOB.sdql2_vv_statobj))
var/list/sdql2B = list()
for(var/datum/sdql2_query/query as anything in GLOB.sdql2_queries)
sdql2B = query.generate_stat()
sdql2A += sdql2B
target.stat_panel.send_message("update_sdql2", sdql2A)
/// Stat panel window declaration
/client/var/datum/tgui_window/stat_panel
+9 -9
View File
@@ -13,7 +13,7 @@ SUBSYSTEM_DEF(stickyban)
//sanitize the sticky ban list
//delete db bans that no longer exist in the database and add new legacy bans to the database
if (!establish_db_connection(dbcon))
if (!establish_db_connection(GLOB.dbcon))
for (var/oldban in (world.GetConfig("ban") - bannedkeys))
var/ckey = ckey(oldban)
if (ckey != oldban && (ckey in bannedkeys))
@@ -53,10 +53,10 @@ SUBSYSTEM_DEF(stickyban)
/datum/controller/subsystem/stickyban/proc/Populatedbcache()
var/newdbcache = list() //so if we runtime or the db connection dies we don't kill the existing cache
var/DBQuery/query_stickybans = dbcon.NewQuery("SELECT ckey, reason, banning_admin, datetime FROM ss13_stickyban ORDER BY ckey")
var/DBQuery/query_ckey_matches = dbcon.NewQuery("SELECT stickyban, matched_ckey, first_matched, last_matched, exempt FROM ss13_stickyban_matched_ckey ORDER BY first_matched")
var/DBQuery/query_cid_matches = dbcon.NewQuery("SELECT stickyban, matched_cid, first_matched, last_matched FROM ss13_stickyban_matched_cid ORDER BY first_matched")
var/DBQuery/query_ip_matches = dbcon.NewQuery("SELECT stickyban, INET_NTOA(matched_ip), first_matched, last_matched FROM ss13_stickyban_matched_ip ORDER BY first_matched")
var/DBQuery/query_stickybans = GLOB.dbcon.NewQuery("SELECT ckey, reason, banning_admin, datetime FROM ss13_stickyban ORDER BY ckey")
var/DBQuery/query_ckey_matches = GLOB.dbcon.NewQuery("SELECT stickyban, matched_ckey, first_matched, last_matched, exempt FROM ss13_stickyban_matched_ckey ORDER BY first_matched")
var/DBQuery/query_cid_matches = GLOB.dbcon.NewQuery("SELECT stickyban, matched_cid, first_matched, last_matched FROM ss13_stickyban_matched_cid ORDER BY first_matched")
var/DBQuery/query_ip_matches = GLOB.dbcon.NewQuery("SELECT stickyban, INET_NTOA(matched_ip), first_matched, last_matched FROM ss13_stickyban_matched_ip ORDER BY first_matched")
if (!query_stickybans.Execute())
return
@@ -137,7 +137,7 @@ SUBSYSTEM_DEF(stickyban)
if (!ban["message"])
ban["message"] = "Evasion"
var/DBQuery/query_create_stickyban = dbcon.NewQuery("INSERT IGNORE INTO ss13_stickyban (ckey, reason, banning_admin) VALUES ('[sanitizeSQL(ckey)]', '[sanitizeSQL(ban["message"])]', '[sanitizeSQL(ban["admin"])]')")
var/DBQuery/query_create_stickyban = GLOB.dbcon.NewQuery("INSERT IGNORE INTO ss13_stickyban (ckey, reason, banning_admin) VALUES ('[sanitizeSQL(ckey)]', '[sanitizeSQL(ban["message"])]', '[sanitizeSQL(ban["admin"])]')")
if (!query_create_stickyban.Execute())
return
@@ -180,13 +180,13 @@ SUBSYSTEM_DEF(stickyban)
sqlips[++sqlips.len] = sqlip
if (length(sqlckeys))
dbcon.MassInsert("ss13_stickyban_matched_ckey", sqlckeys, FALSE, TRUE)
GLOB.dbcon.MassInsert("ss13_stickyban_matched_ckey", sqlckeys, FALSE, TRUE)
if (length(sqlcids))
dbcon.MassInsert("ss13_stickyban_matched_cid", sqlcids, FALSE, TRUE)
GLOB.dbcon.MassInsert("ss13_stickyban_matched_cid", sqlcids, FALSE, TRUE)
if (length(sqlips))
dbcon.MassInsert("ss13_stickyban_matched_ip", sqlips, FALSE, TRUE)
GLOB.dbcon.MassInsert("ss13_stickyban_matched_ip", sqlips, FALSE, TRUE)
return TRUE
+6 -6
View File
@@ -11,7 +11,7 @@ SUBSYSTEM_DEF(sunlight)
var/list/presets
/datum/controller/subsystem/sunlight/stat_entry(msg)
msg = "A:[config.sun_accuracy] LP:[light_points.len] Z:[config.sun_target_z]"
msg = "A:[GLOB.config.sun_accuracy] LP:[light_points.len] Z:[GLOB.config.sun_target_z]"
return ..()
/datum/controller/subsystem/sunlight/Initialize()
@@ -20,16 +20,16 @@ SUBSYSTEM_DEF(sunlight)
for (var/thing in subtypesof(/datum/sun_state))
presets += new thing
if (config.fastboot)
if (GLOB.config.fastboot)
LOG_DEBUG("sunlight: fastboot detected, skipping setup.")
..()
return
var/thing
var/turf/T
for (thing in Z_ALL_TURFS(config.sun_target_z))
for (thing in Z_ALL_TURFS(GLOB.config.sun_target_z))
T = thing
if (!(T.x % config.sun_accuracy) && !(T.y % config.sun_accuracy))
if (!(T.x % GLOB.config.sun_accuracy) && !(T.y % GLOB.config.sun_accuracy))
light_points += new /atom/movable/sunobj(thing)
CHECK_TICK
@@ -47,7 +47,7 @@ SUBSYSTEM_DEF(sunlight)
/datum/controller/subsystem/sunlight/proc/apply_sun_state(datum/sun_state/S)
LOG_DEBUG("sunlight: Applying preset [S].")
set_overall_light(config.sun_accuracy * 1.2, 1, S.color)
set_overall_light(GLOB.config.sun_accuracy * 1.2, 1, S.color)
/atom/movable/sunobj
name = "sunlight emitter"
@@ -66,7 +66,7 @@ SUBSYSTEM_DEF(sunlight)
return ..()
/atom/movable/sunobj/Initialize()
light_range = Ceiling(config.sun_accuracy * 1.2)
light_range = Ceiling(GLOB.config.sun_accuracy * 1.2)
return ..()
/atom/movable/sunobj/can_fall()
+39 -39
View File
@@ -72,7 +72,7 @@ var/datum/controller/subsystem/ticker/SSticker
/datum/controller/subsystem/ticker/Initialize(timeofday)
pregame()
restart_timeout = config.restart_timeout
restart_timeout = GLOB.config.restart_timeout
/datum/controller/subsystem/ticker/stat_entry(msg)
var/state = ""
@@ -130,12 +130,12 @@ var/datum/controller/subsystem/ticker/SSticker
game_tick()
/datum/controller/subsystem/ticker/proc/pregame_tick()
if (round_progressing)
if (GLOB.round_progressing)
pregame_timeleft--
total_players = length(player_list)
total_players = length(GLOB.player_list)
if (current_state == GAME_STATE_PREGAME && pregame_timeleft == config.vote_autogamemode_timeleft)
if (current_state == GAME_STATE_PREGAME && pregame_timeleft == GLOB.config.vote_autogamemode_timeleft)
if (!SSvote.time_remaining)
SSvote.autogamemode()
pregame_timeleft--
@@ -203,7 +203,7 @@ var/datum/controller/subsystem/ticker/SSticker
var/delay_notified = 0
do
wait_for_tickets = 0
for(var/datum/ticket/ticket in tickets)
for(var/datum/ticket/ticket in GLOB.tickets)
if(ticket.is_active())
wait_for_tickets = 1
break
@@ -231,7 +231,7 @@ var/datum/controller/subsystem/ticker/SSticker
set waitfor = FALSE
to_world("<br><br><br><H1>A round of [mode.name] has ended!</H1>")
for(var/mob/Player in player_list)
for(var/mob/Player in GLOB.player_list)
if(Player.mind && !isnewplayer(Player))
if(Player.stat != DEAD)
var/turf/playerTurf = get_turf(Player)
@@ -256,7 +256,7 @@ var/datum/controller/subsystem/ticker/SSticker
to_chat(Player, SPAN_WARNING(SPAN_BOLD("You did not survive the events on [station_name()]...")))
to_world("<br>")
for (var/mob/living/silicon/ai/aiPlayer in mob_list)
for (var/mob/living/silicon/ai/aiPlayer in GLOB.mob_list)
if (aiPlayer.stat != 2)
to_world("<b>[aiPlayer.name]'s laws at the end of the round were:</b>")
else
@@ -271,7 +271,7 @@ var/datum/controller/subsystem/ticker/SSticker
var/dronecount = 0
for (var/mob/living/silicon/robot/robo in mob_list)
for (var/mob/living/silicon/robot/robo in GLOB.mob_list)
if(istype(robo,/mob/living/silicon/robot/drone))
dronecount++
@@ -377,7 +377,7 @@ var/datum/controller/subsystem/ticker/SSticker
/datum/controller/subsystem/ticker/proc/update_ready_count()
total_players_ready = 0
for(var/mob/abstract/new_player/NP in player_list)
for(var/mob/abstract/new_player/NP in GLOB.player_list)
if(NP.ready)
total_players_ready++
@@ -390,7 +390,7 @@ var/datum/controller/subsystem/ticker/SSticker
update_ready_list(NP)
/datum/controller/subsystem/ticker/proc/setup_player_ready_list()
for(var/mob/abstract/new_player/NP in player_list)
for(var/mob/abstract/new_player/NP in GLOB.player_list)
// initial setup to catch people who readied 0.1 seconds into init
if(NP.ready)
update_ready_list(NP)
@@ -400,8 +400,8 @@ var/datum/controller/subsystem/ticker/SSticker
if(tip_override)
message = tip_override
else
var/chosen_tip_category = pick(tips_by_category)
var/datum/tip/tip_datum = tips_by_category[chosen_tip_category]
var/chosen_tip_category = pick(GLOB.tips_by_category)
var/datum/tip/tip_datum = GLOB.tips_by_category[chosen_tip_category]
message = pick(tip_datum.messages)
if(message)
@@ -425,12 +425,12 @@ var/datum/controller/subsystem/ticker/SSticker
else
var/mc_init_time = round(Master.initialization_time_taken, 1)
var/dynamic_time = LOBBY_TIME - mc_init_time
total_players = length(player_list)
total_players = length(GLOB.player_list)
LAZYINITLIST(ready_player_jobs)
if (dynamic_time <= config.vote_autogamemode_timeleft)
pregame_timeleft = config.vote_autogamemode_timeleft + 10
LOG_DEBUG("SSticker: dynamic set pregame time [dynamic_time]s was less than or equal to configured autogamemode vote time [config.vote_autogamemode_timeleft]s, clamping.")
if (dynamic_time <= GLOB.config.vote_autogamemode_timeleft)
pregame_timeleft = GLOB.config.vote_autogamemode_timeleft + 10
LOG_DEBUG("SSticker: dynamic set pregame time [dynamic_time]s was less than or equal to configured autogamemode vote time [GLOB.config.vote_autogamemode_timeleft]s, clamping.")
else
pregame_timeleft = dynamic_time
LOG_DEBUG("SSticker: dynamic set pregame time [dynamic_time]s was greater than configured autogamemode time, not clamping.")
@@ -477,37 +477,37 @@ var/datum/controller/subsystem/ticker/SSticker
/datum/controller/subsystem/ticker/proc/setup()
//Create and announce mode
if(master_mode == ROUNDTYPE_STR_SECRET)
if(GLOB.master_mode == ROUNDTYPE_STR_SECRET)
src.hide_mode = ROUNDTYPE_SECRET
else if (master_mode == ROUNDTYPE_STR_MIXED_SECRET)
else if (GLOB.master_mode == ROUNDTYPE_STR_MIXED_SECRET)
src.hide_mode = ROUNDTYPE_MIXED_SECRET
var/list/runnable_modes = config.get_runnable_modes(master_mode)
if(master_mode in list(ROUNDTYPE_STR_RANDOM, ROUNDTYPE_STR_SECRET, ROUNDTYPE_STR_MIXED_SECRET))
var/list/runnable_modes = GLOB.config.get_runnable_modes(GLOB.master_mode)
if(GLOB.master_mode in list(ROUNDTYPE_STR_RANDOM, ROUNDTYPE_STR_SECRET, ROUNDTYPE_STR_MIXED_SECRET))
if(!runnable_modes.len)
current_state = GAME_STATE_PREGAME
to_world("<B>Unable to choose playable game mode.</B> Reverting to pre-game lobby.")
return SETUP_REVOTE
if(secret_force_mode != ROUNDTYPE_STR_SECRET && secret_force_mode != ROUNDTYPE_STR_MIXED_SECRET)
src.mode = config.pick_mode(secret_force_mode)
if(GLOB.secret_force_mode != ROUNDTYPE_STR_SECRET && GLOB.secret_force_mode != ROUNDTYPE_STR_MIXED_SECRET)
src.mode = GLOB.config.pick_mode(GLOB.secret_force_mode)
if(!src.mode)
var/list/weighted_modes = list()
var/list/probabilities = list()
if (master_mode == ROUNDTYPE_STR_SECRET)
probabilities = config.probabilities_secret
else if (master_mode == ROUNDTYPE_STR_MIXED_SECRET)
probabilities = config.probabilities_mixed_secret
if (GLOB.master_mode == ROUNDTYPE_STR_SECRET)
probabilities = GLOB.config.probabilities_secret
else if (GLOB.master_mode == ROUNDTYPE_STR_MIXED_SECRET)
probabilities = GLOB.config.probabilities_mixed_secret
else
// master_mode == ROUNDTYPE_STR_RANDOM
probabilities = config.probabilities_secret.Copy()
probabilities |= config.probabilities_mixed_secret
// GLOB.master_mode == ROUNDTYPE_STR_RANDOM
probabilities = GLOB.config.probabilities_secret.Copy()
probabilities |= GLOB.config.probabilities_mixed_secret
for(var/datum/game_mode/GM in runnable_modes)
weighted_modes[GM.config_tag] = probabilities[GM.config_tag]
src.mode = gamemode_cache[pickweight(weighted_modes)]
src.mode = GLOB.gamemode_cache[pickweight(weighted_modes)]
else
src.mode = config.pick_mode(master_mode)
src.mode = GLOB.config.pick_mode(GLOB.master_mode)
if(!src.mode)
current_state = GAME_STATE_PREGAME
@@ -544,7 +544,7 @@ var/datum/controller/subsystem/ticker/SSticker
mode.fail_setup()
mode = null
SSjobs.ResetOccupations()
if(master_mode in list(ROUNDTYPE_STR_RANDOM, ROUNDTYPE_STR_SECRET, ROUNDTYPE_STR_MIXED_SECRET))
if(GLOB.master_mode in list(ROUNDTYPE_STR_RANDOM, ROUNDTYPE_STR_SECRET, ROUNDTYPE_STR_MIXED_SECRET))
to_world("<B>Reselecting gamemode...</B>")
return SETUP_REATTEMPT
else
@@ -589,12 +589,12 @@ var/datum/controller/subsystem/ticker/SSticker
/datum/controller/subsystem/ticker/proc/roundstart()
mode.post_setup()
//Cleanup some stuff
for(var/obj/effect/landmark/start/S in landmarks_list)
for(var/obj/effect/landmark/start/S in GLOB.landmarks_list)
//Deleting Startpoints but we need the ai point to AI-ize people later
if (S.name != "AI")
qdel(S)
// update join icon for lobbysitters
for(var/mob/abstract/new_player/NP in player_list)
for(var/mob/abstract/new_player/NP in GLOB.player_list)
if(!NP.client)
continue
var/obj/screen/new_player/selection/join_game/JG = locate() in NP.client.screen
@@ -635,12 +635,12 @@ var/datum/controller/subsystem/ticker/SSticker
var/obj/structure/bed/temp_buckle = new
//Incredibly hackish. It creates a bed within the gameticker (lol) to stop mobs running around
if(station_missed)
for(var/mob/living/M in living_mob_list)
for(var/mob/living/M in GLOB.living_mob_list)
M.buckled_to = temp_buckle //buckles the mob so it can't do anything
if(M.client)
M.client.screen += cinematic //show every client the cinematic
else //nuke kills everyone on z-level 1 to prevent "hurr-durr I survived"
for(var/mob/living/M in living_mob_list)
for(var/mob/living/M in GLOB.living_mob_list)
M.buckled_to = temp_buckle
if(M.client)
M.client.screen += cinematic
@@ -720,7 +720,7 @@ var/datum/controller/subsystem/ticker/SSticker
// Round setup stuff.
/datum/controller/subsystem/ticker/proc/create_characters()
for(var/mob/abstract/new_player/player in player_list)
for(var/mob/abstract/new_player/player in GLOB.player_list)
if(player && player.ready && player.mind)
if(player.mind.assigned_role=="AI")
player.close_spawn_windows()
@@ -733,12 +733,12 @@ var/datum/controller/subsystem/ticker/SSticker
CHECK_TICK
/datum/controller/subsystem/ticker/proc/collect_minds()
for(var/mob/living/player in player_list)
for(var/mob/living/player in GLOB.player_list)
if(player.mind)
minds += player.mind
/datum/controller/subsystem/ticker/proc/equip_characters()
for(var/mob/living/carbon/human/player in player_list)
for(var/mob/living/carbon/human/player in GLOB.player_list)
if(player && player.mind && player.mind.assigned_role)
if(!player_is_antag(player.mind, only_offstation_roles = 1))
SSjobs.EquipAugments(player, player.client.prefs)
@@ -61,7 +61,7 @@ SUBSYSTEM_DEF(virtualreality)
if(old_mob)
ckey_transfer(old_mob)
languages = list(all_languages[LANGUAGE_TCB])
languages = list(GLOB.all_languages[LANGUAGE_TCB])
to_chat(old_mob, SPAN_NOTICE("System exited safely, we hope you enjoyed your stay."))
old_mob = null
else
@@ -74,7 +74,7 @@ SUBSYSTEM_DEF(virtualreality)
if(old_mob)
ckey_transfer(old_mob)
speech_synthesizer_langs = list(all_languages[LANGUAGE_TCB])
speech_synthesizer_langs = list(GLOB.all_languages[LANGUAGE_TCB])
to_chat(old_mob, SPAN_NOTICE("System exited safely, we hope you enjoyed your stay."))
old_mob = null
else
@@ -87,7 +87,7 @@ SUBSYSTEM_DEF(virtualreality)
if(old_mob)
ckey_transfer(old_mob)
languages = list(all_languages[LANGUAGE_TCB])
languages = list(GLOB.all_languages[LANGUAGE_TCB])
internal_id.access = list()
to_chat(old_mob, SPAN_NOTICE("System exited safely, we hope you enjoyed your stay."))
old_mob = null
@@ -101,7 +101,7 @@ SUBSYSTEM_DEF(virtualreality)
if(old_mob)
ckey_transfer(old_mob)
languages = list(all_languages[LANGUAGE_TCB])
languages = list(GLOB.all_languages[LANGUAGE_TCB])
to_chat(old_mob, SPAN_NOTICE("System exited safely, we hope you enjoyed your stay."))
old_mob = null
qdel(src)
@@ -110,11 +110,11 @@ SUBSYSTEM_DEF(virtualreality)
to_chat(src, SPAN_WARNING("Ahelp to get back into your body, a bug has occurred."))
/mob/living/proc/vr_mob_exit_languages()
languages = list(all_languages[LANGUAGE_TCB])
languages = list(GLOB.all_languages[LANGUAGE_TCB])
/mob/living/silicon/vr_mob_exit_languages()
..()
speech_synthesizer_langs = list(all_languages[LANGUAGE_TCB])
speech_synthesizer_langs = list(GLOB.all_languages[LANGUAGE_TCB])
// Handles saving of the original mob and assigning the new mob
/datum/controller/subsystem/virtualreality/proc/mind_transfer(var/mob/living/M, var/mob/living/target)
@@ -250,8 +250,8 @@ SUBSYSTEM_DEF(virtualreality)
mind_transfer(user, bound[choice])
/datum/controller/subsystem/virtualreality/proc/create_virtual_reality_avatar(var/mob/living/carbon/human/user)
if(virtual_reality_spawn.len)
var/mob/living/carbon/human/virtual_reality/H = new /mob/living/carbon/human/virtual_reality(pick(virtual_reality_spawn))
if(GLOB.virtual_reality_spawn.len)
var/mob/living/carbon/human/virtual_reality/H = new /mob/living/carbon/human/virtual_reality(pick(GLOB.virtual_reality_spawn))
H.set_species(user.species.name, 1)
H.gender = user.gender
+41 -41
View File
@@ -21,7 +21,7 @@ SUBSYSTEM_DEF(vote)
var/list/round_voters = list()
/datum/controller/subsystem/vote/Initialize(timeofday)
next_transfer_time = config.vote_autotransfer_initial
next_transfer_time = GLOB.config.vote_autotransfer_initial
/datum/controller/subsystem/vote/fire(resumed = FALSE)
if (mode)
@@ -31,21 +31,21 @@ SUBSYSTEM_DEF(vote)
reset()
return
if(((started_time + config.vote_period - world.time)) < 0)
if(((started_time + GLOB.config.vote_period - world.time)) < 0)
result()
SStgui.close_uis(src)
reset()
if (get_round_duration() >= next_transfer_time - 600)
autotransfer()
next_transfer_time += config.vote_autotransfer_interval
next_transfer_time += GLOB.config.vote_autotransfer_interval
/datum/controller/subsystem/vote/proc/autotransfer()
initiate_vote("crew_transfer","the server", 1)
LOG_DEBUG("The server has called a crew transfer vote")
/datum/controller/subsystem/vote/proc/autogamemode()
for(var/thing in clients)
for(var/thing in GLOB.clients)
var/client/C = thing
window_flash(C)
initiate_vote("gamemode","the server", 1)
@@ -71,18 +71,18 @@ SUBSYSTEM_DEF(vote)
if(votes > greatest_votes)
greatest_votes = votes
//default-vote for everyone who didn't vote
if(!config.vote_no_default && choices.len)
var/non_voters = (clients.len - total_votes)
if(!GLOB.config.vote_no_default && choices.len)
var/non_voters = (GLOB.clients.len - total_votes)
if(non_voters > 0)
if(mode == "restart")
choices["Continue Playing"]["votes"] += non_voters
if(choices["Continue Playing"]["votes"] >= greatest_votes)
greatest_votes = choices["Continue Playing"]["votes"]
else if(mode == "gamemode")
if(master_mode in choices)
choices[master_mode]["votes"] += non_voters
if(choices[master_mode]["votes"] >= greatest_votes)
greatest_votes = choices[master_mode]["votes"]
if(GLOB.master_mode in choices)
choices[GLOB.master_mode]["votes"] += non_voters
if(choices[GLOB.master_mode]["votes"] >= greatest_votes)
greatest_votes = choices[GLOB.master_mode]["votes"]
else if(mode == "crew_transfer")
var/factor = 0.5
switch(get_round_duration() / (10 * 60)) // minutes
@@ -153,12 +153,12 @@ SUBSYSTEM_DEF(vote)
if(. == "Restart Round")
restart = 1
if("gamemode")
if(master_mode != .)
if(GLOB.master_mode != .)
SSpersistent_configuration.last_gamemode = .
if(SSticker.mode)
restart = 1
else
master_mode = .
GLOB.master_mode = .
if("crew_transfer")
if(. == "Initiate Crew Transfer")
init_shift_change(null, 1)
@@ -167,11 +167,11 @@ SUBSYSTEM_DEF(vote)
if(isnull(.) || . == "None")
antag_add_failed = 1
else
additional_antag_types |= antag_names_to_ids[.]
GLOB.additional_antag_types |= GLOB.antag_names_to_ids[.]
if(mode == "gamemode") //fire this even if the vote fails.
if(!round_progressing)
round_progressing = 1
if(!GLOB.round_progressing)
GLOB.round_progressing = 1
to_world("<span class='warning'><b>The round will start soon.</b></span>")
if(restart)
@@ -184,7 +184,7 @@ SUBSYSTEM_DEF(vote)
/datum/controller/subsystem/vote/proc/submit_vote(ckey, vote)
if(mode)
if (mode == "crew_transfer")
if(config.vote_no_dead && usr && !usr.client.holder)
if(GLOB.config.vote_no_dead && usr && !usr.client.holder)
if (isnewplayer(usr))
to_chat(usr, "<span class='warning'>You must be playing or have been playing to start a vote.</span>")
return 0
@@ -215,7 +215,7 @@ SUBSYSTEM_DEF(vote)
// Transfer votes are their own little special snowflake
var/next_allowed_time = 0
if (vote_type == "crew_transfer")
if (config.vote_no_dead && !usr.client.holder)
if (GLOB.config.vote_no_dead && !usr.client.holder)
if (isnewplayer(usr))
to_chat(usr, "<span class='warning'>You must be playing or have been playing to start a vote.</span>")
return 0
@@ -226,11 +226,11 @@ SUBSYSTEM_DEF(vote)
return 0
if (last_transfer_vote)
next_allowed_time = (last_transfer_vote + config.vote_delay)
next_allowed_time = (last_transfer_vote + GLOB.config.vote_delay)
else
next_allowed_time = config.transfer_timeout
next_allowed_time = GLOB.config.transfer_timeout
else
next_allowed_time = (started_time + config.vote_delay)
next_allowed_time = (started_time + GLOB.config.vote_delay)
if(next_allowed_time > get_round_duration())
return 0
@@ -244,8 +244,8 @@ SUBSYSTEM_DEF(vote)
round_voters.Cut() //Delete the old list, since we are having a new gamemode vote
if(SSticker.current_state >= 2)
return 0
for (var/F in config.votable_modes)
var/datum/game_mode/M = gamemode_cache[F]
for (var/F in GLOB.config.votable_modes)
var/datum/game_mode/M = GLOB.gamemode_cache[F]
if(!M)
continue
AddChoice(F, capitalize(M.name), "", M.required_players)
@@ -268,11 +268,11 @@ SUBSYSTEM_DEF(vote)
AddChoice("Initiate Crew Transfer")
AddChoice("Continue The Round")
if("add_antagonist")
if(!config.allow_extra_antags || SSticker.current_state >= 2)
if(!GLOB.config.allow_extra_antags || SSticker.current_state >= 2)
return 0
for(var/antag_type in all_antag_types)
var/datum/antagonist/antag = all_antag_types[antag_type]
if(!(antag.id in additional_antag_types) && antag.is_votable())
for(var/antag_type in GLOB.all_antag_types)
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
if(!(antag.id in GLOB.additional_antag_types) && antag.is_votable())
AddChoice(antag.role_text)
AddChoice("None")
if("custom")
@@ -294,9 +294,9 @@ SUBSYSTEM_DEF(vote)
text += "\n[sanitizeSafe(question)]"
log_vote(text)
for(var/cc in clients)
for(var/cc in GLOB.clients)
var/client/C = cc
to_chat(C, "<span class='vote'><b>[text]</b>\nType <b>vote</b> or click <a href='?src=\ref[src];open=1'>here</a> to place your votes.\nYou have [config.vote_period/10] seconds to vote.</span>")
to_chat(C, "<span class='vote'><b>[text]</b>\nType <b>vote</b> or click <a href='?src=\ref[src];open=1'>here</a> to place your votes.\nYou have [GLOB.config.vote_period/10] seconds to vote.</span>")
if(C.prefs.sfx_toggles & ASFX_VOTE) //Personal mute
switch(vote_type)
if("crew_transfer")
@@ -305,8 +305,8 @@ SUBSYSTEM_DEF(vote)
sound_to(C, sound('sound/ambience/vote_alarm.ogg', repeat = 0, wait = 0, volume = 50, channel = 3))
if("custom")
sound_to(C, sound('sound/ambience/vote_alarm.ogg', repeat = 0, wait = 0, volume = 50, channel = 3))
if(mode == "gamemode" && round_progressing)
round_progressing = 0
if(mode == "gamemode" && GLOB.round_progressing)
GLOB.round_progressing = 0
to_world("<span class='warning'><b>Round start has been delayed.</b></span>")
SStgui.update_uis(src)
return 1
@@ -355,23 +355,23 @@ SUBSYSTEM_DEF(vote)
return TRUE
if("toggle_restart")
if(isstaff)
config.allow_vote_restart = !config.allow_vote_restart
GLOB.config.allow_vote_restart = !GLOB.config.allow_vote_restart
SStgui.update_uis(src)
return TRUE
if("toggle_gamemode")
if(isstaff)
config.allow_vote_mode = !config.allow_vote_mode
GLOB.config.allow_vote_mode = !GLOB.config.allow_vote_mode
SStgui.update_uis(src)
return TRUE
if("restart")
if(isstaff)
initiate_vote("restart", ui.user.key)
return TRUE
else if (config.allow_vote_restart)
else if (GLOB.config.allow_vote_restart)
var/admin_number_present = 0
var/admin_number_afk = 0
for (var/s in staff)
for (var/s in GLOB.staff)
var/client/X = s
if (X.holder.rights & R_ADMIN)
admin_number_present++
@@ -387,15 +387,15 @@ SUBSYSTEM_DEF(vote)
log_and_message_admins("tried to start a restart vote.", usr, null)
to_chat(ui.user, "<span class='notice'><b>There are active admins around! You cannot start a restart vote due to this.</b></span>")
if("gamemode")
if(config.allow_vote_mode || isstaff)
if(GLOB.config.allow_vote_mode || isstaff)
initiate_vote("gamemode", ui.user.key)
return TRUE
if("crew_transfer")
if(config.allow_vote_restart || isstaff)
if(GLOB.config.allow_vote_restart || isstaff)
initiate_vote("crew_transfer", ui.user.key)
return TRUE
if("add_antagonist")
if(!antag_add_failed && config.allow_extra_antags)
if(!antag_add_failed && GLOB.config.allow_extra_antags)
initiate_vote("add_antagonist", ui.user.key)
return TRUE
if("custom")
@@ -424,10 +424,10 @@ SUBSYSTEM_DEF(vote)
data["mode"] = mode
data["voted"] = current_votes[user.ckey]
data["endtime"] = started_time + config.vote_period
data["allow_vote_restart"] = config.allow_vote_restart
data["allow_vote_mode"] = config.allow_vote_mode
data["allow_extra_antags"] = (!antag_add_failed && config.allow_extra_antags)
data["endtime"] = started_time + GLOB.config.vote_period
data["allow_vote_restart"] = GLOB.config.allow_vote_restart
data["allow_vote_mode"] = GLOB.config.allow_vote_mode
data["allow_extra_antags"] = (!antag_add_failed && GLOB.config.allow_extra_antags)
if(!question)
data["question"] = capitalize(mode)
+2 -2
View File
@@ -1,9 +1,9 @@
/client/proc/debug_antagonist_template(antag_type in all_antag_types)
/client/proc/debug_antagonist_template(antag_type in GLOB.all_antag_types)
set category = "Debug"
set name = "Debug Antagonist"
set desc = "Debug an antagonist template."
var/datum/antagonist/antag = all_antag_types[antag_type]
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
if(antag)
usr.client.debug_variables(antag)
message_admins("Admin [key_name_admin(usr)] is debugging the [antag.role_text] template.")