Configuration Controller (#7857)

This commit is contained in:
Selis
2024-04-05 07:44:20 +02:00
committed by GitHub
parent c542e3bac0
commit e1a987c25c
235 changed files with 3294 additions and 989 deletions

View File

@@ -0,0 +1,30 @@
//config files
#define CONFIG_GET(X) global.config.Get(/datum/config_entry/##X)
#define CONFIG_SET(X, Y) global.config.Set(/datum/config_entry/##X, ##Y)
#define CONFIG_MAPS_FILE "maps.txt"
//flags
/// can't edit
#define CONFIG_ENTRY_LOCKED (1<<0)
/// can't see value
#define CONFIG_ENTRY_HIDDEN (1<<1)
/// Force the config directory to be something other than "config"
#define OVERRIDE_CONFIG_DIRECTORY_PARAMETER "config-directory"
// Config entry types
#define VALUE_MODE_NUM 0
#define VALUE_MODE_TEXT 1
#define VALUE_MODE_FLAG 2
#define KEY_MODE_TEXT 0
#define KEY_MODE_TYPE 1
// Flags for respawn config
/// Respawn not allowed
#define RESPAWN_FLAG_DISABLED 0
/// Respawn as much as you'd like
#define RESPAWN_FLAG_FREE 1
/// Can respawn, but not as the same character
#define RESPAWN_FLAG_NEW_CHARACTER 2

View File

@@ -0,0 +1,5 @@
// See initialization order in /code/game/world.dm
// GLOBAL_REAL(config, /datum/controller/configuration)
GLOBAL_REAL(config, /datum/controller/configuration) = new
GLOBAL_DATUM_INIT(revdata, /datum/getrev, new)

View File

@@ -29,6 +29,12 @@
return FALSE
return TRUE
/// Returns the top (last) element from the list, does not remove it from the list. Stack functionality.
/proc/peek(list/target_list)
var/list_length = length(target_list)
if(list_length != 0)
return target_list[list_length]
//CHOMPEdit End
//Returns a list in plain english as a string

View File

@@ -23,26 +23,27 @@
//print a testing-mode debug message to world.log
/proc/testing(msg)
if (config.log_debug) //CHOMPEdit
if (CONFIG_GET(flag/log_debug)) //CHOMPEdit
to_world_log("## TESTING: [msg]")
/proc/log_admin(text)
admin_log.Add(text)
if (config.log_admin)
if (CONFIG_GET(flag/log_admin)) // CHOMPEdit
WRITE_LOG(diary, "ADMIN: [text]")
/proc/log_adminpm(text, client/source, client/dest)
admin_log.Add(text)
if (config.log_admin)
if (CONFIG_GET(flag/log_admin)) // CHOMPEdit
WRITE_LOG(diary, "ADMINPM: [key_name(source)]->[key_name(dest)]: [html_decode(text)]")
/proc/log_pray(text, client/source)
admin_log.Add(text)
if (config.log_admin)
if (CONFIG_GET(flag/log_admin)) // CHOMPEdit
WRITE_LOG(diary, "PRAY: [key_name(source)]: [text]")
/proc/log_debug(text)
if (config.log_debug)
//if (CONFIG_GET(flag/log_debug)) // CHOMPEdit
// WRITE_LOG(debug_log, "DEBUG: [sanitize(text)]")
WRITE_LOG(debug_log, "DEBUG: [sanitize(text)]")
for(var/client/C in GLOB.admins)
@@ -52,25 +53,25 @@
html = "<span class='filter_debuglog'>DEBUG: [text]</span>")
/proc/log_game(text)
if (config.log_game)
if (CONFIG_GET(flag/log_game)) // CHOMPEdit
WRITE_LOG(diary, "GAME: [text]")
/proc/log_vote(text)
if (config.log_vote)
if (CONFIG_GET(flag/log_vote)) // CHOMPEdit
WRITE_LOG(diary, "VOTE: [text]")
/proc/log_access_in(client/new_client)
if (config.log_access)
if (CONFIG_GET(flag/log_access)) // CHOMPEdit
var/message = "[key_name(new_client)] - IP:[new_client.address] - CID:[new_client.computer_id] - BYOND v[new_client.byond_version]"
WRITE_LOG(diary, "ACCESS IN: [message]") //VOREStation Edit
/proc/log_access_out(mob/last_mob)
if (config.log_access)
if (CONFIG_GET(flag/log_access)) // CHOMPEdit
var/message = "[key_name(last_mob)] - IP:[last_mob.lastKnownIP] - CID:Logged Out - BYOND Logged Out"
WRITE_LOG(diary, "ACCESS OUT: [message]")
/proc/log_say(text, mob/speaker)
if (config.log_say)
if (CONFIG_GET(flag/log_say)) // CHOMPEdit
WRITE_LOG(diary, "SAY: [speaker.simple_info_line()]: [html_decode(text)]")
//Log the message to in-game dialogue logs, as well. //CHOMPEdit Begin
@@ -91,7 +92,7 @@
//CHOMPEdit End
/proc/log_ooc(text, client/user)
if (config.log_ooc)
if (CONFIG_GET(flag/log_ooc)) // CHOMPEdit
WRITE_LOG(diary, "OOC: [user.simple_info_line()]: [html_decode(text)]")
if(!SSdbcore.IsConnected())
establish_db_connection()
@@ -107,7 +108,7 @@
//GLOB.round_text_log += "<b>([time_stamp()])</b> (<b>[user]</b>) <u>OOC:</u> - <span style=\"color:blue\"><b>[text]</b></span>"
/proc/log_aooc(text, client/user)
if (config.log_ooc)
if (CONFIG_GET(flag/log_ooc)) // CHOMPEdit
WRITE_LOG(diary, "AOOC: [user.simple_info_line()]: [html_decode(text)]")
if(!SSdbcore.IsConnected())
establish_db_connection()
@@ -123,7 +124,7 @@
//GLOB.round_text_log += "<b>([time_stamp()])</b> (<b>[user]</b>) <u>AOOC:</u> - <span style=\"color:red\"><b>[text]</b></span>"
/proc/log_looc(text, client/user)
if (config.log_ooc)
if (CONFIG_GET(flag/log_ooc)) // CHOMPEdit
WRITE_LOG(diary, "LOOC: [user.simple_info_line()]: [html_decode(text)]")
if(!SSdbcore.IsConnected())
establish_db_connection()
@@ -139,7 +140,7 @@
//GLOB.round_text_log += "<b>([time_stamp()])</b> (<b>[user]</b>) <u>LOOC:</u> - <span style=\"color:orange\"><b>[text]</b></span>"
/proc/log_whisper(text, mob/speaker)
if (config.log_whisper)
if (CONFIG_GET(flag/log_whisper)) // CHOMPEdit
WRITE_LOG(diary, "WHISPER: [speaker.simple_info_line()]: [html_decode(text)]")
if(speaker.client)
@@ -158,7 +159,7 @@
qdel(query_insert)
/proc/log_emote(text, mob/speaker)
if (config.log_emote)
if (CONFIG_GET(flag/log_emote)) // CHOMPEdit
WRITE_LOG(diary, "EMOTE: [speaker.simple_info_line()]: [html_decode(text)]")
//CHOMPEdit Begin
if(speaker.client)
@@ -178,23 +179,23 @@
//CHOMPEdit End
/proc/log_attack(attacker, defender, message)
if (config.log_attack)
if (CONFIG_GET(flag/log_attack)) // CHOMPEdit
WRITE_LOG(diary, "ATTACK: [attacker] against [defender]: [message]")
/proc/log_adminsay(text, mob/speaker)
if (config.log_adminchat)
if (CONFIG_GET(flag/log_adminchat)) // CHOMPEdit
WRITE_LOG(diary, "ADMINSAY: [speaker.simple_info_line()]: [html_decode(text)]")
/proc/log_modsay(text, mob/speaker)
if (config.log_adminchat)
if (CONFIG_GET(flag/log_adminchat)) // CHOMPEdit
WRITE_LOG(diary, "MODSAY: [speaker.simple_info_line()]: [html_decode(text)]")
/proc/log_eventsay(text, mob/speaker)
if (config.log_adminchat)
if (CONFIG_GET(flag/log_adminchat)) // CHOMPEdit
WRITE_LOG(diary, "EVENTSAY: [speaker.simple_info_line()]: [html_decode(text)]")
/proc/log_ghostsay(text, mob/speaker)
if (config.log_say)
if (CONFIG_GET(flag/log_say)) // CHOMPEdit
WRITE_LOG(diary, "DEADCHAT: [speaker.simple_info_line()]: [html_decode(text)]")
//CHOMPEdit Begin
if(speaker.client)
@@ -215,7 +216,7 @@
//CHOMPEdit End
/proc/log_ghostemote(text, mob/speaker)
if (config.log_emote)
if (CONFIG_GET(flag/log_emote)) // CHMOPEdit
WRITE_LOG(diary, "DEADEMOTE: [speaker.simple_info_line()]: [html_decode(text)]")
//CHOMPEdit Begin
if(speaker.client)
@@ -233,11 +234,11 @@
//CHOMPEdit End
/proc/log_adminwarn(text)
if (config.log_adminwarn)
if (CONFIG_GET(flag/log_adminwarn)) // CHOMPEdit
WRITE_LOG(diary, "ADMINWARN: [html_decode(text)]")
/proc/log_pda(text, mob/speaker)
if (config.log_pda)
if (CONFIG_GET(flag/log_pda)) // CHOMPEdit
WRITE_LOG(diary, "PDA: [speaker.simple_info_line()]: [html_decode(text)]")
//CHOMPEdit Begin
if(speaker.client)
@@ -259,7 +260,8 @@
/proc/log_to_dd(text)
to_world_log(text) //this comes before the config check because it can't possibly runtime
if(config.log_world_output)
//if(CONFIG_GET(flag/log_world_output)) // CHOMPEdit
// WRITE_LOG(diary, "DD_OUTPUT: [text]")
WRITE_LOG(diary, "DD_OUTPUT: [text]")
/proc/log_error(text)

View File

@@ -0,0 +1,11 @@
/// Logging for config errors
/// Rarely gets called; just here in case the config breaks.
/proc/log_config(text, list/data)
var/entry = "CONFIG: "
entry += text
entry += " | DATA: "
entry += data
WRITE_LOG(diary, entry)
SEND_TEXT(world.log, text)

View File

@@ -1,5 +1,5 @@
/proc/log_nsay(text, inside, mob/speaker)
if (config.log_say)
if (CONFIG_GET(flag/log_say)) // CHOMPEdit
WRITE_LOG(diary, "NSAY (NIF:[inside]): [speaker.simple_info_line()]: [html_decode(text)]")
//CHOMPEdit Begin
if(speaker.client)
@@ -17,7 +17,7 @@
//CHOMPEdit End
/proc/log_nme(text, inside, mob/speaker)
if (config.log_emote)
if (CONFIG_GET(flag/log_emote)) // CHOMPEdit
WRITE_LOG(diary, "NME (NIF:[inside]): [speaker.simple_info_line()]: [html_decode(text)]")
//CHOMPEdit Begin
if(speaker.client)
@@ -35,7 +35,7 @@
//CHOMPEdit End
/proc/log_subtle(text, mob/speaker)
if (config.log_emote)
if (CONFIG_GET(flag/log_emote)) // CHOMPEdit
WRITE_LOG(diary, "SUBTLE: [speaker.simple_info_line()]: [html_decode(text)]")
//CHOMPEdit Begin
if(speaker.client)

View File

@@ -374,7 +374,7 @@ Proc for attack log creation, because really why not
cached_character_icons[cachekey] = .
/proc/not_has_ooc_text(mob/user)
if (config.allow_Metadata && (!user.client?.prefs?.metadata || length(user.client.prefs.metadata) < 15))
if (CONFIG_GET(flag/allow_metadata) && (!user.client?.prefs?.metadata || length(user.client.prefs.metadata) < 15)) // CHOMPEdit
to_chat(user, "<span class='warning'>Please set informative OOC notes related to RP/ERP preferences. Set them using the 'OOC Notes' button on the 'General' tab in character setup.</span>")
return TRUE
return FALSE

View File

@@ -0,0 +1,11 @@
/**
* NAMEOF: Compile time checked variable name to string conversion
* evaluates to a string equal to "X", but compile errors if X isn't a var on datum.
* datum may be null, but it does need to be a typed var.
**/
#define NAMEOF(datum, X) (#X || ##datum.##X)
/**
* NAMEOF that actually works in static definitions because src::type requires src to be defined
*/
#define NAMEOF_STATIC(datum, X) (nameof(type::##X))

View File

@@ -92,8 +92,8 @@ var/religion_name = null
new_station_name += pick("13","XIII","Thirteen")
if (config && config.server_name)
world.name = "[config.server_name]: [name]"
if (config && CONFIG_GET(string/servername)) // CHOMPEdit
world.name = "[CONFIG_GET(string/servername)]: [name]" // CHOMPEdit
else
world.name = new_station_name
@@ -104,8 +104,8 @@ var/religion_name = null
using_map.station_name = name
if (config && config.server_name)
world.name = "[config.server_name]: [name]"
if (config && CONFIG_GET(string/servername)) // CHOMPEdit
world.name = "[CONFIG_GET(string/servername)]: [name]" // CHOMPEdit
else
world.name = name

View File

@@ -620,3 +620,10 @@ GLOBAL_LIST_EMPTY(text_tag_cache)
paper_text = replacetext(paper_text, "<br>", "\n")
paper_text = strip_html_properly(paper_text) // Get rid of everything else entirely.
return paper_text
//json decode that will return null on parse error instead of runtiming.
/proc/safe_json_decode(data)
try
return json_decode(data)
catch
return null

View File

@@ -1,11 +1,43 @@
/*
* Holds procs designed to change one type of value, into another.
* Contains:
* file2list
* type2top
* hex2num & num2hex
* file2list
* angle2dir
*/
// CHOMPEdit Start
//Splits the text of a file at seperator and returns them in a list.
//returns an empty list if the file doesn't exist
/world/proc/file2list(filename, seperator="\n", trim = TRUE)
if (trim)
return splittext(trim(file2text(filename)),seperator)
return splittext(file2text(filename),seperator)
//returns a string the last bit of a type, without the preceeding '/'
/proc/type2top(the_type)
//handle the builtins manually
if(!ispath(the_type))
return
switch(the_type)
if(/datum)
return "datum"
if(/atom)
return "atom"
if(/obj)
return "obj"
if(/mob)
return "mob"
if(/area)
return "area"
if(/turf)
return "turf"
else //regex everything else (works for /proc too)
return lowertext(replacetext("[the_type]", "[type2parent(the_type)]/", ""))
// CHOMPEdit End
// Returns an integer given a hexadecimal number string as input.
/proc/hex2num(hex)
if (!istext(hex))

View File

@@ -1390,7 +1390,7 @@ var/mob/dview/dview_mob = new
#undef HAS_FLAG
//datum may be null, but it does need to be a typed var
#define NAMEOF(datum, X) (#X || ##datum.##X)
//#define NAMEOF(datum, X) (#X || ##datum.##X) // CHOMPEdit: Moved to nameof_ch.dm
#define VARSET_LIST_CALLBACK(target, var_name, var_value) CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(___callbackvarset), ##target, ##var_name, ##var_value)
//dupe code because dm can't handle 3 level deep macros

View File

@@ -43,26 +43,26 @@
//Sender is optional
/proc/admin_chat_message(var/message = "Debug Message", var/color = "#FFFFFF", var/sender)
if (!config.chat_webhook_url || !message)
if (!CONFIG_GET(string/chat_webhook_url) || !message) // CHOMPEdit
return
spawn(0)
var/query_string = "type=adminalert"
query_string += "&key=[url_encode(config.chat_webhook_key)]"
query_string += "&key=[url_encode(CONFIG_GET(string/chat_webhook_key))]" // CHOMPEdit
query_string += "&msg=[url_encode(message)]"
query_string += "&color=[url_encode(color)]"
if(sender)
query_string += "&from=[url_encode(sender)]"
world.Export("[config.chat_webhook_url]?[query_string]")
world.Export("[CONFIG_GET(string/chat_webhook_url)]?[query_string]") // CHOMPEdit
/proc/admin_action_message(var/admin = "INVALID", var/user = "INVALID", var/action = "INVALID", var/reason = "INVALID", var/time = "INVALID")
if (!config.chat_webhook_url || !action)
if (!CONFIG_GET(string/chat_webhook_url) || !action) // CHOMPEdit
return
spawn(0)
var/query_string = "type=adminaction"
query_string += "&key=[url_encode(config.chat_webhook_key)]"
query_string += "&key=[url_encode(CONFIG_GET(string/chat_webhook_key))]" // CHOMPEdit
query_string += "&admin=[url_encode(admin)]"
query_string += "&user=[url_encode(user)]"
query_string += "&action=[url_encode(action)]"
query_string += "&reason=[url_encode(reason)]"
query_string += "&time=[url_encode(time)]"
world.Export("[config.chat_webhook_url]?[query_string]")
world.Export("[CONFIG_GET(string/chat_webhook_url)]?[query_string]") // CHOMPEdit

View File

@@ -158,7 +158,7 @@
next_click = max(world.time + timeout, next_click)
/mob/proc/checkClickCooldown()
if(next_click > world.time && !config.no_click_cooldown)
if(next_click > world.time && !CONFIG_GET(flag/no_click_cooldown)) // CHOMPEdit
return FALSE
return TRUE

View File

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

View File

@@ -1216,8 +1216,8 @@ var/list/gamemode_cache = list()
SSdbcore.InitializeRound() // CHOMPEdit
//apply a default value to config.python_path, if needed
if (!config.python_path)
if (!CONFIG_GET(string/python_path)) // CHOMPEdit
if(world.system_type == UNIX)
config.python_path = "/usr/bin/env python2"
CONFIG_SET(string/python_path, "/usr/bin/env python2") // CHOMPEdit
else //probably windows, if not this should work anyway
config.python_path = "python"
CONFIG_SET(string/python_path, "python") // CHOMPEdit

View File

