mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 13:05:44 +01:00
Ports the TG globals controller and converts globals. (#18057)
* SDQL2 update * fix that verb * cl * fix that * toworld * this is pointless * update info * siiiiick.. * vv edit update * fix that * fix editing vars * fix VV * Port the /TG/ globals controller. * part 1 * part 2 * oops * part 3 * Hollow Purple * sadas * bsbsdb * muda na agaki ta * ids 1-15 * 16-31 * 41-75 * bring me back to how things used to be before i lost it all * the strength of mayhem * final touches * cl * protect some vars * update sdql2 to use glob * stuff? * forgot that is not defined there * whoops * observ * but it never gets better * a --------- Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
@@ -111,8 +111,8 @@ var/list/localhost_addresses = list(
|
||||
return
|
||||
|
||||
//Logs all hrefs
|
||||
if(config && config.logsettings["log_hrefs"] && href_logfile)
|
||||
WRITE_LOG(config.logfiles["world_href_log"], "<small>[time2text(world.timeofday,"hh:mm")] [src] (usr:[usr])</small> || [hsrc ? "[hsrc] " : ""][href]<br>")
|
||||
if(GLOB.config && GLOB.config.logsettings["log_hrefs"] && GLOB.href_logfile)
|
||||
WRITE_LOG(GLOB.config.logfiles["world_href_log"], "<small>[time2text(world.timeofday,"hh:mm")] [src] (usr:[usr])</small> || [hsrc ? "[hsrc] " : ""][href]<br>")
|
||||
|
||||
switch(href_list["_src_"])
|
||||
if("holder") hsrc = holder
|
||||
@@ -136,7 +136,7 @@ var/list/localhost_addresses = list(
|
||||
warnings_check()
|
||||
|
||||
if(href_list["linkingrequest"])
|
||||
if (!config.webint_url)
|
||||
if (!GLOB.config.webint_url)
|
||||
return
|
||||
|
||||
if (!href_list["linkingaction"])
|
||||
@@ -144,12 +144,12 @@ var/list/localhost_addresses = list(
|
||||
|
||||
var/request_id = text2num(href_list["linkingrequest"])
|
||||
|
||||
if (!establish_db_connection(dbcon))
|
||||
if (!establish_db_connection(GLOB.dbcon))
|
||||
to_chat(src, "<span class='warning'>Action failed! Database link could not be established!</span>")
|
||||
return
|
||||
|
||||
|
||||
var/DBQuery/check_query = dbcon.NewQuery("SELECT player_ckey, status FROM ss13_player_linking WHERE id = :id:")
|
||||
var/DBQuery/check_query = GLOB.dbcon.NewQuery("SELECT player_ckey, status FROM ss13_player_linking WHERE id = :id:")
|
||||
check_query.Execute(list("id" = request_id))
|
||||
|
||||
if (!check_query.NextRow())
|
||||
@@ -180,7 +180,7 @@ var/list/localhost_addresses = list(
|
||||
to_chat(src, "<span class='warning'>Invalid command sent.</span>")
|
||||
return
|
||||
|
||||
var/DBQuery/update_query = dbcon.NewQuery(query_contents)
|
||||
var/DBQuery/update_query = GLOB.dbcon.NewQuery(query_contents)
|
||||
update_query.Execute(query_details)
|
||||
|
||||
if (href_list["linkingaction"] == "accept" && alert("To complete the process, you have to visit the website. Do you want to do so now?",,"Yes","No") == "Yes")
|
||||
@@ -215,14 +215,14 @@ var/list/localhost_addresses = list(
|
||||
|
||||
// Forum link from various panels.
|
||||
if ("github")
|
||||
if (!config.githuburl)
|
||||
if (!GLOB.config.githuburl)
|
||||
to_chat(src, "<span class='danger'>GitHub URL not set in the config. Unable to open the site.</span>")
|
||||
else if (alert("This will open the GitHub page in your browser. Are you sure?",, "Yes", "No") == "Yes")
|
||||
if (href_list["pr"])
|
||||
var/pr_link = "[config.githuburl]pull/[href_list["pr"]]"
|
||||
var/pr_link = "[GLOB.config.githuburl]pull/[href_list["pr"]]"
|
||||
send_link(src, pr_link)
|
||||
else
|
||||
send_link(src, config.githuburl)
|
||||
send_link(src, GLOB.config.githuburl)
|
||||
|
||||
// Forum link from various panels.
|
||||
if ("forums")
|
||||
@@ -273,13 +273,13 @@ var/list/localhost_addresses = list(
|
||||
..() //redirect to hsrc.Topic()
|
||||
|
||||
/proc/client_by_ckey(ckey)
|
||||
return directory[ckey]
|
||||
return GLOB.directory[ckey]
|
||||
|
||||
/client/proc/automute_by_time(mute_type)
|
||||
if (!last_message_time)
|
||||
return FALSE
|
||||
|
||||
if (config.macro_trigger && (REALTIMEOFDAY - last_message_time) < config.macro_trigger)
|
||||
if (GLOB.config.macro_trigger && (REALTIMEOFDAY - last_message_time) < GLOB.config.macro_trigger)
|
||||
spam_alert = min(spam_alert + 1, 4)
|
||||
LOG_DEBUG("SPAM_PROTECT: [src] tripped macro-trigger. Now at alert [spam_alert].")
|
||||
|
||||
@@ -323,7 +323,7 @@ var/list/localhost_addresses = list(
|
||||
if (prefs.muted & mute_type)
|
||||
to_chat(src, "<span class='warning'>You are muted and cannot send messages.</span>")
|
||||
. = TRUE
|
||||
else if (config.automute_on && !holder && length(message))
|
||||
else if (GLOB.config.automute_on && !holder && length(message))
|
||||
. = . || automute_by_time(mute_type)
|
||||
|
||||
. = . || automute_by_duplicate(message, mute_type)
|
||||
@@ -357,20 +357,20 @@ var/list/localhost_addresses = list(
|
||||
if(byond_version < MIN_CLIENT_VERSION) //Out of date client.
|
||||
return null
|
||||
|
||||
if(!(config.guests_allowed || config.external_auth) && IsGuestKey(key))
|
||||
if(!(GLOB.config.guests_allowed || GLOB.config.external_auth) && IsGuestKey(key))
|
||||
alert(src,"This server doesn't allow guest accounts to play. Please go to http://www.byond.com/ and register for a key.","Guest","OK")
|
||||
del(src)
|
||||
return
|
||||
|
||||
clients += src
|
||||
directory[ckey] = src
|
||||
GLOB.clients += src
|
||||
GLOB.directory[ckey] = src
|
||||
connection_time = world.time
|
||||
connection_realtime = world.realtime
|
||||
connection_timeofday = world.timeofday
|
||||
|
||||
if (LAZYLEN(config.client_blacklist_version))
|
||||
if (LAZYLEN(GLOB.config.client_blacklist_version))
|
||||
var/client_version = "[byond_version].[byond_build]"
|
||||
if (client_version in config.client_blacklist_version)
|
||||
if (client_version in GLOB.config.client_blacklist_version)
|
||||
to_chat_immediate(src, "<span class='danger'><b>Your version of BYOND is explicitly blacklisted from joining this server!</b></span>")
|
||||
to_chat_immediate(src, "Your current version: [client_version].")
|
||||
to_chat_immediate(src, "Visit http://www.byond.com/download/ to download a different version. Try looking for a newer one, or go one lower.")
|
||||
@@ -384,7 +384,7 @@ var/list/localhost_addresses = list(
|
||||
tgui_panel = new(src, "browseroutput")
|
||||
tgui_say = new(src, "tgui_say")
|
||||
|
||||
if(IsGuestKey(key) && config.external_auth)
|
||||
if(IsGuestKey(key) && GLOB.config.external_auth)
|
||||
src.authed = FALSE
|
||||
var/mob/abstract/unauthed/m = new()
|
||||
m.client = src
|
||||
@@ -434,7 +434,7 @@ var/list/localhost_addresses = list(
|
||||
/client/proc/InitClient()
|
||||
to_chat(src, "<span class='alert'>If the title screen is black, resources are still downloading. Please be patient until the title screen appears.</span>")
|
||||
|
||||
var/local_connection = (config.auto_local_admin && !config.use_forumuser_api && (isnull(address) || localhost_addresses[address]))
|
||||
var/local_connection = (GLOB.config.auto_local_admin && !GLOB.config.use_forumuser_api && (isnull(address) || localhost_addresses[address]))
|
||||
// Automatic admin rights for people connecting locally.
|
||||
// Concept stolen from /tg/ with deepest gratitude.
|
||||
// And ported from Nebula with love.
|
||||
@@ -444,16 +444,16 @@ var/list/localhost_addresses = list(
|
||||
//Admin Authorisation
|
||||
holder = admin_datums[ckey]
|
||||
if(holder)
|
||||
staff += src
|
||||
GLOB.staff += src
|
||||
holder.owner = src
|
||||
|
||||
log_client_to_db()
|
||||
|
||||
if (byond_version < config.client_error_version)
|
||||
if (byond_version < GLOB.config.client_error_version)
|
||||
to_chat(src, "<span class='danger'><b>Your version of BYOND is too old!</b></span>")
|
||||
to_chat(src, config.client_error_message)
|
||||
to_chat(src, GLOB.config.client_error_message)
|
||||
to_chat(src, "Your version: [byond_version].")
|
||||
to_chat(src, "Required version: [config.client_error_version] or later.")
|
||||
to_chat(src, "Required version: [GLOB.config.client_error_version] or later.")
|
||||
to_chat(src, "Visit http://www.byond.com/download/ to get the latest version of BYOND.")
|
||||
if (holder)
|
||||
to_chat(src, "Admins get a free pass. However, <b>please</b> update your BYOND as soon as possible. Certain things may cause crashes if you play with your present version.")
|
||||
@@ -464,7 +464,7 @@ var/list/localhost_addresses = list(
|
||||
|
||||
// New player, and we don't want any.
|
||||
if (!holder)
|
||||
if (config.access_deny_new_players && player_age == -1)
|
||||
if (GLOB.config.access_deny_new_players && player_age == -1)
|
||||
log_access("Failed Login: [key] [computer_id] [address] - New player attempting connection during panic bunker.", ckey = ckey)
|
||||
message_admins("Failed Login: [key] [computer_id] [address] - New player attempting connection during panic bunker.")
|
||||
to_chat(src, "<span class='danger'>Apologies, but the server is currently not accepting connections from never before seen players.</span>")
|
||||
@@ -472,7 +472,7 @@ var/list/localhost_addresses = list(
|
||||
return 0
|
||||
|
||||
// Check if the account is too young.
|
||||
if (config.access_deny_new_accounts != -1 && account_age != -1 && account_age <= config.access_deny_new_accounts)
|
||||
if (GLOB.config.access_deny_new_accounts != -1 && account_age != -1 && account_age <= GLOB.config.access_deny_new_accounts)
|
||||
log_access("Failed Login: [key] [computer_id] [address] - Account too young to play. [account_age] days.", ckey = ckey)
|
||||
message_admins("Failed Login: [key] [computer_id] [address] - Account too young to play. [account_age] days.")
|
||||
to_chat(src, "<span class='danger'>Apologies, but the server is currently not accepting connections from BYOND accounts this young.</span>")
|
||||
@@ -500,12 +500,12 @@ var/list/localhost_addresses = list(
|
||||
//DISCONNECT//
|
||||
//////////////
|
||||
/client/Del()
|
||||
ticket_panels -= src
|
||||
GLOB.ticket_panels -= src
|
||||
if(holder)
|
||||
holder.owner = null
|
||||
staff -= src
|
||||
directory -= ckey
|
||||
clients -= src
|
||||
GLOB.staff -= src
|
||||
GLOB.directory -= ckey
|
||||
GLOB.clients -= src
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -514,10 +514,10 @@ var/list/localhost_addresses = list(
|
||||
// Returns null if no DB connection can be established, or -1 if the requested key was not found in the database
|
||||
|
||||
/proc/get_player_age(key)
|
||||
if(!establish_db_connection(dbcon))
|
||||
if(!establish_db_connection(GLOB.dbcon))
|
||||
return null
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT datediff(Now(),firstseen) as age FROM ss13_player WHERE ckey = :ckey:")
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT datediff(Now(),firstseen) as age FROM ss13_player WHERE ckey = :ckey:")
|
||||
query.Execute(list("ckey"=ckey(key)))
|
||||
|
||||
if(query.NextRow())
|
||||
@@ -529,10 +529,10 @@ var/list/localhost_addresses = list(
|
||||
if (IsGuestKey(src.key))
|
||||
return
|
||||
|
||||
if(!establish_db_connection(dbcon))
|
||||
if(!establish_db_connection(GLOB.dbcon))
|
||||
return
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT datediff(Now(),firstseen) as age, whitelist_status, account_join_date, DATEDIFF(NOW(), account_join_date) FROM ss13_player WHERE ckey = :ckey:")
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT datediff(Now(),firstseen) as age, whitelist_status, account_join_date, DATEDIFF(NOW(), account_join_date) FROM ss13_player WHERE ckey = :ckey:")
|
||||
|
||||
if(!query.Execute(list("ckey"=ckey(key))))
|
||||
return
|
||||
@@ -551,20 +551,20 @@ var/list/localhost_addresses = list(
|
||||
if (!account_join_date)
|
||||
account_age = -1
|
||||
else
|
||||
var/DBQuery/query_datediff = dbcon.NewQuery("SELECT DATEDIFF(NOW(), [account_join_date])")
|
||||
var/DBQuery/query_datediff = GLOB.dbcon.NewQuery("SELECT DATEDIFF(NOW(), [account_join_date])")
|
||||
if (!query_datediff.Execute())
|
||||
return
|
||||
if (query_datediff.NextRow())
|
||||
account_age = text2num(query_datediff.item[1])
|
||||
|
||||
var/DBQuery/query_ip = dbcon.NewQuery("SELECT ckey FROM ss13_player WHERE ip = '[address]'")
|
||||
var/DBQuery/query_ip = GLOB.dbcon.NewQuery("SELECT ckey FROM ss13_player WHERE ip = '[address]'")
|
||||
query_ip.Execute()
|
||||
related_accounts_ip = ""
|
||||
while(query_ip.NextRow())
|
||||
related_accounts_ip += "[query_ip.item[1]], "
|
||||
break
|
||||
|
||||
var/DBQuery/query_cid = dbcon.NewQuery("SELECT ckey FROM ss13_player WHERE computerid = '[computer_id]'")
|
||||
var/DBQuery/query_cid = GLOB.dbcon.NewQuery("SELECT ckey FROM ss13_player WHERE computerid = '[computer_id]'")
|
||||
query_cid.Execute()
|
||||
related_accounts_cid = ""
|
||||
while(query_cid.NextRow())
|
||||
@@ -577,11 +577,11 @@ var/list/localhost_addresses = list(
|
||||
|
||||
if(found)
|
||||
//Player already identified previously, we need to just update the 'lastseen', 'ip', 'computer_id', 'byond_version' and 'byond_build' variables
|
||||
var/DBQuery/query_update = dbcon.NewQuery("UPDATE ss13_player SET lastseen = Now(), ip = :ip:, computerid = :computerid:, lastadminrank = :lastadminrank:, account_join_date = :account_join_date:, byond_version = :byond_version:, byond_build = :byond_build: WHERE ckey = :ckey:")
|
||||
var/DBQuery/query_update = GLOB.dbcon.NewQuery("UPDATE ss13_player SET lastseen = Now(), ip = :ip:, computerid = :computerid:, lastadminrank = :lastadminrank:, account_join_date = :account_join_date:, byond_version = :byond_version:, byond_build = :byond_build: WHERE ckey = :ckey:")
|
||||
query_update.Execute(list("ckey"=ckey(key),"ip"=src.address,"computerid"=src.computer_id,"lastadminrank"=admin_rank,"account_join_date"=account_join_date,"byond_version"=byond_version,"byond_build"=byond_build))
|
||||
else if (!config.access_deny_new_players)
|
||||
else if (!GLOB.config.access_deny_new_players)
|
||||
//New player!! Need to insert all the stuff
|
||||
var/DBQuery/query_insert = dbcon.NewQuery("INSERT INTO ss13_player (ckey, firstseen, lastseen, ip, computerid, lastadminrank, account_join_date, byond_version, byond_build) VALUES (:ckey:, Now(), Now(), :ip:, :computerid:, :lastadminrank:, :account_join_date:, :byond_version:, :byond_build:)")
|
||||
var/DBQuery/query_insert = GLOB.dbcon.NewQuery("INSERT INTO ss13_player (ckey, firstseen, lastseen, ip, computerid, lastadminrank, account_join_date, byond_version, byond_build) VALUES (:ckey:, Now(), Now(), :ip:, :computerid:, :lastadminrank:, :account_join_date:, :byond_version:, :byond_build:)")
|
||||
query_insert.Execute(list("ckey"=ckey(key),"ip"=src.address,"computerid"=src.computer_id,"lastadminrank"=admin_rank,"account_join_date"=account_join_date,"byond_version"=byond_version,"byond_build"=byond_build))
|
||||
else
|
||||
// Flag as -1 to know we have to kiiick them.
|
||||
@@ -591,7 +591,7 @@ var/list/localhost_addresses = list(
|
||||
account_join_date = "Error"
|
||||
|
||||
//Logging player access
|
||||
var/DBQuery/query_accesslog = dbcon.NewQuery("INSERT INTO `ss13_connection_log`(`datetime`,`serverip`,`ckey`,`ip`,`computerid`,`byond_version`,`byond_build`,`game_id`) VALUES(Now(), :serverip:, :ckey:, :ip:, :computerid:, :byond_version:, :byond_build:, :game_id:);")
|
||||
var/DBQuery/query_accesslog = GLOB.dbcon.NewQuery("INSERT INTO `ss13_connection_log`(`datetime`,`serverip`,`ckey`,`ip`,`computerid`,`byond_version`,`byond_build`,`game_id`) VALUES(Now(), :serverip:, :ckey:, :ip:, :computerid:, :byond_version:, :byond_build:, :game_id:);")
|
||||
query_accesslog.Execute(list("serverip"="[world.internet_address]:[world.port]","ckey"=ckey(key),"ip"=src.address,"computerid"=src.computer_id,"byond_version"=byond_version,"byond_build"=byond_build,"game_id"=game_id))
|
||||
|
||||
|
||||
@@ -609,7 +609,7 @@ var/list/localhost_addresses = list(
|
||||
/client/proc/send_resources()
|
||||
#if (PRELOAD_RSC == 0)
|
||||
var/static/next_external_rsc = 0
|
||||
var/list/external_rsc_urls = config.external_rsc_urls
|
||||
var/list/external_rsc_urls = GLOB.config.external_rsc_urls
|
||||
if(length(external_rsc_urls))
|
||||
next_external_rsc = Wrap(next_external_rsc+1, 1, external_rsc_urls.len+1)
|
||||
preload_rsc = external_rsc_urls[next_external_rsc]
|
||||
@@ -620,7 +620,7 @@ var/list/localhost_addresses = list(
|
||||
src << browse('code/modules/asset_cache/validate_assets.html', "window=asset_cache_browser")
|
||||
|
||||
//Precache the client with all other assets slowly, so as to not block other browse() calls
|
||||
if (config.asset_simple_preload)
|
||||
if (GLOB.config.asset_simple_preload)
|
||||
addtimer(CALLBACK(SSassets.transport, TYPE_PROC_REF(/datum/asset_transport, send_assets_slow), src, SSassets.transport.preload), 5 SECONDS)
|
||||
|
||||
|
||||
@@ -679,16 +679,16 @@ var/list/localhost_addresses = list(
|
||||
check_linking_requests()
|
||||
|
||||
/client/proc/check_linking_requests()
|
||||
if (!config.webint_url || !config.sql_enabled)
|
||||
if (!GLOB.config.webint_url || !GLOB.config.sql_enabled)
|
||||
return
|
||||
|
||||
if (!establish_db_connection(dbcon))
|
||||
if (!establish_db_connection(GLOB.dbcon))
|
||||
return
|
||||
|
||||
var/list/requests = list()
|
||||
var/list/query_details = list("ckey" = ckey)
|
||||
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT id, forum_id, forum_username, datediff(Now(), created_at) as request_age FROM ss13_player_linking WHERE status = 'new' AND player_ckey = :ckey: AND deleted_at IS NULL")
|
||||
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT id, forum_id, forum_username, datediff(Now(), created_at) as request_age FROM ss13_player_linking WHERE status = 'new' AND player_ckey = :ckey: AND deleted_at IS NULL")
|
||||
select_query.Execute(query_details)
|
||||
|
||||
while (select_query.NextRow())
|
||||
@@ -703,7 +703,7 @@ var/list/localhost_addresses = list(
|
||||
i++
|
||||
|
||||
var/linked_forum_name = null
|
||||
if (config.forumurl)
|
||||
if (GLOB.config.forumurl)
|
||||
var/route_attributes = list2params(list("mode" = "viewprofile", "u" = request["forum_id"]))
|
||||
linked_forum_name = "<a href='byond://?src=\ref[src];routeWebInt=forums/members;routeAttributes=[route_attributes]'>[request["forum_username"]]</a>"
|
||||
|
||||
@@ -716,13 +716,13 @@ var/list/localhost_addresses = list(
|
||||
return
|
||||
|
||||
/client/proc/gather_linking_requests()
|
||||
if (!config.webint_url || !config.sql_enabled)
|
||||
if (!GLOB.config.webint_url || !GLOB.config.sql_enabled)
|
||||
return
|
||||
|
||||
if (!establish_db_connection(dbcon))
|
||||
if (!establish_db_connection(GLOB.dbcon))
|
||||
return
|
||||
|
||||
var/DBQuery/select_query = dbcon.NewQuery("SELECT COUNT(*) AS request_count FROM ss13_player_linking WHERE status = 'new' AND player_ckey = :ckey: AND deleted_at IS NULL")
|
||||
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT COUNT(*) AS request_count FROM ss13_player_linking WHERE status = 'new' AND player_ckey = :ckey: AND deleted_at IS NULL")
|
||||
select_query.Execute(list("ckey" = ckey))
|
||||
|
||||
if (select_query.NextRow())
|
||||
@@ -742,18 +742,18 @@ var/list/localhost_addresses = list(
|
||||
if (!webint_validate_attributes(list("mode", "u"), attributes_text = attributes))
|
||||
return
|
||||
|
||||
if (!config.forumurl)
|
||||
if (!GLOB.config.forumurl)
|
||||
return
|
||||
|
||||
linkURL = "[config.forumurl]memberlist.php?"
|
||||
linkURL = "[GLOB.config.forumurl]memberlist.php?"
|
||||
|
||||
linkURL += attributes
|
||||
|
||||
if ("interface/user/link")
|
||||
if (!config.webint_url)
|
||||
if (!GLOB.config.webint_url)
|
||||
return
|
||||
|
||||
linkURL = "[config.webint_url]user/link"
|
||||
linkURL = "[GLOB.config.webint_url]user/link"
|
||||
|
||||
if ("interface/login/sso_server")
|
||||
//This also validates the attributes as it runs
|
||||
@@ -761,10 +761,10 @@ var/list/localhost_addresses = list(
|
||||
if (!new_attributes)
|
||||
return
|
||||
|
||||
if (!config.webint_url)
|
||||
if (!GLOB.config.webint_url)
|
||||
return
|
||||
|
||||
linkURL = "[config.webint_url]login/sso_server?"
|
||||
linkURL = "[GLOB.config.webint_url]login/sso_server?"
|
||||
linkURL += new_attributes
|
||||
|
||||
else
|
||||
@@ -776,9 +776,9 @@ var/list/localhost_addresses = list(
|
||||
|
||||
/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 (GLOB.config.ipintel_email)
|
||||
var/datum/ipintel/res = get_ip_intel(address)
|
||||
if (config.ipintel_rating_kick && res.intel >= config.ipintel_rating_kick)
|
||||
if (GLOB.config.ipintel_rating_kick && res.intel >= GLOB.config.ipintel_rating_kick)
|
||||
if (!holder)
|
||||
message_admins("Proxy Detection: [key_name_admin(src)] IP intel rated [res.intel*100]% likely to be a proxy/VPN. They are being kicked because of this.")
|
||||
log_admin("Proxy Detection: [key_name_admin(src)] IP intel rated [res.intel*100]% likely to be a proxy/VPN. They are being kicked because of this.")
|
||||
@@ -786,7 +786,7 @@ var/list/localhost_addresses = list(
|
||||
del(src)
|
||||
else
|
||||
message_admins("Proxy Detection: [key_name_admin(src)] IP intel rated [res.intel*100]% likely to be a Proxy/VPN.")
|
||||
else if (res.intel >= config.ipintel_rating_bad)
|
||||
else if (res.intel >= GLOB.config.ipintel_rating_bad)
|
||||
message_admins("Proxy Detection: [key_name_admin(src)] IP intel rated [res.intel*100]% likely to be a Proxy/VPN.")
|
||||
ip_intel = res.intel
|
||||
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
"<table>"
|
||||
)
|
||||
var/is_global_banned = jobban_isbanned(preference_mob(), "Antagonist")
|
||||
for(var/antag_type in all_antag_types)
|
||||
var/datum/antagonist/antag = all_antag_types[antag_type]
|
||||
for(var/antag_type in GLOB.all_antag_types)
|
||||
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
|
||||
if(antag.flags & ANTAG_NO_ROUNDSTART_SPAWN)
|
||||
continue
|
||||
dat += "<tr><td>[antag.role_text]: </td><td>"
|
||||
@@ -52,7 +52,7 @@
|
||||
dat += "<span class='danger'>\[IN [player_old_enough_for_role(preference_mob(), antag.bantype)] DAYS\]</span><br>"
|
||||
else if(is_global_banned || ban_reason)
|
||||
dat += "<span class='danger'>\[<a href='?src=\ref[user.client];view_jobban=[is_global_banned ? "Antagonist" : "[antag.bantype]"];'>BANNED</a>\]</span><br>"
|
||||
else if(establish_db_connection(dbcon) && antag.required_age && antag.required_age > user.client?.player_age)
|
||||
else if(establish_db_connection(GLOB.dbcon) && antag.required_age && antag.required_age > user.client?.player_age)
|
||||
dat += "<span class='notice'>ACC TOO YOUNG</span><br>"
|
||||
else if(antag.role_type in pref.be_special_role)
|
||||
dat += "<b>Yes</b> / <a href='?src=\ref[src];del_special=[antag.role_type]'>No</a></br>"
|
||||
@@ -78,8 +78,8 @@
|
||||
|
||||
/datum/category_item/player_setup_item/antagonism/candidacy/proc/valid_special_roles()
|
||||
var/list/private_valid_special_roles = list()
|
||||
for(var/antag_type in all_antag_types)
|
||||
var/datum/antagonist/antag = all_antag_types[antag_type]
|
||||
for(var/antag_type in GLOB.all_antag_types)
|
||||
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
|
||||
private_valid_special_roles += antag.role_type
|
||||
|
||||
return private_valid_special_roles
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
S["OOC_Notes"] >> pref.metadata
|
||||
S["floating_chat_color"] >> pref.floating_chat_color
|
||||
S["speech_bubble_type"] >> pref.speech_bubble_type
|
||||
if(istype(all_species[pref.species], /datum/species/machine))
|
||||
if(istype(GLOB.all_species[pref.species], /datum/species/machine))
|
||||
S["ipc_tag_status"] >> pref.machine_tag_status
|
||||
S["ipc_serial_number"] >> pref.machine_serial_number
|
||||
S["ipc_ownership_status"] >> pref.machine_ownership_status
|
||||
@@ -29,7 +29,7 @@
|
||||
S["OOC_Notes"] << pref.metadata
|
||||
S["floating_chat_color"] << pref.floating_chat_color
|
||||
S["speech_bubble_type"] << pref.speech_bubble_type
|
||||
if(istype(all_species[pref.species], /datum/species/machine))
|
||||
if(istype(GLOB.all_species[pref.species], /datum/species/machine))
|
||||
S["ipc_tag_status"] << pref.machine_tag_status
|
||||
S["ipc_serial_number"] << pref.machine_serial_number
|
||||
S["ipc_ownership_status"] << pref.machine_ownership_status
|
||||
@@ -119,19 +119,19 @@
|
||||
pref.can_edit_name = TRUE
|
||||
pref.can_edit_ipc_tag = TRUE
|
||||
|
||||
if (config.sql_saves && pref.current_character)
|
||||
if (!establish_db_connection(dbcon))
|
||||
if (GLOB.config.sql_saves && pref.current_character)
|
||||
if (!establish_db_connection(GLOB.dbcon))
|
||||
return
|
||||
|
||||
// Called /after/ loading and /before/ sanitization.
|
||||
// So we have pref.current_character. It's just in text format.
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT DATEDIFF(NOW(), created_at) AS DiffDate FROM ss13_characters WHERE id = :id:")
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT DATEDIFF(NOW(), created_at) AS DiffDate FROM ss13_characters WHERE id = :id:")
|
||||
query.Execute(list("id" = text2num(pref.current_character)))
|
||||
|
||||
if (query.NextRow())
|
||||
if (text2num(query.item[1]) > 5)
|
||||
pref.can_edit_name = FALSE
|
||||
if(config.ipc_timelock_active)
|
||||
if(GLOB.config.ipc_timelock_active)
|
||||
pref.can_edit_ipc_tag = FALSE
|
||||
else
|
||||
log_world("ERROR: SQL CHARACTER LOAD: Logic error, general/basic/load_special() didn't return any rows when it should have. Character ID: [pref.current_character].")
|
||||
@@ -140,8 +140,8 @@
|
||||
if(!pref.species)
|
||||
pref.species = SPECIES_HUMAN
|
||||
var/is_in_playable_species = FALSE
|
||||
for(var/thing in playable_species)
|
||||
if(pref.species in playable_species[thing])
|
||||
for(var/thing in GLOB.playable_species)
|
||||
if(pref.species in GLOB.playable_species[thing])
|
||||
is_in_playable_species = TRUE
|
||||
if(!is_in_playable_species)
|
||||
pref.species = SPECIES_HUMAN
|
||||
@@ -156,7 +156,7 @@
|
||||
pref.spawnpoint = sanitize_inlist(pref.spawnpoint, SSatlas.spawn_locations, initial(pref.spawnpoint))
|
||||
pref.machine_tag_status = text2num(pref.machine_tag_status) // SQL queries return as text, so make this a num
|
||||
pref.floating_chat_color = sanitize_hexcolor(pref.floating_chat_color, get_random_colour(0, 160, 230))
|
||||
var/datum/species/S = all_species[pref.species]
|
||||
var/datum/species/S = GLOB.all_species[pref.species]
|
||||
if(!pref.speech_bubble_type || !(pref.speech_bubble_type in S.possible_speech_bubble_types))
|
||||
if(istype(S))
|
||||
pref.speech_bubble_type = S.possible_speech_bubble_types[1]
|
||||
@@ -173,7 +173,7 @@
|
||||
dat += "(<a href='?src=\ref[src];random_name=1'>Random Name</A>)"
|
||||
dat += "<br>"
|
||||
dat += "<b>Sex:</b> <a href='?src=\ref[src];gender=1'><b>[capitalize(lowertext(pref.gender))]</b></a><br>"
|
||||
var/datum/species/S = all_species[pref.species]
|
||||
var/datum/species/S = GLOB.all_species[pref.species]
|
||||
if(length(S.selectable_pronouns))
|
||||
dat += "<b>Pronouns:</b> <a href='?src=\ref[src];pronouns=1'><b>[capitalize_first_letters(pref.pronouns)]</b></a><br>"
|
||||
dat += "<b>Age:</b> <a href='?src=\ref[src];age=1'>[pref.age]</a><br>"
|
||||
@@ -197,7 +197,7 @@
|
||||
else
|
||||
dat += "<b>Serial Number:</b> [pref.machine_serial_number] (<a href='?src=\ref[src];namehelp=1'>?</a>)<br>"
|
||||
dat += "<b>Ownership Status:</b> [pref.machine_ownership_status] (<a href='?src=\ref[src];namehelp=1'>?</a>)<br>"
|
||||
if(config.allow_Metadata)
|
||||
if(GLOB.config.allow_Metadata)
|
||||
dat += "<b>OOC Notes:</b> <a href='?src=\ref[src];metadata=1'> Edit </a><br>"
|
||||
|
||||
. = dat.Join()
|
||||
@@ -217,9 +217,9 @@
|
||||
if(new_name)
|
||||
if(new_name == pref.real_name)
|
||||
return TOPIC_NOACTION //If the name is the same do nothing
|
||||
if(config.sql_saves)
|
||||
if(GLOB.config.sql_saves)
|
||||
//Check if the player already has a character with the same name. (We dont have to account for the current char in that query, as that is already handled by the condition above)
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT COUNT(*) FROM ss13_characters WHERE ckey = :ckey: and name = :char_name:")
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT COUNT(*) FROM ss13_characters WHERE ckey = :ckey: and name = :char_name:")
|
||||
query.Execute(list("ckey" = user.client.ckey, "char_name" = new_name))
|
||||
query.NextRow()
|
||||
var/count = text2num(query.item[1])
|
||||
@@ -255,13 +255,13 @@
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["speech_bubble_type"])
|
||||
var/datum/species/S = all_species[pref.species]
|
||||
var/datum/species/S = GLOB.all_species[pref.species]
|
||||
pref.speech_bubble_type = next_in_list(pref.speech_bubble_type, S.possible_speech_bubble_types)
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["gender"])
|
||||
var/datum/species/S = all_species[pref.species]
|
||||
pref.gender = next_in_list(pref.gender, valid_player_genders & S.default_genders)
|
||||
var/datum/species/S = GLOB.all_species[pref.species]
|
||||
pref.gender = next_in_list(pref.gender, GLOB.valid_player_genders & S.default_genders)
|
||||
pref.pronouns = pref.gender
|
||||
|
||||
var/datum/category_item/player_setup_item/general/equipment/equipment_item = category.items[4]
|
||||
@@ -269,7 +269,7 @@
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["pronouns"])
|
||||
var/datum/species/S = all_species[pref.species]
|
||||
var/datum/species/S = GLOB.all_species[pref.species]
|
||||
var/selectable_pronouns = list() // this only exists to uppercase the first letters, otherwise it is uggo
|
||||
for(var/pronoun in S.selectable_pronouns)
|
||||
selectable_pronouns += capitalize_first_letters(pronoun)
|
||||
@@ -286,7 +286,7 @@
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["height"])
|
||||
var/datum/species/char_spec = all_species[pref.species]
|
||||
var/datum/species/char_spec = GLOB.all_species[pref.species]
|
||||
var/new_height = input(user, "Choose your character's height: (Values in Centimetres. [char_spec.name] height range [pref.getMinHeight()] - [pref.getMaxHeight()])", "Character Preference", pref.height) as num|null
|
||||
if(new_height && CanUseTopic(user))
|
||||
pref.height = max(min(round(text2num(new_height)), pref.getMaxHeight()),pref.getMinHeight())
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
// Nothing to validate. Leave.
|
||||
return
|
||||
|
||||
var/datum/species/S = all_species[pref.species] || all_species[SPECIES_HUMAN]
|
||||
var/datum/species/S = GLOB.all_species[pref.species] || GLOB.all_species[SPECIES_HUMAN]
|
||||
|
||||
if (pref.alternate_languages.len > S.num_alternate_languages)
|
||||
if(pref.client)
|
||||
@@ -62,9 +62,9 @@
|
||||
return
|
||||
|
||||
var/list/langs = S.secondary_langs.Copy()
|
||||
for (var/L in all_languages)
|
||||
var/datum/language/lang = all_languages[L]
|
||||
if (pref.client && !(lang.flags & RESTRICTED) && (!config.usealienwhitelist || is_alien_whitelisted(pref.client.mob, L) || !(lang.flags & WHITELISTED)))
|
||||
for (var/L in GLOB.all_languages)
|
||||
var/datum/language/lang = GLOB.all_languages[L]
|
||||
if (pref.client && !(lang.flags & RESTRICTED) && (!GLOB.config.usealienwhitelist || is_alien_whitelisted(pref.client.mob, L) || !(lang.flags & WHITELISTED)))
|
||||
langs |= L
|
||||
|
||||
var/list/bad_langs = pref.alternate_languages - langs
|
||||
@@ -82,7 +82,7 @@
|
||||
|
||||
/datum/category_item/player_setup_item/general/language/content(var/mob/user)
|
||||
var/list/dat = list("<b>Languages</b><br>")
|
||||
var/datum/species/S = all_species[pref.species]
|
||||
var/datum/species/S = GLOB.all_species[pref.species]
|
||||
if(S.language)
|
||||
dat += "- [S.language]<br>"
|
||||
if(S.default_language && S.default_language != S.language)
|
||||
@@ -113,14 +113,14 @@
|
||||
|
||||
return TOPIC_REFRESH
|
||||
else if(href_list["add_language"])
|
||||
var/datum/species/S = all_species[pref.species]
|
||||
var/datum/species/S = GLOB.all_species[pref.species]
|
||||
if(pref.alternate_languages.len >= S.num_alternate_languages)
|
||||
alert(user, "You have already selected the maximum number of alternate languages for this species!")
|
||||
else
|
||||
var/list/available_languages = S.secondary_langs.Copy()
|
||||
for(var/L in all_languages)
|
||||
var/datum/language/lang = all_languages[L]
|
||||
if(!(lang.flags & RESTRICTED) && (!config.usealienwhitelist || is_alien_whitelisted(user, L) || !(lang.flags & WHITELISTED)))
|
||||
for(var/L in GLOB.all_languages)
|
||||
var/datum/language/lang = GLOB.all_languages[L]
|
||||
if(!(lang.flags & RESTRICTED) && (!GLOB.config.usealienwhitelist || is_alien_whitelisted(user, L) || !(lang.flags & WHITELISTED)))
|
||||
available_languages |= L
|
||||
|
||||
// make sure we don't let them waste slots on the default languages
|
||||
|
||||
@@ -184,7 +184,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
LOG_DEBUG("DISABILITIES: Caught [e]. Initial value: [before]")
|
||||
pref.disabilities = list()
|
||||
|
||||
var/datum/species/mob_species = all_species[pref.species]
|
||||
var/datum/species/mob_species = GLOB.all_species[pref.species]
|
||||
|
||||
pref.r_hair = sanitize_integer(pref.r_hair, 0, 255, initial(pref.r_hair))
|
||||
pref.g_hair = sanitize_integer(pref.g_hair, 0, 255, initial(pref.g_hair))
|
||||
@@ -197,9 +197,9 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
pref.g_skin = sanitize_integer(pref.g_skin, 0, 255, initial(pref.g_skin))
|
||||
pref.b_skin = sanitize_integer(pref.b_skin, 0, 255, initial(pref.b_skin))
|
||||
pref.tail_style = sanitize_inlist(pref.tail_style, mob_species.selectable_tails, mob_species.tail)
|
||||
pref.h_style = sanitize_inlist(pref.h_style, hair_styles_list, initial(pref.h_style))
|
||||
pref.f_style = sanitize_inlist(pref.f_style, facial_hair_styles_list, initial(pref.f_style))
|
||||
pref.g_style = sanitize_inlist(pref.g_style, hair_gradient_styles_list, initial(pref.g_style))
|
||||
pref.h_style = sanitize_inlist(pref.h_style, GLOB.hair_styles_list, initial(pref.h_style))
|
||||
pref.f_style = sanitize_inlist(pref.f_style, GLOB.facial_hair_styles_list, initial(pref.f_style))
|
||||
pref.g_style = sanitize_inlist(pref.g_style, GLOB.hair_gradient_styles_list, initial(pref.g_style))
|
||||
pref.r_eyes = sanitize_integer(pref.r_eyes, 0, 255, initial(pref.r_eyes))
|
||||
pref.g_eyes = sanitize_integer(pref.g_eyes, 0, 255, initial(pref.g_eyes))
|
||||
pref.b_eyes = sanitize_integer(pref.b_eyes, 0, 255, initial(pref.b_eyes))
|
||||
@@ -220,7 +220,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
/datum/category_item/player_setup_item/general/body/content(var/mob/user)
|
||||
var/list/out = list()
|
||||
|
||||
var/datum/species/mob_species = all_species[pref.species]
|
||||
var/datum/species/mob_species = GLOB.all_species[pref.species]
|
||||
out += "<table><tr style='vertical-align:top'><td><b>Body</b> "
|
||||
out += "(<a href='?src=\ref[src];random=1'>®</A>)"
|
||||
out += "<br>"
|
||||
@@ -246,19 +246,19 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
|
||||
if(status == "cyborg")
|
||||
var/datum/robolimb/R
|
||||
if(pref.rlimb_data[name] && all_robolimbs[pref.rlimb_data[name]])
|
||||
R = all_robolimbs[pref.rlimb_data[name]]
|
||||
if(pref.rlimb_data[name] && GLOB.all_robolimbs[pref.rlimb_data[name]])
|
||||
R = GLOB.all_robolimbs[pref.rlimb_data[name]]
|
||||
else
|
||||
R = basic_robolimb
|
||||
R = GLOB.basic_robolimb
|
||||
out += "<li>- [R.company] [capitalize_first_letters(parse_zone(organ_name))] Prosthesis</li>"
|
||||
else if(status == "amputated")
|
||||
out += "<li>- Amputated [capitalize_first_letters(parse_zone(organ_name))]</li>"
|
||||
else if(status == "mechanical")
|
||||
var/datum/robolimb/R
|
||||
if(pref.rlimb_data[name] && all_robolimbs[pref.rlimb_data[name]])
|
||||
R = all_robolimbs[pref.rlimb_data[name]]
|
||||
if(pref.rlimb_data[name] && GLOB.all_robolimbs[pref.rlimb_data[name]])
|
||||
R = GLOB.all_robolimbs[pref.rlimb_data[name]]
|
||||
else
|
||||
R = basic_robolimb
|
||||
R = GLOB.basic_robolimb
|
||||
out += "<li>- [R.company] Mechanical [capitalize_first_letters(parse_zone(organ_name))]</li>"
|
||||
else if(status == "nymph")
|
||||
out += "<li>- Diona Nymph [capitalize_first_letters(parse_zone(organ_name))]</li>"
|
||||
@@ -334,7 +334,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
return mob_species && (mob_species.appearance_flags & flag)
|
||||
|
||||
/datum/category_item/player_setup_item/general/body/OnTopic(var/href,var/list/href_list, var/mob/user)
|
||||
var/datum/species/mob_species = all_species[pref.species]
|
||||
var/datum/species/mob_species = GLOB.all_species[pref.species]
|
||||
|
||||
if(href_list["random"])
|
||||
pref.randomize_appearance_for()
|
||||
@@ -348,14 +348,14 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
|
||||
else if(href_list["show_species"])
|
||||
// Actual whitelist checks are handled elsewhere, this is just for accessing the preview window.
|
||||
var/species_choice = tgui_input_list(usr, "Which species would you like to look at?", "Species Selection", playable_species)
|
||||
var/species_choice = tgui_input_list(usr, "Which species would you like to look at?", "Species Selection", GLOB.playable_species)
|
||||
if(!species_choice)
|
||||
return
|
||||
var/choice
|
||||
if(length(playable_species[species_choice]) == 1)
|
||||
choice = playable_species[species_choice][1]
|
||||
if(length(GLOB.playable_species[species_choice]) == 1)
|
||||
choice = GLOB.playable_species[species_choice][1]
|
||||
else
|
||||
choice = tgui_input_list(usr, "Which subspecies would you like to look at?", "Sub-species Selection", playable_species[species_choice])
|
||||
choice = tgui_input_list(usr, "Which subspecies would you like to look at?", "Sub-species Selection", GLOB.playable_species[species_choice])
|
||||
if(!choice)
|
||||
return
|
||||
choice = html_decode(choice)
|
||||
@@ -366,13 +366,13 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
|
||||
else if(href_list["set_species"])
|
||||
user << browse(null, "window=species")
|
||||
if(!pref.species_preview || !(pref.species_preview in all_species))
|
||||
if(!pref.species_preview || !(pref.species_preview in GLOB.all_species))
|
||||
return TOPIC_NOACTION
|
||||
|
||||
var/prev_species = pref.species
|
||||
pref.species = html_decode(href_list["set_species"])
|
||||
if(prev_species != pref.species)
|
||||
mob_species = all_species[pref.species]
|
||||
mob_species = GLOB.all_species[pref.species]
|
||||
|
||||
pref.gender = sanitize_gender(pref.gender, pref.species)
|
||||
//var/bodytype = mob_species.get_bodytype()
|
||||
@@ -381,20 +381,20 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
var/list/valid_hairstyles = list()
|
||||
|
||||
// Snowflake check for industrials - they're an IPC bodytype but don't have IPC screens.
|
||||
for(var/hairstyle in hair_styles_list)
|
||||
var/datum/sprite_accessory/S = hair_styles_list[hairstyle]
|
||||
for(var/hairstyle in GLOB.hair_styles_list)
|
||||
var/datum/sprite_accessory/S = GLOB.hair_styles_list[hairstyle]
|
||||
if(pref.gender == MALE && S.gender == FEMALE)
|
||||
continue
|
||||
if(pref.gender == FEMALE && S.gender == MALE)
|
||||
continue
|
||||
if(!(mob_species.type in S.species_allowed))
|
||||
continue
|
||||
valid_hairstyles[hairstyle] = hair_styles_list[hairstyle]
|
||||
valid_hairstyles[hairstyle] = GLOB.hair_styles_list[hairstyle]
|
||||
|
||||
if(valid_hairstyles.len)
|
||||
pref.h_style = pick(valid_hairstyles)
|
||||
else // Species has no hair, or something fucked up.
|
||||
pref.h_style = hair_styles_list["Bald"]
|
||||
pref.h_style = GLOB.hair_styles_list["Bald"]
|
||||
|
||||
if(length(mob_species.selectable_tails))
|
||||
pref.tail_style = pick(mob_species.selectable_tails)
|
||||
@@ -403,8 +403,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
|
||||
//grab one of the valid facial hair styles for the newly chosen species
|
||||
var/list/valid_facialhairstyles = list()
|
||||
for(var/facialhairstyle in facial_hair_styles_list)
|
||||
var/datum/sprite_accessory/S = facial_hair_styles_list[facialhairstyle]
|
||||
for(var/facialhairstyle in GLOB.facial_hair_styles_list)
|
||||
var/datum/sprite_accessory/S = GLOB.facial_hair_styles_list[facialhairstyle]
|
||||
if(pref.gender == MALE && S.gender == FEMALE)
|
||||
continue
|
||||
if(pref.gender == FEMALE && S.gender == MALE)
|
||||
@@ -412,17 +412,17 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
if(!(mob_species.type in S.species_allowed))
|
||||
continue
|
||||
|
||||
valid_facialhairstyles[facialhairstyle] = facial_hair_styles_list[facialhairstyle]
|
||||
valid_facialhairstyles[facialhairstyle] = GLOB.facial_hair_styles_list[facialhairstyle]
|
||||
|
||||
if(valid_facialhairstyles.len)
|
||||
pref.f_style = pick(valid_facialhairstyles)
|
||||
else
|
||||
//this shouldn't happen
|
||||
pref.f_style = facial_hair_styles_list["Shaved"]
|
||||
pref.f_style = GLOB.facial_hair_styles_list["Shaved"]
|
||||
|
||||
var/list/valid_hair_gradients = list()
|
||||
for(var/hair_gradient in hair_gradient_styles_list)
|
||||
var/datum/sprite_accessory/S = hair_gradient_styles_list[hair_gradient]
|
||||
for(var/hair_gradient in GLOB.hair_gradient_styles_list)
|
||||
var/datum/sprite_accessory/S = GLOB.hair_gradient_styles_list[hair_gradient]
|
||||
if(pref.gender == MALE && S.gender == FEMALE)
|
||||
continue
|
||||
if(pref.gender == FEMALE && S.gender == MALE)
|
||||
@@ -463,13 +463,13 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
|
||||
if(!valid_gradients[mob_species.type])
|
||||
valid_gradients[mob_species.type] = list()
|
||||
for(var/gradient in hair_gradient_styles_list)
|
||||
var/datum/sprite_accessory/S = hair_gradient_styles_list[gradient]
|
||||
for(var/gradient in GLOB.hair_gradient_styles_list)
|
||||
var/datum/sprite_accessory/S = GLOB.hair_gradient_styles_list[gradient]
|
||||
if(mob_species.type in S.species_allowed)
|
||||
valid_gradients[mob_species.type] += gradient
|
||||
|
||||
if(!(pref.g_style in valid_gradients[mob_species.type]))
|
||||
pref.g_style = hair_gradient_styles_list["None"]
|
||||
pref.g_style = GLOB.hair_gradient_styles_list["None"]
|
||||
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
@@ -506,8 +506,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
return
|
||||
//var/bodytype = mob_species.get_bodytype()
|
||||
var/list/valid_hairstyles = list()
|
||||
for(var/hairstyle in hair_styles_list)
|
||||
var/datum/sprite_accessory/S = hair_styles_list[hairstyle]
|
||||
for(var/hairstyle in GLOB.hair_styles_list)
|
||||
var/datum/sprite_accessory/S = GLOB.hair_styles_list[hairstyle]
|
||||
if(pref.gender == MALE && S.gender == FEMALE)
|
||||
continue
|
||||
if(pref.gender == FEMALE && S.gender == MALE)
|
||||
@@ -515,7 +515,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
if(!(mob_species.type in S.species_allowed))
|
||||
continue
|
||||
|
||||
valid_hairstyles[hairstyle] = hair_styles_list[hairstyle]
|
||||
valid_hairstyles[hairstyle] = GLOB.hair_styles_list[hairstyle]
|
||||
|
||||
var/new_h_style = tgui_input_list(user, "Choose your character's hair style.", "Character Preference", valid_hairstyles, pref.h_style)
|
||||
if(new_h_style && CanUseTopic(user))
|
||||
@@ -524,12 +524,12 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
|
||||
else if(href_list["gradient_style"])
|
||||
var/list/valid_gradients = list()
|
||||
for(var/gradstyle in hair_gradient_styles_list)
|
||||
var/datum/sprite_accessory/S = hair_gradient_styles_list[gradstyle]
|
||||
for(var/gradstyle in GLOB.hair_gradient_styles_list)
|
||||
var/datum/sprite_accessory/S = GLOB.hair_gradient_styles_list[gradstyle]
|
||||
if(!(mob_species.type in S.species_allowed))
|
||||
continue
|
||||
|
||||
valid_gradients[gradstyle] = hair_gradient_styles_list[gradstyle]
|
||||
valid_gradients[gradstyle] = GLOB.hair_gradient_styles_list[gradstyle]
|
||||
|
||||
var/new_g_style = tgui_input_list(user, "Choose a color pattern for your hair.", "Character Preference", valid_gradients, pref.g_style)
|
||||
if(new_g_style && CanUseTopic(user))
|
||||
@@ -588,8 +588,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
return
|
||||
var/list/valid_facialhairstyles = list()
|
||||
//var/bodytype = mob_species.get_bodytype()
|
||||
for(var/facialhairstyle in facial_hair_styles_list)
|
||||
var/datum/sprite_accessory/S = facial_hair_styles_list[facialhairstyle]
|
||||
for(var/facialhairstyle in GLOB.facial_hair_styles_list)
|
||||
var/datum/sprite_accessory/S = GLOB.facial_hair_styles_list[facialhairstyle]
|
||||
if(pref.gender == MALE && S.gender == FEMALE)
|
||||
continue
|
||||
if(pref.gender == FEMALE && S.gender == MALE)
|
||||
@@ -597,7 +597,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
if(!(mob_species.type in S.species_allowed))
|
||||
continue
|
||||
|
||||
valid_facialhairstyles[facialhairstyle] = facial_hair_styles_list[facialhairstyle]
|
||||
valid_facialhairstyles[facialhairstyle] = GLOB.facial_hair_styles_list[facialhairstyle]
|
||||
|
||||
var/new_f_style = tgui_input_list(user, "Choose your character's facial-hair style:", "Character Preference", valid_facialhairstyles, pref.f_style)
|
||||
if(new_f_style && has_flag(mob_species, HAS_HAIR_COLOR) && CanUseTopic(user))
|
||||
@@ -605,8 +605,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["marking_style"])
|
||||
var/list/usable_markings = pref.body_markings ^ body_marking_styles_list
|
||||
var/datum/species/species = global.all_species[pref.species]
|
||||
var/list/usable_markings = pref.body_markings ^ GLOB.body_marking_styles_list
|
||||
var/datum/species/species = GLOB.all_species[pref.species]
|
||||
for(var/M in usable_markings)
|
||||
var/datum/sprite_accessory/S = usable_markings[M]
|
||||
if(!S.species_allowed.len)
|
||||
@@ -726,8 +726,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
if("Prosthesis")
|
||||
var/tmp_species = pref.species ? pref.species : SPECIES_HUMAN
|
||||
var/list/usable_manufacturers = list()
|
||||
for(var/company in chargen_robolimbs)
|
||||
var/datum/robolimb/M = chargen_robolimbs[company]
|
||||
for(var/company in GLOB.chargen_robolimbs)
|
||||
var/datum/robolimb/M = GLOB.chargen_robolimbs[company]
|
||||
if(!(tmp_species in M.species_can_use))
|
||||
continue
|
||||
usable_manufacturers[company] = M
|
||||
@@ -781,8 +781,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
|
||||
var/tmp_species = pref.species ? pref.species : SPECIES_HUMAN
|
||||
var/list/usable_manufacturers = list()
|
||||
for(var/company in internal_robolimbs)
|
||||
var/datum/robolimb/M = chargen_robolimbs[company]
|
||||
for(var/company in GLOB.internal_robolimbs)
|
||||
var/datum/robolimb/M = GLOB.chargen_robolimbs[company]
|
||||
if(!(tmp_species in M.species_can_use))
|
||||
continue
|
||||
usable_manufacturers[company] = M
|
||||
@@ -793,7 +793,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
return
|
||||
|
||||
|
||||
var/datum/robolimb/R = all_robolimbs[choice]
|
||||
var/datum/robolimb/R = GLOB.all_robolimbs[choice]
|
||||
if(!(organ_name in R.allowed_internal_organs))
|
||||
alert(user, "You can not select this manufacturer for this organ.")
|
||||
return
|
||||
@@ -812,7 +812,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["trait_add"])
|
||||
var/list/available_disabilities = pref.disabilities ^ chargen_disabilities_list
|
||||
var/list/available_disabilities = pref.disabilities ^ GLOB.chargen_disabilities_list
|
||||
|
||||
var/new_trait = tgui_input_list(user, "Choose a disability.", "Character Preference", available_disabilities)
|
||||
if(new_trait && CanUseTopic(user))
|
||||
@@ -842,9 +842,9 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
return ..()
|
||||
|
||||
/datum/category_item/player_setup_item/general/body/proc/SetSpecies(mob/user)
|
||||
if(!pref.species_preview || !(pref.species_preview in all_species))
|
||||
if(!pref.species_preview || !(pref.species_preview in GLOB.all_species))
|
||||
pref.species_preview = SPECIES_HUMAN
|
||||
var/datum/species/current_species = all_species[pref.species_preview]
|
||||
var/datum/species/current_species = GLOB.all_species[pref.species_preview]
|
||||
var/list/dat = list(
|
||||
"<center><h2>[current_species.name] \[<a href='?src=\ref[src];show_species=1'>change</a>\]</h2></center><hr/>",
|
||||
"<table padding='8px'>",
|
||||
@@ -888,7 +888,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
dat += "</table><center><hr/>"
|
||||
|
||||
var/restricted = 0
|
||||
if(config.usealienwhitelist) //If we're using the whitelist, make sure to check it!
|
||||
if(GLOB.config.usealienwhitelist) //If we're using the whitelist, make sure to check it!
|
||||
if(!(current_species.spawn_flags & CAN_JOIN))
|
||||
restricted = 2
|
||||
else if((current_species.spawn_flags & IS_WHITELISTED) && !is_alien_whitelisted(preference_mob(),current_species.name))
|
||||
|
||||
@@ -134,14 +134,14 @@
|
||||
if(!(underwear_metadata in pref.all_underwear))
|
||||
pref.all_underwear_metadata -= underwear_metadata
|
||||
|
||||
pref.backbag = sanitize_integer(pref.backbag, 1, backbaglist.len, initial(pref.backbag))
|
||||
pref.backbag_style = sanitize_integer(pref.backbag_style, 1, backbagstyles.len, initial(pref.backbag_style))
|
||||
pref.backbag_color = sanitize_integer(pref.backbag_color, 1, backbagcolors.len, initial(pref.backbag_color))
|
||||
pref.backbag_strap = sanitize_integer(pref.backbag_strap, 1, backbagstrap.len, initial(pref.backbag_strap))
|
||||
pref.pda_choice = sanitize_integer(pref.pda_choice, 1, pdalist.len, initial(pref.pda_choice))
|
||||
pref.headset_choice = sanitize_integer(pref.headset_choice, 1, headsetlist.len, initial(pref.headset_choice))
|
||||
if(!(pref.primary_radio_slot in primary_radio_slot_choice))
|
||||
pref.primary_radio_slot = primary_radio_slot_choice[1]
|
||||
pref.backbag = sanitize_integer(pref.backbag, 1, GLOB.backbaglist.len, initial(pref.backbag))
|
||||
pref.backbag_style = sanitize_integer(pref.backbag_style, 1, GLOB.backbagstyles.len, initial(pref.backbag_style))
|
||||
pref.backbag_color = sanitize_integer(pref.backbag_color, 1, GLOB.backbagcolors.len, initial(pref.backbag_color))
|
||||
pref.backbag_strap = sanitize_integer(pref.backbag_strap, 1, GLOB.backbagstrap.len, initial(pref.backbag_strap))
|
||||
pref.pda_choice = sanitize_integer(pref.pda_choice, 1, GLOB.pdalist.len, initial(pref.pda_choice))
|
||||
pref.headset_choice = sanitize_integer(pref.headset_choice, 1, GLOB.headsetlist.len, initial(pref.headset_choice))
|
||||
if(!(pref.primary_radio_slot in GLOB.primary_radio_slot_choice))
|
||||
pref.primary_radio_slot = GLOB.primary_radio_slot_choice[1]
|
||||
pref.sensor_setting = sanitize_inlist(pref.sensor_setting, SUIT_SENSOR_MODES, get_key_by_index(SUIT_SENSOR_MODES, 0))
|
||||
|
||||
/datum/category_item/player_setup_item/general/equipment/content(var/mob/user)
|
||||
@@ -158,13 +158,13 @@
|
||||
|
||||
. += "<br>"
|
||||
|
||||
. += "Backpack Type: <a href='?src=\ref[src];change_backpack=1'><b>[backbaglist[pref.backbag]]</b></a><br>"
|
||||
. += "Backpack Style: <a href='?src=\ref[src];change_backpack_style=1'><b>[backbagstyles[pref.backbag_style]]</b></a><br>"
|
||||
. += "Backpack Type: <a href='?src=\ref[src];change_backpack=1'><b>[GLOB.backbaglist[pref.backbag]]</b></a><br>"
|
||||
. += "Backpack Style: <a href='?src=\ref[src];change_backpack_style=1'><b>[GLOB.backbagstyles[pref.backbag_style]]</b></a><br>"
|
||||
if(pref.backbag == OUTFIT_SATCHEL_ALT || pref.backbag == OUTFIT_RUCKSACK || pref.backbag == OUTFIT_POCKETBOOK) // Hardcoded. Sucks, I know.
|
||||
. += "Backpack Color: <a href='?src=\ref[src];change_backpack_color=1'><b>[backbagcolors[pref.backbag_color]]</b></a><br>"
|
||||
. += "Backpack Strap: <a href='?src=\ref[src];change_backbag_strap=1'><b>[backbagstrap[pref.backbag_strap]]</b></a><br>"
|
||||
. += "PDA Type: <a href='?src=\ref[src];change_pda=1'><b>[pdalist[pref.pda_choice]]</b></a><br>"
|
||||
. += "Headset Type: <a href='?src=\ref[src];change_headset=1'><b>[headsetlist[pref.headset_choice]]</b></a><br>"
|
||||
. += "Backpack Color: <a href='?src=\ref[src];change_backpack_color=1'><b>[GLOB.backbagcolors[pref.backbag_color]]</b></a><br>"
|
||||
. += "Backpack Strap: <a href='?src=\ref[src];change_backbag_strap=1'><b>[GLOB.backbagstrap[pref.backbag_strap]]</b></a><br>"
|
||||
. += "PDA Type: <a href='?src=\ref[src];change_pda=1'><b>[GLOB.pdalist[pref.pda_choice]]</b></a><br>"
|
||||
. += "Headset Type: <a href='?src=\ref[src];change_headset=1'><b>[GLOB.headsetlist[pref.headset_choice]]</b></a><br>"
|
||||
. += "Primary Radio Slot: <a href='?src=\ref[src];change_radio_slot=1'><b>[pref.primary_radio_slot]</b></a><br>"
|
||||
. += "Suit Sensor Setting: <a href='?src=\ref[src];change_sensor_setting=1'><b>[pref.sensor_setting]</b></a><br/>"
|
||||
|
||||
@@ -188,43 +188,43 @@
|
||||
|
||||
/datum/category_item/player_setup_item/general/equipment/OnTopic(var/href,var/list/href_list, var/mob/user)
|
||||
if(href_list["change_backpack"])
|
||||
var/new_backbag = tgui_input_list(user, "Choose your character's bag type.", "Character Preference", backbaglist, backbaglist[pref.backbag])
|
||||
var/new_backbag = tgui_input_list(user, "Choose your character's bag type.", "Character Preference", GLOB.backbaglist, GLOB.backbaglist[pref.backbag])
|
||||
if(!isnull(new_backbag) && CanUseTopic(user))
|
||||
pref.backbag = backbaglist.Find(new_backbag)
|
||||
pref.backbag = GLOB.backbaglist.Find(new_backbag)
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["change_backpack_style"])
|
||||
var/new_backbag = tgui_input_list(user, "Choose your character's style of bag.", "Character Preference", backbagstyles, backbagstyles[pref.backbag_style])
|
||||
var/new_backbag = tgui_input_list(user, "Choose your character's style of bag.", "Character Preference", GLOB.backbagstyles, GLOB.backbagstyles[pref.backbag_style])
|
||||
if(!isnull(new_backbag) && CanUseTopic(user))
|
||||
pref.backbag_style = backbagstyles.Find(new_backbag)
|
||||
pref.backbag_style = GLOB.backbagstyles.Find(new_backbag)
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["change_backpack_color"])
|
||||
var/new_backbag = tgui_input_list(user, "Choose your character's color of bag.", "Character Preference", backbagcolors, backbagcolors[pref.backbag_color])
|
||||
var/new_backbag = tgui_input_list(user, "Choose your character's color of bag.", "Character Preference", GLOB.backbagcolors, GLOB.backbagcolors[pref.backbag_color])
|
||||
if(!isnull(new_backbag) && CanUseTopic(user))
|
||||
pref.backbag_color = backbagcolors.Find(new_backbag)
|
||||
pref.backbag_color = GLOB.backbagcolors.Find(new_backbag)
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["change_backbag_strap"])
|
||||
var/new_backbag = tgui_input_list(user, "Choose your character's style of bag strap.", "Character Preference", backbagstrap, backbagstrap[pref.backbag_strap])
|
||||
var/new_backbag = tgui_input_list(user, "Choose your character's style of bag strap.", "Character Preference", GLOB.backbagstrap, GLOB.backbagstrap[pref.backbag_strap])
|
||||
if(!isnull(new_backbag) && CanUseTopic(user))
|
||||
pref.backbag_strap = backbagstrap.Find(new_backbag)
|
||||
pref.backbag_strap = GLOB.backbagstrap.Find(new_backbag)
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["change_pda"])
|
||||
var/new_pda = tgui_input_list(user, "Choose your character's PDA type.", "Character Preference", pdalist, pdalist[pref.pda_choice])
|
||||
var/new_pda = tgui_input_list(user, "Choose your character's PDA type.", "Character Preference", GLOB.pdalist, GLOB.pdalist[pref.pda_choice])
|
||||
if(!isnull(new_pda) && CanUseTopic(user))
|
||||
pref.pda_choice = pdalist.Find(new_pda)
|
||||
pref.pda_choice = GLOB.pdalist.Find(new_pda)
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["change_headset"])
|
||||
var/new_headset = tgui_input_list(user, "Choose your character's headset type.", "Character Preference", headsetlist, headsetlist[pref.headset_choice])
|
||||
var/new_headset = tgui_input_list(user, "Choose your character's headset type.", "Character Preference", GLOB.headsetlist, GLOB.headsetlist[pref.headset_choice])
|
||||
if(!isnull(new_headset) && CanUseTopic(user))
|
||||
pref.headset_choice = headsetlist.Find(new_headset)
|
||||
pref.headset_choice = GLOB.headsetlist.Find(new_headset)
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["change_radio_slot"])
|
||||
var/new_slot = tgui_input_list(user, "Choose which radio will be spoken into first if multiple slots are occupied.", "Character Preference", primary_radio_slot_choice, pref.primary_radio_slot)
|
||||
var/new_slot = tgui_input_list(user, "Choose which radio will be spoken into first if multiple slots are occupied.", "Character Preference", GLOB.primary_radio_slot_choice, pref.primary_radio_slot)
|
||||
if(!isnull(new_slot) && CanUseTopic(user))
|
||||
pref.primary_radio_slot = new_slot
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
//Flavour text for robots.
|
||||
S["flavour_texts_robot_Default"] >> pref.flavour_texts_robot["Default"]
|
||||
for(var/module in robot_module_types)
|
||||
for(var/module in GLOB.robot_module_types)
|
||||
S["flavour_texts_robot_[module]"] >> pref.flavour_texts_robot[module]
|
||||
|
||||
S["signature"] >> pref.signature
|
||||
@@ -33,7 +33,7 @@
|
||||
S["flavor_texts_feet"] << pref.flavor_texts["feet"]
|
||||
|
||||
S["flavour_texts_robot_Default"] << pref.flavour_texts_robot["Default"]
|
||||
for(var/module in robot_module_types)
|
||||
for(var/module in GLOB.robot_module_types)
|
||||
S["flavour_texts_robot_[module]"] << pref.flavour_texts_robot[module]
|
||||
|
||||
S["signature"] << pref.signature
|
||||
@@ -55,7 +55,7 @@
|
||||
"signature_font" = "signfont"
|
||||
)
|
||||
|
||||
for (var/module in robot_module_types)
|
||||
for (var/module in GLOB.robot_module_types)
|
||||
var_list["robot_[lowertext(module)]"] = "flavour_texts_robot/[module]"
|
||||
|
||||
return list(
|
||||
@@ -85,7 +85,7 @@
|
||||
"char_id" = 1
|
||||
)
|
||||
|
||||
for (var/module in robot_module_types)
|
||||
for (var/module in GLOB.robot_module_types)
|
||||
var_list += "robot_[lowertext(module)]"
|
||||
|
||||
return list("ss13_characters_flavour" = var_list)
|
||||
@@ -107,7 +107,7 @@
|
||||
"signature_font" = pref.signfont
|
||||
)
|
||||
|
||||
for (var/module in robot_module_types)
|
||||
for (var/module in GLOB.robot_module_types)
|
||||
var_list["robot_[lowertext(module)]"] += pref.flavour_texts_robot[module]
|
||||
|
||||
return var_list
|
||||
@@ -255,7 +255,7 @@
|
||||
HTML += "<a href='?src=\ref[src];flavour_text_robot=Default'>Default:</a> "
|
||||
HTML += TextPreview(pref.flavour_texts_robot["Default"])
|
||||
HTML += "<hr />"
|
||||
for(var/module in robot_module_types)
|
||||
for(var/module in GLOB.robot_module_types)
|
||||
HTML += "<a href='?src=\ref[src];flavour_text_robot=[module]'>[module]:</a> "
|
||||
HTML += TextPreview(pref.flavour_texts_robot[module])
|
||||
HTML += "<br>"
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
pref.psionics = list()
|
||||
|
||||
/datum/category_item/player_setup_item/general/psionics/sanitize_character(var/sql_load = 0)
|
||||
var/datum/species/mob_species = all_species[pref.species]
|
||||
var/datum/species/mob_species = GLOB.all_species[pref.species]
|
||||
if(length(pref.psionics) && !mob_species.has_psionics)
|
||||
to_chat(pref.client, SPAN_WARNING("This species does not have psionics! Resetting..."))
|
||||
pref.psionics = list()
|
||||
@@ -83,7 +83,7 @@
|
||||
pref.psionics = list()
|
||||
|
||||
/datum/category_item/player_setup_item/general/psionics/content(var/mob/user)
|
||||
var/datum/species/mob_species = all_species[pref.species]
|
||||
var/datum/species/mob_species = GLOB.all_species[pref.species]
|
||||
if(!(mob_species.has_psionics))
|
||||
return
|
||||
var/list/bought_psionic_powers = list()
|
||||
@@ -108,7 +108,7 @@
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["add_psi_power"])
|
||||
var/datum/species/mob_species = all_species[pref.species]
|
||||
var/datum/species/mob_species = GLOB.all_species[pref.species]
|
||||
var/total_psi_points = mob_species.character_creation_psi_points
|
||||
var/list/available_psionics = list()
|
||||
var/list/psionic_map = list()
|
||||
|
||||
@@ -202,4 +202,4 @@
|
||||
return ..()
|
||||
|
||||
/datum/category_item/player_setup_item/player_global/ui/proc/can_select_ooc_color(var/mob/user)
|
||||
return config.allow_admin_ooccolor && check_rights(R_ADMIN, 0, user)
|
||||
return GLOB.config.allow_admin_ooccolor && check_rights(R_ADMIN, 0, user)
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
pref.current_character = validate_current_character()
|
||||
|
||||
pref.lastchangelog = sanitize_text(pref.lastchangelog, initial(pref.lastchangelog))
|
||||
pref.default_slot = sanitize_integer(text2num(pref.default_slot), 1, config.character_slots, initial(pref.default_slot))
|
||||
pref.default_slot = sanitize_integer(text2num(pref.default_slot), 1, GLOB.config.character_slots, initial(pref.default_slot))
|
||||
pref.toggles = sanitize_integer(text2num(pref.toggles), 0, BITFIELDMAX, initial(pref.toggles))
|
||||
pref.sfx_toggles = sanitize_integer(text2num(pref.sfx_toggles), 0, BITFIELDMAX, initial(pref.toggles))
|
||||
pref.motd_hash = sanitize_text(pref.motd_hash, initial(pref.motd_hash))
|
||||
@@ -112,10 +112,10 @@
|
||||
return ..()
|
||||
|
||||
/datum/category_item/player_setup_item/player_global/settings/proc/validate_current_character()
|
||||
if (!establish_db_connection(dbcon))
|
||||
if (!establish_db_connection(GLOB.dbcon))
|
||||
return pref.current_character
|
||||
|
||||
var/DBQuery/is_ours = dbcon.NewQuery("SELECT COUNT(*) as valid_id FROM ss13_characters WHERE ckey = :ckey: AND id = :curr_char: AND deleted_at IS NULL")
|
||||
var/DBQuery/is_ours = GLOB.dbcon.NewQuery("SELECT COUNT(*) as valid_id FROM ss13_characters WHERE ckey = :ckey: AND id = :curr_char: AND deleted_at IS NULL")
|
||||
is_ours.Execute(list("ckey" = pref.client.ckey, "curr_char" = pref.current_character))
|
||||
|
||||
if (!is_ours.NextRow())
|
||||
@@ -129,10 +129,10 @@
|
||||
return pref.current_character
|
||||
|
||||
/datum/category_item/player_setup_item/player_global/settings/proc/select_default_character()
|
||||
if (!establish_db_connection(dbcon))
|
||||
if (!establish_db_connection(GLOB.dbcon))
|
||||
return 0
|
||||
|
||||
var/DBQuery/first_char = dbcon.NewQuery("SELECT id FROM ss13_characters WHERE ckey = :ckey: AND deleted_at IS NULL LIMIT 1")
|
||||
var/DBQuery/first_char = GLOB.dbcon.NewQuery("SELECT id FROM ss13_characters WHERE ckey = :ckey: AND deleted_at IS NULL LIMIT 1")
|
||||
first_char.Execute(list("ckey" = pref.client.ckey))
|
||||
|
||||
if (!first_char.NextRow())
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
pref.language_prefixes = params2list(pref.language_prefixes)
|
||||
|
||||
if (isnull(pref.language_prefixes) || !pref.language_prefixes.len)
|
||||
pref.language_prefixes = config.language_prefixes.Copy()
|
||||
pref.language_prefixes = GLOB.config.language_prefixes.Copy()
|
||||
|
||||
/datum/category_item/player_setup_item/player_global/language/content(var/mob/user)
|
||||
. += "<b>Language Keys</b><br>"
|
||||
@@ -55,7 +55,7 @@
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["reset_prefix"])
|
||||
pref.language_prefixes = config.language_prefixes.Copy()
|
||||
pref.language_prefixes = GLOB.config.language_prefixes.Copy()
|
||||
return TOPIC_REFRESH
|
||||
|
||||
return ..()
|
||||
|
||||
@@ -69,8 +69,8 @@ var/list/gear_datums = list()
|
||||
var/list/whitelist_cache = list()
|
||||
|
||||
if(preference_mob)
|
||||
for(var/species in global.all_species)
|
||||
var/datum/species/S = global.all_species[species]
|
||||
for(var/species in GLOB.all_species)
|
||||
var/datum/species/S = GLOB.all_species[species]
|
||||
if(is_alien_whitelisted(preference_mob, S))
|
||||
whitelist_cache += S.name
|
||||
|
||||
@@ -337,14 +337,14 @@ var/list/gear_datums = list()
|
||||
if(href_list["next_slot"])
|
||||
//change the current slot number
|
||||
pref.gear_slot = pref.gear_slot+1
|
||||
if(pref.gear_slot > config.loadout_slots)
|
||||
if(pref.gear_slot > GLOB.config.loadout_slots)
|
||||
pref.gear_slot = 1
|
||||
//If we're moving down a slot..
|
||||
else if(href_list["prev_slot"])
|
||||
//change current slot one down
|
||||
pref.gear_slot = pref.gear_slot-1
|
||||
if(pref.gear_slot < 1)
|
||||
pref.gear_slot = config.loadout_slots
|
||||
pref.gear_slot = GLOB.config.loadout_slots
|
||||
// Set the currently selected gear to whatever's in the new slot
|
||||
if(pref.gear_list["[pref.gear_slot]"])
|
||||
pref.gear = pref.gear_list["[pref.gear_slot]"]
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
dat += "<del>[dispRank]</del></td><td><b> \[<a href='?src=\ref[user.client];view_jobban=[rank];'>BANNED</a>]</b></td></tr>"
|
||||
continue
|
||||
if(job.blacklisted_species) // check for restricted species
|
||||
var/datum/species/S = all_species[pref.species]
|
||||
var/datum/species/S = GLOB.all_species[pref.species]
|
||||
if(S.name in job.blacklisted_species)
|
||||
dat += "<del>[dispRank]</del></td><td><b> \[SPECIES RESTRICTED]</b></td></tr>"
|
||||
continue
|
||||
@@ -483,7 +483,7 @@
|
||||
if (!job)
|
||||
return
|
||||
var/choices = list(job.title) + job.alt_titles
|
||||
if((global.all_species[src.species].spawn_flags & NO_AGE_MINIMUM))
|
||||
if((GLOB.all_species[src.species].spawn_flags & NO_AGE_MINIMUM))
|
||||
return choices
|
||||
for(var/t in choices)
|
||||
if (src.age >= (job.get_alt_character_age(species, t) || job.get_minimum_character_age(species)))
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
)
|
||||
|
||||
/datum/category_item/player_setup_item/origin/sanitize_character(var/sql_load = 0)
|
||||
var/datum/species/S = all_species[pref.species]
|
||||
var/datum/species/S = GLOB.all_species[pref.species]
|
||||
if(!istext(pref.culture) || !ispath(text2path(pref.culture), /singleton/origin_item/culture))
|
||||
var/singleton/origin_item/culture/CI = S.possible_cultures[1]
|
||||
pref.culture = "[CI]"
|
||||
@@ -121,7 +121,7 @@
|
||||
. = dat.Join()
|
||||
|
||||
/datum/category_item/player_setup_item/origin/OnTopic(href, href_list, user)
|
||||
var/datum/species/S = all_species[pref.species]
|
||||
var/datum/species/S = GLOB.all_species[pref.species]
|
||||
if(href_list["open_culture_menu"])
|
||||
var/list/options = list()
|
||||
var/list/possible_cultures = Singletons.GetMap(S.possible_cultures)
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
pref.ccia_actions = list()
|
||||
|
||||
//Special Aurora Snowflake to load in the ccia actions and persistant incidents
|
||||
if (config.sql_saves) // Doesnt work without db
|
||||
if (GLOB.config.sql_saves) // Doesnt work without db
|
||||
//Load in the CCIA Actions
|
||||
var/DBQuery/ccia_action_query = dbcon.NewQuery({"SELECT
|
||||
var/DBQuery/ccia_action_query = GLOB.dbcon.NewQuery({"SELECT
|
||||
act.title,
|
||||
act.type,
|
||||
act.issuedby,
|
||||
@@ -39,7 +39,7 @@
|
||||
pref.ccia_actions.Add(list(action))
|
||||
|
||||
//Load in the infractions
|
||||
var/DBQuery/char_infraction_query = dbcon.NewQuery({"SELECT
|
||||
var/DBQuery/char_infraction_query = GLOB.dbcon.NewQuery({"SELECT
|
||||
id, char_id, UID, datetime, notes, charges, evidence, arbiters, brig_sentence, fine, felony
|
||||
FROM ss13_character_incidents
|
||||
WHERE
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
/datum/category_group/player_setup_category/proc/load_character(var/savefile/S)
|
||||
// Load all data, then sanitize it.
|
||||
// Need due to, for example, the 01_basic module relying on species having been loaded to sanitize correctly but that isn't loaded until module 03_body.
|
||||
if (!config.sql_saves || !establish_db_connection(dbcon))
|
||||
if (!GLOB.config.sql_saves || !establish_db_connection(GLOB.dbcon))
|
||||
for(var/datum/category_item/player_setup_item/PI in items)
|
||||
PI.load_character(S)
|
||||
else
|
||||
@@ -154,14 +154,14 @@
|
||||
|
||||
for(var/datum/category_item/player_setup_item/PI in items)
|
||||
PI.load_special(S)
|
||||
PI.sanitize_character(config.sql_saves)
|
||||
PI.sanitize_character(GLOB.config.sql_saves)
|
||||
|
||||
/datum/category_group/player_setup_category/proc/save_character(var/savefile/S)
|
||||
// Sanitize all data, then save it
|
||||
for (var/datum/category_item/player_setup_item/PI in items)
|
||||
PI.sanitize_character()
|
||||
|
||||
if (!config.sql_saves || !establish_db_connection(dbcon))
|
||||
if (!GLOB.config.sql_saves || !establish_db_connection(GLOB.dbcon))
|
||||
for (var/datum/category_item/player_setup_item/PI in items)
|
||||
PI.save_character(S)
|
||||
else if (modified)
|
||||
@@ -170,20 +170,20 @@
|
||||
modified = 0
|
||||
|
||||
/datum/category_group/player_setup_category/proc/load_preferences(var/savefile/S)
|
||||
if (!config.sql_saves || !establish_db_connection(dbcon))
|
||||
if (!GLOB.config.sql_saves || !establish_db_connection(GLOB.dbcon))
|
||||
for (var/datum/category_item/player_setup_item/PI in items)
|
||||
PI.load_preferences(S)
|
||||
else
|
||||
handle_sql_loading(SQL_PREFERENCES)
|
||||
|
||||
for (var/datum/category_item/player_setup_item/PI in items)
|
||||
PI.sanitize_preferences(config.sql_saves)
|
||||
PI.sanitize_preferences(GLOB.config.sql_saves)
|
||||
|
||||
/datum/category_group/player_setup_category/proc/save_preferences(var/savefile/S)
|
||||
for (var/datum/category_item/player_setup_item/PI in items)
|
||||
PI.sanitize_preferences()
|
||||
|
||||
if (!config.sql_saves || !establish_db_connection(dbcon))
|
||||
if (!GLOB.config.sql_saves || !establish_db_connection(GLOB.dbcon))
|
||||
for (var/datum/category_item/player_setup_item/PI in items)
|
||||
PI.save_preferences(S)
|
||||
else
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
#endif
|
||||
|
||||
for (var/query_text in query_cache[type])
|
||||
var/DBQuery/query = dbcon.NewQuery(query_text)
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery(query_text)
|
||||
query.Execute(arg_list)
|
||||
if (query.ErrorMsg())
|
||||
log_world("ERROR: SQL CHARACTER LOAD: SQL query error: [query.ErrorMsg()]")
|
||||
@@ -211,7 +211,7 @@
|
||||
// Typecast the collection so we can access its preferences var.
|
||||
var/datum/category_collection/player_setup_collection/cc = collection
|
||||
for (var/query_text in query_cache[type])
|
||||
var/DBQuery/query = dbcon.NewQuery(query_text)
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery(query_text)
|
||||
query.Execute(arg_list)
|
||||
|
||||
if (query.ErrorMsg())
|
||||
@@ -228,7 +228,7 @@
|
||||
if ((role_type & SQL_CHARACTER) && !cc.preferences.current_character)
|
||||
// No current character, means we're doing insert queries.
|
||||
// Quickly nab the new ID and substitute it within the args.
|
||||
query = dbcon.NewQuery("SELECT LAST_INSERT_ID() AS new_id")
|
||||
query = GLOB.dbcon.NewQuery("SELECT LAST_INSERT_ID() AS new_id")
|
||||
query.Execute()
|
||||
|
||||
if (query.NextRow())
|
||||
|
||||
@@ -219,23 +219,23 @@ var/list/preferences_datums = list()
|
||||
save_character()
|
||||
|
||||
/datum/preferences/proc/getMinAge()
|
||||
var/datum/species/mob_species = all_species[species]
|
||||
var/datum/species/mob_species = GLOB.all_species[species]
|
||||
return mob_species.age_min
|
||||
|
||||
/datum/preferences/proc/getMaxAge()
|
||||
var/datum/species/mob_species = all_species[species]
|
||||
var/datum/species/mob_species = GLOB.all_species[species]
|
||||
return mob_species.age_max
|
||||
|
||||
/datum/preferences/proc/getMinHeight()
|
||||
var/datum/species/mob_species = all_species[species]
|
||||
var/datum/species/mob_species = GLOB.all_species[species]
|
||||
return mob_species.height_min
|
||||
|
||||
/datum/preferences/proc/getMaxHeight()
|
||||
var/datum/species/mob_species = all_species[species]
|
||||
var/datum/species/mob_species = GLOB.all_species[species]
|
||||
return mob_species.height_max
|
||||
|
||||
/datum/preferences/proc/getAvgHeight()
|
||||
var/datum/species/mob_species = all_species[species]
|
||||
var/datum/species/mob_species = GLOB.all_species[species]
|
||||
return mob_species.species_height
|
||||
|
||||
/datum/preferences/proc/ShowChoices(mob/user)
|
||||
@@ -246,7 +246,7 @@ var/list/preferences_datums = list()
|
||||
dat += "<a href='?src=\ref[src];load=1'>Load slot</a> - "
|
||||
dat += "<a href='?src=\ref[src];save=1'>Save slot</a> - "
|
||||
dat += "<a href='?src=\ref[src];reload=1'>Reload slot</a>"
|
||||
if (config.sql_saves)
|
||||
if (GLOB.config.sql_saves)
|
||||
dat += " - <a href='?src=\ref[src];delete=1'>Permanently delete slot</a>"
|
||||
|
||||
else
|
||||
@@ -287,7 +287,7 @@ var/list/preferences_datums = list()
|
||||
BG.screen_loc = "character_preview_map:1,1 to 1,5"
|
||||
|
||||
var/index = 0
|
||||
for(var/D in global.cardinal)
|
||||
for(var/D in GLOB.cardinal)
|
||||
var/obj/screen/O = LAZYACCESS(char_render_holders, "[D]")
|
||||
if(!O)
|
||||
O = new
|
||||
@@ -328,8 +328,8 @@ var/list/preferences_datums = list()
|
||||
return
|
||||
|
||||
if(href_list["preference"] == "open_whitelist_forum")
|
||||
if(config.forumurl)
|
||||
send_link(user, config.forumurl)
|
||||
if(GLOB.config.forumurl)
|
||||
send_link(user, GLOB.config.forumurl)
|
||||
else
|
||||
to_chat(user, "<span class='danger'>The forum URL is not set in the server configuration.</span>")
|
||||
return
|
||||
@@ -351,7 +351,7 @@ var/list/preferences_datums = list()
|
||||
load_character()
|
||||
else if(href_list["load"])
|
||||
if(!IsGuestKey(usr.key))
|
||||
if (config.sql_saves)
|
||||
if (GLOB.config.sql_saves)
|
||||
open_load_dialog_sql(usr)
|
||||
else
|
||||
open_load_dialog_file(usr)
|
||||
@@ -367,7 +367,7 @@ var/list/preferences_datums = list()
|
||||
else if(href_list["close_load_dialog"])
|
||||
close_load_dialog(usr)
|
||||
else if(href_list["delete"])
|
||||
if (!config.sql_saves)
|
||||
if (!GLOB.config.sql_saves)
|
||||
return 0
|
||||
if (alert(usr, "You will be unable to re-create a character with the same name! Are you sure you want to permanently [real_name]? The slot can not be restored.", "Permanently Delete Character", "No", "Yes") == "Yes")
|
||||
if(alert(usr, "Are you sure you want to PERMANENTLY delete your character?","Confirm Permanent Deletion","Yes","No") == "Yes")
|
||||
@@ -382,7 +382,7 @@ var/list/preferences_datums = list()
|
||||
// Sanitizing rather than saving as someone might still be editing when copy_to occurs.
|
||||
player_setup.sanitize_setup()
|
||||
|
||||
if(config.humans_need_surnames)
|
||||
if(GLOB.config.humans_need_surnames)
|
||||
var/firstspace = findtext(real_name, " ")
|
||||
var/name_length = length(real_name)
|
||||
if(!firstspace) //we need a surname
|
||||
@@ -515,10 +515,10 @@ var/list/preferences_datums = list()
|
||||
for(var/ckey in preferences_datums)
|
||||
var/datum/preferences/D = preferences_datums[ckey]
|
||||
if(D == src)
|
||||
if(!establish_db_connection(dbcon))
|
||||
if(!establish_db_connection(GLOB.dbcon))
|
||||
return open_load_dialog_file(user)
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT id, name FROM ss13_characters WHERE ckey = :ckey: AND deleted_at IS NULL ORDER BY id ASC")
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT id, name FROM ss13_characters WHERE ckey = :ckey: AND deleted_at IS NULL ORDER BY id ASC")
|
||||
query.Execute(list("ckey" = user.client.ckey))
|
||||
|
||||
dat += "<b>Select a character slot to load</b><hr>"
|
||||
@@ -534,8 +534,8 @@ var/list/preferences_datums = list()
|
||||
dat += "<a href='?src=\ref[src];changeslot=[id];'>[name]</a><br>"
|
||||
|
||||
dat += "<hr>"
|
||||
dat += "<b>[query.RowCount()]/[config.character_slots] slots used</b><br>"
|
||||
if (query.RowCount() < config.character_slots)
|
||||
dat += "<b>[query.RowCount()]/[GLOB.config.character_slots] slots used</b><br>"
|
||||
if (query.RowCount() < GLOB.config.character_slots)
|
||||
dat += "<a href='?src=\ref[src];new_character_sql=1'>New Character</a>"
|
||||
else
|
||||
dat += "<strike>New Character</strike>"
|
||||
@@ -557,7 +557,7 @@ var/list/preferences_datums = list()
|
||||
if(S)
|
||||
dat += "<b>Select a character slot to load</b><hr>"
|
||||
var/name
|
||||
for(var/i=1, i<= config.character_slots, i++)
|
||||
for(var/i=1, i<= GLOB.config.character_slots, i++)
|
||||
S.cd = "/character[i]"
|
||||
S["real_name"] >> name
|
||||
if(!name) name = "Character[i]"
|
||||
@@ -577,13 +577,13 @@ var/list/preferences_datums = list()
|
||||
|
||||
// Logs a character to the database. For statistics.
|
||||
/datum/preferences/proc/log_character(var/mob/living/carbon/human/H)
|
||||
if (!config.sql_saves || !config.sql_stats || !establish_db_connection(dbcon) || !H)
|
||||
if (!GLOB.config.sql_saves || !GLOB.config.sql_stats || !establish_db_connection(GLOB.dbcon) || !H)
|
||||
return
|
||||
|
||||
if(!H.mind.assigned_role)
|
||||
LOG_DEBUG("Char-Log: Char [current_character] - [H.name] has joined with mind.assigned_role set to NULL")
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery("INSERT INTO ss13_characters_log (char_id, game_id, datetime, job_name, alt_title) VALUES (:char_id:, :game_id:, NOW(), :job:, :alt_title:)")
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery("INSERT INTO ss13_characters_log (char_id, game_id, datetime, job_name, alt_title) VALUES (:char_id:, :game_id:, NOW(), :job:, :alt_title:)")
|
||||
query.Execute(list("char_id" = current_character, "game_id" = game_id, "job" = H.mind.assigned_role, "alt_title" = H.mind.role_alt_title))
|
||||
|
||||
// Turned into a proc so we could reuse it for SQL shenanigans.
|
||||
@@ -681,11 +681,11 @@ var/list/preferences_datums = list()
|
||||
to_chat(C, "<span class='notice'>You do not have a character loaded.</span>")
|
||||
return
|
||||
|
||||
if (!establish_db_connection(dbcon))
|
||||
if (!establish_db_connection(GLOB.dbcon))
|
||||
to_chat(C, "<span class='notice'>Unable to establish database connection.</span>")
|
||||
return
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery("UPDATE ss13_characters SET deleted_at = NOW(), deleted_by = \"player\" WHERE id = :char_id:")
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery("UPDATE ss13_characters SET deleted_at = NOW(), deleted_by = \"player\" WHERE id = :char_id:")
|
||||
query.Execute(list("char_id" = current_character))
|
||||
|
||||
// Create a new character.
|
||||
@@ -695,6 +695,6 @@ var/list/preferences_datums = list()
|
||||
|
||||
/datum/preferences/proc/get_species_datum()
|
||||
if (species)
|
||||
return all_species[species]
|
||||
return GLOB.all_species[species]
|
||||
|
||||
return null
|
||||
|
||||
@@ -115,30 +115,30 @@
|
||||
if (!user)
|
||||
return
|
||||
|
||||
if (user.byond_version < config.client_warn_version)
|
||||
if (user.byond_version < GLOB.config.client_warn_version)
|
||||
var/version_warn = ""
|
||||
version_warn += "<b>Your version of BYOND may be out of date!</b><br>"
|
||||
version_warn += config.client_warn_message
|
||||
version_warn += GLOB.config.client_warn_message
|
||||
version_warn += "Your version: [user.byond_version].<br>"
|
||||
version_warn += "Required version to remove this message: [config.client_warn_version] or later.<br>"
|
||||
version_warn += "Required version to remove this message: [GLOB.config.client_warn_version] or later.<br>"
|
||||
version_warn += "Visit http://www.byond.com/download/ to get the latest version of BYOND."
|
||||
|
||||
new_notification("danger", version_warn)
|
||||
|
||||
if (custom_event_msg && custom_event_msg != "")
|
||||
if (GLOB.custom_event_msg && GLOB.custom_event_msg != "")
|
||||
var/custom_event_warn = "<b><center>A custom event is taking place!</center></b><br>"
|
||||
custom_event_warn += "<b>OOC Info:</b><br>[custom_event_msg]"
|
||||
custom_event_warn += "<b>OOC Info:</b><br>[GLOB.custom_event_msg]"
|
||||
|
||||
new_notification("danger", custom_event_warn)
|
||||
|
||||
if (lastchangelog != changelog_hash)
|
||||
if (lastchangelog != GLOB.changelog_hash)
|
||||
winset(user, "rpane.changelog", "background-color=#eaeaea;font-style=bold")
|
||||
if (config.aggressive_changelog)
|
||||
if (GLOB.config.aggressive_changelog)
|
||||
new_notification("info", "You have unread updates in the changelog.", callback_src = user, callback_proc = "changes")
|
||||
else
|
||||
new_notification("info", "You have unread updates in the changelog.")
|
||||
|
||||
if (config.sql_enabled)
|
||||
if (GLOB.config.sql_enabled)
|
||||
|
||||
var/list/warnings = user.warnings_gather()
|
||||
if (warnings["unread"])
|
||||
@@ -160,11 +160,11 @@
|
||||
if(!user)
|
||||
return null
|
||||
|
||||
if (!establish_db_connection(dbcon))
|
||||
if (!establish_db_connection(GLOB.dbcon))
|
||||
log_world("ERROR: Error initiatlizing database connection while getting notifications.")
|
||||
return null
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery({"SELECT
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery({"SELECT
|
||||
message, type, id
|
||||
FROM ss13_player_notifications
|
||||
WHERE acked_at IS NULL AND ckey = :ckey:
|
||||
@@ -197,7 +197,7 @@
|
||||
//Immeidately ack the notification
|
||||
autoack=1
|
||||
if(autoack)
|
||||
var/DBQuery/ackquery = dbcon.NewQuery({"UPDATE ss13_player_notifications
|
||||
var/DBQuery/ackquery = GLOB.dbcon.NewQuery({"UPDATE ss13_player_notifications
|
||||
SET acked_by = 'autoack-server', acked_at = NOW()
|
||||
WHERE id = :id:
|
||||
"})
|
||||
@@ -214,11 +214,11 @@
|
||||
if (!user)
|
||||
return null
|
||||
|
||||
if (!establish_db_connection(dbcon))
|
||||
if (!establish_db_connection(GLOB.dbcon))
|
||||
log_world("ERROR: Error initiatlizing database connection while counting CCIA actions.")
|
||||
return null
|
||||
|
||||
var/DBQuery/prep_query = dbcon.NewQuery("SELECT id FROM ss13_characters WHERE ckey = :ckey:")
|
||||
var/DBQuery/prep_query = GLOB.dbcon.NewQuery("SELECT id FROM ss13_characters WHERE ckey = :ckey:")
|
||||
prep_query.Execute(list("ckey" = user.ckey))
|
||||
var/list/chars = list()
|
||||
|
||||
@@ -228,7 +228,7 @@
|
||||
if (!chars.len)
|
||||
return null
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery({"SELECT
|
||||
var/DBQuery/query = GLOB.dbcon.NewQuery({"SELECT
|
||||
COUNT(act_chr.action_id) AS action_count
|
||||
FROM ss13_ccia_action_char act_chr
|
||||
JOIN ss13_characters chr ON act_chr.char_id = chr.id
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
/datum/preferences/proc/load_preferences()
|
||||
var/savefile/S
|
||||
if (!config.sql_saves)
|
||||
if (!GLOB.config.sql_saves)
|
||||
if (!path)
|
||||
return 0
|
||||
if (!fexists(path))
|
||||
@@ -22,14 +22,14 @@
|
||||
|
||||
player_setup.load_preferences(S)
|
||||
|
||||
if (!config.sql_saves)
|
||||
if (!GLOB.config.sql_saves)
|
||||
loaded_preferences = S
|
||||
|
||||
return 1
|
||||
|
||||
/datum/preferences/proc/save_preferences()
|
||||
var/savefile/S
|
||||
if (!config.sql_saves)
|
||||
if (!GLOB.config.sql_saves)
|
||||
if(!path)
|
||||
return 0
|
||||
S = new /savefile(path)
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
player_setup.save_preferences(S)
|
||||
|
||||
if (!config.sql_saves)
|
||||
if (!GLOB.config.sql_saves)
|
||||
loaded_preferences = S
|
||||
|
||||
return 1
|
||||
@@ -54,7 +54,7 @@
|
||||
readied = TRUE
|
||||
SSticker.update_ready_list(NP, force_urdy=TRUE)
|
||||
|
||||
if (!config.sql_saves)
|
||||
if (!GLOB.config.sql_saves)
|
||||
if (!path)
|
||||
return 0
|
||||
if (!fexists(path))
|
||||
@@ -65,7 +65,7 @@
|
||||
S.cd = "/"
|
||||
if (!slot)
|
||||
slot = default_slot
|
||||
slot = sanitize_integer(slot, 1, config.character_slots, initial(default_slot))
|
||||
slot = sanitize_integer(slot, 1, GLOB.config.character_slots, initial(default_slot))
|
||||
if(slot != default_slot)
|
||||
default_slot = slot
|
||||
S["default_slot"] << slot
|
||||
@@ -76,7 +76,7 @@
|
||||
player_setup.load_character(S)
|
||||
clear_character_previews() // Recalculate them on next show
|
||||
|
||||
if (!config.sql_saves)
|
||||
if (!GLOB.config.sql_saves)
|
||||
loaded_character = S
|
||||
else
|
||||
save_preferences()
|
||||
@@ -88,7 +88,7 @@
|
||||
|
||||
/datum/preferences/proc/save_character()
|
||||
var/savefile/S
|
||||
if (!config.sql_saves)
|
||||
if (!GLOB.config.sql_saves)
|
||||
if(!path)
|
||||
return 0
|
||||
S = new /savefile(path)
|
||||
@@ -100,13 +100,13 @@
|
||||
|
||||
player_setup.save_character(S)
|
||||
|
||||
if (!config.sql_saves)
|
||||
if (!GLOB.config.sql_saves)
|
||||
loaded_character = S
|
||||
|
||||
return S
|
||||
|
||||
/datum/preferences/proc/sanitize_preferences()
|
||||
player_setup.sanitize_setup(config.sql_saves)
|
||||
player_setup.sanitize_setup(GLOB.config.sql_saves)
|
||||
return 1
|
||||
|
||||
/datum/preferences/proc/update_setup(var/savefile/preferences, var/savefile/character)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
/datum/spawnpoint/arrivals/New()
|
||||
..()
|
||||
msg = "is inbound from the [current_map.dock_name]"
|
||||
turfs = latejoin
|
||||
turfs = GLOB.latejoin
|
||||
|
||||
/datum/spawnpoint/cryo
|
||||
display_name = "Cryogenic Storage"
|
||||
@@ -35,8 +35,8 @@
|
||||
|
||||
/datum/spawnpoint/cryo/New()
|
||||
..()
|
||||
turfs = latejoin_cryo
|
||||
command_turfs = latejoin_cryo_command
|
||||
turfs = GLOB.latejoin_cryo
|
||||
command_turfs = GLOB.latejoin_cryo_command
|
||||
|
||||
/datum/spawnpoint/cryo/after_join(mob/victim)
|
||||
if(!istype(victim))
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
/datum/spawnpoint/cyborg/New()
|
||||
..()
|
||||
turfs = latejoin_cyborg
|
||||
turfs = GLOB.latejoin_cyborg
|
||||
|
||||
/datum/spawnpoint/living_quarters_lift
|
||||
display_name = "Living Quarters Lift"
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
/datum/spawnpoint/living_quarters_lift/New()
|
||||
..()
|
||||
turfs = latejoin_living_quarters_lift
|
||||
turfs = GLOB.latejoin_living_quarters_lift
|
||||
|
||||
/datum/spawnpoint/living_quarters_lift/after_join(mob/victim)
|
||||
if(!istype(victim))
|
||||
|
||||
Reference in New Issue
Block a user