mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 23:53:47 +01:00
Merge pull request #15980 from AffectedArc07/toml-config
[READY] Converts configs to use TOML + Configuration refactor
This commit is contained in:
@@ -28,24 +28,24 @@
|
||||
admin = 1
|
||||
|
||||
//Guest Checking
|
||||
if(!GLOB.guests_allowed && IsGuestKey(key))
|
||||
if(GLOB.configuration.general.guest_ban && IsGuestKey(key))
|
||||
log_adminwarn("Failed Login: [key] [computer_id] [address] - Guests not allowed")
|
||||
// message_admins("<span class='notice'>Failed Login: [key] - Guests not allowed</span>")
|
||||
INVOKE_ASYNC(GLOBAL_PROC, .proc/log_connection, ckey(key), address, computer_id, CONNECTION_TYPE_DROPPED_BANNED)
|
||||
return list("reason"="guest", "desc"="\nReason: Guests not allowed. Please sign in with a BYOND account.")
|
||||
|
||||
//check if the IP address is a known proxy/vpn, and the user is not whitelisted
|
||||
if(check_ipintel && config.ipintel_email && config.ipintel_whitelist && ipintel_is_banned(key, address))
|
||||
if(check_ipintel && GLOB.configuration.ipintel.contact_email && GLOB.configuration.ipintel.whitelist_mode && ipintel_is_banned(key, address))
|
||||
log_adminwarn("Failed Login: [key] [computer_id] [address] - Proxy/VPN")
|
||||
var/mistakemessage = ""
|
||||
if(config.banappeals)
|
||||
mistakemessage = "\nIf you have to use one, request whitelisting at: [config.banappeals]"
|
||||
if(GLOB.configuration.url.banappeals_url)
|
||||
mistakemessage = "\nIf you have to use one, request whitelisting at: [GLOB.configuration.url.banappeals_url]"
|
||||
INVOKE_ASYNC(GLOBAL_PROC, .proc/log_connection, ckey(key), address, computer_id, CONNECTION_TYPE_DROPPED_IPINTEL)
|
||||
return list("reason"="using proxy or vpn", "desc"="\nReason: Proxies/VPNs are not allowed here. [mistakemessage]")
|
||||
|
||||
|
||||
// If 2FA is enabled, makes sure they were authed within the last minute
|
||||
if(check_2fa && config._2fa_auth_host)
|
||||
if(check_2fa && GLOB.configuration.system._2fa_auth_host)
|
||||
// First see if they exist at all
|
||||
var/datum/db_query/check_query = SSdbcore.NewQuery("SELECT 2fa_status, ip FROM [format_table_name("player")] WHERE ckey=:ckey", list("ckey" = ckey(key)))
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
qdel(verify_query)
|
||||
|
||||
if(config.ban_legacy_system)
|
||||
if(!GLOB.configuration.general.use_database_bans)
|
||||
//Ban Checking
|
||||
. = CheckBan(ckey(key), computer_id, address)
|
||||
if(.)
|
||||
@@ -159,8 +159,8 @@
|
||||
expires = " The ban is for [duration] minutes and expires on [expiration] (server time)."
|
||||
else
|
||||
var/appealmessage = ""
|
||||
if(config.banappeals)
|
||||
appealmessage = " You may appeal it at <a href='[config.banappeals]'>[config.banappeals]</a>."
|
||||
if(GLOB.configuration.url.banappeals_url)
|
||||
appealmessage = " You may appeal it at <a href='[GLOB.configuration.url.banappeals_url]'>[GLOB.configuration.url.banappeals_url]</a>."
|
||||
expires = " This ban does not expire automatically and must be appealed.[appealmessage]"
|
||||
|
||||
var/desc = "\nReason: You, or another user of this computer or connection ([pckey]) is banned from playing here. The ban reason is:\n[reason]\nThis ban was applied by [ackey] on [bantime][ban_round_id ? " (Round [ban_round_id])" : ""].[expires]"
|
||||
|
||||
@@ -10,8 +10,8 @@ GLOBAL_PROTECT(banlist_savefile) // Obvious reasons
|
||||
|
||||
. = 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(GLOB.configuration.url.banappeals_url)
|
||||
appeal = "\nFor more information on your ban, or to appeal, head to <a href='[GLOB.configuration.url.banappeals_url]'>[GLOB.configuration.url.banappeals_url]</a>"
|
||||
GLOB.banlist_savefile.cd = "/base"
|
||||
if( "[ckey][id]" in GLOB.banlist_savefile.dir )
|
||||
GLOB.banlist_savefile.cd = "[ckey][id]"
|
||||
|
||||
+22
-22
@@ -91,8 +91,8 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
else
|
||||
body += "\[[M.client.holder ? M.client.holder.rank : "Player"]\] "
|
||||
body += "\[<A href='?_src_=holder;getplaytimewindow=[M.UID()]'>" + M.client.get_exp_type(EXP_TYPE_CREW) + " as [EXP_TYPE_CREW]</a>\]"
|
||||
body += "<br>BYOND account registration date: [M.client.byondacc_date || "ERROR"] [M.client.byondacc_age <= config.byond_account_age_threshold ? "<b>" : ""]([M.client.byondacc_age] days old)[M.client.byondacc_age <= config.byond_account_age_threshold ? "</b>" : ""]"
|
||||
body += "<br>Global Ban DB Lookup: [config.centcom_ban_db_url ? "<a href='?_src_=holder;open_ccbdb=[M.client.ckey]'>Lookup</a>" : "<i>Disabled</i>"]"
|
||||
body += "<br>BYOND account registration date: [M.client.byondacc_date || "ERROR"] [M.client.byondacc_age <= GLOB.configuration.general.byond_account_age_threshold ? "<b>" : ""]([M.client.byondacc_age] days old)[M.client.byondacc_age <= GLOB.configuration.general.byond_account_age_threshold ? "</b>" : ""]"
|
||||
body += "<br>Global Ban DB Lookup: [GLOB.configuration.url.centcom_ban_db_url ? "<a href='?_src_=holder;open_ccbdb=[M.client.ckey]'>Lookup</a>" : "<i>Disabled</i>"]"
|
||||
|
||||
body += "<br>"
|
||||
|
||||
@@ -127,7 +127,7 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
body += "<A href='?_src_=holder;appearanceban=[M.UID()];dbbanaddckey=[M.ckey]'>Appearance Ban</A> | "
|
||||
body += "<A href='?_src_=holder;shownoteckey=[M.ckey]'>Notes</A> | "
|
||||
body += "<A href='?_src_=holder;viewkarma=[M.ckey]'>View Karma</A> | "
|
||||
if(config.forum_playerinfo_url)
|
||||
if(GLOB.configuration.url.forum_playerinfo_url)
|
||||
body += "<A href='?_src_=holder;webtools=[M.ckey]'>WebInfo</A> | "
|
||||
if(M.client)
|
||||
if(check_watchlist(M.client.ckey))
|
||||
@@ -462,8 +462,8 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
config.looc_allowed = !(config.looc_allowed)
|
||||
if(config.looc_allowed)
|
||||
GLOB.looc_enabled = !(GLOB.looc_enabled)
|
||||
if(GLOB.looc_enabled)
|
||||
to_chat(world, "<B>The LOOC channel has been globally enabled!</B>")
|
||||
else
|
||||
to_chat(world, "<B>The LOOC channel has been globally disabled!</B>")
|
||||
@@ -478,8 +478,8 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
config.dsay_allowed = !(config.dsay_allowed)
|
||||
if(config.dsay_allowed)
|
||||
GLOB.dsay_enabled = !(GLOB.dsay_enabled)
|
||||
if(GLOB.dsay_enabled)
|
||||
to_chat(world, "<B>Deadchat has been globally enabled!</B>")
|
||||
else
|
||||
to_chat(world, "<B>Deadchat has been globally disabled!</B>")
|
||||
@@ -495,7 +495,7 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
config.dooc_allowed = !( config.dooc_allowed )
|
||||
GLOB.dooc_enabled = !(GLOB.dooc_enabled)
|
||||
log_admin("[key_name(usr)] toggled Dead OOC.")
|
||||
message_admins("[key_name_admin(usr)] toggled Dead OOC.", 1)
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Dead OOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -508,7 +508,7 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
config.disable_ooc_emoji = !(config.disable_ooc_emoji)
|
||||
GLOB.configuration.general.enable_ooc_emoji = !(GLOB.configuration.general.enable_ooc_emoji)
|
||||
log_admin("[key_name(usr)] toggled OOC Emoji.")
|
||||
message_admins("[key_name_admin(usr)] toggled OOC Emoji.", 1)
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle OOC Emoji")
|
||||
@@ -525,7 +525,7 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
alert("Unable to start the game as it is not set up.")
|
||||
return
|
||||
|
||||
if(config.start_now_confirmation)
|
||||
if(GLOB.configuration.general.start_now_confirmation)
|
||||
if(alert(usr, "This is a live server. Are you sure you want to start now?", "Start game", "Yes", "No") != "Yes")
|
||||
return
|
||||
|
||||
@@ -568,8 +568,9 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
if(!check_rights(R_EVENT))
|
||||
return
|
||||
|
||||
config.allow_ai = !( config.allow_ai )
|
||||
if(!( config.allow_ai ))
|
||||
|
||||
GLOB.configuration.jobs.allow_ai = !(GLOB.configuration.jobs.allow_ai)
|
||||
if(!GLOB.configuration.jobs.allow_ai)
|
||||
to_chat(world, "<B>The AI job is no longer chooseable.</B>")
|
||||
else
|
||||
to_chat(world, "<B>The AI job is chooseable now.</B>")
|
||||
@@ -586,13 +587,13 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
|
||||
GLOB.abandon_allowed = !( GLOB.abandon_allowed )
|
||||
if(GLOB.abandon_allowed)
|
||||
GLOB.configuration.general.respawn_enabled = !(GLOB.configuration.general.respawn_enabled)
|
||||
if(GLOB.configuration.general.respawn_enabled)
|
||||
to_chat(world, "<B>You may now respawn.</B>")
|
||||
else
|
||||
to_chat(world, "<B>You may no longer respawn :(</B>")
|
||||
message_admins("[key_name_admin(usr)] toggled respawn to [GLOB.abandon_allowed ? "On" : "Off"].", 1)
|
||||
log_admin("[key_name(usr)] toggled respawn to [GLOB.abandon_allowed ? "On" : "Off"].")
|
||||
to_chat(world, "<B>You may no longer respawn</B>")
|
||||
message_admins("[key_name_admin(usr)] toggled respawn to [GLOB.configuration.general.respawn_enabled ? "On" : "Off"].", 1)
|
||||
log_admin("[key_name(usr)] toggled respawn to [GLOB.configuration.general.respawn_enabled ? "On" : "Off"].")
|
||||
world.update_status()
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Respawn") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -724,13 +725,13 @@ GLOBAL_VAR_INIT(nologevent, 0)
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
|
||||
GLOB.guests_allowed = !( GLOB.guests_allowed )
|
||||
if(!( GLOB.guests_allowed ))
|
||||
GLOB.configuration.general.guest_ban = !(GLOB.configuration.general.guest_ban)
|
||||
if(GLOB.configuration.general.guest_ban)
|
||||
to_chat(world, "<B>Guests may no longer enter the game.</B>")
|
||||
else
|
||||
to_chat(world, "<B>Guests may now enter the game.</B>")
|
||||
log_admin("[key_name(usr)] toggled guests game entering [GLOB.guests_allowed ? "" : "dis"]allowed.")
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] toggled guests game entering [GLOB.guests_allowed ? "" : "dis"]allowed.</span>", 1)
|
||||
log_admin("[key_name(usr)] toggled guests game entering [GLOB.configuration?.general.guest_ban ? "dis" : ""]allowed.")
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] toggled guests game entering [GLOB.configuration?.general.guest_ban ? "dis" : ""]allowed.</span>", 1)
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Guests") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/output_ai_laws()
|
||||
@@ -917,4 +918,3 @@ GLOBAL_VAR_INIT(gamma_ship_location, 1) // 0 = station , 1 = space
|
||||
continue
|
||||
result[1]++
|
||||
return result
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
watchlist_show()
|
||||
|
||||
if("hrefs") //persistant logs and stuff
|
||||
if(config && config.log_hrefs)
|
||||
if(GLOB.configuration.logging.href_logging)
|
||||
if(GLOB.world_href_log)
|
||||
src << browse(file(GLOB.world_href_log), "window=investigate[subject];size=800x300")
|
||||
else
|
||||
|
||||
@@ -7,25 +7,15 @@ GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
|
||||
|
||||
var/previous_rights = 0
|
||||
|
||||
//load text from file
|
||||
var/list/Lines = file2list("config/admin_ranks.txt")
|
||||
|
||||
//process each line seperately
|
||||
for(var/line in Lines)
|
||||
if(!length(line)) continue
|
||||
if(copytext(line,1,2) == "#") continue
|
||||
|
||||
var/list/List = splittext(line,"+")
|
||||
if(!List.len) continue
|
||||
|
||||
var/rank = ckeyEx(List[1])
|
||||
switch(rank)
|
||||
if(null,"") continue
|
||||
if("Removed") continue //Reserved
|
||||
// Process each rank set seperately
|
||||
// key: rank name | value: list of rights
|
||||
for(var/rankname in GLOB.configuration.admin.rank_rights_map)
|
||||
var/list/rank_right_tokens = GLOB.configuration.admin.rank_rights_map[rankname]
|
||||
|
||||
var/rights = 0
|
||||
for(var/i=2, i<=List.len, i++)
|
||||
switch(ckey(List[i]))
|
||||
for(var/right_token in rank_right_tokens)
|
||||
var/token = lowertext(splittext(right_token, "+")[2])
|
||||
switch(token)
|
||||
if("@","prev") rights |= previous_rights
|
||||
if("buildmode","build") rights |= R_BUILDMODE
|
||||
if("admin") rights |= R_ADMIN
|
||||
@@ -46,7 +36,7 @@ GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
|
||||
if("proccall") rights |= R_PROCCALL
|
||||
if("viewruntimes") rights |= R_VIEWRUNTIMES
|
||||
|
||||
GLOB.admin_ranks[rank] = rights
|
||||
GLOB.admin_ranks[rankname] = rights
|
||||
previous_rights = rights
|
||||
|
||||
#ifdef TESTING
|
||||
@@ -73,29 +63,13 @@ GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
|
||||
for(var/A in world.GetConfig("admin"))
|
||||
world.SetConfig("APP/admin", A, null)
|
||||
|
||||
if(config.admin_legacy_system)
|
||||
if(!GLOB.configuration.admin.use_database_admins)
|
||||
load_admin_ranks()
|
||||
|
||||
//load text from file
|
||||
var/list/Lines = file2list("config/admins.txt")
|
||||
|
||||
//process each line seperately
|
||||
for(var/line in Lines)
|
||||
if(!length(line)) continue
|
||||
if(copytext(line,1,2) == "#") continue
|
||||
|
||||
//Split the line at every "-"
|
||||
var/list/List = splittext(line, "-")
|
||||
if(!List.len) continue
|
||||
|
||||
//ckey is before the first "-"
|
||||
var/ckey = ckey(List[1])
|
||||
if(!ckey) continue
|
||||
|
||||
//rank follows the first "-"
|
||||
var/rank = ""
|
||||
if(List.len >= 2)
|
||||
rank = ckeyEx(List[2])
|
||||
for(var/iterator_key in GLOB.configuration.admin.ckey_rank_map)
|
||||
var/ckey = ckey(iterator_key) // Snip out formatting
|
||||
var/rank = GLOB.configuration.admin.ckey_rank_map[iterator_key]
|
||||
|
||||
//load permissions associated with this rank
|
||||
var/rights = GLOB.admin_ranks[rank]
|
||||
@@ -113,7 +87,7 @@ GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
|
||||
//The current admin system uses SQL
|
||||
if(!SSdbcore.IsConnected())
|
||||
log_world("Failed to connect to database in load_admins(). Reverting to legacy system.")
|
||||
config.admin_legacy_system = 1
|
||||
GLOB.configuration.admin.use_database_admins = FALSE
|
||||
load_admins()
|
||||
return
|
||||
|
||||
@@ -141,7 +115,7 @@ GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
|
||||
|
||||
if(!GLOB.admin_datums)
|
||||
log_world("The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system.")
|
||||
config.admin_legacy_system = 1
|
||||
GLOB.configuration.admin.use_database_admins = FALSE
|
||||
load_admins()
|
||||
return
|
||||
|
||||
|
||||
@@ -137,7 +137,6 @@ GLOBAL_LIST_INIT(admin_verbs_server, list(
|
||||
/client/proc/toggle_antagHUD_restrictions,
|
||||
/client/proc/set_ooc,
|
||||
/client/proc/reset_ooc,
|
||||
/client/proc/toggledrones,
|
||||
/client/proc/set_next_map
|
||||
))
|
||||
GLOBAL_LIST_INIT(admin_verbs_debug, list(
|
||||
@@ -403,7 +402,7 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list(
|
||||
if(!check_rights(R_BAN))
|
||||
return
|
||||
|
||||
if(config.ban_legacy_system)
|
||||
if(!GLOB.configuration.general.use_database_bans)
|
||||
holder.unbanpanel()
|
||||
else
|
||||
holder.DB_ban_panel()
|
||||
@@ -679,21 +678,13 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list(
|
||||
|
||||
var/datum/admins/D = GLOB.admin_datums[ckey]
|
||||
var/rank = null
|
||||
if(config.admin_legacy_system)
|
||||
//load text from file
|
||||
var/list/Lines = file2list("config/admins.txt")
|
||||
for(var/line in Lines)
|
||||
if(findtext(line, "#")) // Skip comments
|
||||
if(!GLOB.configuration.admin.use_database_admins)
|
||||
for(var/iterator_key in GLOB.configuration.admin.ckey_rank_map)
|
||||
var/_ckey = ckey(iterator_key) // Snip out formatting
|
||||
if(ckey != _ckey)
|
||||
continue
|
||||
|
||||
var/list/splitline = splittext(line, " - ")
|
||||
if(length(splitline) != 2) // Always 'ckey - rank'
|
||||
continue
|
||||
if(lowertext(splitline[1]) == ckey)
|
||||
rank = ckeyEx(splitline[2])
|
||||
break
|
||||
continue
|
||||
|
||||
rank = GLOB.configuration.admin.ckey_rank_map[iterator_key]
|
||||
break
|
||||
else
|
||||
if(!SSdbcore.IsConnected())
|
||||
to_chat(src, "Warning, MYSQL database is not connected.")
|
||||
@@ -713,7 +704,7 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list(
|
||||
|
||||
qdel(rank_read)
|
||||
if(!D)
|
||||
if(config.admin_legacy_system)
|
||||
if(!GLOB.configuration.admin.use_database_admins)
|
||||
if(GLOB.admin_ranks[rank] == null)
|
||||
error("Error while re-adminning [src], admin rank ([rank]) does not exist.")
|
||||
to_chat(src, "Error while re-adminning, admin rank ([rank]) does not exist.")
|
||||
@@ -773,13 +764,13 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list(
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
|
||||
if(config)
|
||||
if(config.log_hrefs)
|
||||
config.log_hrefs = 0
|
||||
to_chat(src, "<b>Stopped logging hrefs</b>")
|
||||
else
|
||||
config.log_hrefs = 1
|
||||
to_chat(src, "<b>Started logging hrefs</b>")
|
||||
// Why would we ever turn this off?
|
||||
if(GLOB.configuration.logging.href_logging)
|
||||
GLOB.configuration.logging.href_logging = FALSE
|
||||
to_chat(src, "<b>Stopped logging hrefs</b>")
|
||||
else
|
||||
GLOB.configuration.logging.href_logging = TRUE
|
||||
to_chat(src, "<b>Started logging hrefs</b>")
|
||||
|
||||
/client/proc/check_ai_laws()
|
||||
set name = "Check AI Laws"
|
||||
@@ -956,17 +947,6 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list(
|
||||
else
|
||||
to_chat(usr, "You now will get admin ticket messages.")
|
||||
|
||||
/client/proc/toggledrones()
|
||||
set name = "Toggle Maintenance Drones"
|
||||
set category = "Server"
|
||||
|
||||
if(!check_rights(R_SERVER))
|
||||
return
|
||||
|
||||
config.allow_drone_spawn = !(config.allow_drone_spawn)
|
||||
log_admin("[key_name(usr)] has [config.allow_drone_spawn ? "enabled" : "disabled"] maintenance drones.")
|
||||
message_admins("[key_name_admin(usr)] has [config.allow_drone_spawn ? "enabled" : "disabled"] maintenance drones.")
|
||||
|
||||
/client/proc/toggledebuglogs()
|
||||
set name = "Toggle Debug Log Messages"
|
||||
set category = "Preferences"
|
||||
|
||||
@@ -40,8 +40,9 @@ DEBUG
|
||||
appearance_loadbanfile()
|
||||
*/
|
||||
// AA 2020-11-25: This entire proc isnt even called. What the actual fuck.
|
||||
// AA 2021-05-23: This entire proc STILL isnt even called. I am going to screan.
|
||||
/proc/appearance_loadbanfile()
|
||||
if(config.ban_legacy_system)
|
||||
if(!GLOB.configuration.general.use_database_bans)
|
||||
var/savefile/S=new("data/appearance_full.ban")
|
||||
S["keys[0]"] >> GLOB.appearance_keylist
|
||||
log_admin("Loading appearance_rank")
|
||||
@@ -53,7 +54,7 @@ DEBUG
|
||||
else
|
||||
if(!SSdbcore.IsConnected())
|
||||
log_world("Database connection failed. Reverting to the legacy ban system.")
|
||||
config.ban_legacy_system = 1
|
||||
GLOB.configuration.general.use_database_bans = FALSE
|
||||
appearance_loadbanfile()
|
||||
return
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
return
|
||||
GLOB.jobban_keylist.Add(text("[M.ckey] - [rank] ## [reason]"))
|
||||
jobban_assoc_insert(M.ckey, rank, reason)
|
||||
if(config.ban_legacy_system)
|
||||
if(!GLOB.configuration.general.use_database_bans)
|
||||
jobban_savebanfile()
|
||||
|
||||
/proc/jobban_client_fullban(ckey, rank)
|
||||
@@ -25,7 +25,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
return
|
||||
GLOB.jobban_keylist.Add(text("[ckey] - [rank]"))
|
||||
jobban_assoc_insert(ckey, rank)
|
||||
if(config.ban_legacy_system)
|
||||
if(!GLOB.configuration.general.use_database_bans)
|
||||
jobban_savebanfile()
|
||||
|
||||
//returns a reason if M is banned from rank, returns 0 otherwise
|
||||
@@ -33,7 +33,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
if(!M || !rank)
|
||||
return 0
|
||||
|
||||
if(config.guest_jobban && guest_jobbans(rank))
|
||||
if(GLOB.configuration.jobs.guest_job_ban && guest_jobbans(rank))
|
||||
if(IsGuestKey(M.key))
|
||||
return "Guest Job-ban"
|
||||
|
||||
@@ -46,7 +46,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
if(!ckey || !rank)
|
||||
return null
|
||||
|
||||
if(config.guest_jobban && guest_jobbans(rank))
|
||||
if(GLOB.configuration.jobs.guest_job_ban && guest_jobbans(rank))
|
||||
if(IsGuestKey(ckey))
|
||||
return "Guest Job-ban"
|
||||
|
||||
@@ -56,7 +56,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
return null
|
||||
|
||||
/proc/jobban_loadbanfile()
|
||||
if(config.ban_legacy_system)
|
||||
if(!GLOB.configuration.general.use_database_bans)
|
||||
var/savefile/S=new("data/job_full.ban")
|
||||
S["keys[0]"] >> GLOB.jobban_keylist
|
||||
log_admin("Loading jobban_rank")
|
||||
@@ -74,7 +74,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
else
|
||||
if(!SSdbcore.IsConnected())
|
||||
log_world("Database connection failed. Reverting to the legacy ban system.")
|
||||
config.ban_legacy_system = 1
|
||||
GLOB.configuration.general.use_database_bans = FALSE
|
||||
jobban_loadbanfile()
|
||||
return
|
||||
|
||||
@@ -132,7 +132,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
else
|
||||
log_runtime(EXCEPTION("Failed to remove malformed job ban from associative list: [X]"))
|
||||
GLOB.jobban_keylist.Remove(GLOB.jobban_keylist[i])
|
||||
if(config.ban_legacy_system)
|
||||
if(!GLOB.configuration.general.use_database_bans)
|
||||
jobban_savebanfile()
|
||||
return 1
|
||||
return 0
|
||||
@@ -144,7 +144,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
|
||||
if(!client || !ckey)
|
||||
return
|
||||
if(config.ban_legacy_system)
|
||||
if(!GLOB.configuration.general.use_database_bans)
|
||||
//using the legacy .txt ban system
|
||||
to_chat(src, "The server is using the legacy ban system. Ask an administrator for help!")
|
||||
|
||||
@@ -182,7 +182,7 @@ GLOBAL_DATUM_INIT(jobban_regex, /regex, regex("(\[\\S]+) - (\[^#]+\[^# ])(?: ##
|
||||
qdel(select_query)
|
||||
|
||||
if(is_actually_banned)
|
||||
if(config.banappeals)
|
||||
to_chat(src, "<span class='warning'>You can appeal the bans at: [config.banappeals]</span>")
|
||||
if(GLOB.configuration.url.banappeals_url)
|
||||
to_chat(src, "<span class='warning'>You can appeal the bans at: [GLOB.configuration.url.banappeals_url]</span>")
|
||||
else
|
||||
to_chat(src, "<span class='warning'>You have no active jobbans!</span>")
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
/datum/admins/proc/create_ccbdb_lookup(ckey)
|
||||
// Bail if disabled
|
||||
if(!config.centcom_ban_db_url)
|
||||
if(!GLOB.configuration.url.centcom_ban_db_url)
|
||||
to_chat(usr, "<span class='warning'>The CentCom Ban DB lookup is disabled. Please inform a maintainer or server host.</span>")
|
||||
return
|
||||
// Bail if no ckey is supplied
|
||||
@@ -22,7 +22,7 @@
|
||||
return
|
||||
|
||||
var/datum/callback/cb = CALLBACK(src, /datum/admins/.proc/ccbdb_lookup_callback, usr, ckey)
|
||||
SShttp.create_async_request(RUSTG_HTTP_METHOD_GET, "[config.centcom_ban_db_url][ckey]", proc_callback=cb)
|
||||
SShttp.create_async_request(RUSTG_HTTP_METHOD_GET, "[GLOB.configuration.url.centcom_ban_db_url][ckey]", proc_callback=cb)
|
||||
|
||||
/**
|
||||
* CCBDB Lookup Callback
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// AA TODO: Make these procs part of SSipintel
|
||||
/datum/ipintel
|
||||
var/ip
|
||||
var/intel = 0
|
||||
@@ -14,18 +15,18 @@
|
||||
. = FALSE
|
||||
if(intel < 0)
|
||||
return
|
||||
if(intel <= config.ipintel_rating_bad)
|
||||
if(world.realtime < cacherealtime + (config.ipintel_save_good HOURS))
|
||||
if(intel <= GLOB.configuration.ipintel.bad_rating)
|
||||
if(world.realtime < cacherealtime + (GLOB.configuration.ipintel.hours_save_good HOURS))
|
||||
return TRUE
|
||||
else
|
||||
if(world.realtime < cacherealtime + (config.ipintel_save_bad HOURS))
|
||||
if(world.realtime < cacherealtime + (GLOB.configuration.ipintel.hours_save_bad HOURS))
|
||||
return TRUE
|
||||
|
||||
/proc/get_ip_intel(ip, bypasscache = FALSE, updatecache = TRUE)
|
||||
var/datum/ipintel/res = new()
|
||||
res.ip = ip
|
||||
. = res
|
||||
if(!ip || !config.ipintel_email || !SSipintel.enabled)
|
||||
if(!ip || !GLOB.configuration.ipintel.contact_email || !GLOB.configuration.ipintel.enabled || !SSipintel.enabled)
|
||||
return
|
||||
if(!bypasscache)
|
||||
var/datum/ipintel/cachedintel = SSipintel.cache[ip]
|
||||
@@ -50,9 +51,9 @@
|
||||
))
|
||||
"}, list(
|
||||
"ip" = ip,
|
||||
"rating_bad" = config.ipintel_rating_bad,
|
||||
"save_good" = config.ipintel_save_good,
|
||||
"save_bad" = config.ipintel_save_bad,
|
||||
"rating_bad" = GLOB.configuration.ipintel.bad_rating,
|
||||
"save_good" = GLOB.configuration.ipintel.hours_save_good,
|
||||
"save_bad" = GLOB.configuration.ipintel.hours_save_bad,
|
||||
))
|
||||
if(!query_get_ip_intel.warn_execute())
|
||||
qdel(query_get_ip_intel)
|
||||
@@ -93,7 +94,7 @@
|
||||
return
|
||||
|
||||
// Do not refactor this to use SShttp, because that requires the subsystem to be firing for requests to be made, and this will be triggered before the MC has finished loading
|
||||
var/list/http[] = world.Export("http://[config.ipintel_domain]/check.php?ip=[ip]&contact=[config.ipintel_email]&format=json&flags=b")
|
||||
var/list/http[] = world.Export("http://[GLOB.configuration.ipintel.ipintel_domain]/check.php?ip=[ip]&contact=[GLOB.configuration.ipintel.contact_email]&format=json&flags=b")
|
||||
|
||||
if(http)
|
||||
var/status = text2num(http["STATUS"])
|
||||
@@ -146,9 +147,11 @@
|
||||
|
||||
|
||||
/proc/ipintel_is_banned(t_ckey, t_ip)
|
||||
if(!config.ipintel_email)
|
||||
if(!GLOB.configuration.ipintel.contact_email)
|
||||
return FALSE
|
||||
if(!config.ipintel_whitelist)
|
||||
if(!GLOB.configuration.ipintel.enabled)
|
||||
return FALSE
|
||||
if(!GLOB.configuration.ipintel.whitelist_mode)
|
||||
return FALSE
|
||||
if(!SSdbcore.IsConnected())
|
||||
return FALSE
|
||||
@@ -159,11 +162,11 @@
|
||||
return TRUE
|
||||
|
||||
/proc/ipintel_badip_check(target_ip)
|
||||
var/rating_bad = config.ipintel_rating_bad
|
||||
var/rating_bad = GLOB.configuration.ipintel.bad_rating
|
||||
if(!rating_bad)
|
||||
log_debug("ipintel_badip_check reports misconfigured rating_bad directive")
|
||||
return FALSE
|
||||
var/valid_hours = config.ipintel_save_bad
|
||||
var/valid_hours = GLOB.configuration.ipintel.hours_save_bad
|
||||
if(!valid_hours)
|
||||
log_debug("ipintel_badip_check reports misconfigured ipintel_save_bad directive")
|
||||
return FALSE
|
||||
@@ -187,7 +190,7 @@
|
||||
return TRUE
|
||||
|
||||
/proc/vpn_whitelist_check(target_ckey)
|
||||
if(!config.ipintel_whitelist)
|
||||
if(!GLOB.configuration.ipintel.whitelist_mode)
|
||||
return FALSE
|
||||
var/datum/db_query/query_whitelist_check = SSdbcore.NewQuery("SELECT * FROM [format_table_name("vpn_whitelist")] WHERE ckey=:ckey", list(
|
||||
"ckey" = target_ckey
|
||||
|
||||
@@ -52,7 +52,8 @@
|
||||
usr << browse(output,"window=editrights;size=600x500")
|
||||
|
||||
/datum/admins/proc/log_admin_rank_modification(adm_ckey, new_rank)
|
||||
if(config.admin_legacy_system) return
|
||||
if(!GLOB.configuration.admin.use_database_admins)
|
||||
return
|
||||
|
||||
if(!usr.client)
|
||||
return
|
||||
@@ -140,7 +141,7 @@
|
||||
message_admins("[key_name(usr)] attempted to edit admin ranks via advanced proc-call")
|
||||
log_admin("[key_name(usr)] attempted to edit admin ranks via advanced proc-call")
|
||||
return
|
||||
if(config.admin_legacy_system)
|
||||
if(!GLOB.configuration.admin.use_database_admins)
|
||||
return
|
||||
|
||||
if(!usr.client)
|
||||
|
||||
@@ -54,8 +54,8 @@
|
||||
adminckey = ckey(adminckey)
|
||||
|
||||
if(!server)
|
||||
if(config && config.server_name)
|
||||
server = config.server_name
|
||||
if(GLOB.configuration.general.server_name)
|
||||
server = GLOB.configuration.general.server_name
|
||||
|
||||
// Force cast this to 1/0 incase someone tries to feed bad data
|
||||
automated = !!automated
|
||||
|
||||
+22
-27
@@ -287,19 +287,19 @@
|
||||
if(null,"") return
|
||||
if("*New Rank*")
|
||||
new_rank = input("Please input a new rank", "New custom rank", null, null) as null|text
|
||||
if(config.admin_legacy_system)
|
||||
if(!GLOB.configuration.admin.use_database_admins)
|
||||
new_rank = ckeyEx(new_rank)
|
||||
if(!new_rank)
|
||||
to_chat(usr, "<font color='red'>Error: Topic 'editrights': Invalid rank</font>")
|
||||
return
|
||||
if(config.admin_legacy_system)
|
||||
if(!GLOB.configuration.admin.use_database_admins)
|
||||
if(GLOB.admin_ranks.len)
|
||||
if(new_rank in GLOB.admin_ranks)
|
||||
rights = GLOB.admin_ranks[new_rank] //we typed a rank which already exists, use its rights
|
||||
else
|
||||
GLOB.admin_ranks[new_rank] = 0 //add the new rank to admin_ranks
|
||||
else
|
||||
if(config.admin_legacy_system)
|
||||
if(!GLOB.configuration.admin.use_database_admins)
|
||||
new_rank = ckeyEx(new_rank)
|
||||
rights = GLOB.admin_ranks[new_rank] //we input an existing rank, use its rights
|
||||
|
||||
@@ -538,8 +538,8 @@
|
||||
to_chat(M, "<span class='warning'><big><b>You have been appearance banned by [usr.client.ckey].</b></big></span>")
|
||||
to_chat(M, "<span class='danger'>The reason is: [reason]</span>")
|
||||
to_chat(M, "<span class='warning'>Appearance ban can be lifted only upon request.</span>")
|
||||
if(config.banappeals)
|
||||
to_chat(M, "<span class='warning'>To try to resolve this matter head to [config.banappeals]</span>")
|
||||
if(GLOB.configuration.url.banappeals_url)
|
||||
to_chat(M, "<span class='warning'>To try to resolve this matter head to [GLOB.configuration.url.banappeals_url]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='warning'>No ban appeals URL has been set.</span>")
|
||||
if("No")
|
||||
@@ -877,7 +877,7 @@
|
||||
if(notbannedlist.len) //at least 1 unbanned job exists in joblist so we have stuff to ban.
|
||||
switch(alert("Temporary Ban of [M.ckey]?",,"Yes","No", "Cancel"))
|
||||
if("Yes")
|
||||
if(config.ban_legacy_system)
|
||||
if(!GLOB.configuration.general.use_database_bans)
|
||||
to_chat(usr, "<span class='warning'>Your server is using the legacy banning system, which does not support temporary job bans. Consider upgrading. Aborting ban.</span>")
|
||||
return
|
||||
var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null
|
||||
@@ -928,7 +928,7 @@
|
||||
//Unbanning joblist
|
||||
//all jobs in joblist are banned already OR we didn't give a reason (implying they shouldn't be banned)
|
||||
if(joblist.len) //at least 1 banned job exists in joblist so we have stuff to unban.
|
||||
if(!config.ban_legacy_system)
|
||||
if(GLOB.configuration.general.use_database_bans)
|
||||
to_chat(usr, "<span class='warning'>Unfortunately, database based unbanning cannot be done through this panel</span>")
|
||||
DB_ban_panel(M.ckey)
|
||||
return
|
||||
@@ -1002,8 +1002,8 @@
|
||||
|
||||
else if(href_list["webtools"])
|
||||
var/target_ckey = href_list["webtools"]
|
||||
if(config.forum_playerinfo_url)
|
||||
var/url_to_open = config.forum_playerinfo_url + target_ckey
|
||||
if(GLOB.configuration.url.forum_playerinfo_url)
|
||||
var/url_to_open = "[GLOB.configuration.url.forum_playerinfo_url][target_ckey]"
|
||||
if(alert("Open [url_to_open]",,"Yes","No")=="Yes")
|
||||
usr.client << link(url_to_open)
|
||||
|
||||
@@ -1067,8 +1067,8 @@
|
||||
DB_ban_record(BANTYPE_TEMP, M, mins, reason)
|
||||
if(M.client)
|
||||
M.client.link_forum_account(TRUE)
|
||||
if(config.banappeals)
|
||||
to_chat(M, "<span class='warning'>To try to resolve this matter head to [config.banappeals]</span>")
|
||||
if(GLOB.configuration.url.banappeals_url)
|
||||
to_chat(M, "<span class='warning'>To try to resolve this matter head to [GLOB.configuration.url.banappeals_url]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='warning'>No ban appeals URL has been set.</span>")
|
||||
log_admin("[key_name(usr)] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.")
|
||||
@@ -1084,8 +1084,8 @@
|
||||
to_chat(M, "<span class='warning'>This ban does not expire automatically and must be appealed.</span>")
|
||||
if(M.client)
|
||||
M.client.link_forum_account(TRUE)
|
||||
if(config.banappeals)
|
||||
to_chat(M, "<span class='warning'>To try to resolve this matter head to [config.banappeals]</span>")
|
||||
if(GLOB.configuration.url.banappeals_url)
|
||||
to_chat(M, "<span class='warning'>To try to resolve this matter head to [GLOB.configuration.url.banappeals_url]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='warning'>No ban appeals URL has been set.</span>")
|
||||
log_admin("[key_name(usr)] has banned [M.ckey].\nReason: [reason]\nThis ban does not expire automatically and must be appealed.")
|
||||
@@ -1163,8 +1163,8 @@
|
||||
if(SSticker && SSticker.mode)
|
||||
return alert(usr, "The game has already started.", null, null, null, null)
|
||||
var/dat = {"<b>What mode do you wish to play?</b><hr>"}
|
||||
for(var/mode in config.modes)
|
||||
dat += {"<A href='?src=[UID()];c_mode2=[mode]'>[config.mode_names[mode]]</A><br>"}
|
||||
for(var/mode in GLOB.configuration.gamemode.gamemodes)
|
||||
dat += {"<A href='?src=[UID()];c_mode2=[mode]'>[GLOB.configuration.gamemode.gamemode_names[mode]]</A><br>"}
|
||||
dat += {"<A href='?src=[UID()];c_mode2=secret'>Secret</A><br>"}
|
||||
dat += {"<A href='?src=[UID()];c_mode2=random'>Random</A><br>"}
|
||||
dat += {"Now: [GLOB.master_mode]"}
|
||||
@@ -1178,8 +1178,8 @@
|
||||
if(GLOB.master_mode != "secret")
|
||||
return alert(usr, "The game mode has to be secret!", null, null, null, null)
|
||||
var/dat = {"<b>What game mode do you want to force secret to be? Use this if you want to change the game mode, but want the players to believe it's secret. This will only work if the current game mode is secret.</b><hr>"}
|
||||
for(var/mode in config.modes)
|
||||
dat += {"<A href='?src=[UID()];f_secret2=[mode]'>[config.mode_names[mode]]</A><br>"}
|
||||
for(var/mode in GLOB.configuration.gamemode.gamemodes)
|
||||
dat += {"<A href='?src=[UID()];f_secret2=[mode]'>[GLOB.configuration.gamemode.gamemode_names[mode]]</A><br>"}
|
||||
dat += {"<A href='?src=[UID()];f_secret2=secret'>Random (default)</A><br>"}
|
||||
dat += {"Now: [GLOB.secret_force_mode]"}
|
||||
usr << browse(dat, "window=f_secret")
|
||||
@@ -3008,21 +3008,16 @@
|
||||
if("togglebombcap")
|
||||
SSblackbox.record_feedback("tally", "admin_secrets_fun_used", 1, "Bomb Cap")
|
||||
|
||||
var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be between 4 and 128)", "New Bomb Cap", GLOB.max_ex_light_range) as num|null
|
||||
var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be between 4 and 128)", "New Bomb Cap", GLOB.configuration.general.bomb_cap) as num|null
|
||||
if(newBombCap < 4)
|
||||
return
|
||||
if(newBombCap > 128)
|
||||
newBombCap = 128
|
||||
|
||||
GLOB.max_ex_devastation_range = round(newBombCap/4)
|
||||
GLOB.max_ex_heavy_range = round(newBombCap/2)
|
||||
GLOB.max_ex_light_range = newBombCap
|
||||
//I don't know why these are their own variables, but fuck it, they are.
|
||||
GLOB.max_ex_flash_range = newBombCap
|
||||
GLOB.max_ex_flame_range = newBombCap
|
||||
GLOB.configuration.general.bomb_cap = newBombCap
|
||||
|
||||
message_admins("<span class='boldannounce'>[key_name_admin(usr)] changed the bomb cap to [GLOB.max_ex_devastation_range], [GLOB.max_ex_heavy_range], [GLOB.max_ex_light_range]</span>")
|
||||
log_admin("[key_name(usr)] changed the bomb cap to [GLOB.max_ex_devastation_range], [GLOB.max_ex_heavy_range], [GLOB.max_ex_light_range]")
|
||||
message_admins("<span class='boldannounce'>[key_name_admin(usr)] changed the bomb cap to [GLOB.configuration.general.bomb_cap / 4], [GLOB.configuration.general.bomb_cap / 2], [GLOB.configuration.general.bomb_cap]</span>")
|
||||
log_admin("[key_name(usr)] changed the bomb cap to [GLOB.configuration.general.bomb_cap / 4], [GLOB.configuration.general.bomb_cap / 2], [GLOB.configuration.general.bomb_cap]")
|
||||
|
||||
if("flicklights")
|
||||
SSblackbox.record_feedback("tally", "admin_secrets_fun_used", 1, "Flicker Lights")
|
||||
@@ -3299,7 +3294,7 @@
|
||||
var/val = alert(usr, "What do you want to set night shift to? This will override the automatic system until set to automatic again.", "Night Shift", "On", "Off", "Automatic")
|
||||
switch(val)
|
||||
if("Automatic")
|
||||
if(config.enable_night_shifts)
|
||||
if(GLOB.configuration.general.enable_night_shifts)
|
||||
SSnightshift.can_fire = TRUE
|
||||
SSnightshift.fire()
|
||||
else
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
C.adminhelped = 0
|
||||
|
||||
//AdminPM popup for ApocStation and anybody else who wants to use it. Set it with POPUP_ADMIN_PM in config.txt ~Carn
|
||||
if(config.popup_admin_pm)
|
||||
if(GLOB.configuration.general.popup_admin_pm)
|
||||
spawn(0) //so we don't hold the caller proc up
|
||||
var/sender = src
|
||||
var/sendername = key
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
/datum/admins/proc/makeTraitors()
|
||||
var/datum/game_mode/traitor/temp = new
|
||||
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
temp.restricted_jobs += temp.protected_jobs
|
||||
|
||||
var/list/mob/living/carbon/human/candidates = list()
|
||||
@@ -76,7 +76,7 @@
|
||||
/datum/admins/proc/makeChangelings()
|
||||
|
||||
var/datum/game_mode/changeling/temp = new
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
temp.restricted_jobs += temp.protected_jobs
|
||||
|
||||
var/list/mob/living/carbon/human/candidates = list()
|
||||
@@ -106,7 +106,7 @@
|
||||
/datum/admins/proc/makeRevs()
|
||||
|
||||
var/datum/game_mode/revolution/temp = new
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
temp.restricted_jobs += temp.protected_jobs
|
||||
|
||||
var/list/mob/living/carbon/human/candidates = list()
|
||||
@@ -156,7 +156,7 @@
|
||||
/datum/admins/proc/makeCult()
|
||||
|
||||
var/datum/game_mode/cult/temp = new
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
temp.restricted_jobs += temp.protected_jobs
|
||||
|
||||
var/list/mob/living/carbon/human/candidates = list()
|
||||
@@ -517,7 +517,7 @@
|
||||
/datum/admins/proc/makeVampires()
|
||||
|
||||
var/datum/game_mode/vampire/temp = new
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
temp.restricted_jobs += temp.protected_jobs
|
||||
|
||||
var/list/mob/living/carbon/human/candidates = list()
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
return
|
||||
|
||||
if(istype(O,/obj/singularity))
|
||||
if(config.forbid_singulo_possession)
|
||||
if(GLOB.configuration.general.forbid_singulo_possession) // I love how this needs to exist
|
||||
to_chat(usr, "It is forbidden to possess singularities.")
|
||||
return
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@
|
||||
|
||||
/proc/cmd_admin_mute(mob/M as mob, mute_type, automute = 0)
|
||||
if(automute)
|
||||
if(!config.automute_on)
|
||||
if(!GLOB.configuration.general.enable_auto_mute)
|
||||
return
|
||||
else
|
||||
if(!usr || !usr.client)
|
||||
@@ -276,21 +276,21 @@
|
||||
return
|
||||
|
||||
var/action=""
|
||||
if(config.antag_hud_allowed)
|
||||
if(GLOB.configuration.general.allow_antag_hud)
|
||||
for(var/mob/dead/observer/g in get_ghosts())
|
||||
if(g.antagHUD)
|
||||
g.antagHUD = FALSE // Disable it on those that have it enabled
|
||||
g.has_enabled_antagHUD = FALSE // We'll allow them to respawn
|
||||
to_chat(g, "<span class='danger'>The Administrator has disabled AntagHUD </span>")
|
||||
config.antag_hud_allowed = 0
|
||||
to_chat(g, "<span class='danger'>The Administrators have disabled AntagHUD </span>")
|
||||
GLOB.configuration.general.allow_antag_hud = FALSE
|
||||
to_chat(src, "<span class='danger'>AntagHUD usage has been disabled</span>")
|
||||
action = "disabled"
|
||||
else
|
||||
for(var/mob/dead/observer/g in get_ghosts())
|
||||
if(!g.client.holder) // Add the verb back for all non-admin ghosts
|
||||
to_chat(g, "<span class='boldnotice'>The Administrator has enabled AntagHUD </span>")// Notify all observers they can now use AntagHUD
|
||||
to_chat(g, "<span class='boldnotice'>The Administrators have enabled AntagHUD </span>")// Notify all observers they can now use AntagHUD
|
||||
|
||||
config.antag_hud_allowed = 1
|
||||
GLOB.configuration.general.allow_antag_hud = TRUE
|
||||
action = "enabled"
|
||||
to_chat(src, "<span class='boldnotice'>AntagHUD usage has been enabled</span>")
|
||||
|
||||
@@ -307,11 +307,11 @@
|
||||
return
|
||||
|
||||
var/action=""
|
||||
if(config.antag_hud_restricted)
|
||||
if(GLOB.configuration.general.restrict_antag_hud_rejoin)
|
||||
for(var/mob/dead/observer/g in get_ghosts())
|
||||
to_chat(g, "<span class='boldnotice'>The administrator has lifted restrictions on joining the round if you use AntagHUD</span>")
|
||||
action = "lifted restrictions"
|
||||
config.antag_hud_restricted = 0
|
||||
GLOB.configuration.general.restrict_antag_hud_rejoin = FALSE
|
||||
to_chat(src, "<span class='boldnotice'>AntagHUD restrictions have been lifted</span>")
|
||||
else
|
||||
for(var/mob/dead/observer/g in get_ghosts())
|
||||
@@ -320,7 +320,7 @@
|
||||
g.antagHUD = FALSE
|
||||
g.has_enabled_antagHUD = FALSE
|
||||
action = "placed restrictions"
|
||||
config.antag_hud_restricted = 1
|
||||
GLOB.configuration.general.restrict_antag_hud_rejoin = TRUE
|
||||
to_chat(src, "<span class='danger'>AntagHUD restrictions have been enabled</span>")
|
||||
|
||||
log_admin("[key_name(usr)] has [action] on joining the round if they use AntagHUD")
|
||||
@@ -941,14 +941,14 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
if(!check_rights(R_SERVER|R_EVENT))
|
||||
return
|
||||
|
||||
if(!config.allow_random_events)
|
||||
config.allow_random_events = 1
|
||||
if(!GLOB.configuration.event.enable_random_events)
|
||||
GLOB.configuration.event.enable_random_events = TRUE
|
||||
to_chat(usr, "Random events enabled")
|
||||
message_admins("Admin [key_name_admin(usr)] has enabled random events.", 1)
|
||||
message_admins("Admin [key_name_admin(usr)] has enabled random events.")
|
||||
else
|
||||
config.allow_random_events = 0
|
||||
GLOB.configuration.event.enable_random_events = FALSE
|
||||
to_chat(usr, "Random events disabled")
|
||||
message_admins("Admin [key_name_admin(usr)] has disabled random events.", 1)
|
||||
message_admins("Admin [key_name_admin(usr)] has disabled random events.")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Random Events") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/reset_all_tcs()
|
||||
@@ -1031,7 +1031,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
if(H.client == null || H.stat == DEAD) // No clientless or dead
|
||||
continue
|
||||
mins_afk = round(H.client.inactivity / 600)
|
||||
if(mins_afk < config.list_afk_minimum)
|
||||
if(mins_afk < 5)
|
||||
continue
|
||||
if(H.job)
|
||||
job_string = H.job
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
objective_count += 1 //Exchange counts towards number of objectives
|
||||
|
||||
|
||||
var/objective_amount = config.traitor_objectives_amount
|
||||
var/objective_amount = GLOB.configuration.gamemode.traitor_objectives_amount
|
||||
|
||||
if(is_hijacker && objective_count <= objective_amount) //Don't assign hijack if it would exceed the number of objectives set in config.traitor_objectives_amount
|
||||
if (!(locate(/datum/objective/hijack) in objectives))
|
||||
@@ -154,7 +154,7 @@
|
||||
|
||||
objective_count += forge_single_objective()
|
||||
|
||||
for(var/i = objective_count, i < config.traitor_objectives_amount)
|
||||
for(var/i = objective_count, i < GLOB.configuration.gamemode.traitor_objectives_amount)
|
||||
var/datum/objective/assassinate/kill_objective = new
|
||||
kill_objective.owner = owner
|
||||
kill_objective.find_target()
|
||||
@@ -248,7 +248,7 @@
|
||||
owner.announce_objectives()
|
||||
if(should_give_codewords)
|
||||
give_codewords()
|
||||
to_chat(owner.current, "<span class='motd'>For more information, check the wiki page: ([config.wikiurl]/index.php/Traitor)</span>")
|
||||
to_chat(owner.current, "<span class='motd'>For more information, check the wiki page: ([GLOB.configuration.url.wiki_url]/index.php/Traitor)</span>")
|
||||
|
||||
|
||||
/datum/antagonist/traitor/proc/update_traitor_icons_added(datum/mind/traitor_mind)
|
||||
|
||||
@@ -47,7 +47,7 @@ GLOBAL_DATUM_INIT(the_gateway, /obj/machinery/gateway/centerstation, null)
|
||||
/obj/machinery/gateway/centerstation/Initialize()
|
||||
..()
|
||||
update_icon()
|
||||
wait = world.time + config.gateway_delay
|
||||
wait = world.time + GLOB.configuration.gateway.away_mission_delay
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/obj/machinery/gateway/centerstation/LateInitialize()
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
GLOBAL_LIST_INIT(potentialRandomZlevels, generateMapList(filename = "config/away_mission_config.txt"))
|
||||
|
||||
// Call this before you remove the last dirt on a z level - that way, all objects
|
||||
// will have proper atmos and other important enviro things
|
||||
/proc/late_setup_level(turfs, smoothTurfs)
|
||||
@@ -38,39 +36,6 @@ GLOBAL_LIST_INIT(potentialRandomZlevels, generateMapList(filename = "config/away
|
||||
qdel(otherthing)
|
||||
T.ChangeTurf(T.baseturf)
|
||||
|
||||
/proc/generateMapList(filename)
|
||||
var/list/potentialMaps = list()
|
||||
var/list/Lines = file2list(filename)
|
||||
|
||||
if(!Lines.len)
|
||||
return
|
||||
for(var/t in Lines)
|
||||
if(!t)
|
||||
continue
|
||||
|
||||
t = trim(t)
|
||||
if(length(t) == 0)
|
||||
continue
|
||||
else if(copytext(t, 1, 2) == "#")
|
||||
continue
|
||||
|
||||
var/pos = findtext(t, " ")
|
||||
var/name = null
|
||||
|
||||
if(pos)
|
||||
name = lowertext(copytext(t, 1, pos))
|
||||
|
||||
else
|
||||
name = lowertext(t)
|
||||
|
||||
if(!name)
|
||||
continue
|
||||
|
||||
potentialMaps.Add(t)
|
||||
|
||||
return potentialMaps
|
||||
|
||||
|
||||
/datum/map_template/ruin/proc/try_to_place(z,allowed_areas)
|
||||
var/sanity = PLACEMENT_TRIES
|
||||
while(sanity > 0)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// This is in its own file as it has so much stuff to contend with
|
||||
/client/proc/edit_2fa()
|
||||
if(!config._2fa_auth_host)
|
||||
if(!GLOB.configuration.system._2fa_auth_host)
|
||||
alert(usr, "This server does not have 2FA enabled.")
|
||||
return
|
||||
// Client does not have 2FA enabled. Set it up.
|
||||
if(prefs._2fa_status == _2FA_DISABLED)
|
||||
// Get us an auth token
|
||||
var/datum/http_response/qrcr = wrap_http_get("[config._2fa_auth_host]/generateQR?ckey=[ckey]")
|
||||
var/datum/http_response/qrcr = wrap_http_get("[GLOB.configuration.system._2fa_auth_host]/generateQR?ckey=[ckey]")
|
||||
// If this fails, shits gone bad
|
||||
if(qrcr.errored)
|
||||
alert(usr, "Something has gone VERY wrong ingame. Please inform the server host.\nError details: [qrcr.error]")
|
||||
@@ -33,7 +33,7 @@
|
||||
B.close()
|
||||
return
|
||||
|
||||
var/datum/http_response/vr = wrap_http_get("[config._2fa_auth_host]/validateCode?ckey=[ckey]&code=[entered_code]")
|
||||
var/datum/http_response/vr = wrap_http_get("[GLOB.configuration.system._2fa_auth_host]/validateCode?ckey=[ckey]&code=[entered_code]")
|
||||
// If this fails, shits gone bad
|
||||
if(vr.errored)
|
||||
alert(usr, "Something has gone VERY wrong ingame. Please inform the server host.\nError details: [vr.error]")
|
||||
@@ -86,7 +86,7 @@
|
||||
alert(usr, "2FA deactivation aborted!")
|
||||
return
|
||||
|
||||
var/datum/http_response/vr = wrap_http_get("[config._2fa_auth_host]/validateCode?ckey=[ckey]&code=[entered_code]")
|
||||
var/datum/http_response/vr = wrap_http_get("[GLOB.configuration.system._2fa_auth_host]/validateCode?ckey=[ckey]&code=[entered_code]")
|
||||
// If this fails, shits gone bad
|
||||
if(vr.errored)
|
||||
alert(usr, "Something has gone VERY wrong ingame. Please inform the server host.\nError details: [vr.error]")
|
||||
|
||||
@@ -122,11 +122,12 @@
|
||||
|
||||
|
||||
//Logs all hrefs
|
||||
if(config && config.log_hrefs)
|
||||
if(GLOB.configuration.logging.href_logging)
|
||||
log_href("[src] (usr:[usr]\[[COORD(usr)]\]) : [hsrc ? "[hsrc] " : ""][href]")
|
||||
|
||||
if(href_list["karmashop"])
|
||||
if(config.disable_karma)
|
||||
if(!GLOB.configuration.general.enable_karma)
|
||||
to_chat(src, "Karma is disabled on this server.")
|
||||
return
|
||||
|
||||
switch(href_list["karmashop"])
|
||||
@@ -218,7 +219,7 @@
|
||||
to_chat(src, "<span class='danger'>You are sending messages to quickly. Please wait [wait_time] [wait_time == 1 ? "second" : "seconds"] before sending another message.</span>")
|
||||
return 1
|
||||
last_message_time = world.time
|
||||
if(config.automute_on && !check_rights(R_ADMIN, 0) && last_message == message)
|
||||
if(GLOB.configuration.general.enable_auto_mute && !check_rights(R_ADMIN, 0) && last_message == message)
|
||||
last_message_count++
|
||||
if(last_message_count >= SPAM_TRIGGER_AUTOMUTE)
|
||||
to_chat(src, "<span class='danger'>You have exceeded the spam filter limit for identical messages. An auto-mute was applied.</span>")
|
||||
@@ -259,7 +260,7 @@
|
||||
return null
|
||||
if(byond_version < MIN_CLIENT_VERSION) // Too out of date to play at all. Unfortunately, we can't send them a message here.
|
||||
version_blocked = TRUE
|
||||
if(byond_build < config.minimum_client_build)
|
||||
if(byond_build < GLOB.configuration.general.minimum_client_build)
|
||||
version_blocked = TRUE
|
||||
|
||||
var/show_update_prompt = FALSE
|
||||
@@ -274,7 +275,7 @@
|
||||
GLOB.directory[ckey] = src
|
||||
//Admin Authorisation
|
||||
// Automatically makes localhost connection an admin
|
||||
if(!config.disable_localhost_admin)
|
||||
if(GLOB.configuration.admin.enable_localhost_autoadmin)
|
||||
if(is_connecting_from_localhost())
|
||||
new /datum/admins("!LOCALHOST!", R_HOST, ckey) // Makes localhost rank
|
||||
holder = GLOB.admin_datums[ckey]
|
||||
@@ -306,10 +307,6 @@
|
||||
spawn() // Goonchat does some non-instant checks in start()
|
||||
chatOutput.start()
|
||||
|
||||
if( (world.address == address || !address) && !GLOB.host )
|
||||
GLOB.host = key
|
||||
world.update_status()
|
||||
|
||||
if(holder)
|
||||
on_holder_add()
|
||||
add_admin_verbs()
|
||||
@@ -383,7 +380,7 @@
|
||||
playercount += 1
|
||||
|
||||
// Update the state of the panic bunker based on current playercount
|
||||
var/threshold = config.panic_bunker_threshold
|
||||
var/threshold = GLOB.configuration.general.panic_bunker_threshold
|
||||
|
||||
if((playercount > threshold) && (GLOB.panic_bunker_enabled == FALSE))
|
||||
GLOB.panic_bunker_enabled = TRUE
|
||||
@@ -466,7 +463,7 @@
|
||||
|
||||
/client/proc/donor_loadout_points()
|
||||
if(donator_level > 0 && prefs)
|
||||
prefs.max_gear_slots = config.max_loadout_points + 5
|
||||
prefs.max_gear_slots = GLOB.configuration.general.base_loadout_points + 5
|
||||
|
||||
/client/proc/log_client_to_db(connectiontopic)
|
||||
set waitfor = FALSE // This needs to run async because any sleep() inside /client/New() breaks stuff badly
|
||||
@@ -568,8 +565,9 @@
|
||||
//New player!! Need to insert all the stuff
|
||||
|
||||
// Check new peeps for panic bunker
|
||||
// AA TODO: Move this to world.IsBanned()
|
||||
if(GLOB.panic_bunker_enabled)
|
||||
var/threshold = config.panic_bunker_threshold
|
||||
var/threshold = GLOB.configuration.general.panic_bunker_threshold
|
||||
src << "Server is not accepting connections from never-before-seen players until player count is less than [threshold]. Please try again later."
|
||||
qdel(src)
|
||||
return // Dont insert or they can just go in again
|
||||
@@ -593,10 +591,10 @@
|
||||
|
||||
/client/proc/check_ip_intel()
|
||||
set waitfor = 0 //we sleep when getting the intel, no need to hold up the client connection while we sleep
|
||||
if(config.ipintel_email)
|
||||
if(config.ipintel_maxplaytime && config.use_exp_tracking)
|
||||
if(GLOB.configuration.ipintel.enabled)
|
||||
if(GLOB.configuration.ipintel.playtime_ignore_threshold && GLOB.configuration.jobs.enable_exp_tracking)
|
||||
var/living_hours = get_exp_type_num(EXP_TYPE_LIVING) / 60
|
||||
if(living_hours >= config.ipintel_maxplaytime)
|
||||
if(living_hours >= GLOB.configuration.ipintel.playtime_ignore_threshold)
|
||||
return
|
||||
|
||||
if(is_connecting_from_localhost())
|
||||
@@ -612,14 +610,15 @@
|
||||
verify_ip_intel()
|
||||
|
||||
/client/proc/verify_ip_intel()
|
||||
if(ip_intel >= config.ipintel_rating_bad)
|
||||
var/detailsurl = config.ipintel_detailsurl ? "(<a href='[config.ipintel_detailsurl][address]'>IP Info</a>)" : ""
|
||||
if(config.ipintel_whitelist)
|
||||
if(ip_intel >= GLOB.configuration.ipintel.bad_rating)
|
||||
var/detailsurl = GLOB.configuration.ipintel.details_url ? "(<a href='[GLOB.configuration.ipintel.details_url][address]'>IP Info</a>)" : ""
|
||||
if(GLOB.configuration.ipintel.whitelist_mode)
|
||||
// AA TODO: move this check to world.IsBanned()
|
||||
spawn(40) // This is necessary because without it, they won't see the message, and addtimer cannot be used because the timer system may not have initialized yet
|
||||
message_admins("<span class='adminnotice'>IPIntel: [key_name_admin(src)] on IP [address] was rejected. [detailsurl]</span>")
|
||||
var/blockmsg = "<B>Error: proxy/VPN detected. Proxy/VPN use is not allowed here. Deactivate it before you reconnect.</B>"
|
||||
if(config.banappeals)
|
||||
blockmsg += "\nIf you are not actually using a proxy/VPN, or have no choice but to use one, request whitelisting at: [config.banappeals]"
|
||||
if(GLOB.configuration.url.banappeals_url)
|
||||
blockmsg += "\nIf you are not actually using a proxy/VPN, or have no choice but to use one, request whitelisting at: [GLOB.configuration.url.banappeals_url]"
|
||||
to_chat(src, blockmsg)
|
||||
qdel(src)
|
||||
else
|
||||
@@ -627,9 +626,9 @@
|
||||
|
||||
|
||||
/client/proc/check_forum_link()
|
||||
if(!config.forum_link_url || !prefs || prefs.fuid)
|
||||
if(!GLOB.configuration.url.forum_link_url || !prefs || prefs.fuid)
|
||||
return
|
||||
if(config.use_exp_tracking)
|
||||
if(GLOB.configuration.jobs.enable_exp_tracking)
|
||||
var/living_hours = get_exp_type_num(EXP_TYPE_LIVING) / 60
|
||||
if(living_hours < 20)
|
||||
return
|
||||
@@ -663,7 +662,7 @@
|
||||
return tokenstr
|
||||
|
||||
/client/proc/link_forum_account(fromban)
|
||||
if(!config.forum_link_url)
|
||||
if(!GLOB.configuration.url.forum_link_url)
|
||||
return
|
||||
if(IsGuestKey(key))
|
||||
to_chat(src, "Guest keys cannot be linked.")
|
||||
@@ -689,7 +688,7 @@
|
||||
if(!tokenid)
|
||||
to_chat(src, "link_forum_account: unable to create token")
|
||||
return
|
||||
var/url = "[config.forum_link_url][tokenid]"
|
||||
var/url = "[GLOB.configuration.url.forum_link_url][tokenid]"
|
||||
if(fromban)
|
||||
url += "&fwd=appeal"
|
||||
to_chat(src, {"Now opening a window to verify your information with the forums, so that you can appeal your ban. If the window does not load, please copy/paste this link: <a href="[url]">[url]</a>"})
|
||||
@@ -709,7 +708,7 @@
|
||||
if(connection != "seeker") //Invalid connection type.
|
||||
return null
|
||||
topic = params2list(topic)
|
||||
if(!config.check_randomizer)
|
||||
if(!GLOB.configuration.general.enabled_cid_randomiser_buster)
|
||||
return
|
||||
// Stash o' ckeys
|
||||
var/static/cidcheck = list()
|
||||
@@ -842,8 +841,8 @@
|
||||
//Send resources to the client.
|
||||
/client/proc/send_resources()
|
||||
// Change the way they should download resources.
|
||||
if(config.resource_urls)
|
||||
preload_rsc = pick(config.resource_urls)
|
||||
if(length(GLOB.configuration.url.rsc_urls))
|
||||
preload_rsc = pick(GLOB.configuration.url.rsc_urls)
|
||||
else
|
||||
preload_rsc = 1 // If config.resource_urls is not set, preload like normal.
|
||||
// Most assets are now handled through global_cache.dm
|
||||
@@ -949,7 +948,7 @@
|
||||
void.UpdateGreed(actualview[1],actualview[2])
|
||||
|
||||
/client/proc/send_ssd_warning(mob/M)
|
||||
if(!config.ssd_warning)
|
||||
if(!GLOB.configuration.general.ssd_warning)
|
||||
return FALSE
|
||||
if(ssd_warning_acknowledged)
|
||||
return FALSE
|
||||
@@ -1102,7 +1101,7 @@
|
||||
qdel(query_age)
|
||||
|
||||
// Notify admins on new clients connecting, if the byond account age is less than a config value
|
||||
if(notify && (byondacc_age < config.byond_account_age_threshold))
|
||||
if(notify && (byondacc_age < GLOB.configuration.general.byond_account_age_threshold))
|
||||
message_admins("[key] has just connected for the first time. BYOND account registered on [byondacc_date] ([byondacc_age] days old)")
|
||||
|
||||
/client/proc/show_update_notice()
|
||||
@@ -1149,7 +1148,7 @@
|
||||
*/
|
||||
/client/proc/cid_count_check()
|
||||
// If the config is 0, disable this
|
||||
if(config.max_client_cid_history == 0)
|
||||
if(GLOB.configuration.general.max_client_cid_history == 0)
|
||||
return
|
||||
|
||||
// If we have no DB, dont even bother
|
||||
@@ -1169,7 +1168,7 @@
|
||||
cidcount = query_cidcheck.item[1]
|
||||
qdel(query_cidcheck)
|
||||
|
||||
if(cidcount > config.max_client_cid_history)
|
||||
if(cidcount > GLOB.configuration.general.max_client_cid_history)
|
||||
// Check their notes for CID tracking in the past
|
||||
var/has_note = FALSE
|
||||
var/note_text = ""
|
||||
|
||||
@@ -38,7 +38,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
|
||||
return 0
|
||||
if(!role)
|
||||
return 0
|
||||
if(!config.use_age_restriction_for_antags)
|
||||
if(!GLOB.configuration.gamemode.antag_account_age_restriction)
|
||||
return 0
|
||||
if(!isnum(C.player_age))
|
||||
return 0 //This is only a number if the db connection is established, otherwise it is text: "Requires database", meaning these restrictions cannot be enforced
|
||||
@@ -214,7 +214,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
|
||||
parent = C
|
||||
b_type = pick(4;"O-", 36;"O+", 3;"A-", 28;"A+", 1;"B-", 20;"B+", 1;"AB-", 5;"AB+")
|
||||
|
||||
max_gear_slots = config.max_loadout_points
|
||||
max_gear_slots = GLOB.configuration.general.base_loadout_points
|
||||
var/loaded_preferences_successfully = FALSE
|
||||
if(istype(C))
|
||||
if(!IsGuestKey(C.key))
|
||||
@@ -473,7 +473,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
|
||||
dat += "<b>Ghost PDA:</b> <a href='?_src_=prefs;preference=ghost_pda'><b>[(toggles & PREFTOGGLE_CHAT_GHOSTPDA) ? "All PDA Messages" : "No PDA Messages"]</b></a><br>"
|
||||
if(check_rights(R_ADMIN,0))
|
||||
dat += "<b>OOC Color:</b> <span style='border: 1px solid #161616; background-color: [ooccolor ? ooccolor : GLOB.normal_ooc_colour];'> </span> <a href='?_src_=prefs;preference=ooccolor;task=input'><b>Change</b></a><br>"
|
||||
if(config.allow_Metadata)
|
||||
if(GLOB.configuration.general.allow_character_metadata)
|
||||
dat += "<b>OOC Notes:</b> <a href='?_src_=prefs;preference=metadata;task=input'><b>Edit</b></a><br>"
|
||||
dat += "<b>Parallax (Fancy Space):</b> <a href='?_src_=prefs;preference=parallax'>"
|
||||
switch (parallax)
|
||||
@@ -1102,9 +1102,9 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
|
||||
ResetJobs()
|
||||
SetChoices(user)
|
||||
if("learnaboutselection")
|
||||
if(config.wikiurl)
|
||||
if(GLOB.configuration.url.wiki_url)
|
||||
if(alert("Would you like to open the Job selection info in your browser?", "Open Job Selection", "Yes", "No") == "Yes")
|
||||
user << link("[config.wikiurl]/index.php/Job_Selection_and_Assignment")
|
||||
user << link("[GLOB.configuration.url.wiki_url]/index.php/Job_Selection_and_Assignment")
|
||||
else
|
||||
to_chat(user, "<span class='danger'>The Wiki URL is not set in the server configuration.</span>")
|
||||
if("random")
|
||||
@@ -1321,17 +1321,10 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
|
||||
if("species")
|
||||
var/list/new_species = list("Human", "Tajaran", "Skrell", "Unathi", "Diona", "Vulpkanin")
|
||||
var/prev_species = species
|
||||
// var/whitelisted = 0
|
||||
|
||||
if(config.usealienwhitelist) //If we're using the whitelist, make sure to check it!
|
||||
for(var/Spec in GLOB.whitelisted_species)
|
||||
if(is_alien_whitelisted(user,Spec))
|
||||
new_species += Spec
|
||||
// whitelisted = 1
|
||||
// if(!whitelisted)
|
||||
// alert(user, "You cannot change your species as you need to be whitelisted. If you wish to be whitelisted contact an admin in-game, on the forums, or on IRC.")
|
||||
else //Not using the whitelist? Aliens for everyone!
|
||||
new_species += GLOB.whitelisted_species
|
||||
for(var/species in GLOB.whitelisted_species)
|
||||
if(is_alien_whitelisted(user, species))
|
||||
new_species += species
|
||||
|
||||
species = input("Please select a species", "Character Generation", null) in sortTim(new_species, /proc/cmp_text_asc)
|
||||
var/datum/species/NS = GLOB.all_species[species]
|
||||
@@ -1414,18 +1407,6 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
|
||||
if("language")
|
||||
// var/languages_available
|
||||
var/list/new_languages = list("None")
|
||||
/*
|
||||
if(config.usealienwhitelist)
|
||||
for(var/L in GLOB.all_languages)
|
||||
var/datum/language/lang = GLOB.all_languages[L]
|
||||
if((!(lang.flags & RESTRICTED)) && (is_alien_whitelisted(user, L)||(!( lang.flags & WHITELISTED ))))
|
||||
new_languages += lang
|
||||
languages_available = 1
|
||||
|
||||
if(!(languages_available))
|
||||
alert(user, "There are not currently any available secondary languages.")
|
||||
else
|
||||
*/
|
||||
for(var/L in GLOB.all_languages)
|
||||
var/datum/language/lang = GLOB.all_languages[L]
|
||||
if(!(lang.flags & RESTRICTED))
|
||||
@@ -2029,8 +2010,8 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
|
||||
|
||||
if("afk_watch")
|
||||
if(!(toggles2 & PREFTOGGLE_2_AFKWATCH))
|
||||
to_chat(user, "<span class='info'>You will now get put into cryo dorms after [config.auto_cryo_afk] minutes. \
|
||||
Then after [config.auto_despawn_afk] minutes you will be fully despawned. You will receive a visual and auditory warning before you will be put into cryodorms.</span>")
|
||||
to_chat(user, "<span class='info'>You will now get put into cryo dorms after [GLOB.configuration.afk.auto_cryo_minutes] minutes. \
|
||||
Then after [GLOB.configuration.afk.auto_despawn_minutes] minutes you will be fully despawned. You will receive a visual and auditory warning before you will be put into cryodorms.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='info'>Automatic cryoing turned off.</span>")
|
||||
toggles2 ^= PREFTOGGLE_2_AFKWATCH
|
||||
@@ -2162,14 +2143,6 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
|
||||
if(be_random_name)
|
||||
real_name = random_name(gender,species)
|
||||
|
||||
if(config.humans_need_surnames)
|
||||
var/firstspace = findtext(real_name, " ")
|
||||
var/name_length = length(real_name)
|
||||
if(!firstspace) //we need a surname
|
||||
real_name += " [pick(GLOB.last_names)]"
|
||||
else if(firstspace == name_length)
|
||||
real_name += "[pick(GLOB.last_names)]"
|
||||
|
||||
character.add_language(language)
|
||||
|
||||
|
||||
|
||||
@@ -115,8 +115,7 @@ GLOBAL_DATUM(error_cache, /datum/ErrorViewer/ErrorCache)
|
||||
|
||||
// Show the error to admins with debug messages turned on, but only if one
|
||||
// from the same source hasn't been shown too recently
|
||||
// (Also, make sure config is initialized, or log_debug will runtime)
|
||||
if(config && error_source.next_message_at <= world.time)
|
||||
if(error_source.next_message_at <= world.time)
|
||||
var/const/viewtext = "\[view]" // Nesting these in other brackets went poorly
|
||||
log_debug("Runtime in [e.file],[e.line]: [html_encode(e.name)] [error_entry.makeLink(viewtext)]")
|
||||
error_source.next_message_at = world.time + ERROR_MSG_DELAY
|
||||
|
||||
@@ -30,6 +30,6 @@
|
||||
SSticker.mode.update_blob_icons_added(B.mind)
|
||||
|
||||
to_chat(B, "<span class='userdanger'>You are now a mouse, infected with blob spores. Find somewhere isolated... before you burst and become the blob! Use ventcrawl (alt-click on vents) to move around.</span>")
|
||||
to_chat(B, "<span class='motd'>For more information, check the wiki page: ([config.wikiurl]/index.php/Blob)</span>")
|
||||
to_chat(B, "<span class='motd'>For more information, check the wiki page: ([GLOB.configuration.url.wiki_url]/index.php/Blob)</span>")
|
||||
notify_ghosts("Infected Mouse has appeared in [get_area(B)].", source = B)
|
||||
successSpawn = TRUE
|
||||
|
||||
@@ -40,11 +40,6 @@
|
||||
|
||||
return clamp((weight + job_weight) * weight_mod, min_weight, max_weight)
|
||||
|
||||
/datum/event_meta/alien/get_weight(list/active_with_role)
|
||||
if(GLOB.aliens_allowed)
|
||||
return ..(active_with_role)
|
||||
return 0
|
||||
|
||||
/*/datum/event_meta/ninja/get_weight(var/list/active_with_role)
|
||||
if(toggle_space_ninja)
|
||||
return ..(active_with_role)
|
||||
|
||||
@@ -29,7 +29,8 @@ GLOBAL_LIST_EMPTY(event_last_fired)
|
||||
if(delayed)
|
||||
next_event_time += (world.time - last_world_time)
|
||||
else if(world.time > next_event_time)
|
||||
start_event()
|
||||
if(GLOB.configuration.event.enable_random_events)
|
||||
start_event()
|
||||
|
||||
last_world_time = world.time
|
||||
|
||||
@@ -66,7 +67,7 @@ GLOBAL_LIST_EMPTY(event_last_fired)
|
||||
|
||||
for(var/event_meta in last_event_time) if(possible_events[event_meta])
|
||||
var/time_passed = world.time - GLOB.event_last_fired[event_meta]
|
||||
var/weight_modifier = max(0, (config.expected_round_length - time_passed) / 300)
|
||||
var/weight_modifier = max(0, (GLOB.configuration.event.expected_round_length - time_passed) / 300)
|
||||
var/new_weight = max(possible_events[event_meta] - weight_modifier, 0)
|
||||
|
||||
if(new_weight)
|
||||
@@ -84,9 +85,9 @@ GLOBAL_LIST_EMPTY(event_last_fired)
|
||||
|
||||
/datum/event_container/proc/set_event_delay()
|
||||
// If the next event time has not yet been set and we have a custom first time start
|
||||
if(next_event_time == 0 && config.event_first_run[severity])
|
||||
var/lower = config.event_first_run[severity]["lower"]
|
||||
var/upper = config.event_first_run[severity]["upper"]
|
||||
if(next_event_time == 0 && GLOB.configuration.event.first_run_times[severity])
|
||||
var/lower = GLOB.configuration.event.first_run_times[severity]["lower"]
|
||||
var/upper = GLOB.configuration.event.first_run_times[severity]["upper"]
|
||||
var/event_delay = rand(lower, upper)
|
||||
next_event_time = world.time + event_delay
|
||||
// Otherwise, follow the standard setup process
|
||||
@@ -110,7 +111,7 @@ GLOBAL_LIST_EMPTY(event_last_fired)
|
||||
|
||||
playercount_modifier = playercount_modifier * delay_modifier
|
||||
|
||||
var/event_delay = rand(config.event_delay_lower[severity], config.event_delay_upper[severity]) * playercount_modifier
|
||||
var/event_delay = rand(GLOB.configuration.event.delay_lower_bound[severity], GLOB.configuration.event.delay_upper_bound[severity]) * playercount_modifier
|
||||
next_event_time = world.time + event_delay
|
||||
|
||||
log_debug("Next event of severity [GLOB.severity_to_string[severity]] in [(next_event_time - world.time)/600] minutes.")
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
var/mob/living/simple_animal/hostile/poison/terror_spider/S = new spider_type(vent.loc)
|
||||
var/mob/M = pick_n_take(candidates)
|
||||
S.key = M.key
|
||||
to_chat(S, "<span class='motd'>For more information, check the wiki page: ([config.wikiurl]/index.php/Terror_Spider)</span>")
|
||||
to_chat(S, "<span class='motd'>For more information, check the wiki page: ([GLOB.configuration.url.wiki_url]/index.php/Terror_Spider)</span>")
|
||||
spawncount--
|
||||
successSpawn = TRUE
|
||||
|
||||
|
||||
@@ -293,9 +293,9 @@
|
||||
return 1
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/monkeycube/proc/Expand()
|
||||
if(LAZYLEN(SSmobs.cubemonkeys) >= config.cubemonkeycap)
|
||||
if(LAZYLEN(SSmobs.cubemonkeys) >= GLOB.configuration.general.monkey_cube_cap)
|
||||
if(fingerprintslast)
|
||||
to_chat(get_mob_by_ckey(fingerprintslast), "<span class='warning'>Bluespace harmonics prevent the spawning of more than [config.cubemonkeycap] monkeys on the station at one time!</span>")
|
||||
to_chat(get_mob_by_ckey(fingerprintslast), "<span class='warning'>Bluespace harmonics prevent the spawning of more than [GLOB.configuration.general.monkey_cube_cap] monkeys on the station at one time!</span>")
|
||||
else
|
||||
visible_message("<span class='notice'>[src] fails to expand!</span>")
|
||||
return
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
var/obj/machinery/hydroponics/parent = loc
|
||||
var/make_podman = 0
|
||||
var/ckey_holder = null
|
||||
if(config.revival_pod_plants)
|
||||
if(GLOB.configuration.general.enable_revival_pod_plants)
|
||||
if(ckey)
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(isobserver(M))
|
||||
|
||||
@@ -78,7 +78,7 @@ GLOBAL_LIST_EMPTY(karma_spenders)
|
||||
if(!client)
|
||||
to_chat(src, "<span class='warning'>You can't award karma without being connected.</span>")
|
||||
return FALSE
|
||||
if(config.disable_karma)
|
||||
if(!GLOB.configuration.general.enable_karma)
|
||||
to_chat(src, "<span class='warning'>Karma is disabled.</span>")
|
||||
return FALSE
|
||||
if(!SSticker || !GLOB.player_list.len || (SSticker.current_state == GAME_STATE_PREGAME))
|
||||
@@ -152,7 +152,7 @@ GLOBAL_LIST_EMPTY(karma_spenders)
|
||||
if(!M)
|
||||
to_chat(usr, "Please right click a mob to award karma directly, or use the 'Award Karma' verb to select a player from the player listing.")
|
||||
return
|
||||
if(config.disable_karma) // this is here because someone thought it was a good idea to add an alert box before checking if they can even give a mob karma
|
||||
if(!GLOB.configuration.general.enable_karma) // this is here because someone thought it was a good idea to add an alert box before checking if they can even give a mob karma
|
||||
to_chat(usr, "<span class='warning'>Karma is disabled.</span>")
|
||||
return
|
||||
if(alert("Give [M.name] good karma?", "Karma", "Yes", "No") != "Yes")
|
||||
@@ -173,6 +173,7 @@ GLOBAL_LIST_EMPTY(karma_spenders)
|
||||
special_role = M.mind.special_role
|
||||
if(M.mind.assigned_role)
|
||||
assigned_role = M.mind.assigned_role
|
||||
// AA TODO: Make this use proper RUSTG logging. Why is this a normal file write these are so expensive aaaaaaaaa
|
||||
karma_diary << "[M.name] ([M.key]) [assigned_role]/[special_role]: [M.client.karma] - [time2text(world.timeofday, "hh:mm:ss")] given by [key]"
|
||||
|
||||
sql_report_karma(src, M)
|
||||
@@ -182,7 +183,7 @@ GLOBAL_LIST_EMPTY(karma_spenders)
|
||||
set desc = "Reports how much karma you have accrued."
|
||||
set category = "Special Verbs"
|
||||
|
||||
if(config.disable_karma)
|
||||
if(!GLOB.configuration.general.enable_karma)
|
||||
to_chat(src, "<span class='warning'>Karma is disabled.</span>")
|
||||
return
|
||||
|
||||
@@ -218,7 +219,7 @@ GLOBAL_LIST_EMPTY(karma_spenders)
|
||||
set desc = "Spend your hard-earned karma here"
|
||||
set hidden = TRUE
|
||||
|
||||
if(config.disable_karma)
|
||||
if(!GLOB.configuration.general.enable_karma)
|
||||
to_chat(src, "<span class='warning'>Karma is disabled.</span>")
|
||||
return
|
||||
karmashopmenu()
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
return
|
||||
|
||||
if(!src.client.holder)
|
||||
if(!config.dsay_allowed)
|
||||
if(!GLOB.dsay_enabled)
|
||||
to_chat(src, "<span class='warning'>Deadchat is globally muted</span>")
|
||||
return
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
|
||||
/mob/living/carbon/alien/movement_delay()
|
||||
. = ..()
|
||||
. += move_delay_add + config.alien_delay //move_delay_add is used to slow aliens with stuns
|
||||
. += move_delay_add + GLOB.configuration.movement.alien_delay //move_delay_add is used to slow aliens with stuns
|
||||
|
||||
/mob/living/carbon/alien/getDNA()
|
||||
return null
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
new_xeno.mind.assigned_role = SPECIAL_ROLE_XENOMORPH
|
||||
new_xeno.mind.special_role = SPECIAL_ROLE_XENOMORPH
|
||||
new_xeno << sound('sound/voice/hiss5.ogg',0,0,0,100)//To get the player's attention
|
||||
to_chat(new_xeno, "<span class='motd'>For more information, check the wiki page: ([config.wikiurl]/index.php/Xenomorph)</span>")
|
||||
to_chat(new_xeno, "<span class='motd'>For more information, check the wiki page: ([GLOB.configuration.url.wiki_url]/index.php/Xenomorph)</span>")
|
||||
|
||||
if(gib_on_success)
|
||||
owner.gib()
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/mob/living/carbon/brain/Life()
|
||||
. = ..()
|
||||
if(.)
|
||||
if(!container && (world.time - timeofhostdeath) > config.revival_brain_life)
|
||||
if(!container && (world.time - timeofhostdeath) > GLOB.configuration.general.revival_brain_life)
|
||||
death()
|
||||
|
||||
/mob/living/carbon/brain/breathe()
|
||||
|
||||
@@ -1130,8 +1130,6 @@ so that different stomachs can handle things in different ways VB*/
|
||||
|
||||
//to recalculate and update the mob's total tint from tinted equipment it's wearing.
|
||||
/mob/living/carbon/proc/update_tint()
|
||||
if(!GLOB.tinted_weldhelh)
|
||||
return
|
||||
var/tinttotal = get_total_tint()
|
||||
if(tinttotal >= TINT_BLIND)
|
||||
overlay_fullscreen("tint", /obj/screen/fullscreen/blind)
|
||||
|
||||
@@ -320,7 +320,7 @@
|
||||
for(var/current_species_name in GLOB.all_species)
|
||||
var/datum/species/current_species = GLOB.all_species[current_species_name]
|
||||
|
||||
if(check_whitelist && config.usealienwhitelist && !check_rights(R_ADMIN, 0, src)) //If we're using the whitelist, make sure to check it!
|
||||
if(check_whitelist && !check_rights(R_ADMIN, 0, src)) //If we're using the whitelist, make sure to check it!
|
||||
if(whitelist.len && !(current_species_name in whitelist))
|
||||
continue
|
||||
if(blacklist.len && (current_species_name in blacklist))
|
||||
|
||||
@@ -1942,3 +1942,16 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
|
||||
runechat_msg_location = loc
|
||||
else
|
||||
runechat_msg_location = src
|
||||
|
||||
/mob/living/carbon/human/verb/Examine_OOC()
|
||||
set name = "Examine Meta-Info (OOC)"
|
||||
set category = "OOC"
|
||||
set src in view()
|
||||
|
||||
if(GLOB.configuration.general.allow_character_metadata)
|
||||
if(client)
|
||||
to_chat(usr, "[src]'s Metainfo:<br>[sanitize(client.prefs.metadata)]")
|
||||
else
|
||||
to_chat(usr, "[src] does not have any stored infomation!")
|
||||
else
|
||||
to_chat(usr, "OOC Metadata is not supported by this server!")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/mob/living/carbon/human/movement_delay()
|
||||
. = 0
|
||||
. += ..()
|
||||
. += config.human_delay
|
||||
. += GLOB.configuration.movement.human_delay
|
||||
. += dna.species.movement_delay(src)
|
||||
|
||||
/mob/living/carbon/human/Process_Spacemove(movement_dir = 0)
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
player_logged++
|
||||
if(istype(loc, /obj/machinery/cryopod))
|
||||
return
|
||||
if(config.auto_cryo_ssd_mins && (player_logged >= (config.auto_cryo_ssd_mins * 30)) && player_logged % 30 == 0)
|
||||
if(GLOB.configuration.afk.ssd_auto_cryo_minutes && (player_logged >= (GLOB.configuration.afk.ssd_auto_cryo_minutes * 30)) && player_logged % 30 == 0)
|
||||
var/turf/T = get_turf(src)
|
||||
if(!is_station_level(T.z))
|
||||
return
|
||||
|
||||
@@ -129,17 +129,11 @@
|
||||
if((head_organ.dna.species.name in tmp_hair.species_allowed) && (robohead.company in tmp_hair.models_allowed)) //Populate the list of available monitor styles only with styles that the monitor-head is allowed to use.
|
||||
hair += i
|
||||
|
||||
var/file = file2text("config/custom_sprites.txt") //Pulls up the custom_sprites list
|
||||
var/lines = splittext(file, "\n")
|
||||
|
||||
for(var/line in lines) // Looks for lines set up as screen:ckey:screen_name
|
||||
var/list/Entry = splittext(line, ":") // split lines
|
||||
for(var/i = 1 to Entry.len)
|
||||
Entry[i] = trim(Entry[i]) // Cleans up lines
|
||||
if(Entry.len != 3 || Entry[1] != "screen") // Ignore entries that aren't for screens
|
||||
continue
|
||||
if(Entry[2] == H.ckey) // They're in the list? Custom sprite time, var and icon change required
|
||||
hair += Entry[3] // Adds custom screen to list
|
||||
if(H.ckey in GLOB.configuration.custom_sprites.ipc_screen_map)
|
||||
// key: ckey | value: list of icon states
|
||||
for(var/style in GLOB.configuration.custom_sprites.ipc_screen_map[H.ckey])
|
||||
hair += style
|
||||
|
||||
var/new_style = input(H, "Select a monitor display", "Monitor Display", head_organ.h_style) as null|anything in hair
|
||||
var/new_color = input("Please select hair color.", "Monitor Color", head_organ.hair_colour) as null|color
|
||||
|
||||
@@ -519,22 +519,6 @@
|
||||
/mob/living/proc/UpdateDamageIcon()
|
||||
return
|
||||
|
||||
|
||||
/mob/living/proc/Examine_OOC()
|
||||
set name = "Examine Meta-Info (OOC)"
|
||||
set category = "OOC"
|
||||
set src in view()
|
||||
|
||||
if(config.allow_Metadata)
|
||||
if(client)
|
||||
to_chat(usr, "[src]'s Metainfo:<br>[client.prefs.metadata]")
|
||||
else
|
||||
to_chat(usr, "[src] does not have any stored infomation!")
|
||||
else
|
||||
to_chat(usr, "OOC Metadata is not supported by this server!")
|
||||
|
||||
return
|
||||
|
||||
/mob/living/Move(atom/newloc, direct, movetime)
|
||||
if(buckled && buckled.loc != newloc) //not updating position
|
||||
if(!buckled.anchored)
|
||||
@@ -928,15 +912,15 @@
|
||||
if(forced_look)
|
||||
. += 3
|
||||
if(ignorewalk)
|
||||
. += config.run_speed
|
||||
. += GLOB.configuration.movement.base_run_speed
|
||||
else
|
||||
switch(m_intent)
|
||||
if(MOVE_INTENT_RUN)
|
||||
if(drowsyness > 0)
|
||||
. += 6
|
||||
. += config.run_speed
|
||||
. += GLOB.configuration.movement.base_run_speed
|
||||
if(MOVE_INTENT_WALK)
|
||||
. += config.walk_speed
|
||||
. += GLOB.configuration.movement.base_walk_speed
|
||||
|
||||
|
||||
/mob/living/proc/can_use_guns(obj/item/gun/G)
|
||||
|
||||
@@ -365,20 +365,8 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
|
||||
if(stat || aiRestorePowerRoutine)
|
||||
return
|
||||
if(!custom_sprite) //Check to see if custom sprite time, checking the appopriate file to change a var
|
||||
var/file = file2text("config/custom_sprites.txt")
|
||||
var/lines = splittext(file, "\n")
|
||||
|
||||
for(var/line in lines)
|
||||
// split & clean up
|
||||
var/list/Entry = splittext(line, ":")
|
||||
for(var/i = 1 to Entry.len)
|
||||
Entry[i] = trim(Entry[i])
|
||||
|
||||
if(Entry.len < 2 || Entry[1] != "ai") //ignore incorrectly formatted entries or entries that aren't marked for AI
|
||||
continue
|
||||
|
||||
if(Entry[2] == ckey) //They're in the list? Custom sprite time, var and icon change required
|
||||
custom_sprite = 1
|
||||
if(ckey in GLOB.configuration.custom_sprites.ai_core_ckeys)
|
||||
custom_sprite = TRUE
|
||||
|
||||
var/display_choices = list(
|
||||
"Monochrome",
|
||||
@@ -963,21 +951,9 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
|
||||
|
||||
if(check_unable())
|
||||
return
|
||||
if(!custom_hologram) //Check to see if custom sprite time, checking the appopriate file to change a var
|
||||
var/file = file2text("config/custom_sprites.txt")
|
||||
var/lines = splittext(file, "\n")
|
||||
|
||||
for(var/line in lines)
|
||||
// split & clean up
|
||||
var/list/Entry = splittext(line, ":")
|
||||
for(var/i = 1 to Entry.len)
|
||||
Entry[i] = trim(Entry[i])
|
||||
|
||||
if(Entry.len < 2 || Entry[1] != "hologram")
|
||||
continue
|
||||
|
||||
if (Entry[2] == ckey) //Custom holograms
|
||||
custom_hologram = 1 // option is given in hologram menu
|
||||
if(!custom_hologram)
|
||||
if(ckey in GLOB.configuration.custom_sprites.ai_hologram_ckeys)
|
||||
custom_hologram = TRUE
|
||||
|
||||
var/input
|
||||
switch(alert("Would you like to select a hologram based on a crew member, an animal, or switch to a unique avatar?",,"Crew Member","Unique","Animal"))
|
||||
@@ -1319,7 +1295,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
|
||||
/mob/living/silicon/ai/proc/open_nearest_door(mob/living/target)
|
||||
if(!istype(target))
|
||||
return
|
||||
|
||||
|
||||
if(check_unable(AI_CHECK_WIRELESS))
|
||||
return
|
||||
|
||||
|
||||
@@ -125,11 +125,10 @@
|
||||
laws.sort_laws()
|
||||
|
||||
/mob/living/silicon/proc/make_laws()
|
||||
switch(config.default_laws)
|
||||
if(0)
|
||||
laws = new /datum/ai_laws/crewsimov()
|
||||
else
|
||||
laws = get_random_lawset()
|
||||
if(GLOB.configuration.general.random_ai_lawset)
|
||||
laws = get_random_lawset()
|
||||
else
|
||||
laws = new /datum/ai_laws/crewsimov()
|
||||
|
||||
/mob/living/silicon/proc/get_random_lawset()
|
||||
var/list/law_options[0]
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
. = ..()
|
||||
. += slowdown
|
||||
. += 1 //A bit slower than humans, so they're easier to smash
|
||||
. += config.robot_delay
|
||||
. += GLOB.configuration.movement.robot_delay
|
||||
|
||||
/mob/living/silicon/pai/update_icons()
|
||||
if(stat == DEAD)
|
||||
@@ -286,21 +286,9 @@
|
||||
|
||||
//check for custom_sprite
|
||||
if(!custom_sprite)
|
||||
var/file = file2text("config/custom_sprites.txt")
|
||||
var/lines = splittext(file, "\n")
|
||||
|
||||
for(var/line in lines)
|
||||
// split & clean up
|
||||
var/list/Entry = splittext(line, ":")
|
||||
for(var/i = 1 to Entry.len)
|
||||
Entry[i] = trim(Entry[i])
|
||||
|
||||
if(Entry.len < 2 || Entry[1] != "pai") //ignore incorrectly formatted entries or entries that aren't marked for pAI
|
||||
continue
|
||||
|
||||
if(Entry[2] == ckey) //They're in the list? Custom sprite time, var and icon change required
|
||||
custom_sprite = 1
|
||||
my_choices["Custom"] = "[ckey]-pai"
|
||||
if(ckey in GLOB.configuration.custom_sprites.pai_holoform_ckeys)
|
||||
custom_sprite = TRUE
|
||||
my_choices["Custom"] = "[ckey]-pai"
|
||||
|
||||
my_choices = possible_chassis.Copy()
|
||||
if(custom_sprite)
|
||||
|
||||
@@ -49,35 +49,6 @@
|
||||
else
|
||||
..()
|
||||
|
||||
/mob/living/silicon/robot/drone/verb/customize()
|
||||
set name = "Customize Chassis"
|
||||
set desc = "Reconfigure your chassis into a customized version."
|
||||
set category = "Drone"
|
||||
|
||||
if(!custom_sprite) //Check to see if custom sprite time, checking the appopriate file to change a var
|
||||
var/file = file2text("config/custom_sprites.txt")
|
||||
var/lines = splittext(file, "\n")
|
||||
|
||||
for(var/line in lines)
|
||||
// split & clean up
|
||||
var/list/Entry = splittext(line, ":")
|
||||
for(var/i = 1 to Entry.len)
|
||||
Entry[i] = trim(Entry[i])
|
||||
|
||||
if(Entry.len < 2 || Entry[1] != "drone")
|
||||
continue
|
||||
|
||||
if (Entry[2] == ckey) //Custom holograms
|
||||
custom_sprite = 1 // option is given in hologram menu
|
||||
|
||||
if(!custom_sprite)
|
||||
to_chat(src, "<span class='warning'>Error 404: Custom chassis not found. Revoking customization option.</span>")
|
||||
else
|
||||
icon = 'icons/mob/custom_synthetic/custom-synthetic.dmi'
|
||||
icon_state = "[ckey]-drone"
|
||||
to_chat(src, "<span class='notice'>You reconfigure your chassis and improve the station through your new aesthetics.</span>")
|
||||
verbs -= /mob/living/silicon/robot/drone/verb/customize
|
||||
|
||||
/mob/living/silicon/robot/drone/get_scooped(mob/living/carbon/grabber)
|
||||
var/obj/item/holder/H = ..()
|
||||
if(!istype(H))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#define DRONE_BUILD_TIME 2 MINUTES
|
||||
#define MAX_MAINT_DRONES 5
|
||||
|
||||
/obj/machinery/drone_fabricator
|
||||
name = "drone fabricator"
|
||||
desc = "A large automated factory for producing maintenance drones."
|
||||
@@ -37,14 +40,14 @@
|
||||
|
||||
icon_state = "drone_fab_active"
|
||||
var/elapsed = world.time - time_last_drone
|
||||
drone_progress = clamp(round((elapsed / config.drone_build_time) * 100), 0, 100)
|
||||
drone_progress = clamp(round((elapsed / DRONE_BUILD_TIME) * 100), 0, 100)
|
||||
|
||||
if(drone_progress >= 100)
|
||||
visible_message("[src] voices a strident beep, indicating a drone chassis is prepared.")
|
||||
|
||||
/obj/machinery/drone_fabricator/examine(mob/user)
|
||||
. = ..()
|
||||
if(produce_drones && drone_progress >= 100 && isobserver(user) && config.allow_drone_spawn && count_drones() < config.max_maint_drones)
|
||||
if(produce_drones && drone_progress >= 100 && isobserver(user) && count_drones() < MAX_MAINT_DRONES)
|
||||
. += "<BR><B>A drone is prepared. Select 'Join As Drone' from the Ghost tab to spawn as a maintenance drone.</B>"
|
||||
|
||||
/obj/machinery/drone_fabricator/proc/count_drones()
|
||||
@@ -58,7 +61,7 @@
|
||||
if(stat & NOPOWER)
|
||||
return
|
||||
|
||||
if(!produce_drones || !config.allow_drone_spawn || count_drones() >= config.max_maint_drones)
|
||||
if(!produce_drones || count_drones() >= MAX_MAINT_DRONES)
|
||||
return
|
||||
|
||||
if(!player || !isobserver(player.mob))
|
||||
@@ -80,10 +83,6 @@
|
||||
set name = "Join As Drone"
|
||||
set desc = "If there is a powered, enabled fabricator in the game world with a prepared chassis, join as a maintenance drone."
|
||||
|
||||
if(!(config.allow_drone_spawn))
|
||||
to_chat(src, "<span class='warning'>That verb is not currently permitted.</span>")
|
||||
return
|
||||
|
||||
if(stat != DEAD)
|
||||
return
|
||||
|
||||
@@ -99,7 +98,7 @@
|
||||
return
|
||||
|
||||
var/player_age_check = check_client_age(usr.client, 14) // 14 days to play as a drone
|
||||
if(player_age_check && config.use_age_restriction_for_antags)
|
||||
if(player_age_check && GLOB.configuration.gamemode.antag_account_age_restriction)
|
||||
to_chat(usr, "<span class='warning'>This role is not yet available to you. You need to wait another [player_age_check] days.</span>")
|
||||
return
|
||||
|
||||
@@ -141,7 +140,7 @@
|
||||
if(DF.stat & NOPOWER || !DF.produce_drones)
|
||||
continue
|
||||
|
||||
if(DF.count_drones() >= config.max_maint_drones)
|
||||
if(DF.count_drones() >= MAX_MAINT_DRONES)
|
||||
to_chat(src, "<span class='warning'>There are too many active drones in the world for you to spawn.</span>")
|
||||
return
|
||||
|
||||
@@ -150,3 +149,6 @@
|
||||
return
|
||||
|
||||
to_chat(src, "<span class='warning'>There are no available drone spawn points, sorry.</span>")
|
||||
|
||||
#undef DRONE_BUILD_TIME
|
||||
#undef MAX_MAINT_DRONES
|
||||
|
||||
@@ -215,20 +215,8 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
|
||||
|
||||
//Check for custom sprite
|
||||
if(!custom_sprite)
|
||||
var/file = file2text("config/custom_sprites.txt")
|
||||
var/lines = splittext(file, "\n")
|
||||
|
||||
for(var/line in lines)
|
||||
// split & clean up
|
||||
var/list/Entry = splittext(line, ":")
|
||||
for(var/i = 1 to Entry.len)
|
||||
Entry[i] = trim(Entry[i])
|
||||
|
||||
if(Entry.len < 2 || Entry[1] != "cyborg") //ignore incorrectly formatted entries or entries that aren't marked for cyborg
|
||||
continue
|
||||
|
||||
if(Entry[2] == ckey) //They're in the list? Custom sprite time, var and icon change required
|
||||
custom_sprite = 1
|
||||
if(ckey in GLOB.configuration.custom_sprites.cyborg_ckeys)
|
||||
custom_sprite = TRUE
|
||||
|
||||
if(mmi && mmi.brainmob)
|
||||
mmi.brainmob.name = newname
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
. += speed
|
||||
if(module_active && istype(module_active,/obj/item/borg/destroyer/mobility))
|
||||
. -= 3
|
||||
. += config.robot_delay
|
||||
. += GLOB.configuration.movement.robot_delay
|
||||
|
||||
/mob/living/silicon/robot/mob_negates_gravity()
|
||||
return magpulse
|
||||
|
||||
@@ -139,12 +139,22 @@
|
||||
update_controls()
|
||||
|
||||
/mob/living/simple_animal/bot/New()
|
||||
/*
|
||||
HEY! LISTEN!
|
||||
|
||||
I see you're poking the the bot/New() proc
|
||||
Assuming you are converting this to Initialize() [yay], please see my note in
|
||||
code\game\jobs\job\job.dm | /datum/job/proc/get_access()
|
||||
|
||||
Theres a useless check that bugs me but needs to exist because these things New()
|
||||
-AA07
|
||||
*/
|
||||
..()
|
||||
GLOB.bots_list += src
|
||||
icon_living = icon_state
|
||||
icon_dead = icon_state
|
||||
access_card = new /obj/item/card/id(src)
|
||||
//This access is so bots can be immediately set to patrol and leave Robotics, instead of having to be let out first.
|
||||
//This access is so bots can be immediately set to patrol and leave Robotics, instead of having to be let out first.
|
||||
access_card.access += ACCESS_ROBOTICS
|
||||
set_custom_texts()
|
||||
Radio = new/obj/item/radio/headset/bot(src)
|
||||
|
||||
@@ -42,6 +42,6 @@
|
||||
to_chat(user, "<span class='notice'>Someone else already took this spider.</span>")
|
||||
return
|
||||
key = user.key
|
||||
to_chat(src, "<span class='motd'>For more information, check the wiki page: ([config.wikiurl]/index.php/Terror_Spider)</span>")
|
||||
to_chat(src, "<span class='motd'>For more information, check the wiki page: ([GLOB.configuration.url.wiki_url]/index.php/Terror_Spider)</span>")
|
||||
for(var/mob/dead/observer/G in GLOB.player_list)
|
||||
G.show_message("<i>A ghost has taken control of <b>[src]</b>. ([ghost_follow_link(src, ghost=G)]).</i>")
|
||||
|
||||
@@ -332,7 +332,7 @@
|
||||
. = speed
|
||||
if(forced_look)
|
||||
. += 3
|
||||
. += config.animal_delay
|
||||
. += GLOB.configuration.movement.animal_delay
|
||||
|
||||
/mob/living/simple_animal/Stat()
|
||||
..()
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
if(health <= 0) // if damaged, the slime moves twice as slow
|
||||
. *= 2
|
||||
|
||||
. += config.slime_delay
|
||||
. += GLOB.configuration.movement.slime_delay
|
||||
|
||||
/mob/living/simple_animal/slime/update_health_hud()
|
||||
if(hud_used)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
log_access_in(client)
|
||||
create_attack_log("<font color='red'>Logged in at [atom_loc_line(get_turf(src))]</font>")
|
||||
create_log(MISC_LOG, "Logged in")
|
||||
if(config.log_access)
|
||||
if(GLOB.configuration.logging.access_logging)
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(M == src) continue
|
||||
if( M.key && (M.key != key) )
|
||||
@@ -16,7 +16,7 @@
|
||||
if( (M.computer_id == client.computer_id) )
|
||||
if(matches) matches += " and "
|
||||
matches += "ID ([client.computer_id])"
|
||||
if(!config.disable_cid_warn_popup)
|
||||
if(!GLOB.configuration.general.disable_cid_warning_popup)
|
||||
spawn() alert("You have logged in already with another key this round, please log out of this one NOW or risk being banned!")
|
||||
if(matches)
|
||||
if(M.client)
|
||||
@@ -68,9 +68,5 @@
|
||||
for(var/datum/alternate_appearance/AA in viewing_alternate_appearances)
|
||||
AA.display_to(list(src))
|
||||
|
||||
if(!fexists("config/config.txt") || !fexists("config/game_options.txt"))
|
||||
to_chat(src, "<span class='biggerdanger'>The game config files have not been properly set!\n Please copy ALL files from '/config/example' into the parent folder, '/config'.</span>")
|
||||
log_world("The game config files have not been properly set! Please copy ALL files from /config/example into the parent folder, /config.")
|
||||
|
||||
update_client_colour(0)
|
||||
update_morgue()
|
||||
|
||||
@@ -749,7 +749,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
|
||||
set name = "Respawn"
|
||||
set category = "OOC"
|
||||
|
||||
if(!GLOB.abandon_allowed)
|
||||
if(!GLOB.configuration.general.respawn_enabled)
|
||||
to_chat(usr, "<span class='warning'>Respawning is disabled.</span>")
|
||||
return
|
||||
|
||||
@@ -1007,7 +1007,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
|
||||
|
||||
// this function displays the station time in the status panel
|
||||
/mob/proc/show_stat_station_time()
|
||||
stat(null, "Round Time: [worldtime2text()]")
|
||||
stat(null, "Round Time: [worldtime2text()]") // AA TODO: Make this do "Game Time" and "Round Time" with the ROUND_TIME macro
|
||||
stat(null, "Station Time: [station_time_timestamp()]")
|
||||
|
||||
// this function displays the shuttles ETA in the status panel if the shuttle has been called
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
|
||||
/proc/cannotPossess(A)
|
||||
var/mob/dead/observer/G = A
|
||||
if(G.has_enabled_antagHUD && config.antag_hud_restricted)
|
||||
if(G.has_enabled_antagHUD && GLOB.configuration.general.restrict_antag_hud_rejoin)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
if(client)
|
||||
client.playtitlemusic()
|
||||
|
||||
if(config.player_overflow_cap && config.overflow_server_url) //Overflow rerouting, if set, forces players to be moved to a different server once a player cap is reached. Less rough than a pure kick.
|
||||
if(src.client.holder) return //admins are immune to overflow rerouting
|
||||
if(config.overflow_whitelist.Find(lowertext(src.ckey))) return //Whitelisted people are immune to overflow rerouting.
|
||||
var/tally = 0
|
||||
for(var/client/C in GLOB.clients)
|
||||
tally++
|
||||
if(tally > config.player_overflow_cap)
|
||||
src << link(config.overflow_server_url)
|
||||
//Overflow rerouting, if set, forces players to be moved to a different server once a player cap is reached. Less rough than a pure kick.
|
||||
if(GLOB.configuration.overflow.reroute_cap && GLOB.configuration.overflow.overflow_server_location)
|
||||
if(client.holder)
|
||||
return //admins are immune to overflow rerouting
|
||||
if(ckey in GLOB.configuration.overflow.overflow_whitelist)
|
||||
return //Whitelisted people are immune to overflow rerouting.
|
||||
if(length(GLOB.clients) > GLOB.configuration.overflow.reroute_cap)
|
||||
src << link(GLOB.configuration.overflow.overflow_server_location)
|
||||
|
||||
@@ -214,7 +214,7 @@
|
||||
return
|
||||
if(client.prefs.species in GLOB.whitelisted_species)
|
||||
|
||||
if(!is_alien_whitelisted(src, client.prefs.species) && config.usealienwhitelist)
|
||||
if(!is_alien_whitelisted(src, client.prefs.species))
|
||||
to_chat(src, alert("You are currently not whitelisted to play [client.prefs.species]."))
|
||||
return FALSE
|
||||
|
||||
@@ -233,7 +233,7 @@
|
||||
client.prefs.load_random_character_slot(client)
|
||||
|
||||
if(client.prefs.species in GLOB.whitelisted_species)
|
||||
if(!is_alien_whitelisted(src, client.prefs.species) && config.usealienwhitelist)
|
||||
if(!is_alien_whitelisted(src, client.prefs.species))
|
||||
to_chat(src, alert("You are currently not whitelisted to play [client.prefs.species]."))
|
||||
return FALSE
|
||||
|
||||
@@ -257,14 +257,14 @@
|
||||
if(job.available_in_playtime(client))
|
||||
return 0
|
||||
|
||||
if(config.assistantlimit)
|
||||
if(GLOB.configuration.jobs.assistant_limit)
|
||||
if(job.title == "Civilian")
|
||||
var/count = 0
|
||||
var/datum/job/officer = SSjobs.GetJob("Security Officer")
|
||||
var/datum/job/warden = SSjobs.GetJob("Warden")
|
||||
var/datum/job/hos = SSjobs.GetJob("Head of Security")
|
||||
count += (officer.current_positions + warden.current_positions + hos.current_positions)
|
||||
if(job.current_positions > (config.assistantratio * count))
|
||||
if(job.current_positions > (GLOB.configuration.jobs.assistant_security_ratio * count))
|
||||
if(count >= 5) // if theres more than 5 security on the station just let assistants join regardless, they should be able to handle the tide
|
||||
return 1
|
||||
return 0
|
||||
@@ -603,7 +603,7 @@
|
||||
|
||||
/mob/new_player/proc/is_species_whitelisted(datum/species/S)
|
||||
if(!S) return 1
|
||||
return is_alien_whitelisted(src, S.name) || !config.usealienwhitelist || !(IS_WHITELISTED in S.species_traits)
|
||||
return is_alien_whitelisted(src, S.name) || !(IS_WHITELISTED in S.species_traits)
|
||||
|
||||
/mob/new_player/get_gender()
|
||||
if(!client || !client.prefs) ..()
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
/mob/proc/say_dead(message)
|
||||
if(client)
|
||||
if(!client.holder)
|
||||
if(!config.dsay_allowed)
|
||||
if(!GLOB.dsay_enabled)
|
||||
to_chat(src, "<span class='danger'>Deadchat is globally muted.</span>")
|
||||
return
|
||||
|
||||
|
||||
@@ -115,7 +115,10 @@
|
||||
dat+= "<hr><div style='float:left;'><a href='?src=[UID()];prev_page=1'>Previous Page</a></div>"
|
||||
else
|
||||
// No trailing punctuation so that it's easy to copy and paste the address
|
||||
dat += "We're sorry to break your immersion, but there has been an error with the newscaster. Please report this error, along with any more information you have, to [config.githuburl]/issues/new?template=bug_report.md"
|
||||
if(GLOB.configuration.url.github_url)
|
||||
dat += "We're sorry to break your immersion, but there has been an error with the newscaster. Please report this error, along with any more information you have, to [GLOB.configuration.url.github_url]/issues/new?template=bug_report.md"
|
||||
else
|
||||
dat += "We're sorry to break your immersion, but there has been an error with the newscaster. Unfortunately there is no GitHub URL set in the config. This is really bad."
|
||||
|
||||
dat += "<br><hr><div align='center'>[curr_page+1]</div>"
|
||||
human_user << browse(dat, "window=newspaper_main;size=300x400")
|
||||
|
||||
@@ -72,9 +72,9 @@
|
||||
if(MOVE_INTENT_RUN)
|
||||
if(M.drowsyness > 0)
|
||||
mob_speed += 6
|
||||
mob_speed += config.run_speed - 1
|
||||
mob_speed += GLOB.configuration.movement.base_run_speed - 1
|
||||
if(MOVE_INTENT_WALK)
|
||||
mob_speed += config.walk_speed - 1
|
||||
mob_speed += GLOB.configuration.movement.base_run_speed - 1
|
||||
mob_speed = BASE_MOVE_DELAY / max(1, BASE_MOVE_DELAY + mob_speed)
|
||||
speed = min(speed + inertia * mob_speed, mob_speed)
|
||||
continue
|
||||
|
||||
@@ -235,8 +235,8 @@
|
||||
var/obj/machinery/computer/camera_advanced/xenobio/X = target
|
||||
|
||||
if(GLOB.cameranet.checkTurfVis(remote_eye.loc))
|
||||
if(LAZYLEN(SSmobs.cubemonkeys) >= config.cubemonkeycap)
|
||||
to_chat(owner, "<span class='warning'>Bluespace harmonics prevent the spawning of more than [config.cubemonkeycap] monkeys on the station at one time!</span>")
|
||||
if(LAZYLEN(SSmobs.cubemonkeys) >= GLOB.configuration.general.monkey_cube_cap)
|
||||
to_chat(owner, "<span class='warning'>Bluespace harmonics prevent the spawning of more than [GLOB.configuration.general.monkey_cube_cap] monkeys on the station at one time!</span>")
|
||||
return
|
||||
else if(X.monkeys >= 1)
|
||||
var/mob/living/carbon/human/monkey/food = new /mob/living/carbon/human/monkey(remote_eye.loc)
|
||||
|
||||
@@ -375,7 +375,7 @@
|
||||
|
||||
if(istype(O, /obj/vehicle))
|
||||
var/obj/vehicle/V = O
|
||||
var/vehicle_speed_mod = config.run_speed
|
||||
var/vehicle_speed_mod = GLOB.configuration.movement.base_run_speed
|
||||
if(V.vehicle_move_delay <= vehicle_speed_mod)
|
||||
to_chat(user, "<span class='warning'>[V] can't be made any faster!</span>")
|
||||
return ..()
|
||||
|
||||
@@ -47,7 +47,7 @@ GLOBAL_VAR_INIT(ert_request_answered, FALSE)
|
||||
return 0
|
||||
|
||||
var/player_age_check = check_client_age(client, GLOB.responseteam_age)
|
||||
if(player_age_check && config.use_age_restriction_for_antags)
|
||||
if(player_age_check && GLOB.configuration.gamemode.antag_account_age_restriction)
|
||||
to_chat(src, "<span class='warning'>This role is not yet available to you. You need to wait another [player_age_check] days.</span>")
|
||||
return 0
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
new_spawn.rename_character(new_spawn.real_name, new_spawn.dna.species.get_random_name(new_spawn.gender))
|
||||
|
||||
to_chat(new_spawn, "<b>Drag the corpses of men and beasts to your nest. It will absorb them to create more of your kind. Glory to the Necropolis!</b>")
|
||||
to_chat(new_spawn, "<span class='motd'>For more information, check the wiki page: ([config.wikiurl]/index.php/Ash_Walker)</span>")
|
||||
to_chat(new_spawn, "<span class='motd'>For more information, check the wiki page: ([GLOB.configuration.url.wiki_url]/index.php/Ash_Walker)</span>")
|
||||
|
||||
/obj/effect/mob_spawn/human/ash_walker/New()
|
||||
. = ..()
|
||||
|
||||
@@ -269,8 +269,6 @@
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(!isnewplayer(M) && !M.client.karma_spent && !(M.client.ckey in GLOB.karma_spenders) && !M.get_preference(PREFTOGGLE_DISABLE_KARMA_REMINDER))
|
||||
to_chat(M, "<i>You have not yet spent your karma for the round; was there a player worthy of receiving your reward? Look under Special Verbs tab, Award Karma.</i>")
|
||||
if(config.map_voting_enabled)
|
||||
SSvote.initiate_vote("map", "the server", TRUE)
|
||||
|
||||
if(SHUTTLE_ESCAPE)
|
||||
if(time_left <= 0)
|
||||
|
||||
@@ -400,7 +400,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
|
||||
//Updates brute_damn and burn_damn from wound damages. Updates BLEEDING status.
|
||||
/obj/item/organ/external/proc/check_fracture(damage_inflicted)
|
||||
if(config.bones_can_break && brute_dam > min_broken_damage && !is_robotic())
|
||||
if(GLOB.configuration.general.breakable_bones && brute_dam > min_broken_damage && !is_robotic())
|
||||
if(prob(damage_inflicted))
|
||||
fracture()
|
||||
|
||||
|
||||
@@ -47,14 +47,14 @@ GLOBAL_DATUM_INIT(ghost_hud_panel, /datum/ui_module/ghost_hud_panel, new)
|
||||
ghost.remove_the_hud(hud_type)
|
||||
|
||||
if("ahud_on")
|
||||
if(!config.antag_hud_allowed && !ghost.client.holder)
|
||||
if(!GLOB.configuration.general.allow_antag_hud && !ghost.client.holder)
|
||||
to_chat(ghost, "<span class='warning'>Admins have disabled this for this round.</span>")
|
||||
return FALSE
|
||||
if(jobban_isbanned(ghost, "AntagHUD"))
|
||||
to_chat(ghost, "<span class='danger'>You have been banned from using this feature.</span>")
|
||||
return FALSE
|
||||
// Check if this is the first time they're turning on Antag HUD.
|
||||
if(!check_rights(R_ADMIN | R_MOD, FALSE) && !ghost.has_enabled_antagHUD && config.antag_hud_restricted)
|
||||
if(!check_rights(R_ADMIN | R_MOD, FALSE) && !ghost.has_enabled_antagHUD && GLOB.configuration.general.restrict_antag_hud_rejoin)
|
||||
var/response = alert(ghost, "If you turn this on, you will not be able to take any part in the round.", "Are you sure you want to enable antag HUD?", "Yes", "No")
|
||||
if(response == "No")
|
||||
return FALSE
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#ifdef UNIT_TESTS
|
||||
#include "component_tests.dm"
|
||||
#include "config_sanity.dm"
|
||||
#include "crafting_lists.dm"
|
||||
#include "log_format.dm"
|
||||
#include "map_templates.dm"
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
// This one test does multiple config things
|
||||
/datum/unit_test/config_sanity/Run()
|
||||
// First test the ruins. Space then lava.
|
||||
var/list/config_space_ruins = GLOB.configuration.ruins.active_space_ruins.Copy() // Copy so we dont remove
|
||||
var/list/datum/map_template/ruin/space/game_space_ruins = list()
|
||||
|
||||
// Yes I know this is inefficient. Sue me.
|
||||
for(var/path in subtypesof(/datum/map_template/ruin/space))
|
||||
var/datum/map_template/ruin/space/S = new path()
|
||||
// istype() doesnt work here. Dont even try it.
|
||||
if(S.ci_exclude == S.type)
|
||||
continue
|
||||
game_space_ruins.Add(S)
|
||||
|
||||
for(var/datum/map_template/ruin/space/S in game_space_ruins)
|
||||
if(S.mappath in config_space_ruins)
|
||||
// Remove both
|
||||
game_space_ruins -= S
|
||||
config_space_ruins -= S.mappath
|
||||
|
||||
// Do not confuse this with the map_templates unit test. They do different things!!!!!
|
||||
if(length(game_space_ruins))
|
||||
Fail("Space ruins exist in the game code that do not exist in the config file")
|
||||
for(var/datum/map_template/ruin/space/S in game_space_ruins)
|
||||
Fail("Ruin [S.type] does not have a valid map path ([S.mappath])")
|
||||
|
||||
if(length(config_space_ruins))
|
||||
Fail("Space ruins exist in the game config that do not have associated datums")
|
||||
for(var/path in config_space_ruins)
|
||||
Fail("- [path]")
|
||||
|
||||
|
||||
// Now for lava ruins
|
||||
var/list/config_lava_ruins = GLOB.configuration.ruins.active_lava_ruins.Copy() // Copy so we dont remove
|
||||
var/list/datum/map_template/ruin/space/game_lava_ruins = list()
|
||||
|
||||
// Yes I know this is inefficient. Sue me.
|
||||
for(var/path in subtypesof(/datum/map_template/ruin/lavaland))
|
||||
var/datum/map_template/ruin/lavaland/L = new path()
|
||||
// istype() doesnt work here. Dont even try it.
|
||||
if(L.ci_exclude == L.type)
|
||||
continue
|
||||
game_lava_ruins.Add(L)
|
||||
|
||||
for(var/datum/map_template/ruin/lavaland/L in game_lava_ruins)
|
||||
if(L.mappath in config_lava_ruins)
|
||||
// Remove both
|
||||
game_lava_ruins -= L
|
||||
config_lava_ruins -= L.mappath
|
||||
|
||||
// Do not confuse this with the map_templates unit test. They do different things!!!!!
|
||||
if(length(game_lava_ruins))
|
||||
Fail("Lava ruins exist in the game code that do not exist in the config file")
|
||||
for(var/datum/map_template/ruin/lavaland/L in game_lava_ruins)
|
||||
Fail("Ruin [L.type] does not have a valid map path ([L.mappath])")
|
||||
|
||||
if(length(config_lava_ruins))
|
||||
Fail("Lava ruins exist in the game config that do not have associated datums")
|
||||
for(var/path in config_lava_ruins)
|
||||
Fail("- [path]")
|
||||
@@ -2,6 +2,10 @@
|
||||
var/list/datum/map_template/templates = subtypesof(/datum/map_template)
|
||||
for(var/I in templates)
|
||||
var/datum/map_template/MT = new I // The new is important here to ensure stuff gets set properly
|
||||
if(MT.ci_exclude == MT.type)
|
||||
continue
|
||||
// Check if it even has a path and if so, does it exist
|
||||
if(MT.mappath && !fexists(MT.mappath))
|
||||
Fail("The map file for [MT.type] does not exist!")
|
||||
if(MT.mappath && !findtext(MT.mappath, ".dmm"))
|
||||
Fail("The map file for [MT.type] is not a map!")
|
||||
|
||||
@@ -1,43 +1,8 @@
|
||||
// Unit test to check SQL version has been updated properly.,
|
||||
/datum/unit_test/sql_version/Run()
|
||||
// Check if the SQL version set in the code is equal to the CI DB config
|
||||
if(config.sql_enabled && sql_version != SQL_VERSION)
|
||||
Fail("SQL version error: Game is running V[SQL_VERSION] but config is V[sql_version]. You may need to update tools/ci/dbconfig.txt")
|
||||
// Check if the CI DB config is up to date with the example dbconfig
|
||||
// This proc is a little unclean but it works
|
||||
var/example_db_version
|
||||
var/list/Lines = file2list("config/example/dbconfig.txt")
|
||||
for(var/t in Lines)
|
||||
if(!t) continue
|
||||
|
||||
t = trim(t)
|
||||
if(length(t) == 0)
|
||||
continue
|
||||
else if(copytext(t, 1, 2) == "#")
|
||||
continue
|
||||
|
||||
var/pos = findtext(t, " ")
|
||||
var/name = null
|
||||
var/value = null
|
||||
|
||||
if(pos)
|
||||
name = lowertext(copytext(t, 1, pos))
|
||||
value = copytext(t, pos + 1)
|
||||
else
|
||||
name = lowertext(t)
|
||||
|
||||
if(!name)
|
||||
continue
|
||||
|
||||
switch(name)
|
||||
if("db_version")
|
||||
example_db_version = text2num(value)
|
||||
|
||||
if(!example_db_version)
|
||||
Fail("SQL version error: File config/example/dbconfig.txt does not have a valid SQL version set!")
|
||||
|
||||
if(example_db_version != SQL_VERSION)
|
||||
Fail("SQL version error: Game is running V[SQL_VERSION] but config/example/dbconfig.txt is V[example_db_version].")
|
||||
if(GLOB.configuration.database.version != SQL_VERSION)
|
||||
Fail("SQL version error: Game is running V[SQL_VERSION] but config is V[GLOB.configuration.database.version]. You may need to update the example config.")
|
||||
|
||||
if(SSdbcore.total_errors > 0)
|
||||
Fail("SQL errors occured on startup. Please fix them.")
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
bed = null
|
||||
. = ..()
|
||||
if(bed && get_dist(oldloc, loc) <= 2)
|
||||
bed.Move(oldloc, get_dir(bed, oldloc), (last_move_diagonal? 2 : 1) * (vehicle_move_delay + config.human_delay))
|
||||
bed.Move(oldloc, get_dir(bed, oldloc), (last_move_diagonal? 2 : 1) * (vehicle_move_delay + GLOB.configuration.movement.human_delay))
|
||||
bed.dir = Dir
|
||||
if(bed.has_buckled_mobs())
|
||||
for(var/m in bed.buckled_mobs)
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
unbuckle_mob(user)
|
||||
return
|
||||
|
||||
var/delay = (last_move_diagonal? 2 : 1) * (vehicle_move_delay + config.human_delay)
|
||||
var/delay = (last_move_diagonal? 2 : 1) * (vehicle_move_delay + GLOB.configuration.movement.human_delay)
|
||||
if(world.time < last_vehicle_move + delay)
|
||||
return
|
||||
last_vehicle_move = world.time
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
/datum/world_topic_handler/proc/invoke(list/input)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
var/authorised = (config.comms_password && input["key"] == config.comms_password) // No password means no comms, not any password
|
||||
var/authorised = (GLOB.configuration.system.topic_key && input["key"] == GLOB.configuration.system.topic_key) // No password means no comms, not any password
|
||||
if(requires_commskey && !authorised)
|
||||
// Try keep all returns in JSON unless absolutely necessary (?ping for example)
|
||||
return(json_encode(list("error" = "Invalid Key")))
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
var/list/admins = list()
|
||||
status_info["version"] = GLOB.revision_info.commit_hash
|
||||
status_info["mode"] = GLOB.master_mode
|
||||
status_info["respawn"] = GLOB.abandon_allowed
|
||||
status_info["respawn"] = GLOB.configuration.general.respawn_enabled
|
||||
status_info["enter"] = GLOB.enter_allowed
|
||||
status_info["vote"] = config.allow_vote_mode
|
||||
status_info["ai"] = config.allow_ai
|
||||
status_info["vote"] = GLOB.configuration.vote.allow_mode_votes
|
||||
status_info["ai"] = GLOB.configuration.jobs.allow_ai
|
||||
status_info["host"] = world.host ? world.host : null
|
||||
status_info["players"] = list()
|
||||
status_info["roundtime"] = worldtime2text()
|
||||
|
||||
Reference in New Issue
Block a user