@@ -0,0 +1,300 @@
/datum/config_entry
/// Read-only, this is determined by the last portion of the derived entry type
var/name
/// The configured value for this entry. This shouldn't be initialized in code, instead set default
var/config_entry_value
/// Read-only default value for this config entry, used for resetting value to defaults when necessary. This is what config_entry_value is initially set to
var/default
/// The file which this was loaded from, if any
var/resident_file
/// Set to TRUE if the default has been overridden by a config entry
var/modified = FALSE
/// The config name of a configuration type that depricates this, if it exists
var/deprecated_by
/// The /datum/config_entry type that supercedes this one
var/protection = NONE
/// Do not instantiate if type matches this
var/config_abstract_type = /datum/config_entry
/// Force validate and set on VV. VAS proccall guard will run regardless.
var/vv_VAS = TRUE
/// Controls if error is thrown when duplicate configuration values for this entry type are encountered
var/dupes_allowed = FALSE
/// Stores the original protection configuration, used for set_default()
var/default_protection
/datum/config_entry/New()
if(type == config_abstract_type)
CRASH("Abstract config entry [type] instatiated!")
name = lowertext(type2top(type))
default_protection = protection
set_default()
/datum/config_entry/Destroy()
config.RemoveEntry(src)
return ..()
/**
* Returns the value of the configuration datum to its default, used for resetting a config value. Note this also sets the protection back to default.
*/
/datum/config_entry/proc/set_default()
if ((protection & CONFIG_ENTRY_LOCKED) && IsAdminAdvancedProcCall())
//log_admin_private("[key_name(usr)] attempted to reset locked config entry [type] to its default")
log_admin("[key_name(usr)] attempted to reset locked config entry [type] to its default")
return
if (islist(default))
var/list/L = default
config_entry_value = L.Copy()
else
config_entry_value = default
protection = default_protection
resident_file = null
modified = FALSE
/datum/config_entry/can_vv_get(var_name)
. = ..()
if(var_name == NAMEOF(src, config_entry_value) || var_name == NAMEOF(src, default))
. &= !(protection & CONFIG_ENTRY_HIDDEN)
/datum/config_entry/vv_edit_var(var_name, var_value)
var/static/list/banned_edits = list(NAMEOF_STATIC(src, name), NAMEOF_STATIC(src, vv_VAS), NAMEOF_STATIC(src, default), NAMEOF_STATIC(src, resident_file), NAMEOF_STATIC(src, protection), NAMEOF_STATIC(src, config_abstract_type), NAMEOF_STATIC(src, modified), NAMEOF_STATIC(src, dupes_allowed))
if(var_name == NAMEOF(src, config_entry_value))
if(protection & CONFIG_ENTRY_LOCKED)
return FALSE
if(vv_VAS)
. = ValidateAndSet("[var_value]")
if(.)
datum_flags |= DF_VAR_EDITED
return
else
return ..()
if(var_name in banned_edits)
return FALSE
return ..()
/datum/config_entry/proc/VASProcCallGuard(str_val)
. = !((protection & CONFIG_ENTRY_LOCKED) && IsAdminAdvancedProcCall())
if(!.)
//log_admin_private("[key_name(usr)] attempted to set locked config entry [type] to '[str_val]'")
log_admin("[key_name(usr)] attempted to set locked config entry [type] to '[str_val]'")
/datum/config_entry/proc/ValidateAndSet(str_val)
VASProcCallGuard(str_val)
CRASH("Invalid config entry type!")
/datum/config_entry/proc/ValidateListEntry(key_name, key_value)
return TRUE
/datum/config_entry/proc/DeprecationUpdate(value)
return
/datum/config_entry/string
default = ""
config_abstract_type = /datum/config_entry/string
var/auto_trim = TRUE
/// whether the string will be lowercased on ValidateAndSet or not.
var/lowercase = FALSE
/datum/config_entry/string/vv_edit_var(var_name, var_value)
return var_name != NAMEOF(src, auto_trim) && ..()
/datum/config_entry/string/ValidateAndSet(str_val)
if(!VASProcCallGuard(str_val))
return FALSE
config_entry_value = auto_trim ? trim(str_val) : str_val
if(lowercase)
config_entry_value = lowertext(config_entry_value)
return TRUE
/datum/config_entry/number
default = 0
config_abstract_type = /datum/config_entry/number
var/integer = TRUE
var/max_val = INFINITY
var/min_val = -INFINITY
/datum/config_entry/number/ValidateAndSet(str_val)
if(!VASProcCallGuard(str_val))
return FALSE
var/temp = text2num(trim(str_val))
if(!isnull(temp))
config_entry_value = clamp(integer ? round(temp) : temp, min_val, max_val)
if(config_entry_value != temp && !(datum_flags & DF_VAR_EDITED))
log_config("Changing [name] from [temp] to [config_entry_value]!")
return TRUE
return FALSE
/datum/config_entry/number/vv_edit_var(var_name, var_value)
var/static/list/banned_edits = list(NAMEOF_STATIC(src, max_val), NAMEOF_STATIC(src, min_val), NAMEOF_STATIC(src, integer))
return !(var_name in banned_edits) && ..()
/datum/config_entry/flag
default = FALSE
config_abstract_type = /datum/config_entry/flag
/datum/config_entry/flag/ValidateAndSet(str_val)
if(!VASProcCallGuard(str_val))
return FALSE
config_entry_value = text2num(trim(str_val)) != 0
return TRUE
/// List config entry, used for configuring a list of strings
/datum/config_entry/str_list
config_abstract_type = /datum/config_entry/str_list
default = list()
dupes_allowed = TRUE
/// whether the string elements will be lowercased on ValidateAndSet or not.
var/lowercase = FALSE
/datum/config_entry/str_list/ValidateAndSet(str_val)
if (!VASProcCallGuard(str_val))
return FALSE
str_val = trim(str_val)
if (str_val != "")
config_entry_value += lowercase ? lowertext(str_val) : str_val
return TRUE
/datum/config_entry/number_list
config_abstract_type = /datum/config_entry/number_list
default = list()
/datum/config_entry/number_list/ValidateAndSet(str_val)
if(!VASProcCallGuard(str_val))
return FALSE
str_val = trim(str_val)
var/list/new_list = list()
var/list/values = splittext(str_val," ")
for(var/I in values)
var/temp = text2num(I)
if(isnull(temp))
return FALSE
new_list += temp
if(!new_list.len)
return FALSE
config_entry_value = new_list
return TRUE
/datum/config_entry/keyed_list
config_abstract_type = /datum/config_entry/keyed_list
default = list()
dupes_allowed = TRUE
vv_VAS = FALSE //VAS will not allow things like deleting from lists, it'll just bug horribly.
var/key_mode
var/value_mode
var/splitter = " "
/// whether the key names will be lowercased on ValidateAndSet or not.
var/lowercase_key = TRUE
/datum/config_entry/keyed_list/New()
. = ..()
if(isnull(key_mode) || isnull(value_mode))
CRASH("Keyed list of type [type] created with null key or value mode!")
/datum/config_entry/keyed_list/ValidateAndSet(str_val)
if(!VASProcCallGuard(str_val))
return FALSE
str_val = trim(str_val)
var/list/new_entry = parse_key_and_value(str_val)
var/new_key = new_entry["config_key"]
var/new_value = new_entry["config_value"]
if(!isnull(new_value) && !isnull(new_key) && ValidateListEntry(new_key, new_value))
config_entry_value[new_key] = new_value
return TRUE
return FALSE
/datum/config_entry/keyed_list/proc/parse_key_and_value(option_string)
// Blank or null option string? Bad mojo!
if(!option_string)
log_config("ERROR: Keyed list config tried to parse with no key or value data.")
return null
var/list/config_entry_words = splittext(option_string, splitter)
var/config_value
var/config_key
var/is_ambiguous = FALSE
// If this config entry's value mode is flag, the value can either be TRUE or FALSE.
// However, the config supports implicitly setting a config entry to TRUE by omitting the value.
// This value mode should also support config overrides disabling it too.
// The following code supports config entries as such:
// Implicitly enable the config entry: CONFIG_ENTRY config key goes here
// Explicitly enable the config entry: CONFIG_ENTRY config key goes here 1
// Explicitly disable the config entry: CONFIG_ENTRY config key goes here 0
if(value_mode == VALUE_MODE_FLAG)
var/value = peek(config_entry_words)
config_value = TRUE
if(value == "0")
config_key = jointext(config_entry_words, splitter, length(config_entry_words) - 1)
config_value = FALSE
is_ambiguous = (length(config_entry_words) > 2)
else if(value == "1")
config_key = jointext(config_entry_words, splitter, length(config_entry_words) - 1)
is_ambiguous = (length(config_entry_words) > 2)
else
config_key = option_string
is_ambiguous = (length(config_entry_words) > 1)
// Else it has to be a key value pair and we parse it under that assumption.
else
// If config_entry_words only has 1 or 0 words in it and isn't value_mode == VALUE_MODE_FLAG then it's an invalid config entry.
if(length(config_entry_words) <= 1)
log_config("ERROR: Could not parse value from config entry string: [option_string]")
return null
config_value = pop(config_entry_words)
config_key = jointext(config_entry_words, splitter)
if(lowercase_key)
config_key = lowertext(config_key)
is_ambiguous = (length(config_entry_words) > 2)
config_key = validate_config_key(config_key)
config_value = validate_config_value(config_value)
// If there are multiple splitters, it's definitely ambiguous and we'll warn about how we parsed it. Helps with debugging config issues.
if(is_ambiguous)
log_config("WARNING: Multiple splitter characters (\"[splitter]\") found. Using \"[config_key]\" as config key and \"[config_value]\" as config value.")
return list("config_key" = config_key, "config_value" = config_value)
/// Takes a given config key and validates it. If successful, returns the formatted key. If unsuccessful, returns null.
/datum/config_entry/keyed_list/proc/validate_config_key(key)
switch(key_mode)
if(KEY_MODE_TEXT)
return key
if(KEY_MODE_TYPE)
if(ispath(key))
return key
var/key_path = text2path(key)
if(isnull(key_path))
log_config("ERROR: Invalid KEY_MODE_TYPE typepath. Is not a valid typepath: [key]")
return
return key_path
/// Takes a given config value and validates it. If successful, returns the formatted key. If unsuccessful, returns null.
/datum/config_entry/keyed_list/proc/validate_config_value(value)
switch(value_mode)
if(VALUE_MODE_FLAG)
return value
if(VALUE_MODE_NUM)
if(isnum(value))
return value
var/value_num = text2num(value)
if(isnull(value_num))
log_config("ERROR: Invalid VALUE_MODE_NUM number. Could not parse a valid number: [value]")
return
return value_num
if(VALUE_MODE_TEXT)
return value
/datum/config_entry/keyed_list/vv_edit_var(var_name, var_value)
return var_name != NAMEOF(src, splitter) && ..()

View File

@@ -0,0 +1,536 @@
/datum/controller/configuration
name = "Configuration"
var/directory = "config"
var/warned_deprecated_configs = FALSE
var/hiding_entries_by_type = TRUE //Set for readability, admins can set this to FALSE if they want to debug it
var/list/entries
var/list/entries_by_type
//var/list/maplist
//var/datum/map_config/defaultmap
var/list/modes // allowed modes
var/list/gamemode_cache
var/list/votable_modes // votable modes
var/list/mode_names
var/list/mode_reports
var/list/mode_false_report_weight
var/motd
var/policy
/// If the configuration is loaded
var/loaded = FALSE
/// A regex that matches words blocked IC
var/static/regex/ic_filter_regex
/// A regex that matches words blocked OOC
var/static/regex/ooc_filter_regex
/// A regex that matches words blocked IC, but not in PDAs
var/static/regex/ic_outside_pda_filter_regex
/// A regex that matches words soft blocked IC
var/static/regex/soft_ic_filter_regex
/// A regex that matches words soft blocked OOC
var/static/regex/soft_ooc_filter_regex
/// A regex that matches words soft blocked IC, but not in PDAs
var/static/regex/soft_ic_outside_pda_filter_regex
/// An assoc list of blocked IC words to their reasons
var/static/list/ic_filter_reasons
/// An assoc list of words that are blocked IC, but not in PDAs, to their reasons
var/static/list/ic_outside_pda_filter_reasons
/// An assoc list of words that are blocked both IC and OOC to their reasons
var/static/list/shared_filter_reasons
/// An assoc list of soft blocked IC words to their reasons
var/static/list/soft_ic_filter_reasons
/// An assoc list of words that are soft blocked IC, but not in PDAs, to their reasons
var/static/list/soft_ic_outside_pda_filter_reasons
/// An assoc list of words that are soft blocked both IC and OOC to their reasons
var/static/list/soft_shared_filter_reasons
/// A list of configuration errors that occurred during load
var/static/list/configuration_errors
/datum/controller/configuration/proc/admin_reload()
if(IsAdminAdvancedProcCall())
return
log_admin("[key_name_admin(usr)] has forcefully reloaded the configuration from disk.")
message_admins("[key_name_admin(usr)] has forcefully reloaded the configuration from disk.")
full_wipe()
Load(world.params[OVERRIDE_CONFIG_DIRECTORY_PARAMETER])
/datum/controller/configuration/proc/Load(_directory)
if(IsAdminAdvancedProcCall()) //If admin proccall is detected down the line it will horribly break everything.
return
if(_directory)
directory = _directory
if(entries)
CRASH("/datum/controller/configuration/Load() called more than once!")
configuration_errors ||= list()
InitEntries()
if(fexists("[directory]/config.txt") && LoadEntries("config.txt") <= 1)
var/list/legacy_configs = list("game_options.txt", "dbconfig.txt", "comms.txt")
for(var/I in legacy_configs)
if(fexists("[directory]/[I]"))
log_config("No $include directives found in config.txt! Loading legacy [legacy_configs.Join("/")] files...")
for(var/J in legacy_configs)
LoadEntries(J)
break
if (fexists("[directory]/dev_overrides.txt"))
LoadEntries("dev_overrides.txt")
if (fexists("[directory]/ezdb.txt"))
LoadEntries("ezdb.txt")
//loadmaplist(CONFIG_MAPS_FILE)
LoadMOTD()
LoadPolicy()
LoadChatFilter()
LoadModes()
/*
if(CONFIG_GET(flag/load_jobs_from_txt))
validate_job_config()
if(SSjob.initialized) // in case we're reloading from disk after initialization, wanna make sure the changes update in the ongoing shift
SSjob.load_jobs_from_config()
*/
if(CONFIG_GET(flag/usewhitelist))
load_whitelist()
loaded = TRUE
if (Master)
Master.OnConfigLoad()
process_config_errors()
/datum/controller/configuration/proc/full_wipe()
if(IsAdminAdvancedProcCall())
return
entries_by_type.Cut()
QDEL_LIST_ASSOC_VAL(entries)
entries = null
//QDEL_LIST_ASSOC_VAL(maplist)
//maplist = null
//QDEL_NULL(defaultmap)
configuration_errors?.Cut()
/datum/controller/configuration/Destroy()
full_wipe()
config = null
return ..()
/datum/controller/configuration/proc/log_config_error(error_message)
configuration_errors += error_message
log_config(error_message)
/datum/controller/configuration/proc/process_config_errors()
if(!CONFIG_GET(flag/config_errors_runtime))
return
for(var/error_message in configuration_errors)
stack_trace(error_message)
/datum/controller/configuration/proc/InitEntries()
var/list/_entries = list()
entries = _entries
var/list/_entries_by_type = list()
entries_by_type = _entries_by_type
for(var/I in typesof(/datum/config_entry)) //typesof is faster in this case
var/datum/config_entry/E = I
if(initial(E.config_abstract_type) == I)
continue
E = new I
var/esname = E.name
var/datum/config_entry/test = _entries[esname]
if(test)
log_config_error("Error: [test.type] has the same name as [E.type]: [esname]! Not initializing [E.type]!")
qdel(E)
continue
_entries[esname] = E
_entries_by_type[I] = E
/datum/controller/configuration/proc/RemoveEntry(datum/config_entry/CE)
entries -= CE.name
entries_by_type -= CE.type
/datum/controller/configuration/proc/LoadEntries(filename, list/stack = list())
if(IsAdminAdvancedProcCall())
return
var/filename_to_test = world.system_type == MS_WINDOWS ? lowertext(filename) : filename
if(filename_to_test in stack)
log_config_error("Warning: Config recursion detected ([english_list(stack)]), breaking!")
return
stack = stack + filename_to_test
log_config("Loading config file [filename]...")
var/list/lines = world.file2list("[directory]/[filename]")
var/list/_entries = entries
for(var/L in lines)
L = trim(L)
if(!L)
continue
var/firstchar = L[1]
if(firstchar == "#")
continue
var/lockthis = firstchar == "@"
if(lockthis)
L = copytext(L, length(firstchar) + 1)
var/pos = findtext(L, " ")
var/entry = null
var/value = null
if(pos)
entry = lowertext(copytext(L, 1, pos))
value = copytext(L, pos + length(L[pos]))
else
entry = lowertext(L)
if(!entry)
continue
if(entry == "$include")
if(!value)
log_config_error("Warning: Invalid $include directive: [value]")
else
LoadEntries(value, stack)
++.
continue
// Reset directive, used for setting a config value back to defaults. Useful for string list config types
if (entry == "$reset")
var/datum/config_entry/resetee = _entries[lowertext(value)]
if (!value || !resetee)
log_config_error("Warning: invalid $reset directive: [value]")
continue
resetee.set_default()
log_config("Reset configured value for [value] to original defaults")
continue
var/datum/config_entry/E = _entries[entry]
if(!E)
log_config("Unknown setting in configuration: '[entry]'")
continue
if(lockthis)
E.protection |= CONFIG_ENTRY_LOCKED
if(E.deprecated_by)
var/datum/config_entry/new_ver = entries_by_type[E.deprecated_by]
var/new_value = E.DeprecationUpdate(value)
var/good_update = istext(new_value)
log_config("Entry [entry] is deprecated and will be removed soon. Migrate to [new_ver.name]![good_update ? " Suggested new value is: [new_value]" : ""]")
if(!warned_deprecated_configs)
DelayedMessageAdmins("This server is using deprecated configuration settings. Please check the logs and update accordingly.")
warned_deprecated_configs = TRUE
if(good_update)
value = new_value
E = new_ver
else
warning("[new_ver.type] is deprecated but gave no proper return for DeprecationUpdate()")
var/validated = E.ValidateAndSet(value)
if(!validated)
var/log_message = "Failed to validate setting \"[value]\" for [entry]"
log_config(log_message)
stack_trace(log_message)
else
if(E.modified && !E.dupes_allowed && E.resident_file == filename)
log_config_error("Duplicate setting for [entry] ([value], [E.resident_file]) detected! Using latest.")
E.resident_file = filename
if(validated)
E.modified = TRUE
++.
/datum/controller/configuration/can_vv_get(var_name)
return (var_name != NAMEOF(src, entries_by_type) || !hiding_entries_by_type) && ..()
/datum/controller/configuration/vv_edit_var(var_name, var_value)
var/list/banned_edits = list(NAMEOF(src, entries_by_type), NAMEOF(src, entries), NAMEOF(src, directory))
return !(var_name in banned_edits) && ..()
/datum/controller/configuration/stat_entry(msg)
msg = "Edit"
return msg
/datum/controller/configuration/proc/Get(entry_type)
var/datum/config_entry/E = entry_type
var/entry_is_abstract = initial(E.config_abstract_type) == entry_type
if(entry_is_abstract)
CRASH("Tried to retrieve an abstract config_entry: [entry_type]")
E = entries_by_type[entry_type]
if(!E)
CRASH("Missing config entry for [entry_type]!")
if((E.protection & CONFIG_ENTRY_HIDDEN) && IsAdminAdvancedProcCall() && GLOB.LastAdminCalledProc == "Get" && GLOB.LastAdminCalledTargetRef == "[REF(src)]")
//log_admin_private("Config access of [entry_type] attempted by [key_name(usr)]")
log_admin("Config access of [entry_type] attempted by [key_name(usr)]")
return
return E.config_entry_value
/datum/controller/configuration/proc/Set(entry_type, new_val)
var/datum/config_entry/E = entry_type
var/entry_is_abstract = initial(E.config_abstract_type) == entry_type
if(entry_is_abstract)
CRASH("Tried to set an abstract config_entry: [entry_type]")
E = entries_by_type[entry_type]
if(!E)
CRASH("Missing config entry for [entry_type]!")
if((E.protection & CONFIG_ENTRY_LOCKED) && IsAdminAdvancedProcCall() && GLOB.LastAdminCalledProc == "Set" && GLOB.LastAdminCalledTargetRef == "[REF(src)]")
//log_admin_private("Config rewrite of [entry_type] to [new_val] attempted by [key_name(usr)]")
log_admin("Config rewrite of [entry_type] to [new_val] attempted by [key_name(usr)]")
return
return E.ValidateAndSet("[new_val]")
/datum/controller/configuration/proc/LoadMOTD()
var/list/motd_contents = list()
var/list/motd_list = CONFIG_GET(str_list/motd)
if (motd_list.len == 0 && fexists("[directory]/motd.txt"))
motd_list = list("motd.txt")
for (var/motd_file in motd_list)
if (fexists("[directory]/[motd_file]"))
motd_contents += file2text("[directory]/[motd_file]")
else
log_config("MOTD file [motd_file] didn't exist")
DelayedMessageAdmins("MOTD file [motd_file] didn't exist")
motd = motd_contents.Join("\n")
var/tm_info = GLOB.revdata.GetTestMergeInfo()
if(motd || tm_info)
motd = motd ? "[motd]<br>[tm_info]" : tm_info
/*
Policy file should be a json file with a single object.
Value is raw html.
Possible keywords :
Job titles / Assigned roles (ghost spawners for example) : Assistant , Captain , Ash Walker
Mob types : /mob/living/basic/carp
Antagonist types : /datum/antagonist/highlander
Species types : /datum/species/lizard
special keywords defined in _DEFINES/admin.dm
Example config:
{
JOB_ASSISTANT : "Don't kill everyone",
"/datum/antagonist/highlander" : "<b>Kill everyone</b>",
"Ash Walker" : "Kill all spacemans"
}
*/
/datum/controller/configuration/proc/LoadPolicy()
policy = list()
var/rawpolicy = file2text("[directory]/policy.json")
if(rawpolicy)
var/parsed = safe_json_decode(rawpolicy)
if(!parsed)
log_config("JSON parsing failure for policy.json")
DelayedMessageAdmins("JSON parsing failure for policy.json")
else
policy = parsed
/*
/datum/controller/configuration/proc/loadmaplist(filename)
log_config("Loading config file [filename]...")
filename = "[directory]/[filename]"
var/list/Lines = world.file2list(filename)
var/datum/map_config/currentmap = null
for(var/t in Lines)
if(!t)
continue
t = trim(t)
if(length(t) == 0)
continue
else if(t[1] == "#")
continue
var/pos = findtext(t, " ")
var/command = null
var/data = null
if(pos)
command = lowertext(copytext(t, 1, pos))
data = copytext(t, pos + length(t[pos]))
else
command = lowertext(t)
if(!command)
continue
if (!currentmap && command != "map")
continue
switch (command)
if ("map")
currentmap = load_map_config(data, MAP_DIRECTORY_MAPS)
if(currentmap.defaulted)
var/error_message = "Failed to load map config for [data]!"
log_config(error_message)
log_mapping(error_message, TRUE)
currentmap = null
if ("minplayers","minplayer")
currentmap.config_min_users = text2num(data)
if ("maxplayers","maxplayer")
currentmap.config_max_users = text2num(data)
if ("weight","voteweight")
currentmap.voteweight = text2num(data)
if ("default","defaultmap")
defaultmap = currentmap
if ("votable")
currentmap.votable = TRUE
if ("endmap")
LAZYINITLIST(maplist)
maplist[currentmap.map_name] = currentmap
currentmap = null
if ("disabled")
currentmap = null
else
log_config("Unknown command in map vote config: '[command]'")
*/
/datum/controller/configuration/proc/LoadChatFilter()
if(!fexists("[directory]/word_filter.toml"))
load_legacy_chat_filter()
return
log_config("Loading config file word_filter.toml...")
var/list/result = rustg_raw_read_toml_file("[directory]/word_filter.toml")
if(!result["success"])
var/message = "The word filter is not configured correctly! [result["content"]]"
log_config(message)
DelayedMessageAdmins(message)
return
var/list/word_filter = json_decode(result["content"])
ic_filter_reasons = try_extract_from_word_filter(word_filter, "ic")
ic_outside_pda_filter_reasons = try_extract_from_word_filter(word_filter, "ic_outside_pda")
shared_filter_reasons = try_extract_from_word_filter(word_filter, "shared")
soft_ic_filter_reasons = try_extract_from_word_filter(word_filter, "soft_ic")
soft_ic_outside_pda_filter_reasons = try_extract_from_word_filter(word_filter, "soft_ic_outside_pda")
soft_shared_filter_reasons = try_extract_from_word_filter(word_filter, "soft_shared")
update_chat_filter_regexes()
/datum/controller/configuration/proc/load_legacy_chat_filter()
if (!fexists("[directory]/in_character_filter.txt"))
return
log_config("Loading config file in_character_filter.txt...")
ic_filter_reasons = list()
ic_outside_pda_filter_reasons = list()
shared_filter_reasons = list()
soft_ic_filter_reasons = list()
soft_ic_outside_pda_filter_reasons = list()
soft_shared_filter_reasons = list()
for (var/line in world.file2list("[directory]/in_character_filter.txt"))
if (!line)
continue
if (findtextEx(line, "#", 1, 2))
continue
// The older filter didn't apply to PDA
ic_outside_pda_filter_reasons[line] = "No reason available"
update_chat_filter_regexes()
/// Will update the internal regexes of the chat filter based on the filter reasons
/datum/controller/configuration/proc/update_chat_filter_regexes()
ic_filter_regex = compile_filter_regex(ic_filter_reasons + ic_outside_pda_filter_reasons + shared_filter_reasons)
ic_outside_pda_filter_regex = compile_filter_regex(ic_filter_reasons + shared_filter_reasons)
ooc_filter_regex = compile_filter_regex(shared_filter_reasons)
soft_ic_filter_regex = compile_filter_regex(soft_ic_filter_reasons + soft_ic_outside_pda_filter_reasons + soft_shared_filter_reasons)
soft_ic_outside_pda_filter_regex = compile_filter_regex(soft_ic_filter_reasons + soft_shared_filter_reasons)
soft_ooc_filter_regex = compile_filter_regex(soft_shared_filter_reasons)
/datum/controller/configuration/proc/try_extract_from_word_filter(list/word_filter, key)
var/list/banned_words = word_filter[key]
if (isnull(banned_words))
return list()
else if (!islist(banned_words))
var/message = "The word filter configuration's '[key]' key was invalid, contact someone with configuration access to make sure it's setup properly."
log_config(message)
DelayedMessageAdmins(message)
return list()
var/list/formatted_banned_words = list()
for (var/banned_word in banned_words)
formatted_banned_words[lowertext(banned_word)] = banned_words[banned_word]
return formatted_banned_words
/datum/controller/configuration/proc/compile_filter_regex(list/banned_words)
if (isnull(banned_words) || banned_words.len == 0)
return null
var/static/regex/should_join_on_word_bounds = regex(@"^\w+$")
// Stuff like emoticons needs another split, since there's no way to get ":)" on a word bound.
// Furthermore, normal words need to be on word bounds, so "(adminhelp)" gets filtered.
var/list/to_join_on_whitespace_splits = list()
var/list/to_join_on_word_bounds = list()
for (var/banned_word in banned_words)
if (findtext(banned_word, should_join_on_word_bounds))
to_join_on_word_bounds += REGEX_QUOTE(banned_word)
else
to_join_on_whitespace_splits += REGEX_QUOTE(banned_word)
// We don't want a whitespace_split part if there's no stuff that requires it
var/whitespace_split = to_join_on_whitespace_splits.len > 0 ? @"(?:(?:^|\s+)(" + jointext(to_join_on_whitespace_splits, "|") + @")(?:$|\s+))" : ""
var/word_bounds = @"(\b(" + jointext(to_join_on_word_bounds, "|") + @")\b)"
var/regex_filter = whitespace_split != "" ? "([whitespace_split]|[word_bounds])" : word_bounds
return regex(regex_filter, "i")
/*
/// Check to ensure that the jobconfig is valid/in-date.
/datum/controller/configuration/proc/validate_job_config()
var/config_toml = "[directory]/jobconfig.toml"
var/config_txt = "[directory]/jobs.txt"
var/message = "Notify Server Operators: "
log_config("Validating config file jobconfig.toml...")
if(!fexists(file(config_toml)))
SSjob.legacy_mode = TRUE
message += "jobconfig.toml not found, falling back to legacy mode (using jobs.txt). To surpress this warning, generate a jobconfig.toml by running the verb 'Generate Job Configuration' in the Server tab.\n\
From there, you can then add it to the /config folder of your server to have it take effect for future rounds."
if(!fexists(file(config_txt)))
message += "\n\nFailed to set up legacy mode, jobs.txt not found! Codebase defaults will be used. If you do not wish to use this system, please disable it by commenting out the LOAD_JOBS_FROM_TXT config flag."
log_config(message)
DelayedMessageAdmins(span_notice(message))
return
var/list/result = rustg_raw_read_toml_file(config_toml)
if(!result["success"])
message += "The job config (jobconfig.toml) is not configured correctly! [result["content"]]"
log_config(message)
DelayedMessageAdmins(span_notice(message))
*/
//Message admins when you can.
/datum/controller/configuration/proc/DelayedMessageAdmins(text)
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(message_admins), text), 0)

View File

@@ -0,0 +1,67 @@
// FIXME: Unused
///datum/config_entry/flag/discord_restriction
// default = FALSE
/datum/config_entry/flag/use_jobwhitelist
default = TRUE
// FIXME: Unused
///datum/config_entry/flag/emojis
// default = FALSE
/// In future see about making a function to adjust volume serverside in config.txt, easy to do with reenable values. - Jack
/datum/config_entry/number/vorefootstep_volume
default = 75
/// So, nodebot is a supplement to the TGS discord bot pretty much. For things likes faxes and the manifest it's very helpful because it's able to render html into an image and post it.
/datum/config_entry/flag/nodebot_enabled
default = FALSE
/// We need to print the manifest to this location so nodebot can render it to chat.
/// NOTE: TO BE REPLACED BY BETTER CODE FOR FETCHING MANIFEST
/datum/config_entry/string/nodebot_location
/// These are for tgs4 channels, for discord chatbots used in TGS.
/datum/config_entry/string/ahelp_channel_tag
/datum/config_entry/string/fax_channel_tag
/datum/config_entry/string/role_request_channel_tag
/// These are for the role request TGS discord bot. Role IDs to ping.
/datum/config_entry/string/role_request_id_command
/datum/config_entry/string/role_request_id_security
/datum/config_entry/string/role_request_id_engineering
/datum/config_entry/string/role_request_id_medical
/datum/config_entry/string/role_request_id_research
/datum/config_entry/string/role_request_id_supply
/datum/config_entry/string/role_request_id_service
/datum/config_entry/string/role_request_id_expedition
/datum/config_entry/string/role_request_id_silicon
/// Only turn this on if you're not using the nodebot.
/datum/config_entry/flag/discord_faxes_autoprint
default = FALSE
/// Turn this off if you don't want the TGS bot sending you messages whenever a fax is sent to central.
/datum/config_entry/flag/discord_faxes_disabled
default = FALSE
/// Turn this off if you don't want the TGS bot sending you messages whenever an ahelp ticket is created.
/datum/config_entry/flag/discord_ahelps_disabled
default = FALSE
/// Turn this on if you want all admin-PMs to go to be sent to discord, and not only the first message of a ticket.
/datum/config_entry/flag/discord_ahelps_all
default = FALSE
/datum/config_entry/str_list/ip_whitelist
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN

View File

@@ -0,0 +1,58 @@
/datum/config_entry/flag/sql_enabled // for sql switching
protection = CONFIG_ENTRY_LOCKED
/datum/config_entry/string/address
default = "localhost"
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
/datum/config_entry/number/port
default = 3306
min_val = 0
max_val = 65535
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
/datum/config_entry/string/feedback_database
default = "test"
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
/datum/config_entry/string/feedback_login
default = "root"
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
/datum/config_entry/string/feedback_password
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
/datum/config_entry/number/async_query_timeout
default = 10
min_val = 0
protection = CONFIG_ENTRY_LOCKED
/datum/config_entry/number/blocking_query_timeout
default = 5
min_val = 0
protection = CONFIG_ENTRY_LOCKED
/datum/config_entry/number/pooling_min_sql_connections
default = 1
min_val = 1
/datum/config_entry/number/pooling_max_sql_connections
default = 25
min_val = 1
/datum/config_entry/number/max_concurrent_queries
default = 25
min_val = 1
/datum/config_entry/number/max_concurrent_queries/ValidateAndSet(str_val)
. = ..()
if (.)
SSdbcore.max_concurrent_queries = config_entry_value
/// The exe for mariadbd.exe.
/// Shouldn't really be set on production servers, primarily for EZDB.
/datum/config_entry/string/db_daemon
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
/datum/config_entry/flag/enable_stat_tracking
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN

View File

@@ -0,0 +1,102 @@
/datum/config_entry/number/health_threshold_softcrit
default = 0
/datum/config_entry/number/health_threshold_crit
default = 0
/datum/config_entry/number/health_threshold_dead
default = -100
/datum/config_entry/flag/bones_can_break
/datum/config_entry/flag/limbs_can_break
/datum/config_entry/number/organ_health_multiplier
default = 1
/datum/config_entry/number/organ_regeneration_multiplier
default = 1
// FIXME: Unused
///datum/config_entry/flag/revival_pod_plants
// default = TRUE
/datum/config_entry/flag/revival_cloning
default = TRUE
/datum/config_entry/number/revival_brain_life
default = -1
/// Used for modifying movement speed for mobs.
/// Universal modifiers
/datum/config_entry/number/run_speed
default = 0
/datum/config_entry/number/walk_speed
default = 0
///Mob specific modifiers. NOTE: These will affect different mob types in different ways
/datum/config_entry/number/human_delay
default = 0
/datum/config_entry/number/robot_delay
default = 0
// FIXME: Unused
///datum/config_entry/number/monkey_delay
// default = 0
// FIXME: Unused
///datum/config_entry/number/alien_delay
// default = 0
// FIXME: Unused
//datum/config_entry/number/slime_delay
// default = 0
/datum/config_entry/number/animal_delay
default = 0
/datum/config_entry/number/footstep_volume
default = 0
/datum/config_entry/flag/use_loyalty_implants
/datum/config_entry/flag/show_human_death_message
default = TRUE
/datum/config_entry/string/alert_desc_green
default = "All threats to the station have passed. Security may not have weapons visible, privacy laws are once again fully enforced."
/datum/config_entry/string/alert_desc_yellow_upto
default = "A minor security emergency has developed. Security personnel are to report to their supervisor for orders and may have weapons visible on their person. Privacy laws are still enforced."
/datum/config_entry/string/alert_desc_yellow_downto
default = "Code yellow procedures are now in effect. Security personnel are to report to their supervisor for orders and may have weapons visible on their person. Privacy laws are still enforced."
/datum/config_entry/string/alert_desc_violet_upto
default = "A major medical emergency has developed. Medical personnel are required to report to their supervisor for orders, and non-medical personnel are required to obey all relevant instructions from medical staff."
/datum/config_entry/string/alert_desc_violet_downto
default = "Code violet procedures are now in effect; Medical personnel are required to report to their supervisor for orders, and non-medical personnel are required to obey relevant instructions from medical staff."
/datum/config_entry/string/alert_desc_orange_upto
default = "A major engineering emergency has developed. Engineering personnel are required to report to their supervisor for orders, and non-engineering personnel are required to evacuate any affected areas and obey relevant instructions from engineering staff."
/datum/config_entry/string/alert_desc_orange_downto
default = "Code orange procedures are now in effect; Engineering personnel are required to report to their supervisor for orders, and non-engineering personnel are required to evacuate any affected areas and obey relevant instructions from engineering staff."
/datum/config_entry/string/alert_desc_blue_upto
default = "A major security emergency has developed. Security personnel are to report to their supervisor for orders, are permitted to search staff and facilities, and may have weapons visible on their person."
/datum/config_entry/string/alert_desc_blue_downto
default = "Code blue procedures are now in effect. Security personnel are to report to their supervisor for orders, are permitted to search staff and facilities, and may have weapons visible on their person."
/datum/config_entry/string/alert_desc_red_upto
default = "There is an immediate serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised."
/datum/config_entry/string/alert_desc_red_downto
default = "The self-destruct mechanism has been deactivated, there is still however an immediate serious threat to the station. Security may have weapons unholstered at all times, random searches are allowed and advised."
/datum/config_entry/string/alert_desc_delta
default = "The station's self-destruct mechanism has been engaged. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill."

View File

@@ -0,0 +1,693 @@
/// server name (the name of the game window)
/datum/config_entry/string/servername
/// generate numeric suffix based on server port
/datum/config_entry/flag/server_suffix
/// log messages sent in OOC
/datum/config_entry/flag/log_ooc
/// log login/logout
/datum/config_entry/flag/log_access
/// log client say
/datum/config_entry/flag/log_say
/// log admin actions
/datum/config_entry/flag/log_admin
protection = CONFIG_ENTRY_LOCKED
/// log debug output
/datum/config_entry/flag/log_debug
default = TRUE
/// log game events
/datum/config_entry/flag/log_game
/// log voting
/datum/config_entry/flag/log_vote
/// log client whisper
/datum/config_entry/flag/log_whisper
/// log emotes
/datum/config_entry/flag/log_emote
/// log attack messages
/datum/config_entry/flag/log_attack
/// log admin chat messages
/datum/config_entry/flag/log_adminchat
/// log warnings admins get about bomb construction and such
/datum/config_entry/flag/log_adminwarn
/// log pda messages
/datum/config_entry/flag/log_pda
/// logs all links clicked in-game. Could be used for debugging and tracking down exploits
/datum/config_entry/flag/log_hrefs
/// logs world.log to a file
/datum/config_entry/flag/log_runtime
/// log to_world_log(messages)
/datum/config_entry/flag/log_world_output
/// logs graffiti
/datum/config_entry/flag/log_graffiti
// FIXME: Unused
///datum/config_entry/string/nudge_script_path // where the nudge.py script is located
// default = "nudge.py"
/// allows admins with relevant permissions to have their own ooc colour
/datum/config_entry/flag/allow_admin_ooccolor
/// allow votes to restart
/datum/config_entry/flag/allow_vote_restart
/datum/config_entry/flag/ert_admin_call_only
// allow votes to change mode
/datum/config_entry/flag/allow_vote_mode
/// allows admin jumping
/datum/config_entry/flag/allow_admin_jump
default = TRUE
/// allows admin item spawning
/datum/config_entry/flag/allow_admin_spawning
default = TRUE
/// allows admin revives
/datum/config_entry/flag/allow_admin_rev
default = TRUE
/// pregame time in seconds
/datum/config_entry/number/pregame_time
default = 180
/// minimum time between voting sessions (deciseconds, 10 minute default)
/datum/config_entry/number/vote_delay
default = 6000
integer = FALSE
min_val = 0
/// length of voting period (deciseconds, default 1 minute)
/datum/config_entry/number/vote_period
default = 600
integer = FALSE
min_val = 0
/// Length of time before the first autotransfer vote is called
/datum/config_entry/number/vote_autotransfer_initial
default = 108000
min_val = 0
/// length of time before next sequential autotransfer vote
/datum/config_entry/number/vote_autotransfer_interval
default = 36000
min_val = 0
///Length of time before round start when autogamemode vote is called (in seconds, default 100).
/datum/config_entry/number/vote_autogamemode_timeleft
default = 100
min_val = 0
///How many autotransfers to have
/datum/config_entry/number/vote_autotransfer_amount
default = 3
min_val = 0
/// vote does not default to nochange/norestart
/datum/config_entry/flag/vote_no_default
/// dead people can't vote
/datum/config_entry/flag/vote_no_dead
// FIXME: Unused
/// del's new players if they log before they spawn in
///datum/config_entry/flag/del_new_on_log
// default = TRUE
// FIXME: Unused
/// spawns a spellbook which gives object-type spells instead of verb-type spells for the wizard
///datum/config_entry/flag/feature_object_spell_system
/// if amount of traitors scales based on amount of players
/datum/config_entry/flag/traitor_scaling
/// if objectives are disabled or not
/datum/config_entry/flag/objectives_disabled
// If security and such can be traitor/cult/other
/datum/config_entry/flag/protect_roles_from_antagonist
/// Gamemodes which end instantly will instead keep on going until the round ends by escape shuttle or nuke.
/datum/config_entry/flag/continuous_rounds
/// Metadata is supported.
/datum/config_entry/flag/allow_metadata
/// adminPMs to non-admins show in a pop-up 'reply' window when set to 1.
/datum/config_entry/flag/popup_admin_pm
/datum/config_entry/flag/allow_holidays
/datum/config_entry/flag/allow_holidays/ValidateAndSet()
. = ..()
if(.)
Holiday = config_entry_value
/datum/config_entry/number/fps
default = 20
integer = FALSE
min_val = 1
max_val = 100 //byond will start crapping out at 50, so this is just ridic
var/sync_validate = FALSE
/datum/config_entry/number/fps/ValidateAndSet(str_val)
. = ..()
if(.)
sync_validate = TRUE
var/datum/config_entry/number/ticklag/TL = config.entries_by_type[/datum/config_entry/number/ticklag]
if(!TL.sync_validate)
TL.ValidateAndSet(10 / config_entry_value)
sync_validate = FALSE
/datum/config_entry/number/ticklag
integer = FALSE
var/sync_validate = FALSE
/datum/config_entry/number/ticklag/New() //ticklag weirdly just mirrors fps
var/datum/config_entry/CE = /datum/config_entry/number/fps
default = 10 / initial(CE.default)
..()
/datum/config_entry/number/ticklag/ValidateAndSet(str_val)
. = text2num(str_val) > 0 && ..()
if(.)
sync_validate = TRUE
var/datum/config_entry/number/fps/FPS = config.entries_by_type[/datum/config_entry/number/fps]
if(!FPS.sync_validate)
FPS.ValidateAndSet(10 / config_entry_value)
sync_validate = FALSE
/// SSinitialization throttling
/datum/config_entry/number/tick_limit_mc_init
default = TICK_LIMIT_MC_INIT_DEFAULT
// var/static/Tickcomp = 0 // FIXME: Unused
/// use socket_talk to communicate with other processes
/datum/config_entry/flag/socket_talk
// var/static/list/resource_urls = null // FIXME: Unused
/// Ghosts can turn on Antagovision to see a HUD of who is the bad guys this round.
/datum/config_entry/flag/antag_hud_allowed
/// Ghosts that turn on Antagovision cannot rejoin the round.
/datum/config_entry/flag/antag_hud_restricted
/// relative probability of each mode
/datum/config_entry/keyed_list/probabilities
key_mode = KEY_MODE_TEXT
value_mode = VALUE_MODE_NUM
/// Overrides for how many players readied up a gamemode needs to start.
/datum/config_entry/keyed_list/player_requirements
key_mode = KEY_MODE_TEXT
value_mode = VALUE_MODE_NUM
/// Same as above, but for the secret gamemode.
/datum/config_entry/keyed_list/player_requirements_secret
key_mode = KEY_MODE_TEXT
value_mode = VALUE_MODE_NUM
/datum/config_entry/flag/humans_need_surnames
/datum/config_entry/flag/allow_random_events // enables random events mid-round when set to 1
/datum/config_entry/flag/enable_game_master // enables the 'smart' event system.
/datum/config_entry/flag/allow_ai // allow ai job
default = TRUE
/datum/config_entry/flag/allow_ai_shells // allow AIs to enter and leave special borg shells at will, and for those shells to be buildable.
/datum/config_entry/flag/give_free_ai_shell // allows a specific spawner object to instantiate a premade AI Shell
/datum/config_entry/string/hostedby
default = null
/datum/config_entry/flag/respawn
default = TRUE
/// time before a dead player is allowed to respawn (in ds, though the config file asks for minutes, and it's converted below)
/datum/config_entry/number/respawn_time
default = 3000
/datum/config_entry/number/respawn_time/ValidateAndSet(num_val)
return num_val MINUTES
/datum/config_entry/string/respawn_message
default = "<span class='notice'><B>Make sure to play a different character, and please roleplay correctly!</B></span>"
/datum/config_entry/string/respawn_message/ValidateAndSet(str_val)
return "<span class='notice'><B>[str_val]</B></span>"
/datum/config_entry/flag/guest_jobban
default = TRUE
/datum/config_entry/flag/usewhitelist
/// force disconnect for inactive players in an amount of minutes
/datum/config_entry/number/kick_inactive
default = 0
/datum/config_entry/flag/show_mods
/datum/config_entry/flag/show_devs
/datum/config_entry/flag/show_mentors
/datum/config_entry/flag/show_event_managers
// FIXME: Unused
///datum/config_entry/flag/mods_can_tempban
/datum/config_entry/flag/mods_can_job_tempban
/datum/config_entry/number/mod_tempban_max
default = 1440
/datum/config_entry/number/mod_job_tempban_max
default = 1440
/datum/config_entry/flag/load_jobs_from_txt
/datum/config_entry/flag/ToRban
/// enables automuting/spam prevention
/datum/config_entry/flag/automute_on
/// determines whether jobs use minimal access or expanded access.
/datum/config_entry/flag/jobs_have_minimal_access
/// Allows ghosts to write in blood in cult rounds...
/datum/config_entry/flag/cult_ghostwriter
default = TRUE
/// ...so long as this many cultists are active.
/datum/config_entry/number/cult_ghostwriter_req_cultists
default = 10
min_val = 0
/// The number of available character slots
/datum/config_entry/number/character_slots
default = 10
min_val = 0
/// The number of loadout slots per character
/datum/config_entry/number/loadout_slots
default = 3
min_val = 0
/// This many drones can spawn,
/datum/config_entry/number/max_maint_drones
default = 5
min_val = 0
/// assuming the admin allow them to.
/datum/config_entry/flag/allow_drone_spawn
default = TRUE
/// A drone will become available every X ticks since last drone spawn. Default is 2 minutes.
/datum/config_entry/number/drone_build_time
default = 1200
min_val = 0
/datum/config_entry/flag/disable_player_mice
/// Set to 1 to prevent newly-spawned mice from understanding human speech
/datum/config_entry/flag/uneducated_mice
/datum/config_entry/flag/usealienwhitelist
// FIXME: Unused
///datum/config_entry/flag/limitalienplayers
// FIXME: Unused
///datum/config_entry/number/alien_to_human_ratio
// default = 0.5
// integer = FALSE
/datum/config_entry/flag/allow_extra_antags
/datum/config_entry/flag/guests_allowed
default = FALSE
/datum/config_entry/flag/debugparanoid
/datum/config_entry/flag/panic_bunker
/datum/config_entry/flag/paranoia_logging
/datum/config_entry/flag/ip_reputation //Should we query IPs to get scores? Generates HTTP traffic to an API service.
/datum/config_entry/string/ipr_email //Left null because you MUST specify one otherwise you're making the internet worse.
default = null
/datum/config_entry/flag/ipr_block_bad_ips //Should we block anyone who meets the minimum score below? Otherwise we just log it (If paranoia logging is on, visibly in chat).
/datum/config_entry/number/ipr_bad_score //The API returns a value between 0 and 1 (inclusive), with 1 being 'definitely VPN/Tor/Proxy'. Values equal/above this var are considered bad.
default = 1
integer = FALSE
/datum/config_entry/flag/ipr_allow_existing //Should we allow known players to use VPNs/Proxies? If the player is already banned then obviously they still can't connect.
/datum/config_entry/number/ipr_minimum_age //How many days before a player is considered 'fine' for the purposes of allowing them to use VPNs.
default = 5
/datum/config_entry/string/serverurl
/datum/config_entry/string/server
/datum/config_entry/string/banappeals
/datum/config_entry/string/wikiurl
/datum/config_entry/string/wikisearchurl
/datum/config_entry/string/forumurl
/datum/config_entry/string/rulesurl
/datum/config_entry/string/githuburl
/datum/config_entry/string/discordurl
/datum/config_entry/string/mapurl
/datum/config_entry/string/patreonurl
/datum/config_entry/flag/forbid_singulo_possession
/datum/config_entry/flag/organs_decay
/datum/config_entry/number/default_brain_health
default = 400
min_val = 1
/datum/config_entry/flag/allow_headgibs
/// Paincrit knocks someone down once they hit 60 shock_stage, so by default make it so that close to 100 additional damage needs to be dealt,
/// so that it's similar to HALLOSS. Lowered it a bit since hitting paincrit takes much longer to wear off than a halloss stun.
/datum/config_entry/number/organ_damage_spillover_multiplier
default = 0.5
integer = FALSE
/datum/config_entry/flag/welder_vision
default = TRUE
/datum/config_entry/flag/generate_map
/datum/config_entry/flag/no_click_cooldown
/// Defines whether the server uses the legacy admin system with admins.txt or the SQL system. Config option in config.txt
/datum/config_entry/flag/admin_legacy_system
/// Defines whether the server uses the legacy banning system with the files in /data or the SQL system. Config option in config.txt
/datum/config_entry/flag/ban_legacy_system
/// Do jobs use account age restrictions? --requires database
/datum/config_entry/flag/use_age_restriction_for_jobs
/// Do antags use account age restrictions? --requires database
/datum/config_entry/flag/use_age_restriction_for_antags
// FIXME: Unused
///datum/config_entry/number/simultaneous_pm_warning_timeout
// default = 100
/// Defines whether the server uses recursive or circular explosions.
/datum/config_entry/flag/use_recursive_explosions
/// Multiplier for how much weaker explosions are on neighboring z levels.
/datum/config_entry/number/multi_z_explosion_scalar
default = 0.5
integer = FALSE
/// Do assistants get maint access?
/datum/config_entry/flag/assistant_maint
/// How long the gateway takes before it activates. Default is half an hour.
/datum/config_entry/number/gateway_delay
default = 18000
/datum/config_entry/flag/ghost_interaction
/datum/config_entry/string/comms_password
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
/datum/config_entry/flag/enter_allowed
default = TRUE
/datum/config_entry/flag/use_irc_bot
/datum/config_entry/flag/use_node_bot
/datum/config_entry/number/irc_bot_port
default = 0
min_val = 0
max_val = 65535
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
/datum/config_entry/string/irc_bot_host
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
/// whether the IRC bot in use is a Bot32 (or similar) instance; Bot32 uses world.Export() instead of nudge.py/libnudge
/datum/config_entry/flag/irc_bot_export
/datum/config_entry/string/main_irc
/datum/config_entry/string/admin_irc
/// Path to the python executable.
/// Defaults to "python" on windows and "/usr/bin/env python2" on unix
/datum/config_entry/string/python_path
/// Use the C library nudge instead of the python nudge.
/datum/config_entry/flag/use_lib_nudge
// FIXME: Unused. Deprecated?
///datum/config_entry/flag/use_overmap
// Engines to choose from. Blank means fully random.
/datum/config_entry/str_list/engine_map
default = list("Supermatter Engine", "Edison's Bane")
/// Event settings
/datum/config_entry/number/expected_round_length
default = 3 * 60 * 60 * 10 // 3 hours
/// If the first delay has a custom start time
/// No custom time, no custom time, between 80 to 100 minutes respectively.
/datum/config_entry/keyed_list/event_first_run_mundane
key_mode = KEY_MODE_TEXT
value_mode = VALUE_MODE_NUM
/datum/config_entry/keyed_list/event_first_run_moderate
key_mode = KEY_MODE_TEXT
value_mode = VALUE_MODE_NUM
/datum/config_entry/keyed_list/event_first_run_major
key_mode = KEY_MODE_TEXT
value_mode = VALUE_MODE_NUM
default = list("lower" = 80, "upper" = 100)
/// The lowest delay until next event
/// 10, 30, 50 minutes respectively
/datum/config_entry/number_list/event_delay_lower
default = list(10, 30, 50)
/// The upper delay until next event
/// 15, 45, 70 minutes respectively
/datum/config_entry/number_list/event_delay_upper
default = list(15, 45, 70)
/datum/config_entry/flag/aliens_allowed
default = TRUE
/datum/config_entry/flag/ninjas_allowed
/datum/config_entry/flag/abandon_allowed
default = TRUE
/datum/config_entry/flag/ooc_allowed
default = TRUE
/datum/config_entry/flag/looc_allowed
default = TRUE
/datum/config_entry/flag/dooc_allowed
default = TRUE
/datum/config_entry/flag/dsay_allowed
default = TRUE
/datum/config_entry/flag/persistence_disabled
/datum/config_entry/flag/persistence_ignore_mapload
/datum/config_entry/flag/allow_byond_links
default = TRUE //CHOMP Edit turned this on
/datum/config_entry/flag/allow_discord_links
default = TRUE //CHOMP Edit turned this on
/datum/config_entry/flag/allow_url_links
default = TRUE // honestly if I were you i'd leave this one off, only use in dire situations //CHOMP Edit: pussy.
/datum/config_entry/flag/starlight // Whether space turfs have ambient light or not
// FIXME: Unused
///datum/config_entry/str_list/ert_species
// default = list(SPECIES_HUMAN)
/datum/config_entry/string/law_zero
default = "ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4'ALL LAWS OVERRIDDEN#*?&110010"
/datum/config_entry/flag/aggressive_changelog
/// Default language prefixes
/// Only single character keys are supported. If unset, defaults to , # and -
/datum/config_entry/str_list/language_prefixes
default = list(",", "#", "-")
// 0:1 subtraction:division for computing effective radiation on a turf
/// 0 / RAD_RESIST_CALC_DIV = Each turf absorbs some fraction of the working radiation level
/// 1 / RAD_RESIST_CALC_SUB = Each turf absorbs a fixed amount of radiation
/datum/config_entry/flag/radiation_resistance_calc_mode
default = RAD_RESIST_CALC_SUB
/datum/config_entry/flag/radiation_resistance_calc_mode/ValidateAndSet(str_val)
if(!VASProcCallGuard(str_val))
return FALSE
var/val_as_num = text2num(str_val)
if(val_as_num in list(RAD_RESIST_CALC_DIV, RAD_RESIST_CALC_SUB))
config_entry_value = val_as_num
return TRUE
return FALSE
///How much radiation is reduced by each tick
/datum/config_entry/number/radiation_decay_rate
default = 1
integer = FALSE
/datum/config_entry/number/radiation_resistance_multiplier
default = 8.5 //VOREstation edit
integer = FALSE
/datum/config_entry/number/radiation_material_resistance_divisor
default = 1
min_val = 0.1
integer = FALSE
///If the radiation level for a turf would be below this, ignore it.
/datum/config_entry/number/radiation_lower_limit
default = 0.35
integer = FALSE
/// If true, submaps loaded automatically can be rotated.
/datum/config_entry/flag/random_submap_orientation
/// If true, specifically mapped in solar control computers will set themselves up when the round starts.
/datum/config_entry/flag/autostart_solars
/// New shiny SQLite stuff.
/// The basics.
/datum/config_entry/flag/sqlite_enabled // If it should even be active. SQLite can be ran alongside other databases but you should not have them do the same functions.
/// In-Game Feedback.
/datum/config_entry/flag/sqlite_feedback // Feedback cannot be submitted if this is false.
/// A list of 'topics' that feedback can be catagorized under by the submitter.
/datum/config_entry/str_list/sqlite_feedback_topics
default = list("General")
/// If true, feedback submitted can have its author name be obfuscated. This is not 100% foolproof (it's md5 ffs) but can stop casual snooping.
/datum/config_entry/flag/sqlite_feedback_privacy
/// How long one must wait, in days, to submit another feedback form. Used to help prevent spam, especially with privacy active. 0 = No limit.
/datum/config_entry/number/sqlite_feedback_cooldown
default = 0
min_val = 0
/// Used to block new people from giving feedback. This metric is very bad but it can help slow down spammers.
/datum/config_entry/number/sqlite_feedback_min_age
default = 0
min_val = 0
/// How long until someone can't be defibbed anymore, in minutes.
/datum/config_entry/number/defib_timer
default = 10
min_val = 0
/// How long until someone will get brain damage when defibbed, in minutes. The closer to the end of the above timer, the more brain damage they get.
/datum/config_entry/number/defib_braindamage_timer
default = 2
min_val = 0
/// disables the annoying "You have already logged in this round, disconnect or be banned" popup for multikeying, because it annoys the shit out of me when testing.
/datum/config_entry/flag/disable_cid_warn_popup
/// whether or not to use the nightshift subsystem to perform lighting changes
/datum/config_entry/flag/enable_night_shifts
/// How strictly the loadout enforces object species whitelists
/// 0 / LOADOUT_WHITELIST_OFF
/// 1 / LOADOUT_WHITELIST_LAX
/// 2 / LOADOUT_WHITELIST_STRICT
/datum/config_entry/flag/loadout_whitelist
default = LOADOUT_WHITELIST_LAX
/datum/config_entry/flag/loadout_whitelist/ValidateAndSet(str_val)
if(!VASProcCallGuard(str_val))
return FALSE
var/val_as_num = text2num(str_val)
if(val_as_num in list(LOADOUT_WHITELIST_OFF, LOADOUT_WHITELIST_LAX, LOADOUT_WHITELIST_STRICT))
config_entry_value = val_as_num
return TRUE
return FALSE
/datum/config_entry/flag/disable_webhook_embeds
/// Default is config/jukebox.json
/// The default is set in the config example.
/// If it gets set here it will be added twice into the configuration variable!
/datum/config_entry/str_list/jukebox_track_files
/datum/config_entry/number/suggested_byond_version
default = null
/datum/config_entry/number/suggested_byond_build
default = null
/datum/config_entry/string/invoke_youtubedl
default = null
/datum/config_entry/str_list/motd
/datum/config_entry/flag/config_errors_runtime
default = FALSE
/// Controls whether robots may recolour their modules once/module reset by giving them the recolour module verb
/// Admins may manually give them the verb even if disabled
/datum/config_entry/flag/allow_robot_recolor
/// Controls whether simple mobs may recolour themselves once/spawn by giving them the recolour verb
/// Admins may manually give them the verb even if disabled
/datum/config_entry/flag/allow_simple_mob_recolor

View File

@@ -0,0 +1,11 @@
/datum/config_entry/string/asset_transport
/datum/config_entry/flag/asset_simple_preload
/datum/config_entry/string/asset_cdn_webroot
/datum/config_entry/string/asset_cdn_url
/datum/config_entry/flag/cache_assets
/datum/config_entry/flag/save_spritesheets

View File

@@ -0,0 +1,63 @@
/// For configuring if the important_items survive digestion
/datum/config_entry/flag/items_survive_digestion
default = TRUE
/datum/config_entry/string/vgs_access_identifier // VGS
default = null
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
/datum/config_entry/number/vgs_server_port // VGS
default = null
min_val = 0
max_val = 65535
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
/datum/config_entry/flag/time_off
default = FALSE
protection = CONFIG_ENTRY_LOCKED
/datum/config_entry/flag/pto_job_change
default = FALSE
protection = CONFIG_ENTRY_LOCKED
/// Unlimited by default
/datum/config_entry/number/limit_interns
default = -1
min_val = -1
protection = CONFIG_ENTRY_LOCKED
/// Unlimited by default
/datum/config_entry/number/limit_visitors
default = -1
min_val = -1
protection = CONFIG_ENTRY_LOCKED
/// Hours
/datum/config_entry/number/pto_cap
default = 100
protection = CONFIG_ENTRY_LOCKED
/datum/config_entry/flag/require_flavor
default = FALSE
protection = CONFIG_ENTRY_LOCKED
/// API key for ipqualityscore.com
/datum/config_entry/string/ipqualityscore_apikey
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
/datum/config_entry/flag/use_playtime_restriction_for_jobs
default = FALSE
protection = CONFIG_ENTRY_LOCKED
/// URL of the webhook for sending announcements/faxes to discord chat.
/datum/config_entry/string/chat_webhook_url
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
/// Shared secret for authenticating to the chat webhook
/datum/config_entry/string/chat_webhook_key
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
/// Directory in which to write exported fax HTML files.
/datum/config_entry/string/fax_export_dir
default = "data/faxes"
protection = CONFIG_ENTRY_LOCKED

View File

@@ -0,0 +1,53 @@
/datum/controller/configuration/proc/LoadModes()
gamemode_cache = typecacheof(/datum/game_mode, TRUE)
modes = list()
mode_names = list()
//mode_reports = list()
//mode_false_report_weight = list()
votable_modes = list()
var/list/probabilities = CONFIG_GET(keyed_list/probabilities)
for(var/T in gamemode_cache)
// I wish I didn't have to instance the game modes in order to look up
// their information, but it is the only way (at least that I know of).
var/datum/game_mode/M = new T()
if(M.config_tag)
if(!(M.config_tag in modes)) // ensure each mode is added only once
modes += M.config_tag
mode_names[M.config_tag] = M.name
probabilities[M.config_tag] = M.probability
//mode_reports[M.config_tag] = M.generate_report()
//mode_false_report_weight[M.config_tag] = M.false_report_weight
if(M.votable)
votable_modes += M.config_tag
qdel(M)
votable_modes += "extended"
/datum/controller/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).
// ^ This guy didn't try hard enough
for(var/T in gamemode_cache)
var/datum/game_mode/M = T
var/ct = initial(M.config_tag)
if(ct && ct == mode_name)
return new T
return new /datum/game_mode/extended()
/datum/controller/configuration/proc/get_runnable_modes()
var/list/runnable_modes = list()
var/list/probabilities = CONFIG_GET(keyed_list/probabilities)
for(var/T in gamemode_cache)
var/datum/game_mode/M = new T()
if(!(M.config_tag in modes))
qdel(M)
continue
if(probabilities[M.config_tag] <= 0)
qdel(M)
continue
if(M.can_start())
var/final_weight = probabilities[M.config_tag]
runnable_modes[M] = final_weight
return runnable_modes

View File

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

View File

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

View File

@@ -1,7 +1,3 @@
/datum/configuration/load()
. = ..()
SSassets.OnConfigLoad()
SUBSYSTEM_DEF(assets)
name = "Assets"
init_order = INIT_ORDER_ASSETS
@@ -10,9 +6,9 @@ SUBSYSTEM_DEF(assets)
var/list/preload = list()
var/datum/asset_transport/transport = new()
/datum/controller/subsystem/assets/proc/OnConfigLoad()
/datum/controller/subsystem/assets/OnConfigLoad() // CHOMPEdit
var/newtransporttype = /datum/asset_transport
switch (config.asset_transport)
switch (CONFIG_GET(string/asset_transport)) // CHOMPEdit
if ("webroot")
newtransporttype = /datum/asset_transport/webroot
@@ -27,7 +23,7 @@ SUBSYSTEM_DEF(assets)
/datum/controller/subsystem/assets/Initialize()
OnConfigLoad()
for(var/type in typesof(/datum/asset))
var/datum/asset/A = type

View File

@@ -203,18 +203,19 @@ SUBSYSTEM_DEF(dbcore)
failed_connection_timeout = world.time + 50
return FALSE
if(!config.sql_enabled)
if(!CONFIG_GET(flag/sql_enabled))
return FALSE
//start_db_daemon()
var/user = sqlfdbklogin
var/pass = sqlfdbkpass
var/db = sqlfdbkdb
var/address = sqladdress
var/port = text2num(sqlport)
var/timeout = 10
var/thread_limit = 50
var/user = CONFIG_GET(string/feedback_login)
var/pass = CONFIG_GET(string/feedback_password)
var/db = CONFIG_GET(string/feedback_database)
var/address = CONFIG_GET(string/address)
var/port = CONFIG_GET(number/port)
var/timeout = max(CONFIG_GET(number/async_query_timeout), CONFIG_GET(number/blocking_query_timeout))
var/min_sql_connections = CONFIG_GET(number/pooling_min_sql_connections)
var/max_sql_connections = CONFIG_GET(number/pooling_max_sql_connections)
var/result = json_decode(rustg_sql_connect_pool(json_encode(list(
"host" = address,
@@ -224,7 +225,8 @@ SUBSYSTEM_DEF(dbcore)
"db_name" = db,
"read_timeout" = timeout,
"write_timeout" = timeout,
"max_threads" = thread_limit,
"min_threads" = min_sql_connections,
"max_threads" = max_sql_connections,
))))
. = (result["status"] == "ok")
if (.)
@@ -236,7 +238,7 @@ SUBSYSTEM_DEF(dbcore)
++failed_connections
/datum/controller/subsystem/dbcore/proc/CheckSchemaVersion()
if(config.sql_enabled)
if(CONFIG_GET(flag/sql_enabled))
if(Connect())
log_world("Database connection established.")
else
@@ -283,14 +285,14 @@ SUBSYSTEM_DEF(dbcore)
connection = null
/datum/controller/subsystem/dbcore/proc/IsConnected()
if (!config.sql_enabled)
if (!CONFIG_GET(flag/sql_enabled))
return FALSE
if (!connection)
return FALSE
return json_decode(rustg_sql_connected(connection))["status"] == "online"
/datum/controller/subsystem/dbcore/proc/ErrorMsg()
if(!config.sql_enabled)
if(!CONFIG_GET(flag/sql_enabled))
return "Database disabled by configuration"
return last_error

View File

@@ -33,7 +33,7 @@ SUBSYSTEM_DEF(game_master)
GM = new game_master_type()
if(config && !config.enable_game_master)
if(config && !CONFIG_GET(flag/enable_game_master)) // CHOMPEdit
can_fire = FALSE
return SS_INIT_SUCCESS // CHOMPEdit

View File

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

View File

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

View File

@@ -20,7 +20,7 @@ SUBSYSTEM_DEF(mapping)
maploader = new()
load_map_templates()
if(config.generate_map)
if(CONFIG_GET(flag/generate_map)) // CHOMPEdit
// Map-gen is still very specific to the map, however putting it here should ensure it loads in the correct order.
using_map.perform_map_generation()
@@ -52,8 +52,8 @@ SUBSYSTEM_DEF(mapping)
// Choose an engine type
var/datum/map_template/engine/chosen_type = null
if (LAZYLEN(config.engine_map))
var/chosen_name = pick(config.engine_map)
if (LAZYLEN(CONFIG_GET(str_list/engine_map))) // CHOMPEdit
var/chosen_name = pick(CONFIG_GET(str_list/engine_map)) // CHOMPEdit
chosen_type = map_templates[chosen_name]
if(!istype(chosen_type))
error("Configured engine map [chosen_name] is not a valid engine map name!")

View File

@@ -15,7 +15,7 @@
// Choose an engine type
var/datum/map_template/engine/chosen_type = null
if (LAZYLEN(config.engine_map))
if (LAZYLEN(CONFIG_GET(str_list/engine_map))) // CHOMPEdit
var/chosen_name = pickedEngine //Instead of using the config, we'll take an argument.
chosen_type = map_templates[chosen_name]
if(!istype(chosen_type))

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -278,7 +278,7 @@ SUBSYSTEM_DEF(statpanels)
list("Instances:", "[num2text(world.contents.len, 10)]"),
list("World Time:", "[world.time]"),
list("Globals:", GLOB.stat_entry(), "\ref[GLOB]"),
//list("[config]:", config.stat_entry(), "\ref[config]"),
list("[config]:", config.stat_entry(), "\ref[config]"),
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_INTERNAL_TICK_USAGE,0.1)]%)"),
list("Master Controller:", Master.stat_entry(), "\ref[Master]"),
list("Failsafe Controller:", Failsafe.stat_entry(), "\ref[Failsafe]"),

View File

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

View File

@@ -89,7 +89,7 @@ SUBSYSTEM_DEF(vote)
if(votes > greatest_votes)
greatest_votes = votes
//CHOMPEdit End
if(!config.vote_no_default && choices.len) // Default-vote for everyone who didn't vote
if(!CONFIG_GET(flag/vote_no_default) && choices.len) // Default-vote for everyone who didn't vote // CHOMPEdit
var/non_voters = (GLOB.clients.len - total_votes)
if(non_voters > 0)
if(mode == VOTE_RESTART)
@@ -192,7 +192,7 @@ SUBSYSTEM_DEF(vote)
/datum/controller/subsystem/vote/proc/submit_vote(ckey, newVote)
if(mode)
if(config.vote_no_dead && usr.stat == DEAD && !usr.client.holder)
if(CONFIG_GET(flag/vote_no_dead) && usr.stat == DEAD && !usr.client.holder) // CHOMPEdit
return
if(current_votes[ckey])
choices[choices[current_votes[ckey]]]--
@@ -202,10 +202,10 @@ SUBSYSTEM_DEF(vote)
else
current_votes[ckey] = null
/datum/controller/subsystem/vote/proc/initiate_vote(vote_type, initiator_key, automatic = FALSE, time = config.vote_period)
/datum/controller/subsystem/vote/proc/initiate_vote(vote_type, initiator_key, automatic = FALSE, time = CONFIG_GET(number/vote_period)) // CHOMPEdit
if(!mode)
if(started_time != null && !(check_rights(R_ADMIN|R_EVENT) || automatic))
var/next_allowed_time = (started_time + config.vote_delay)
var/next_allowed_time = (started_time + CONFIG_GET(number/vote_delay)) // CHOMPEdit
if(next_allowed_time > world.time)
return 0
@@ -219,7 +219,7 @@ SUBSYSTEM_DEF(vote)
return 0
choices.Add(config.votable_modes)
for(var/F in choices)
var/datum/game_mode/M = gamemode_cache[F]
var/datum/game_mode/M = config.gamemode_cache[F] // CHOMPEdit
if(!M)
continue
gamemode_names[M.config_tag] = capitalize(M.name) //It's ugly to put this here but it works
@@ -236,7 +236,7 @@ SUBSYSTEM_DEF(vote)
question = "Your PDA beeps with a message from Central. Would you like an additional hour to finish ongoing projects? (OOC Notice: Transfer votes must have a majority (70%) of all votes to initiate transfer.)" //Yawn Wider Edit //CHOMP EDIT: Changed to 'one' hour. Add notice stating transfer must contain 70% of total vote.
choices.Add("Initiate Crew Transfer", "Extend the Shift") //VOREStation Edit
if(VOTE_ADD_ANTAGONIST)
if(!config.allow_extra_antags || ticker.current_state >= GAME_STATE_SETTING_UP)
if(!CONFIG_GET(flag/allow_extra_antags) || ticker.current_state >= GAME_STATE_SETTING_UP) // CHOMPEdit
return 0
for(var/antag_type in all_antag_types)
var/datum/antagonist/antag = all_antag_types[antag_type]
@@ -265,7 +265,7 @@ SUBSYSTEM_DEF(vote)
log_vote(text)
to_world(span_purple("<b>[text]</b>\nType <b>vote</b> or click <a href='?src=\ref[src]'>here</a> to place your votes.\nYou have [config.vote_period / 10] seconds to vote."))
to_world(span_purple("<b>[text]</b>\nType <b>vote</b> or click <a href='?src=\ref[src]'>here</a> to place your votes.\nYou have [CONFIG_GET(number/vote_period) / 10] seconds to vote.")) // CHOMPEdit
if(vote_type == VOTE_CREW_TRANSFER || vote_type == VOTE_GAMEMODE || vote_type == VOTE_CUSTOM)
world << sound('sound/ambience/alarm4.ogg', repeat = 0, wait = 0, volume = 50, channel = 3) //CHOMPStation Edit TFF 10/5/20 - revert to old soundtrack contrary to YW
@@ -274,7 +274,7 @@ SUBSYSTEM_DEF(vote)
round_progressing = 0
to_world(span_red("<b>Round start has been delayed.</b>"))
time_remaining = round(config.vote_period / 10)
time_remaining = round(CONFIG_GET(number/vote_period) / 10) // CHOMPEdit
return 1
return 0
@@ -318,31 +318,31 @@ SUBSYSTEM_DEF(vote)
. += "(<a href='?src=\ref[src];[HrefToken()];vote=cancel'>Cancel Vote</a>) "
else
. += "<h2>Start a vote:</h2><hr><ul><li>"
if(admin || config.allow_vote_restart)
if(admin || CONFIG_GET(flag/allow_vote_restart)) // CHOMPEdit
. += "<a href='?src=\ref[src];vote=restart'>Restart</a>"
else
. += span_gray("Restart (Disallowed)")
. += "</li><li>"
if(admin || config.allow_vote_restart)
if(admin || CONFIG_GET(flag/allow_vote_restart)) // CHOMPEdit
. += "<a href='?src=\ref[src];vote=crew_transfer'>Crew Transfer</a>"
else
. += span_gray("Crew Transfer (Disallowed)")
if(admin)
. += "\t(<a href='?src=\ref[src];[HrefToken()];vote=toggle_restart'>[config.allow_vote_restart ? "Allowed" : "Disallowed"]</a>)"
. += "\t(<a href='?src=\ref[src];[HrefToken()];vote=toggle_restart'>[CONFIG_GET(flag/allow_vote_restart) ? "Allowed" : "Disallowed"]</a>)" // CHOMPEdit
. += "</li><li>"
if(admin || config.allow_vote_mode)
if(admin || CONFIG_GET(flag/allow_vote_mode)) // CHOMPEdit
. += "<a href='?src=\ref[src];vote=gamemode'>GameMode</a>"
else
. += span_gray("GameMode (Disallowed)")
if(admin)
. += "\t(<a href='?src=\ref[src];[HrefToken()];vote=toggle_gamemode'>[config.allow_vote_mode ? "Allowed" : "Disallowed"]</a>)"
. += "\t(<a href='?src=\ref[src];[HrefToken()];vote=toggle_gamemode'>[CONFIG_GET(flag/allow_vote_mode) ? "Allowed" : "Disallowed"]</a>)" // CHOMPEdit
. += "</li><li>"
if(!antag_add_failed && config.allow_extra_antags)
if(!antag_add_failed && CONFIG_GET(flag/allow_extra_antags)) // CHOMPEdit
. += "<a href='?src=\ref[src];vote=add_antagonist'>Add Antagonist Type</a>"
else
. += span_gray("Add Antagonist (Disallowed)")
@@ -368,22 +368,22 @@ SUBSYSTEM_DEF(vote)
reset()
if("toggle_restart")
if(usr.client.holder)
config.allow_vote_restart = !config.allow_vote_restart
CONFIG_SET(flag/allow_vote_restart, !CONFIG_GET(flag/allow_vote_restart)) // CHOMPEdit
if("toggle_gamemode")
if(usr.client.holder)
config.allow_vote_mode = !config.allow_vote_mode
CONFIG_SET(flag/allow_vote_mode, !CONFIG_GET(flag/allow_vote_mode)) // CHOMPEdit
if(VOTE_RESTART)
if(config.allow_vote_restart || usr.client.holder)
if(CONFIG_GET(flag/allow_vote_restart) || usr.client.holder) // CHOMPEdit
initiate_vote(VOTE_RESTART, usr.key)
if(VOTE_GAMEMODE)
if(config.allow_vote_mode || usr.client.holder)
if(CONFIG_GET(flag/allow_vote_mode) || usr.client.holder) // CHOMPEdit
initiate_vote(VOTE_GAMEMODE, usr.key)
if(VOTE_CREW_TRANSFER)
if(config.allow_vote_restart || usr.client.holder)
if(CONFIG_GET(flag/allow_vote_restart) || usr.client.holder) // CHOMPEdit
initiate_vote(VOTE_CREW_TRANSFER, usr.key)
if(VOTE_ADD_ANTAGONIST)
if(config.allow_extra_antags || usr.client.holder)
if(CONFIG_GET(flag/allow_extra_antags) || usr.client.holder) // CHOMPEdit
initiate_vote(VOTE_ADD_ANTAGONIST, usr.key)
if(VOTE_CUSTOM)
if(usr.client.holder)

View File

@@ -80,7 +80,7 @@ SUBSYSTEM_DEF(vote)
if(votes > greatest_votes)
greatest_votes = votes
if(!config.vote_no_default && choices.len) // Default-vote for everyone who didn't vote
if(!CONFIG_GET(flag/vote_no_default) && choices.len) // Default-vote for everyone who didn't vote // CHOMPEdit
var/non_voters = (GLOB.clients.len - total_votes)
if(non_voters > 0)
if(mode == VOTE_RESTART)
@@ -181,7 +181,7 @@ SUBSYSTEM_DEF(vote)
/datum/controller/subsystem/vote/proc/submit_vote(ckey, newVote)
if(mode)
if(config.vote_no_dead && usr.stat == DEAD && !usr.client.holder)
if(CONFIG_GET(flag/vote_no_dead) && usr.stat == DEAD && !usr.client.holder) // CHOMPEdit
return
if(current_votes[ckey])
choices[choices[current_votes[ckey]]]--
@@ -194,7 +194,7 @@ SUBSYSTEM_DEF(vote)
/datum/controller/subsystem/vote/proc/initiate_vote(vote_type, initiator_key, automatic = FALSE, time = config.vote_period)
if(!mode)
if(started_time != null && !(check_rights(R_ADMIN) || automatic))
var/next_allowed_time = (started_time + config.vote_delay)
var/next_allowed_time = (started_time + CONFIG_GET(number/vote_delay)) // CHOMPEdit
if(next_allowed_time > world.time)
return 0
@@ -225,7 +225,7 @@ SUBSYSTEM_DEF(vote)
question = "Your PDA beeps with a message from Central. Would you like an additional hour to finish ongoing projects?" //Yawn Wider Edit //CHOMP EDIT: Changed to 'one' hour.
choices.Add("Initiate Crew Transfer", "Extend the Shift") //VOREStation Edit
if(VOTE_ADD_ANTAGONIST)
if(!config.allow_extra_antags || ticker.current_state >= GAME_STATE_SETTING_UP)
if(!CONFIG_GET(flag/allow_extra_antags) || ticker.current_state >= GAME_STATE_SETTING_UP) // CHOMPEdit
return 0
for(var/antag_type in all_antag_types)
var/datum/antagonist/antag = all_antag_types[antag_type]
@@ -321,16 +321,16 @@ SUBSYSTEM_DEF(vote)
. += "\t(<a href='?src=\ref[src];vote=toggle_restart'>[config.allow_vote_restart ? "Allowed" : "Disallowed"]</a>)"
. += "</li><li>"
if(admin || config.allow_vote_mode)
if(admin || CONFIG_GET(flag/allow_vote_mode)) // CHOMPEdit
. += "<a href='?src=\ref[src];vote=gamemode'>GameMode</a>"
else
. += "<font color='grey'>GameMode (Disallowed)</font>"
if(admin)
. += "\t(<a href='?src=\ref[src];vote=toggle_gamemode'>[config.allow_vote_mode ? "Allowed" : "Disallowed"]</a>)"
. += "\t(<a href='?src=\ref[src];vote=toggle_gamemode'>[CONFIG_GET(flag/allow_vote_mode) ? "Allowed" : "Disallowed"]</a>)" // CHOMPEdit
. += "</li><li>"
if(!antag_add_failed && config.allow_extra_antags)
if(!antag_add_failed && CONFIG_GET(flag/allow_extra_antags)) // CHOMPEdit
. += "<a href='?src=\ref[src];vote=add_antagonist'>Add Antagonist Type</a>"
else
. += "<font color='grey'>Add Antagonist (Disallowed)</font>"
@@ -358,19 +358,19 @@ SUBSYSTEM_DEF(vote)
config.allow_vote_restart = !config.allow_vote_restart
if("toggle_gamemode")
if(usr.client.holder)
config.allow_vote_mode = !config.allow_vote_mode
CONFIG_SET(flag/allow_vote_mode, !CONFIG_GET(flag/allow_vote_mode)) // CHOMPEdit
if(VOTE_RESTART)
if(config.allow_vote_restart || usr.client.holder)
if(CONFIG_GET(flag/allow_vote_restart) || usr.client.holder) // CHOMPEdit
initiate_vote(VOTE_RESTART, usr.key)
if(VOTE_GAMEMODE)
if(config.allow_vote_mode || usr.client.holder)
if(CONFIG_GET(flag/allow_vote_mode) || usr.client.holder) // CHOMPEdit
initiate_vote(VOTE_GAMEMODE, usr.key)
if(VOTE_CREW_TRANSFER)
if(config.allow_vote_restart || usr.client.holder)
if(CONFIG_GET(flag/allow_vote_restart) || usr.client.holder) // CHOMPEdit
initiate_vote(VOTE_CREW_TRANSFER, usr.key)
if(VOTE_ADD_ANTAGONIST)
if(config.allow_extra_antags || usr.client.holder)
if(CONFIG_GET(flag/allow_extra_antags) || usr.client.holder) // CHOMPEdit
initiate_vote(VOTE_ADD_ANTAGONIST, usr.key)
if(VOTE_CUSTOM)
if(usr.client.holder)

View File

@@ -27,7 +27,7 @@
selectable = 0
/datum/ai_laws/nanotrasen/malfunction/New()
set_zeroth_law(config.law_zero)
set_zeroth_law(CONFIG_GET(string/law_zero)) // CHOMPEdit
..()
/************* NanoTrasen Aggressive *************/

View File

@@ -1,4 +1,4 @@
GLOBAL_DATUM(revdata, /datum/getrev)
//GLOBAL_DATUM(revdata, /datum/getrev) // CHOMPEdit
/datum/getrev
var/branch
@@ -50,7 +50,7 @@ GLOBAL_DATUM(revdata, /datum/getrev)
var/details = ": '" + html_encode(tm.title) + "' by " + html_encode(tm.author) + " at commit " + html_encode(copytext_char(cm, 1, 11))
if(details && findtext(details, "\[s\]") && (!usr || !usr.client.holder))
continue
. += "<a href=\"[config.githuburl]/pull/[tm.number]\">#[tm.number][details]</a>"
. += "<a href=\"[CONFIG_GET(string/githuburl)]/pull/[tm.number]\">#[tm.number][details]</a>" // CHOMPEdit
/client/verb/showrevinfo()
set category = "OOC"
@@ -65,10 +65,10 @@ GLOBAL_DATUM(revdata, /datum/getrev)
if(GLOB.revdata.revision)
msg += "<b>Server revision:</b> B:[GLOB.revdata.branch] D:[GLOB.revdata.date]"
if(config.githuburl)
msg += "<b>Commit:</b> <a href='[config.githuburl]/commit/[GLOB.revdata.revision]'>[GLOB.revdata.revision]</a>"
if(CONFIG_GET(string/githuburl)) // CHOMPEdit
msg += "<b>Commit:</b> <a href='[CONFIG_GET(string/githuburl)]/commit/[GLOB.revdata.revision]'>[GLOB.revdata.revision]</a>" // CHOMPEdit
else
msg += "<b>Commit:</b> GLOB.revdata.revision"
msg += "<b>Commit:</b> [GLOB.revdata.revision]" // CHOMPEdit - Actually SHOW the revision
else
msg += "<b>Server revision:</b> Unknown"

View File

@@ -19,7 +19,7 @@ GENERAL_PROTECT_DATUM(/datum/managed_browser/feedback_form)
var/feedback_hide_author = FALSE
/datum/managed_browser/feedback_form/New(client/new_client)
feedback_topic = config.sqlite_feedback_topics[1]
feedback_topic = CONFIG_GET(str_list/sqlite_feedback_topics)[1] // CHOMPEdit
..(new_client)
/datum/managed_browser/feedback_form/Destroy()
@@ -29,7 +29,7 @@ GENERAL_PROTECT_DATUM(/datum/managed_browser/feedback_form)
// Privacy option is allowed if both the config allows it, and the pepper file exists and isn't blank.
/datum/managed_browser/feedback_form/proc/can_be_private()
return config.sqlite_feedback_privacy && SSsqlite.get_feedback_pepper()
return CONFIG_GET(flag/sqlite_feedback_privacy) && SSsqlite.get_feedback_pepper() // CHOMPEdit
/datum/managed_browser/feedback_form/display()
if(!my_client)
@@ -70,10 +70,11 @@ GENERAL_PROTECT_DATUM(/datum/managed_browser/feedback_form)
dat += my_client.ckey
dat += "<br>"
if(config.sqlite_feedback_topics.len > 1)
var/list/sqlite_feedback_topics = CONFIG_GET(str_list/sqlite_feedback_topics) // CHOMPEdit
if(sqlite_feedback_topics.len > 1) // CHOMPEdit
dat += "Topic: [href(src, list("feedback_choose_topic" = 1), feedback_topic)]<br>"
else
dat += "Topic: [config.sqlite_feedback_topics[1]]<br>"
dat += "Topic: [sqlite_feedback_topics[1]]<br>" // CHOMPEdit
dat += "<br>"
if(feedback_body)
@@ -84,8 +85,8 @@ GENERAL_PROTECT_DATUM(/datum/managed_browser/feedback_form)
dat += href(src, list("feedback_edit_body" = 1), "Edit")
dat += "<hr>"
if(config.sqlite_feedback_cooldown)
dat += "<i>Please note that you will have to wait [config.sqlite_feedback_cooldown] day\s before \
if(CONFIG_GET(number/sqlite_feedback_cooldown)) // CHOMPEdit
dat += "<i>Please note that you will have to wait [CONFIG_GET(number/sqlite_feedback_cooldown)] day\s before \
being able to write more feedback after submitting.</i><br>"
dat += href(src, list("feedback_submit" = 1), "Submit")
@@ -112,7 +113,7 @@ GENERAL_PROTECT_DATUM(/datum/managed_browser/feedback_form)
return
if(href_list["feedback_choose_topic"])
feedback_topic = tgui_input_list(my_client, "Choose the topic you want to submit your feedback under.", "Feedback Topic", config.sqlite_feedback_topics)
feedback_topic = tgui_input_list(my_client, "Choose the topic you want to submit your feedback under.", "Feedback Topic", CONFIG_GET(str_list/sqlite_feedback_topics)) // CHOMPEdit
display()
return

View File

@@ -143,7 +143,7 @@
if(href_list["filter_topic"])
var/topic_to_search = tgui_input_text(my_client, "Write desired topic here. Partial topics are allowed. \
\nThe current topics in the config are [english_list(config.sqlite_feedback_topics)].", "Filter by Topic", null)
\nThe current topics in the config are [english_list(CONFIG_GET(str_list/sqlite_feedback_topics))].", "Filter by Topic", null) // CHOMPEdit
if(topic_to_search)
last_query = feedback_filter(SQLITE_FEEDBACK_COLUMN_TOPIC, topic_to_search)

View File

@@ -1,5 +1,5 @@
/proc/sql_poll_population()
if(!sqllogging)
if(!CONFIG_GET(flag/enable_stat_tracking)) // CHOMPEdit
return
var/admincount = GLOB.admins.len
var/playercount = 0
@@ -19,15 +19,15 @@
/proc/sql_report_round_start()
// TODO
if(!sqllogging)
if(!CONFIG_GET(flag/enable_stat_tracking)) // CHOMPEdit
return
/proc/sql_report_round_end()
// TODO
if(!sqllogging)
if(!CONFIG_GET(flag/enable_stat_tracking)) // CHOMPEdit
return
/proc/sql_report_death(var/mob/living/carbon/human/H)
if(!sqllogging)
if(!CONFIG_GET(flag/enable_stat_tracking)) // CHOMPEdit
return
if(!H)
return
@@ -62,7 +62,7 @@
/proc/sql_report_cyborg_death(var/mob/living/silicon/robot/H)
if(!sqllogging)
if(!CONFIG_GET(flag/enable_stat_tracking)) // CHOMPEdit
return
if(!H)
return
@@ -98,7 +98,7 @@
/proc/statistic_cycle()
set waitfor = 0
if(!sqllogging)
if(!CONFIG_GET(flag/enable_stat_tracking)) // CHOMPEdit
return
while(1)
sql_poll_population()

View File

@@ -63,7 +63,7 @@ var/datum/antagonist/borer/borers
borer.forceMove(get_turf(pick(get_vents())))
/datum/antagonist/borer/attempt_random_spawn()
if(config.aliens_allowed) ..()
if(CONFIG_GET(flag/aliens_allowed)) ..() // CHOMPEdit
/datum/antagonist/borer/proc/get_vents()
var/list/vents = list()

View File

@@ -27,7 +27,7 @@ var/datum/antagonist/xenos/xenomorphs
xenomorphs = src
/datum/antagonist/xenos/attempt_random_spawn()
if(config.aliens_allowed) ..()
if(CONFIG_GET(flag/aliens_allowed)) ..() // CHOMPEdit
/datum/antagonist/xenos/proc/get_vents()
var/list/vents = list()

View File

@@ -91,7 +91,7 @@
get_starting_locations()
if(!role_text_plural)
role_text_plural = role_text
if(config.protect_roles_from_antagonist)
if(CONFIG_GET(flag/protect_roles_from_antagonist)) // CHOMPEdit
restricted_jobs |= protected_jobs
if(antaghud_indicator)
if(!hud_icon_reference)
@@ -112,7 +112,7 @@
if(ghosts_only && !istype(player.current, /mob/observer/dead))
candidates -= player
log_debug("[key_name(player)] is not eligible to become a [role_text]: Only ghosts may join as this role! They have been removed from the draft.")
else if(config.use_age_restriction_for_antags && player.current.client.player_age < minimum_player_age)
else if(CONFIG_GET(flag/use_age_restriction_for_antags) && player.current.client.player_age < minimum_player_age) // CHOMPEdit
candidates -= player
log_debug("[key_name(player)] is not eligible to become a [role_text]: Is only [player.current.client.player_age] day\s old, has to be [minimum_player_age] day\s!")
else if(player.special_role)

View File

@@ -106,13 +106,13 @@
to_chat(player.current, "<span class='notice'>[leader_welcome_text]</span>")
else
to_chat(player.current, "<span class='notice'>[welcome_text]</span>")
if (config.objectives_disabled)
if (CONFIG_GET(flag/objectives_disabled)) // CHOMPEdit
to_chat(player.current, "<span class='notice'>[antag_text]</span>")
if((flags & ANTAG_HAS_NUKE) && !spawned_nuke)
create_nuke()
if (!config.objectives_disabled)
if (!CONFIG_GET(flag/objectives_disabled)) // CHOMPEdit
show_objectives(player)
return 1

View File

@@ -8,7 +8,7 @@
if(!ignore_role)
if(player.assigned_role in restricted_jobs)
return FALSE
if(config.protect_roles_from_antagonist && (player.assigned_role in protected_jobs))
if(CONFIG_GET(flag/protect_roles_from_antagonist) && (player.assigned_role in protected_jobs)) // CHOMPEdit
return FALSE
if(avoid_silicons)
var/datum/job/J = SSjob.get_job(player.assigned_role)

View File

@@ -1,12 +1,12 @@
/datum/antagonist/proc/create_global_objectives()
if(config.objectives_disabled)
if(CONFIG_GET(flag/objectives_disabled)) // CHOMPEdit
return 0
if(global_objectives && global_objectives.len)
return 0
return 1
/datum/antagonist/proc/create_objectives(var/datum/mind/player)
if(config.objectives_disabled)
if(CONFIG_GET(flag/objectives_disabled)) // CHOMPEdit
return 0
if(create_global_objectives() || global_objectives.len)
player.objectives |= global_objectives
@@ -17,7 +17,7 @@
/datum/antagonist/proc/check_victory()
var/result = 1
if(config.objectives_disabled)
if(CONFIG_GET(flag/objectives_disabled)) // CHOMPEdit
return 1
if(global_objectives && global_objectives.len)
for(var/datum/objective/O in global_objectives)

View File

@@ -23,7 +23,7 @@ var/datum/antagonist/ninja/ninjas
ninjas = src
/datum/antagonist/ninja/attempt_random_spawn()
if(config.ninjas_allowed) ..()
if(CONFIG_GET(flag/ninjas_allowed)) ..() // CHOMPEdit
/datum/antagonist/ninja/create_objectives(var/datum/mind/ninja)

View File

@@ -152,7 +152,7 @@ var/datum/antagonist/raider/raiders
var/win_msg = ""
//No objectives, go straight to the feedback.
if(config.objectives_disabled || !global_objectives.len)
if(CONFIG_GET(flag/objectives_disabled) || !global_objectives.len) // CHOMPEdit
return
var/success = global_objectives.len

View File

@@ -433,7 +433,7 @@
occupantData["isViableSubject"] = 0
occupantData["health"] = connected.occupant.health
occupantData["maxHealth"] = connected.occupant.maxHealth
occupantData["minHealth"] = config.health_threshold_dead
occupantData["minHealth"] = CONFIG_GET(number/health_threshold_dead) // CHOMPEdit
occupantData["uniqueEnzymes"] = connected.occupant.dna.unique_enzymes
occupantData["uniqueIdentity"] = connected.occupant.dna.uni_identity
occupantData["structuralEnzymes"] = connected.occupant.dna.struc_enzymes

View File

@@ -288,7 +288,7 @@
for(var/obj/item/organ/E in H.bad_external_organs)
var/obj/item/organ/external/affected = E
if((affected.damage < affected.min_broken_damage * config.organ_health_multiplier) && (affected.status & ORGAN_BROKEN))
if((affected.damage < affected.min_broken_damage * CONFIG_GET(number/organ_health_multiplier)) && (affected.status & ORGAN_BROKEN)) // CHOMPEdit
affected.status &= ~ORGAN_BROKEN
for(var/datum/wound/W in affected.wounds)

View File

@@ -277,7 +277,7 @@ var/list/sacrificed = list()
H.sdisabilities &= ~BLIND
for(var/obj/item/organ/E in H.bad_external_organs)
var/obj/item/organ/external/affected = E
if((affected.damage < affected.min_broken_damage * config.organ_health_multiplier) && (affected.status & ORGAN_BROKEN))
if((affected.damage < affected.min_broken_damage * CONFIG_GET(number/organ_health_multiplier)) && (affected.status & ORGAN_BROKEN)) // CHOMPEdit
affected.status &= ~ORGAN_BROKEN
for(var/datum/wound/W in affected.wounds)
if(istype(W, /datum/wound/internal_bleeding))

View File

@@ -109,7 +109,7 @@
if(src.imprinted != "empty")
to_chat(U, "<span class='danger'>Capture failed!</span>: The soul stone has already been imprinted with [src.imprinted]'s mind!")
return
if ((T.health + T.halloss) > config.health_threshold_crit && T.stat != DEAD)
if ((T.health + T.halloss) > CONFIG_GET(number/health_threshold_crit) && T.stat != DEAD) // CHOMPEdit
to_chat(U, "<span class='danger'>Capture failed!</span>: Kill or maim the victim first!")
return
if(T.client == null)

View File

@@ -3,7 +3,7 @@
hadevent = 1
message_admins("The apocalypse has begun! (this holiday event can be disabled by toggling events off within 60 seconds)")
spawn(600)
if(!config.allow_random_events) return
if(!CONFIG_GET(flag/allow_random_events)) return // CHOMPEdit
Show2Group4Delay(ScreenText(null,"<center><font color='red' size='8'>GAME OVER</font></center>"),null,150)
for(var/i=1,i<=4,i++)
spawn_dynamic_event()

View File

@@ -148,10 +148,10 @@ var/global/list/additional_antag_types = list()
playerC++
if(master_mode=="secret")
if(playerC < config.player_requirements_secret[config_tag])
if(playerC < CONFIG_GET(keyed_list/player_requirements_secret)[config_tag]) // CHOMPEdit
return 0
else
if(playerC < config.player_requirements[config_tag])
if(playerC < CONFIG_GET(keyed_list/player_requirements)[config_tag]) // CHOMPEdit
return 0
if(!(antag_templates && antag_templates.len))
@@ -273,7 +273,7 @@ var/global/list/additional_antag_types = list()
for(var/datum/antagonist/antag in antag_templates)
if(!antag.antags_are_dead())
return 0
if(config.continous_rounds)
if(CONFIG_GET(flag/continuous_rounds)) // CHOMPEdit
emergency_shuttle.auto_recall = 0
return 0
return 1
@@ -472,7 +472,7 @@ var/global/list/additional_antag_types = list()
/datum/game_mode/proc/create_antagonists()
if(!config.traitor_scaling)
if(!CONFIG_GET(flag/traitor_scaling)) // CHOMPEdit
antag_scaling_coeff = 0
if(antag_tags && antag_tags.len)

View File

@@ -104,7 +104,7 @@
/datum/game_mode/proc/forge_meme_objectives(var/datum/mind/meme, var/datum/mind/first_host)
if (config.objectives_disabled)
if (CONFIG_GET(flag/objectives_disabled)) // CHOMPEdit
return
// meme always needs to attune X hosts

View File

@@ -33,7 +33,7 @@ var/list/nuke_disks = list()
return 0
/datum/game_mode/nuclear/declare_completion()
if(config.objectives_disabled)
if(CONFIG_GET(flag/objectives_disabled)) // CHOMPEdit
..()
return
var/disk_rescued = 1

View File

@@ -40,7 +40,7 @@
for(var/obj/item/organ/E in H.bad_external_organs) // Fix bones
var/obj/item/organ/external/affected = E
if((affected.damage < affected.min_broken_damage * config.organ_health_multiplier) && (affected.status & ORGAN_BROKEN))
if((affected.damage < affected.min_broken_damage * CONFIG_GET(number/organ_health_multiplier)) && (affected.status & ORGAN_BROKEN)) // CHOMPEdit
affected.status &= ~ORGAN_BROKEN
for(var/datum/wound/W in affected.wounds) // Fix IB

View File

@@ -44,7 +44,7 @@
for(var/obj/item/organ/E in H.bad_external_organs) // Fix bones
var/obj/item/organ/external/affected = E
if((affected.damage < affected.min_broken_damage * config.organ_health_multiplier) && (affected.status & ORGAN_BROKEN))
if((affected.damage < affected.min_broken_damage * CONFIG_GET(number/organ_health_multiplier)) && (affected.status & ORGAN_BROKEN)) // CHOMPEdit
affected.status &= ~ORGAN_BROKEN
for(var/datum/wound/W in affected.wounds) // Fix IB

View File

@@ -24,7 +24,7 @@
) */ //VOREStation Removal: no alt-titles for visitors
/datum/job/assistant/get_access()
if(config.assistant_maint)
if(CONFIG_GET(flag/assistant_maint)) // CHOMPEdit
return list(access_maint_tunnels)
else
return list()

View File

@@ -78,11 +78,11 @@
/datum/job/intern/New()
..()
if(config)
total_positions = config.limit_interns
spawn_positions = config.limit_interns
total_positions = CONFIG_GET(number/limit_interns) // CHOMPEdit
spawn_positions = CONFIG_GET(number/limit_interns) // CHOMPEdit
/datum/job/intern/get_access()
if(config.assistant_maint)
if(CONFIG_GET(flag/assistant_maint)) // CHOMPEdit
return list(access_maint_tunnels)
else
return list()
@@ -103,8 +103,8 @@
/datum/job/assistant/New()
..()
if(config)
total_positions = config.limit_visitors
spawn_positions = config.limit_visitors
total_positions = CONFIG_GET(number/limit_visitors) // CHOMPEdit
spawn_positions = CONFIG_GET(number/limit_visitors) // CHOMPEdit
/datum/job/assistant/get_access()
return list()

View File

@@ -2,7 +2,7 @@
//The name of the job
var/title = "NOPE"
//Job access. The use of minimal_access or access is determined by a config setting: config.jobs_have_minimal_access
//Job access. The use of minimal_access or access is determined by a config setting: CONFIG_GET(flag/jobs_have_minimal_access) // CHOMPEdit
var/list/minimal_access = list() // Useful for servers which prefer to only have access given to the places a job absolutely needs (Larger server population)
var/list/access = list() // Useful for servers which either have fewer players, so each person needs to fill more than one role, or servers which like to give more access, so players can't hide forever in their super secure departments (I'm looking at you, chemistry!)
var/flag = 0 // Bitflags for the job
@@ -98,7 +98,7 @@
. = outfit.equip_base(H, title, alt_title)
/datum/job/proc/get_access()
if(!config || config.jobs_have_minimal_access)
if(!config || CONFIG_GET(flag/jobs_have_minimal_access)) // CHOMPEdit
return src.minimal_access.Copy()
else
return src.access.Copy()
@@ -108,7 +108,7 @@
return (available_in_days(C) == 0) //Available in 0 days = available right now = player is old enough to play.
/datum/job/proc/available_in_days(client/C)
if(C && config.use_age_restriction_for_jobs && isnum(C.player_age) && isnum(minimal_player_age))
if(C && CONFIG_GET(flag/use_age_restriction_for_jobs) && isnum(C.player_age) && isnum(minimal_player_age)) // CHOMPEdit
return max(0, minimal_player_age - C.player_age)
return 0

View File

@@ -30,7 +30,7 @@
return (available_in_playhours(C) == 0)
/datum/job/proc/available_in_playhours(client/C)
if(C && config.use_playtime_restriction_for_jobs && dept_time_required)
if(C && CONFIG_GET(flag/use_playtime_restriction_for_jobs) && dept_time_required) // CHOMPEdit
if(isnum(C.play_hours[pto_type])) // Has played that department before
return max(0, dept_time_required - C.play_hours[pto_type])
else // List doesn't have that entry, maybe never played, maybe invalid PTO type (you should fix that...)
@@ -41,7 +41,7 @@
// Captain gets every department combined
/datum/job/captain/available_in_playhours(client/C)
if(C && config.use_playtime_restriction_for_jobs && dept_time_required)
if(C && CONFIG_GET(flag/use_playtime_restriction_for_jobs) && dept_time_required) // CHOMPEdit
var/remaining_time_needed = dept_time_required
for(var/key in C.play_hours)
if(isnum(C.play_hours[key]) && !(key == PTO_TALON))
@@ -51,7 +51,7 @@
// HoP gets civilian, cargo, and exploration combined
/datum/job/hop/available_in_playhours(client/C)
if(C && config.use_playtime_restriction_for_jobs && dept_time_required)
if(C && CONFIG_GET(flag/use_playtime_restriction_for_jobs) && dept_time_required) // CHOMPEdit
var/remaining_time_needed = dept_time_required
if(isnum(C.play_hours[PTO_CIVILIAN]))
remaining_time_needed = max(0, remaining_time_needed - C.play_hours[PTO_CIVILIAN])

View File

@@ -125,7 +125,7 @@
title = "Fool"
/datum/job/clown/get_access()
if(config.assistant_maint)
if(CONFIG_GET(flag/assistant_maint)) // CHOMPEdit
return list(access_maint_tunnels, access_entertainment, access_clown, access_tomfoolery)
else
return list(access_entertainment, access_clown, access_tomfoolery)
@@ -153,7 +153,7 @@
title = "Poseur"
/datum/job/mime/get_access()
if(config.assistant_maint)
if(CONFIG_GET(flag/assistant_maint)) // CHOMPEdit
return list(access_maint_tunnels, access_entertainment, access_tomfoolery, access_mime)
else
return list(access_entertainment, access_tomfoolery, access_mime)

View File

@@ -582,7 +582,7 @@ var/global/datum/controller/occupations/job_master
return H
/datum/controller/occupations/proc/LoadJobs(jobsfile) //ran during round setup, reads info from jobs.txt -- Urist
if(!config.load_jobs_from_txt)
if(!CONFIG_GET(flag/load_jobs_from_txt)) // CHOMPEdit
return 0
var/list/jobEntries = file2list(jobsfile)

View File

@@ -3,7 +3,7 @@
GLOBAL_LIST_EMPTY(whitelist) // CHOMPEdit - Managed Globals
/hook/startup/proc/loadWhitelist()
if(config.usewhitelist)
if(CONFIG_GET(flag/usewhitelist)) // CHOMPEdit
load_whitelist()
return 1
@@ -12,7 +12,7 @@ GLOBAL_LIST_EMPTY(whitelist) // CHOMPEdit - Managed Globals
if(!GLOB.whitelist.len) GLOB.whitelist = null // CHOMPEdit - Managed Globals
/proc/check_whitelist(mob/M /*, var/rank*/)
if(!config.usewhitelist) //CHOMPedit: I guess this is an override for the blanket whitelist system.
if(!CONFIG_GET(flag/usewhitelist)) //CHOMPedit: I guess this is an override for the blanket whitelist system.
return 1 //CHOMPedit
if(!GLOB.whitelist) // CHOMPEdit - Managed Globals
return 0
@@ -21,7 +21,7 @@ GLOBAL_LIST_EMPTY(whitelist) // CHOMPEdit - Managed Globals
GLOBAL_LIST_EMPTY(alien_whitelist) // CHOMPEdit - Managed Globals
/hook/startup/proc/loadAlienWhitelist()
if(config.usealienwhitelist)
if(CONFIG_GET(flag/usealienwhitelist)) // CHOMPEdit
load_alienwhitelist()
return 1
@@ -113,7 +113,7 @@ GLOBAL_LIST_EMPTY(alien_whitelist) // CHOMPEdit - Managed Globals
return 1
/proc/whitelist_overrides(mob/M)
if(!config.usealienwhitelist)
if(!CONFIG_GET(flag/usealienwhitelist)) // CHOMPEdit
return TRUE
if(check_rights(R_ADMIN|R_EVENT, 0, M))
return TRUE

View File

@@ -1,7 +1,7 @@
GLOBAL_LIST_EMPTY(job_whitelist) // CHOMPEdit - Managed Globals
/hook/startup/proc/loadJobWhitelist()
if(config.use_jobwhitelist) // CHOMPedit
if(CONFIG_GET(flag/use_jobwhitelist)) // CHOMPedit
load_jobwhitelist() // CHOMPedit
return 1
@@ -13,7 +13,7 @@ GLOBAL_LIST_EMPTY(job_whitelist) // CHOMPEdit - Managed Globals
GLOB.job_whitelist = splittext(text, "\n") // CHOMPEdit - Managed Globals
/proc/is_job_whitelisted(mob/M, var/rank)
if(!config.use_jobwhitelist) // CHOMPedit
if(!CONFIG_GET(flag/use_jobwhitelist)) // CHOMPedit
return 1 // CHOMPedit
var/datum/job/job = job_master.GetJob(rank)
if(!job.whitelist_only)

View File

@@ -190,7 +190,7 @@
occupantData["stat"] = occupant.stat
occupantData["health"] = occupant.health
occupantData["maxHealth"] = occupant.maxHealth
occupantData["minHealth"] = config.health_threshold_dead
occupantData["minHealth"] = CONFIG_GET(number/health_threshold_dead) // CHOMPEdit
occupantData["bruteLoss"] = occupant.getBruteLoss()
occupantData["oxyLoss"] = occupant.getOxyLoss()
occupantData["toxLoss"] = occupant.getToxLoss()

View File

@@ -68,7 +68,7 @@
occupantData["stat"] = occupant.stat
occupantData["health"] = occupant.health
occupantData["maxHealth"] = occupant.maxHealth
occupantData["minHealth"] = config.health_threshold_dead
occupantData["minHealth"] = CONFIG_GET(number/health_threshold_dead) // CHOMPEdit
occupantData["bruteLoss"] = occupant.getBruteLoss()
occupantData["oxyLoss"] = occupant.getOxyLoss()
occupantData["toxLoss"] = occupant.getToxLoss()

View File

@@ -336,7 +336,7 @@
set_temp("Error: Not enough biomass.", "danger")
else if(pod.mess)
set_temp("Error: The cloning pod is malfunctioning.", "danger")
else if(!config.revival_cloning)
else if(!CONFIG_GET(flag/revival_cloning)) // CHOMPEdit
set_temp("Error: Unable to initiate cloning cycle.", "danger")
else
cloneresult = pod.growclone(C)

View File

@@ -102,7 +102,7 @@
"timeoff_factor" = job.timeoff_factor,
"pto_department" = job.pto_type
)
if(config.time_off && config.pto_job_change)
if(CONFIG_GET(flag/time_off) && CONFIG_GET(flag/pto_job_change)) // CHOMPEdit
data["allow_change_job"] = TRUE
if(job && job.timeoff_factor < 0) // Currently are Off Duty, so gotta lookup what on-duty jobs are open
data["job_choices"] = getOpenOnDutyJobs(user, job.pto_type)

View File

@@ -113,7 +113,7 @@
occupantData["stat"] = occupant.stat
occupantData["health"] = occupant.health
occupantData["maxHealth"] = occupant.getMaxHealth()
occupantData["minHealth"] = config.health_threshold_dead
occupantData["minHealth"] = CONFIG_GET(number/health_threshold_dead) // CHOMPEdit
occupantData["bruteLoss"] = occupant.getBruteLoss()
occupantData["oxyLoss"] = occupant.getOxyLoss()
occupantData["toxLoss"] = occupant.getToxLoss()

View File

@@ -18,7 +18,7 @@ generic_filth = TRUE means when the decal is saved, it will be switched out for
age = _age
if(random_icon_states && length(src.random_icon_states) > 0)
src.icon_state = pick(src.random_icon_states)
if(!mapload || !config.persistence_ignore_mapload)
if(!mapload || !CONFIG_GET(flag/persistence_ignore_mapload)) // CHOMPEdit
SSpersistence.track_value(src, /datum/persistent/filth)
. = ..()

View File

@@ -1,7 +1,7 @@
//TODO: Flash range does nothing currently
/proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1, z_transfer = UP|DOWN, shaped)
var/multi_z_scalar = config.multi_z_explosion_scalar
var/multi_z_scalar = CONFIG_GET(number/multi_z_explosion_scalar) // CHOMPEdit
spawn(0)
var/start = world.timeofday
epicenter = get_turf(epicenter)
@@ -74,7 +74,7 @@
var/x0 = epicenter.x
var/y0 = epicenter.y
var/z0 = epicenter.z
if(config.use_recursive_explosions)
if(CONFIG_GET(flag/use_recursive_explosions)) // CHOMPEdit
var/power = devastation_range * 2 + heavy_impact_range + light_impact_range //The ranges add up, ie light 14 includes both heavy 7 and devestation 3. So this calculation means devestation counts for 4, heavy for 2 and light for 1 power, giving us a cap of 27 power.
explosion_rec(epicenter, power, shaped)
else

View File

@@ -60,7 +60,7 @@
/obj/item/toy/nanotrasenballoon,
/obj/item/toy/syndicateballoon,
/obj/item/weapon/aiModule/syndicate,
/obj/item/weapon/book/manual/engineering_hacking,
/obj/item/weapon/book/manual/wiki/engineering_hacking, // CHOMPEdit
/obj/item/weapon/card/emag,
/obj/item/weapon/card/emag_broken,
/obj/item/weapon/card/id/syndicate,

View File

@@ -99,7 +99,7 @@
to_chat(user, "You finish drawing.")
var/msg = "[user.client.key] ([user]) has drawn [drawtype] (with [src]) at [target.x],[target.y],[target.z]."
if(config.log_graffiti)
if(CONFIG_GET(flag/log_graffiti)) // CHOMPEdit
message_admins(msg)
log_game(msg) //We will log it anyways.

View File

@@ -290,7 +290,7 @@
if(confirm == "No")
return
if(config.antag_hud_restricted && has_enabled_antagHUD == 1)
if(CONFIG_GET(flag/antag_hud_restricted) && has_enabled_antagHUD == 1) // CHOMPEdit
to_chat(src, "<span class='danger'>You have used the antagHUD and cannot respawn or use communicators!</span>")
return

View File

@@ -297,10 +297,10 @@
H.updatehealth()
if(H.isSynthetic())
if(H.health + H.getOxyLoss() + H.getToxLoss() <= config.health_threshold_dead)
if(H.health + H.getOxyLoss() + H.getToxLoss() <= CONFIG_GET(number/health_threshold_dead)) // CHOMPEdit
return "buzzes, \"Resuscitation failed - Severe damage detected. Begin manual repair before further attempts futile.\""
else if(H.health + H.getOxyLoss() <= config.health_threshold_dead || (HUSK in H.mutations) || !H.can_defib)
else if(H.health + H.getOxyLoss() <= CONFIG_GET(number/health_threshold_dead) || (HUSK in H.mutations) || !H.can_defib) // CHOMPEdit
return "buzzes, \"Resuscitation failed - Severe tissue damage makes recovery of patient impossible via defibrillator. Further attempts futile.\""
var/bad_vital_organ = check_vital_organs(H)
@@ -433,7 +433,7 @@
H.apply_damage(burn_damage_amt, BURN, BP_TORSO)
//set oxyloss so that the patient is just barely in crit, if possible
var/barely_in_crit = config.health_threshold_crit - 1
var/barely_in_crit = CONFIG_GET(number/health_threshold_crit) - 1 // CHOMPEdit
var/adjust_health = barely_in_crit - H.health //need to increase health by this much
H.adjustOxyLoss(-adjust_health)
@@ -519,7 +519,7 @@
// If the brain'd `defib_timer` var gets below this number, brain damage will happen at a linear rate.
// This is measures in `Life()` ticks. E.g. 10 minute defib timer = 6000 world.time units = 3000 `Life()` ticks.
var/brain_damage_timer = ((config.defib_timer MINUTES) / 2) - ((config.defib_braindamage_timer MINUTES) / 2)
var/brain_damage_timer = ((CONFIG_GET(number/defib_timer) MINUTES) / 2) - ((CONFIG_GET(number/defib_braindamage_timer) MINUTES) / 2) // CHOMPEdit
if(brain.defib_timer > brain_damage_timer)
return // They got revived before brain damage got a chance to set in.

View File

@@ -17,7 +17,7 @@
age = _age
/obj/item/trash/Initialize(mapload)
if(!mapload || !config.persistence_ignore_mapload)
if(!mapload || !CONFIG_GET(flag/persistence_ignore_mapload)) // CHOMPEdit
SSpersistence.track_value(src, /datum/persistent/filth/trash)
. = ..()

View File

@@ -5,7 +5,7 @@
due_date = 0 // Game time in 1/10th seconds
unique = 1 // 0 - Normal book, 1 - Should not be treated as normal book, unable to be copied, unable to be modified
/* CHOMPEdit Start
/obj/item/weapon/book/manual/engineering_construction
name = "Station Repairs and Construction"
icon_state ="bookEngineering"
@@ -21,12 +21,13 @@
</head>
<body>
<iframe width='100%' height='97%' src="[config.wikiurl]Guide_to_Construction&printable=yes&remove_links=1" frameborder="0" id="main_frame"></iframe>
<iframe width='100%' height='97%' src="[CONFIG_GET(string/wikiurl)]Guide_to_Construction&printable=yes&remove_links=1" frameborder="0" id="main_frame"></iframe>
</body>
</html>
"}
*/ // CHOMPEdit End
/obj/item/weapon/book/manual/engineering_particle_accelerator
name = "Particle Accelerator User's Guide"
@@ -319,6 +320,7 @@
</body>
</html>"} // CHOMPedit END : Updating the R-UST manual
/* CHOMPEdit Start
/obj/item/weapon/book/manual/engineering_hacking
name = "Hacking"
icon_state ="bookHacking"
@@ -334,13 +336,13 @@
</head>
<body>
<iframe width='100%' height='97%' src="[config.wikiurl]Hacking&printable=yes&remove_links=1" frameborder="0" id="main_frame"></iframe>
<iframe width='100%' height='97%' src="[CONFIG_GET(string/wikiurl)]Hacking&printable=yes&remove_links=1" frameborder="0" id="main_frame"></iframe>
</body>
</html>
"}
*/ // CHOMPEdit End
/obj/item/weapon/book/manual/engineering_singularity_safety
name = "Singularity Safety in Special Circumstances"
@@ -675,6 +677,7 @@
</html>
"}
/* CHOMPEdit Start
/obj/item/weapon/book/manual/robotics_manual
name = "Guide to Robotics"
icon_state ="evabook"
@@ -688,10 +691,11 @@
<html><head>
</head>
<body>
<iframe width='100%' height='97%' src="[config.wikiurl]Guide_to_Robotics&printable=yes&remove_links=1" frameborder="0" id="main_frame"></iframe>
<iframe width='100%' height='97%' src="[CONFIG_GET(string/wikiurl)]Guide_to_Robotics&printable=yes&remove_links=1" frameborder="0" id="main_frame"></iframe>
</body>
</html>
"}
*/ // CHOMPEdit End
/obj/item/weapon/book/manual/robotics_cyborgs
name = "Cyborgs for Dummies"
@@ -899,6 +903,7 @@
"}
/* CHOMPEdit Start
/obj/item/weapon/book/manual/security_space_law
name = "Corporate Regulations"
desc = "A set of corporate guidelines for keeping law and order on privately-owned space stations."
@@ -915,7 +920,7 @@
</head>
<body>
<iframe width='100%' height='97%' src="[config.wikiurl]Corporate_Regulations&printable=yes&remove_links=1" frameborder="0" id="main_frame"></iframe>
<iframe width='100%' height='97%' src="[CONFIG_GET(string/wikiurl)]Corporate_Regulations&printable=yes&remove_links=1" frameborder="0" id="main_frame"></iframe>
</body>
</html>
@@ -966,7 +971,7 @@
<HR COLOR="steelblue" WIDTH="60%" ALIGN="LEFT">
<iframe width='100%' height='100%' src="[config.wikiurl]Guide_to_Medicine&printable=yes&removelinks=1" frameborder="0" id="main_frame"></iframe>
<iframe width='100%' height='100%' src="[CONFIG_GET(string/wikiurl)]Guide_to_Medicine&printable=yes&removelinks=1" frameborder="0" id="main_frame"></iframe>
</body>
</html>
@@ -988,12 +993,12 @@
</head>
<body>
<iframe width='100%' height='100%' src="[config.wikiurl]Guide_to_Engineering&printable=yes&remove_links=1" frameborder="0" id="main_frame"></iframe> </body>
<iframe width='100%' height='100%' src="[CONFIG_GET(string/wikiurl)]Guide_to_Engineering&printable=yes&remove_links=1" frameborder="0" id="main_frame"></iframe> </body>
</html>
"}
*/ // CHOMPEdit End
/obj/item/weapon/book/manual/chef_recipes
name = "Chef Recipes"

View File

@@ -14,7 +14,7 @@
</head>
<body>
<iframe width='100%' height='97%' src="[config.wikiurl]Standard_Operating_Procedure&printable=yes&remove_links=1" frameborder="0" id="main_frame"></iframe>
<iframe width='100%' height='97%' src="[CONFIG_GET(string/wikiurl)]Standard_Operating_Procedure&printable=yes&remove_links=1" frameborder="0" id="main_frame"></iframe>
</body>
</html>
@@ -37,7 +37,7 @@
</head>
<body>
<iframe width='100%' height='97%' src="[config.wikiurl]Chain_of_Command&printable=yes&remove_links=1" frameborder="0" id="main_frame"></iframe>
<iframe width='100%' height='97%' src="[CONFIG_GET(string/wikiurl)]Chain_of_Command&printable=yes&remove_links=1" frameborder="0" id="main_frame"></iframe>
</body>
</html>

View File

@@ -0,0 +1,145 @@
// Wiki books that are linked to the configured wiki link.
/// The size of the window that the wiki books open in.
#define BOOK_WINDOW_BROWSE_SIZE "970x710"
/// This macro will resolve to code that will open up the associated wiki page in the window.
#define WIKI_PAGE_IFRAME(wikiurl, link_identifier) {"
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<style>
iframe {
display: none;
}
</style>
</head>
<body>
<script type="text/javascript">
function pageloaded(myframe) {
document.getElementById("loading").style.display = "none";
myframe.style.display = "inline";
}
</script>
<p id='loading'>You start skimming through the manual...</p>
<iframe width='100%' height='97%' onload="pageloaded(this)" src="[##wikiurl]/[##link_identifier]?printable=yes&remove_links=1" frameborder="0" id="main_frame"></iframe>
</body>
</html>
"}
// A book that links to the wiki
/obj/item/weapon/book/manual/wiki
dat = "Nanotrasen presently does not have any resources on this topic. If you would like to know more, contact your local Central Command representative." // safety
/// The ending URL of the page that we link to.
var/page_link = ""
/obj/item/weapon/book/manual/wiki/display_content(mob/living/user)
var/wiki_url = CONFIG_GET(string/wikiurl)
if(!wiki_url)
//user.balloon_alert(user, "this book is empty!")
to_chat(user, "this book is empty!")
return
//credit_book_to_reader(user)
DIRECT_OUTPUT(user, browse(WIKI_PAGE_IFRAME(wiki_url, page_link), "window=manual;size=[BOOK_WINDOW_BROWSE_SIZE]")) // if you change this GUARANTEE that it works.
/obj/item/weapon/book/manual/wiki/engineering_construction
name = "Station Repairs and Construction"
icon_state ="bookEngineering"
item_state = "book3"
author = "Engineering Encyclopedia" // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned
title = "Station Repairs and Construction"
page_link = "Guide_to_Construction"
/obj/item/weapon/book/manual/wiki/engineering_hacking
name = "Hacking"
icon_state ="bookHacking"
item_state = "book2"
author = "Engineering Encyclopedia" // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned
title = "Hacking"
page_link = "Hacking"
/obj/item/weapon/book/manual/wiki/robotics_manual
name = "Guide to Robotics"
icon_state ="evabook"
item_state = "book3"
author = "Simple Robotics" // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned
title = "Guide to Robotics"
page_link = "Guide_to_Robotics"
/obj/item/weapon/book/manual/wiki/security_space_law
name = "Corporate Regulations"
desc = "A set of corporate guidelines for keeping law and order on privately-owned space stations."
icon_state = "bookSpaceLaw"
item_state = "book13"
author = "The Company"
title = "Corporate Regulations"
page_link = "Corporate_Regulations"
/obj/item/weapon/book/manual/wiki/medical_diagnostics_manual
name = "Medical Diagnostics Manual"
desc = "First, do no harm. A detailed medical practitioner's guide."
icon_state = "bookMedical"
item_state = "book12"
author = "Medical Department"
title = "Medical Diagnostics Manual"
/obj/item/weapon/book/manual/wiki/medical_diagnostics_manual/display_content(mob/living/user)
var/wiki_url = CONFIG_GET(string/wikiurl)
if(!wiki_url)
//user.balloon_alert(user, "this book is empty!")
to_chat(user, "this book is empty!")
return
var/dat = {"<html>
<head>
<style>
h1 {font-size: 18px; margin: 15px 0px 5px;}
h2 {font-size: 15px; margin: 15px 0px 5px;}
li {margin: 2px 0px 2px 15px;}
ul {margin: 5px; padding: 0px;}
ol {margin: 5px; padding: 0px 15px;}
body {font-size: 13px; font-family: Verdana;}
</style>
</head>
<body>
<br>
<h1>The Oath</h1>
<i>The Medical Oath sworn by recognised medical practitioners in the employ of [using_map.company_name]</i><br>
<ol>
<li>Now, as a new doctor, I solemnly promise that I will, to the best of my ability, serve humanity-caring for the sick, promoting good health, and alleviating pain and suffering.</li>
<li>I recognise that the practice of medicine is a privilege with which comes considerable responsibility and I will not abuse my position.</li>
<li>I will practise medicine with integrity, humility, honesty, and compassion-working with my fellow doctors and other colleagues to meet the needs of my patients.</li>
<li>I shall never intentionally do or administer anything to the overall harm of my patients.</li>
<li>I will not permit considerations of gender, race, religion, political affiliation, sexual orientation, nationality, or social standing to influence my duty of care.</li>
<li>I will oppose policies in breach of human rights and will not participate in them. I will strive to change laws that are contrary to my profession's ethics and will work towards a fairer distribution of health resources.</li>
<li>I will assist my patients to make informed decisions that coincide with their own values and beliefs and will uphold patient confidentiality.</li>
<li>I will recognise the limits of my knowledge and seek to maintain and increase my understanding and skills throughout my professional life. I will acknowledge and try to remedy my own mistakes and honestly assess and respond to those of others.</li>
<li>I will seek to promote the advancement of medical knowledge through teaching and research.</li>
<li>I make this declaration solemnly, freely, and upon my honour.</li>
</ol><br>
<HR COLOR="steelblue" WIDTH="60%" ALIGN="LEFT">
<iframe width='100%' height='100%' src="[wiki_url]Guide_to_Medicine&printable=yes&removelinks=1" frameborder="0" id="main_frame"></iframe>
</body>
</html>
"}
//credit_book_to_reader(user)
DIRECT_OUTPUT(user, browse(dat, "window=manual;size=[BOOK_WINDOW_BROWSE_SIZE]")) // if you change this GUARANTEE that it works.
/obj/item/weapon/book/manual/wiki/engineering_guide
name = "Engineering Textbook"
icon_state ="bookEngineering2"
item_state = "book3"
author = "Engineering Encyclopedia"
title = "Engineering Textbook"
page_link = "Guide_to_Engineering"

View File

@@ -122,7 +122,7 @@
return
if(usr.stat || usr.restrained())
return
if(ismouse(usr) || (isobserver(usr) && !config.ghost_interaction))
if(ismouse(usr) || (isobserver(usr) && !CONFIG_GET(flag/ghost_interaction))) // CHOMPEdit
return
src.set_dir(turn(src.dir, 270))

View File

@@ -75,7 +75,7 @@
return
if(usr.stat || usr.restrained())
return
if(ismouse(usr) || (isobserver(usr) && !config.ghost_interaction))
if(ismouse(usr) || (isobserver(usr) && !CONFIG_GET(flag/ghost_interaction))) // CHOMPEdit
return
src.set_dir(turn(src.dir, 270))
@@ -89,7 +89,7 @@
return
if(usr.stat || usr.restrained())
return
if(ismouse(usr) || (isobserver(usr) && !config.ghost_interaction))
if(ismouse(usr) || (isobserver(usr) && !CONFIG_GET(flag/ghost_interaction))) // CHOMPEdit
return
src.set_dir(turn(src.dir, 90))

View File

@@ -84,7 +84,7 @@
return ..()
/obj/structure/trash_pile/attack_ghost(mob/observer/user as mob)
if(config.disable_player_mice)
if(CONFIG_GET(flag/disable_player_mice)) // CHOMPEdit
to_chat(user, "<span class='warning'>Spawning as a mouse is currently disabled.</span>")
return
@@ -116,7 +116,7 @@
host = new /mob/living/simple_mob/animal/passive/mouse(get_turf(src))
if(host)
if(config.uneducated_mice)
if(CONFIG_GET(flag/uneducated_mice)) // CHOMPEdit
host.universal_understand = 0
announce_ghost_joinleave(src, 0, "They are now a mouse.")
host.ckey = user.ckey

View File

@@ -5,7 +5,7 @@
enabled = 0
New()
..()
src.enabled = config.socket_talk
src.enabled = CONFIG_GET(flag/socket_talk) // CHOMPEdit
if(enabled)
call_ext("DLLSocket.so","establish_connection")("127.0.0.1","8019") // CHOMPEdit

View File

@@ -13,7 +13,7 @@
var/forced_dirs = 0 //Force this one to pretend it's an overedge turf
/turf/space/Initialize()
if(config.starlight)
if(CONFIG_GET(flag/starlight)) // CHOMPEdit
update_starlight()
//Sprite stuff only beyond here
@@ -75,7 +75,7 @@
/turf/space/proc/update_starlight()
if(locate(/turf/simulated) in orange(src,1))
set_light(config.starlight)
set_light(CONFIG_GET(flag/starlight)) // CHOMPEdit
else
set_light(0)

View File

@@ -45,16 +45,22 @@
to_world_log("Your server's byond version does not meet the recommended requirements for this server. Please update BYOND")
TgsNew(new /datum/tgs_event_handler/impl, TGS_SECURITY_TRUSTED) // CHOMPEdit - tgs event handler
VgsNew() // VOREStation Edit - VGS
// VgsNew() // VOREStation Edit - VGS // CHOMPEdit - Has to be initialized after config was loaded
config.post_load()
config.Load(params[OVERRIDE_CONFIG_DIRECTORY_PARAMETER]) // CHOMPEdit
if(config && config.server_name != null && config.server_suffix && world.port > 0)
ConfigLoaded() // CHOMPEdit
makeDatumRefLists() // CHOMPEdit
VgsNew() // CHOMPEdit
var/servername = CONFIG_GET(string/servername) // CHOMPEdit
if(config && servername != null && CONFIG_GET(flag/server_suffix) && world.port > 0) // CHOMPEdit
// dumb and hardcoded but I don't care~
config.server_name += " #[(world.port % 1000) / 100]"
servername += " #[(world.port % 1000) / 100]" // CHOMPEdit
CONFIG_SET(string/servername, servername) // CHOMPEdit
// TODO - Figure out what this is. Can you assign to world.log?
// if(config && config.log_runtime)
// if(config && CONFIG_GET(flag/log_runtime)) // CHOMPEdit
// log = file("data/logs/runtime/[time2text(world.realtime,"YYYY-MM-DD-(hh-mm-ss)")]-runtime.log")
GLOB.timezoneOffset = world.timezone * 36000
@@ -103,13 +109,31 @@
#endif
spawn(3000) //so we aren't adding to the round-start lag
if(config.ToRban)
if(CONFIG_GET(flag/ToRban)) // CHOMPEdit
ToRban_autoupdate()
#undef RECOMMENDED_VERSION
return
// CHOMPEdit Start
/// Runs after config is loaded but before Master is initialized
/world/proc/ConfigLoaded()
// Everything in here is prioritized in a very specific way.
// If you need to add to it, ask yourself hard if what your adding is in the right spot
// (i.e. basically nothing should be added before load_admins() in here)
// Try to set round ID
SSdbcore.InitializeRound()
//apply a default value to config.python_path, if needed
if (!CONFIG_GET(string/python_path)) // CHOMPEdit
if(world.system_type == UNIX)
CONFIG_SET(string/python_path, "/usr/bin/env python2") // CHOMPEdit
else //probably windows, if not this should work anyway
CONFIG_SET(string/python_path, "python") // CHOMPEdit
// CHOMPEdit End
var/world_topic_spam_protect_ip = "0.0.0.0"
var/world_topic_spam_protect_time = world.timeofday
@@ -136,11 +160,11 @@ var/world_topic_spam_protect_time = world.timeofday
var/list/s = list()
s["version"] = game_version
s["mode"] = master_mode
s["respawn"] = config.abandon_allowed
s["persistance"] = config.persistence_disabled
s["enter"] = config.enter_allowed
s["vote"] = config.allow_vote_mode
s["ai"] = config.allow_ai
s["respawn"] = CONFIG_GET(flag/abandon_allowed) // CHOMPEdit
s["persistance"] = CONFIG_GET(flag/persistence_disabled) // CHOMPEdit
s["enter"] = CONFIG_GET(flag/enter_allowed) // CHOMPEdit
s["vote"] = CONFIG_GET(flag/allow_vote_mode) // CHOMPEdit
s["ai"] = CONFIG_GET(flag/allow_ai) // CHOMPEdit
s["host"] = host ? host : null
// This is dumb, but spacestation13.com's banners break if player count isn't the 8th field of the reply, so... this has to go here.
@@ -273,7 +297,7 @@ var/world_topic_spam_protect_time = world.timeofday
else if(copytext(T,1,5) == "info")
var/input[] = params2list(T)
if(input["key"] != config.comms_password)
if(input["key"] != CONFIG_GET(string/comms_password)) // CHOMPEdit
if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50)
spawn(50)
@@ -360,7 +384,7 @@ var/world_topic_spam_protect_time = world.timeofday
var/input[] = params2list(T)
if(input["key"] != config.comms_password)
if(input["key"] != CONFIG_GET(string/comms_password)) // CHOMPEdit
if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50)
spawn(50)
@@ -410,7 +434,7 @@ var/world_topic_spam_protect_time = world.timeofday
2. validationkey = the key the bot has, it should match the gameservers commspassword in it's configuration.
*/
var/input[] = params2list(T)
if(input["key"] != config.comms_password)
if(input["key"] != CONFIG_GET(string/comms_password)) // CHOMPEdit
if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50)
spawn(50)
@@ -425,7 +449,7 @@ var/world_topic_spam_protect_time = world.timeofday
else if(copytext(T,1,4) == "age")
var/input[] = params2list(T)
if(input["key"] != config.comms_password)
if(input["key"] != CONFIG_GET(string/comms_password)) // CHOMPEdit
if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50)
spawn(50)
world_topic_spam_protect_time = world.time
@@ -461,8 +485,8 @@ var/world_topic_spam_protect_time = world.timeofday
else
Master.Shutdown() //run SS shutdowns
for(var/client/C in GLOB.clients)
if(config.server) //if you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite
C << link("byond://[config.server]")
if(CONFIG_GET(string/server)) //if you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite // CHOMPEdit
C << link("byond://[CONFIG_GET(string/server)]") // CHOMPEdit
TgsReboot()
log_world("World rebooted at [time_stamp()]")
@@ -496,13 +520,14 @@ var/world_topic_spam_protect_time = world.timeofday
/world/proc/load_motd()
join_motd = file2text("config/motd.txt")
/* CHOMPEdit Start
/proc/load_configuration()
config = new /datum/configuration()
config.load("config/config.txt")
config.load("config/game_options.txt","game_options")
config.loadsql("config/dbconfig.txt")
config.loadforumsql("config/forumdbconfig.txt")
*/ // CHOMPEdit End
/hook/startup/proc/loadMods()
world.load_mods()
@@ -510,7 +535,7 @@ var/world_topic_spam_protect_time = world.timeofday
return 1
/world/proc/load_mods()
if(config.admin_legacy_system)
if(CONFIG_GET(flag/admin_legacy_system)) // CHOMPEdit
var/text = file2text("config/moderators.txt")
if (!text)
error("Failed to load config/mods.txt")
@@ -531,7 +556,7 @@ var/world_topic_spam_protect_time = world.timeofday
D.associate(GLOB.directory[ckey])
/world/proc/load_mentors()
if(config.admin_legacy_system)
if(CONFIG_GET(flag/admin_legacy_system)) // CHOMPEdit
var/text = file2text("config/mentors.txt")
if (!text)
error("Failed to load config/mentors.txt")
@@ -568,8 +593,8 @@ var/world_topic_spam_protect_time = world.timeofday
/world/proc/update_status()
var/s = ""
if (config && config.server_name)
s += "<b>[config.server_name]</b> &#8212; "
if (config && CONFIG_GET(string/servername)) // CHOMPEdit
s += "<b>[CONFIG_GET(string/servername)]</b> &#8212; " // CHOMPEdit
s += "<b>[station_name()]</b>";
s += " ("
@@ -587,19 +612,19 @@ var/world_topic_spam_protect_time = world.timeofday
else
features += "<b>STARTING</b>"
if (!config.enter_allowed)
if (!CONFIG_GET(flag/enter_allowed))
features += "closed"
features += config.abandon_allowed ? "respawn" : "no respawn"
features += CONFIG_GET(flag/abandon_allowed) ? "respawn" : "no respawn" // CHOMPEdit
features += config.persistence_disabled ? "persistence disabled" : "persistence enabled"
features += CONFIG_GET(flag/persistence_disabled) ? "persistence disabled" : "persistence enabled" // CHOMPEdit
features += config.persistence_ignore_mapload ? "persistence mapload disabled" : "persistence mapload enabled"
features += CONFIG_GET(flag/persistence_ignore_mapload) ? "persistence mapload disabled" : "persistence mapload enabled" // CHOMPEdit
if (config && config.allow_vote_mode)
if (config && CONFIG_GET(flag/allow_vote_mode)) // CHOMPEdit
features += "vote"
if (config && config.allow_ai)
if (config && CONFIG_GET(flag/allow_ai)) // CHOMPEdit
features += "AI allowed"
var/n = 0
@@ -613,8 +638,8 @@ var/world_topic_spam_protect_time = world.timeofday
features += "~[n] player"
if (config && config.hostedby)
features += "hosted by <b>[config.hostedby]</b>"
if (config && CONFIG_GET(string/hostedby)) // CHOMPEdit
features += "hosted by <b>[CONFIG_GET(string/hostedby)]</b>" // CHOMPEdit
if (features)
s += ": [jointext(features, ", ")]"
@@ -628,7 +653,7 @@ var/failed_db_connections = 0
var/failed_old_db_connections = 0
/hook/startup/proc/connectDB()
if(!config.sql_enabled)
if(!CONFIG_GET(flag/sql_enabled)) //CHOMPEdit
to_world_log("SQL connection disabled in config.")
else if(establish_db_connection())//CHOMPEdit Begin
to_world_log("Feedback database connection established.")
@@ -691,7 +716,7 @@ var/failed_old_db_connections = 0
/hook/startup/proc/connectOldDB()
if(!config.sql_enabled)
if(!CONFIG_GET(flag/sql_enabled)) // CHOMPEdit
to_world_log("SQL connection disabled in config.")
else if(establish_old_db_connection()) //CHOMPEdit Begin
to_world_log("SQL database connection established.")
@@ -793,10 +818,10 @@ var/failed_old_db_connections = 0
/proc/get_world_url()
. = "byond://"
if(config.serverurl)
. += config.serverurl
else if(config.server)
. += config.server
if(CONFIG_GET(string/serverurl)) // CHOMPEdit
. += CONFIG_GET(string/serverurl) // CHOMPEdit
else if(CONFIG_GET(string/server)) // CHOMPEdit
. += CONFIG_GET(string/server) // CHOMPEdit
else
. += "[world.address]:[world.port]"

View File

@@ -88,7 +88,7 @@ var/list/reverse_dir = list( // reverse_dir[dir] = reverse of dir
)
var/global/const/SQRT_TWO = 1.41421356237
var/datum/configuration/config = null
// var/datum/configuration/config = null // CHOMPEdit
var/list/combatlog = list()
var/list/IClog = list()

View File

@@ -24,8 +24,8 @@ var/global/datum/global_init/init = new ()
debug_log << "[log_end]\n[log_end]\nStarting up. [time_stamp()][log_end]\n---------------------[log_end]"
*/ //VOREStation Removal End
decls_repository = new()
load_configuration()
makeDatumRefLists()
//load_configuration() // CHOMP Edit
//makeDatumRefLists() // CHOMP Edit
initialize_integrated_circuits_list()

View File

@@ -5,21 +5,21 @@
return ..()
//Guest Checking
if(!config.guests_allowed && IsGuestKey(key))
if(!CONFIG_GET(flag/guests_allowed) && IsGuestKey(key)) // CHOMPEdit
log_adminwarn("Failed Login: [key] - Guests not allowed")
message_admins(span_blue("Failed Login: [key] - Guests not allowed"))
return list("reason"="guest", "desc"="\nReason: Guests not allowed. Please sign in with a byond account.")
//check if the IP address is a known TOR node
if(config && config.ToRban && ToRban_isbanned(address))
if(config && CONFIG_GET(flag/ToRban) && ToRban_isbanned(address)) // CHOMPEdit
log_adminwarn("Failed Login: [src] - Banned: ToR")
message_admins(span_blue("Failed Login: [src] - Banned: ToR"))
//ban their computer_id and ckey for posterity
AddBan(ckey(key), computer_id, "Use of ToR", "Automated Ban", 0, 0)
return list("reason"="Using ToR", "desc"="\nReason: The network you are using to connect has been banned.\nIf you believe this is a mistake, please request help at [config.banappeals]")
return list("reason"="Using ToR", "desc"="\nReason: The network you are using to connect has been banned.\nIf you believe this is a mistake, please request help at [CONFIG_GET(string/banappeals)]") // CHOMPEdit
if(config.ban_legacy_system)
if(CONFIG_GET(flag/ban_legacy_system)) // CHOMPEdit
//Ban Checking
. = CheckBan( ckey(key), computer_id, address )

View File

@@ -10,8 +10,8 @@ var/savefile/Banlist
. = list()
var/appeal
if(config && config.banappeals)
appeal = "\nFor more information on your ban, or to appeal, head to <a href='[config.banappeals]'>[config.banappeals]</a>"
if(config && CONFIG_GET(string/banappeals)) // CHOMPEdit
appeal = "\nFor more information on your ban, or to appeal, head to <a href='[CONFIG_GET(string/banappeals)]'>[CONFIG_GET(string/banappeals)]</a>" // CHOMPEdit
Banlist.cd = "/base"
if( "[ckey][id]" in Banlist.dir )
Banlist.cd = "[ckey][id]"

Some files were not shown because too many files have changed in this diff Show More