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

* SDQL2 update

* fix that verb

* cl

* fix that

* toworld

* this is pointless

* update info

* siiiiick..

* vv edit update

* fix that

* fix editing vars

* fix VV

* Port the /TG/ globals controller.

* part 1

* part 2

* oops

* part 3

* Hollow Purple

* sadas

* bsbsdb

* muda na agaki ta

* ids 1-15

* 16-31

* 41-75

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

* the strength of mayhem

* final touches

* cl

* protect some vars

* update sdql2 to use glob

* stuff?

* forgot that is not defined there

* whoops

* observ

* but it never gets better

* a

---------

Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
Matt Atlas
2023-12-26 01:16:02 +00:00
committed by GitHub
co-authored by Matt Atlas
parent 19292f01d3
commit cadd19beac
966 changed files with 4785 additions and 4784 deletions
+3 -3
View File
@@ -9,11 +9,11 @@ var/mob/abstract/dview/dview_mob = new
/mob/abstract/dview/Initialize()
. = ..()
// We don't want to be in any mob lists; we're a dummy not a mob.
mob_list -= src
GLOB.mob_list -= src
if(stat == DEAD)
dead_mob_list -= src
GLOB.dead_mob_list -= src
else
living_mob_list -= src
GLOB.living_mob_list -= src
/mob/abstract/dview/Destroy(force = FALSE)
SHOULD_CALL_PARENT(FALSE)
+2 -2
View File
@@ -10,7 +10,7 @@
/mob/abstract/eye/cameranet/Initialize()
. = ..()
visualnet = cameranet
visualnet = GLOB.cameranet
/mob/abstract/eye/aiEye
name = "Inactive AI Eye"
@@ -19,7 +19,7 @@
/mob/abstract/eye/aiEye/Initialize()
. = ..()
visualnet = cameranet
visualnet = GLOB.cameranet
/mob/abstract/eye/aiEye/setLoc(var/T, var/cancel_tracking = 1)
. = ..()
@@ -7,18 +7,18 @@
invalidateCameraCache()
if(!can_use())
set_light(0)
cameranet.update_visibility(src)
GLOB.cameranet.update_visibility(src)
/obj/machinery/camera/Initialize()
. = ..()
var/list/open_networks = difflist(network, restricted_camera_networks)
on_open_network = open_networks.len
if(on_open_network)
cameranet.add_source(src)
GLOB.cameranet.add_source(src)
/obj/machinery/camera/Destroy()
if(on_open_network)
cameranet.remove_source(src)
GLOB.cameranet.remove_source(src)
. = ..()
/obj/machinery/camera/proc/update_coverage(var/network_change = 0)
@@ -27,22 +27,22 @@
// Add or remove camera from the camera net as necessary
if(on_open_network && !open_networks.len)
on_open_network = FALSE
cameranet.remove_source(src)
GLOB.cameranet.remove_source(src)
else if(!on_open_network && open_networks.len)
on_open_network = TRUE
cameranet.add_source(src)
GLOB.cameranet.add_source(src)
else
cameranet.update_visibility(src)
GLOB.cameranet.update_visibility(src)
invalidateCameraCache()
// Mobs
/mob/living/silicon/ai/Initialize()
. = ..()
cameranet.add_source(src)
GLOB.cameranet.add_source(src)
/mob/living/silicon/ai/Destroy()
cameranet.remove_source(src)
GLOB.cameranet.remove_source(src)
. = ..()
/mob/living/silicon/ai/rejuvenate()
@@ -50,10 +50,10 @@
..()
if(was_dead && stat != DEAD)
// Arise!
cameranet.update_visibility(src, FALSE)
GLOB.cameranet.update_visibility(src, FALSE)
/mob/living/silicon/ai/death(gibbed)
. = ..()
if(.)
// If true, the mob went from living to dead (assuming everyone has been overriding as they should...)
cameranet.update_visibility(src, FALSE)
GLOB.cameranet.update_visibility(src, FALSE)
@@ -2,7 +2,7 @@
/proc/updateVisibility(atom/A, var/opacity_check = TRUE)
if(SSticker.current_state >= GAME_STATE_PLAYING)
for(var/datum/visualnet/VN in visual_nets)
for(var/datum/visualnet/VN in GLOB.visual_nets)
VN.update_visibility(A, opacity_check)
/atom/Destroy()
+10 -10
View File
@@ -11,12 +11,12 @@
/datum/visualnet/New()
..()
visual_nets += src
GLOB.visual_nets += src
if(!valid_source_types)
valid_source_types = list()
/datum/visualnet/Destroy()
visual_nets -= src
GLOB.visual_nets -= src
for(var/source in sources)
remove_source(source, FALSE)
sources.Cut()
@@ -118,8 +118,8 @@
if(source in sources)
return FALSE
sources += source
moved_event.register(source, src, PROC_REF(source_moved))
destroyed_event.register(source, src, PROC_REF(remove_source))
GLOB.moved_event.register(source, src, PROC_REF(source_moved))
GLOB.destroyed_event.register(source, src, PROC_REF(remove_source))
for_all_chunks_in_range(source, TYPE_PROC_REF(/datum/chunk, add_source), list(source))
if(update_visibility)
update_visibility(source, opacity_check)
@@ -128,8 +128,8 @@
/datum/visualnet/proc/remove_source(var/atom/source, var/update_visibility = TRUE, var/opacity_check = FALSE)
if(!sources.Remove(source))
return FALSE
moved_event.unregister(source, src)
destroyed_event.unregister(source, src)
GLOB.moved_event.unregister(source, src)
GLOB.destroyed_event.unregister(source, src)
for_all_chunks_in_range(source, /datum/chunk/proc/remove_source, list(source))
if(update_visibility)
update_visibility(source, opacity_check)
@@ -171,8 +171,8 @@
set category = "Debug"
set src in world
if(cameranet.is_chunk_generated(x, y, z))
var/datum/chunk/chunk = cameranet.get_chunk(x, y, z)
if(GLOB.cameranet.is_chunk_generated(x, y, z))
var/datum/chunk/chunk = GLOB.cameranet.get_chunk(x, y, z)
usr.client.debug_variables(chunk)
/turf/proc/update_chunk()
@@ -180,6 +180,6 @@
set category = "Debug"
set src in world
if(cameranet.is_chunk_generated(x, y, z))
var/datum/chunk/chunk = cameranet.get_chunk(x, y, z)
if(GLOB.cameranet.is_chunk_generated(x, y, z))
var/datum/chunk/chunk = GLOB.cameranet.get_chunk(x, y, z)
chunk.visibility_changed(TRUE)
@@ -17,6 +17,6 @@
my_client = client
set_sight(sight|SEE_TURFS)
player_list |= src
GLOB.player_list |= src
client.playtitlemusic()
+8 -8
View File
@@ -249,10 +249,10 @@
/obj/screen/new_player/selection/polls/Initialize()
. = ..()
if(establish_db_connection(dbcon))
if(establish_db_connection(GLOB.dbcon))
var/mob/M = hud.mymob
var/isadmin = M && M.client && M.client.holder
var/DBQuery/query = dbcon.NewQuery("SELECT id FROM ss13_poll_question WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM ss13_poll_vote WHERE ckey = \"[M.ckey]\") AND id NOT IN (SELECT pollid FROM ss13_poll_textreply WHERE ckey = \"[M.ckey]\")")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT id FROM ss13_poll_question WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM ss13_poll_vote WHERE ckey = \"[M.ckey]\") AND id NOT IN (SELECT pollid FROM ss13_poll_textreply WHERE ckey = \"[M.ckey]\")")
query.Execute()
var/newpoll = query.NextRow()
@@ -276,7 +276,7 @@
/mob/abstract/new_player/proc/ready(var/readying = TRUE)
if(SSticker.current_state <= GAME_STATE_PREGAME) // Make sure we don't ready up after the round has started
// Cannot join without a saved character, if we're on SQL saves.
if (config.sql_saves && !client.prefs.current_character)
if (GLOB.config.sql_saves && !client.prefs.current_character)
alert(src, "You have not saved your character yet. Please do so before readying up.")
return
if(client.unacked_warning_count > 0)
@@ -308,7 +308,7 @@
// Only display the warning if it's a /new/ new player,
// if they've died and gone back to menu they probably already know their respawn time (and it won't be reset anymore)
if(!get_death_time(CREW))
if(alert(src, "Are you sure you wish to observe? You will have to wait [config.respawn_delay] minutes before being able to respawn.", "Player Setup", "Yes", "No") != "Yes")
if(alert(src, "Are you sure you wish to observe? You will have to wait [GLOB.config.respawn_delay] minutes before being able to respawn.", "Player Setup", "Yes", "No") != "Yes")
return FALSE
var/mob/abstract/observer/observer = new /mob/abstract/observer(src)
@@ -317,7 +317,7 @@
observer.started_as_observer = 1
close_spawn_windows()
var/obj/O = locate("landmark*Observer-Start") in landmarks_list
var/obj/O = locate("landmark*Observer-Start") in GLOB.landmarks_list
if(istype(O))
to_chat(src, "<span class='notice'>Now teleporting.</span>")
observer.forceMove(O.loc)
@@ -337,7 +337,7 @@
observer.real_name = client.prefs.real_name
observer.name = observer.real_name
if(!client.holder && !config.antag_hud_allowed)
if(!client.holder && !GLOB.config.antag_hud_allowed)
remove_verb(observer, /mob/abstract/observer/verb/toggle_antagHUD)
observer.ckey = ckey
observer.initialise_postkey()
@@ -345,7 +345,7 @@
qdel(src)
/mob/abstract/new_player/proc/show_lore_summary()
if(config.lore_summary)
if(GLOB.config.lore_summary)
var/output = "<div align='center'><hr1><B>Welcome to the [station_name()]!</B></hr1><br>"
output += "<i>[config.lore_summary]</i><hr>"
output += "<i>[GLOB.config.lore_summary]</i><hr>"
to_chat(src, output)
@@ -21,7 +21,7 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
/mob/abstract/new_player/Initialize()
. = ..()
dead_mob_list -= src
GLOB.dead_mob_list -= src
/mob/abstract/new_player/Destroy()
QDEL_NULL(late_choices_ui)
@@ -38,11 +38,11 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
else if (SSticker.hide_mode == ROUNDTYPE_MIXED_SECRET)
. += "Game Mode: Mixed Secret"
else
. += "Game Mode: [master_mode]" // Old setting for showing the game mode
. += "Game Mode: [GLOB.master_mode]" // Old setting for showing the game mode
if(SSticker.current_state == GAME_STATE_PREGAME)
. += "Time To Start: [SSticker.pregame_timeleft][round_progressing ? "" : " (DELAYED)"]"
. += "Players: [length(player_list)] Players Ready: [SSticker.total_players_ready]"
. += "Time To Start: [SSticker.pregame_timeleft][GLOB.round_progressing ? "" : " (DELAYED)"]"
. += "Players: [length(GLOB.player_list)] Players Ready: [SSticker.total_players_ready]"
if(LAZYLEN(SSticker.ready_player_jobs))
. += ""
. += ""
@@ -51,15 +51,15 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
var/list/ready_special_roles = list()
//Get the list of all the players, if they are ready, get their special roles (aka antagonists) preferences and count them up in a list
for(var/mob/abstract/new_player/player in player_list)
for(var/mob/abstract/new_player/player in GLOB.player_list)
if(!player.ready)
continue
for(var/special_role in player?.client?.prefs?.be_special_role)
ready_special_roles[special_role] += 1
//Get the list of all antagonist types, if they require more than one person to spawn, check that there's at least one candidate and if so list the number of candidates for it
for(var/antag_type in all_antag_types)
var/datum/antagonist/possible_antag_type = all_antag_types[antag_type]
for(var/antag_type in GLOB.all_antag_types)
var/datum/antagonist/possible_antag_type = GLOB.all_antag_types[antag_type]
if(possible_antag_type.initial_spawn_req > 1)
if(ready_special_roles[possible_antag_type.role_type])
@@ -86,7 +86,7 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
if(href_list["ready"])
if(SSticker.current_state <= GAME_STATE_PREGAME) // Make sure we don't ready up after the round has started
// Cannot join without a saved character, if we're on SQL saves.
if (config.sql_saves && !client.prefs.current_character)
if (GLOB.config.sql_saves && !client.prefs.current_character)
alert(src, "You have not saved your character yet. Please do so before readying up.")
return
if(client.unacked_warning_count > 0)
@@ -108,13 +108,13 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
return
// Cannot join without a saved character, if we're on SQL saves.
if (config.sql_saves && !client.prefs.current_character)
if (GLOB.config.sql_saves && !client.prefs.current_character)
alert(src, "You have not saved your character yet. Please do so before attempting to join.")
return
if(!check_rights(R_ADMIN, 0))
var/datum/species/S = all_species[client.prefs.species]
if((S.spawn_flags & IS_WHITELISTED) && !is_alien_whitelisted(src, client.prefs.species) && config.usealienwhitelist)
var/datum/species/S = GLOB.all_species[client.prefs.species]
if((S.spawn_flags & IS_WHITELISTED) && !is_alien_whitelisted(src, client.prefs.species) && GLOB.config.usealienwhitelist)
to_chat(usr, "<span class='danger'>You are currently not whitelisted to play [client.prefs.species].</span>")
return 0
@@ -135,7 +135,7 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
if(href_list["SelectedJob"])
if(!config.enter_allowed)
if(!GLOB.config.enter_allowed)
to_chat(usr, "<span class='notice'>There is an administrative lock on entering the game!</span>")
return
else if(SSticker.mode && SSticker.mode.explosion_in_progress)
@@ -146,8 +146,8 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
alert(usr, "You can not join the game, because you have unacknowledged warnings or notifications. Acknowledge them in OOC->Warnings and Notifications.")
return
var/datum/species/S = all_species[client.prefs.species]
if((S.spawn_flags & IS_WHITELISTED) && !is_alien_whitelisted(src, client.prefs.species) && config.usealienwhitelist)
var/datum/species/S = GLOB.all_species[client.prefs.species]
if((S.spawn_flags & IS_WHITELISTED) && !is_alien_whitelisted(src, client.prefs.species) && GLOB.config.usealienwhitelist)
to_chat(usr, "<span class='danger'>You are currently not whitelisted to play [client.prefs.species].</span>")
return 0
@@ -230,7 +230,7 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
return FALSE
if(job.blacklisted_species) // check for restricted species
var/datum/species/S = all_species[client.prefs.species]
var/datum/species/S = GLOB.all_species[client.prefs.species]
if(S.name in job.blacklisted_species)
return FALSE
@@ -259,10 +259,10 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
if(SSticker.current_state != GAME_STATE_PLAYING)
to_chat(usr, "<span class='warning'>The round is either not ready, or has already finished...</span>")
return 0
if(!config.enter_allowed)
if(!GLOB.config.enter_allowed)
to_chat(usr, "<span class='notice'>There is an administrative lock on entering the game!</span>")
return 0
if(config.sql_saves && !client.prefs.current_character)
if(GLOB.config.sql_saves && !client.prefs.current_character)
alert(usr, "You have not saved your character yet. Please do so before attempting to join.")
return 0
if(!IsJobAvailable(rank))
@@ -288,8 +288,8 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
character = character.AIize(move=0) // AIize the character, but don't move them yet
// IsJobAvailable for AI checks that there is an empty core available in this list
var/obj/structure/AIcore/deactivated/C = empty_playable_ai_cores[1]
empty_playable_ai_cores -= C
var/obj/structure/AIcore/deactivated/C = GLOB.empty_playable_ai_cores[1]
GLOB.empty_playable_ai_cores -= C
character.forceMove(C.loc)
character.eyeobj.forceMove(C.loc)
@@ -313,7 +313,7 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
character.buckled_to.set_dir(character.dir)
SSticker.mode.handle_latejoin(character)
universe.OnPlayerLatejoin(character)
GLOB.universe.OnPlayerLatejoin(character)
if(SSjobs.ShouldCreateRecords(character.mind))
if(character.mind.assigned_role != "Cyborg")
SSrecords.generate_record(character)
@@ -332,7 +332,7 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
if(character.mind.role_alt_title)
rank = character.mind.role_alt_title
// can't use their name here, since cyborg namepicking is done post-spawn, so we'll just say "A new Cyborg has arrived"/"A new Android has arrived"/etc.
global_announcer.autosay("A new[rank ? " [rank]" : " visitor" ] [join_message ? join_message : "has arrived on the [current_map.station_type]"].", "Arrivals Announcer")
GLOB.global_announcer.autosay("A new[rank ? " [rank]" : " visitor" ] [join_message ? join_message : "has arrived on the [current_map.station_type]"].", "Arrivals Announcer")
/mob/abstract/new_player/proc/LateChoices()
if(!istype(late_choices_ui))
@@ -350,23 +350,23 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
var/use_species_name
var/datum/species/chosen_species
if(client.prefs.species)
chosen_species = all_species[client.prefs.species]
chosen_species = GLOB.all_species[client.prefs.species]
use_species_name = chosen_species.get_station_variant() //Only used by pariahs atm.
if(chosen_species && use_species_name)
// Have to recheck admin due to no usr at roundstart. Latejoins are fine though.
if(is_species_whitelisted(chosen_species) || has_admin_rights())
new_character = new(newplayer_start, use_species_name)
new_character = new(GLOB.newplayer_start, use_species_name)
if(!new_character)
new_character = new(newplayer_start)
new_character = new(GLOB.newplayer_start)
new_character.lastarea = get_area(loc)
for(var/lang in client.prefs.alternate_languages)
var/datum/language/chosen_language = all_languages[lang]
var/datum/language/chosen_language = GLOB.all_languages[lang]
if(chosen_language)
if(!config.usealienwhitelist || !(chosen_language.flags & WHITELISTED) || is_alien_whitelisted(src, lang) || has_admin_rights() \
if(!GLOB.config.usealienwhitelist || !(chosen_language.flags & WHITELISTED) || is_alien_whitelisted(src, lang) || has_admin_rights() \
|| (new_character.species && (chosen_language.name in new_character.species.secondary_langs)))
new_character.add_language(lang)
@@ -425,12 +425,12 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
/mob/abstract/new_player/proc/is_species_whitelisted(datum/species/S)
if(!S) return 1
return is_alien_whitelisted(src, S.name) || !config.usealienwhitelist || !(S.spawn_flags & IS_WHITELISTED)
return is_alien_whitelisted(src, S.name) || !GLOB.config.usealienwhitelist || !(S.spawn_flags & IS_WHITELISTED)
/mob/abstract/new_player/get_species(var/reference = 0)
var/datum/species/chosen_species
if(client.prefs.species)
chosen_species = all_species[client.prefs.species]
chosen_species = GLOB.all_species[client.prefs.species]
if(!chosen_species)
return SPECIES_HUMAN
+27 -27
View File
@@ -4,12 +4,12 @@
var/optiontext
/mob/abstract/new_player/proc/handle_player_polling()
if(establish_db_connection(dbcon))
if(establish_db_connection(GLOB.dbcon))
var/isadmin = 0
if(src.client && src.client.holder)
isadmin = 1
var/DBQuery/select_query = dbcon.NewQuery("SELECT id, question FROM ss13_poll_question WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime")
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT id, question FROM ss13_poll_question WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime")
select_query.Execute()
var/output = "<div align='center'><B>Player polls</B>"
@@ -31,8 +31,8 @@
/mob/abstract/new_player/proc/show_poll_link(var/pollid = -1)
if(pollid == -1) return
if(establish_db_connection(dbcon))
var/DBQuery/select_query = dbcon.NewQuery("SELECT link FROM ss13_poll_question WHERE id = :pollid:")
if(establish_db_connection(GLOB.dbcon))
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT link FROM ss13_poll_question WHERE id = :pollid:")
select_query.Execute(list("pollid"=pollid))
var/link = null
@@ -47,8 +47,8 @@
/mob/abstract/new_player/proc/poll_player(var/pollid = -1)
if(pollid == -1) return
if(establish_db_connection(dbcon))
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions, link FROM ss13_poll_question WHERE id = :pollid:")
if(establish_db_connection(GLOB.dbcon))
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions, link FROM ss13_poll_question WHERE id = :pollid:")
select_query.Execute(list("pollid"=pollid))
var/pollstarttime = ""
@@ -76,7 +76,7 @@
switch(polltype)
//Polls that have enumerated options
if("OPTION")
var/DBQuery/voted_query = dbcon.NewQuery("SELECT optionid FROM ss13_poll_vote WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT optionid FROM ss13_poll_vote WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
voted_query.Execute()
var/voted = 0
@@ -88,7 +88,7 @@
var/list/datum/polloption/options = list()
var/DBQuery/options_query = dbcon.NewQuery("SELECT id, text FROM ss13_poll_option WHERE pollid = [pollid]")
var/DBQuery/options_query = GLOB.dbcon.NewQuery("SELECT id, text FROM ss13_poll_option WHERE pollid = [pollid]")
options_query.Execute()
while(options_query.NextRow())
var/datum/polloption/PO = new()
@@ -133,7 +133,7 @@
//Polls with a text input
if("TEXT")
var/DBQuery/voted_query = dbcon.NewQuery("SELECT replytext FROM ss13_poll_textreply WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT replytext FROM ss13_poll_textreply WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
voted_query.Execute()
var/voted = 0
@@ -179,7 +179,7 @@
//Polls with a text input
if("NUMVAL")
var/DBQuery/voted_query = dbcon.NewQuery("SELECT o.text, v.rating FROM ss13_poll_option o, ss13_poll_vote v WHERE o.pollid = [pollid] AND v.ckey = '[usr.ckey]' AND o.id = v.optionid")
var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT o.text, v.rating FROM ss13_poll_option o, ss13_poll_vote v WHERE o.pollid = [pollid] AND v.ckey = '[usr.ckey]' AND o.id = v.optionid")
voted_query.Execute()
var/output = "<div align='center'><B>Player poll</B>"
@@ -208,7 +208,7 @@
var/minid = 999999
var/maxid = 0
var/DBQuery/option_query = dbcon.NewQuery("SELECT id, text, minval, maxval, descmin, descmid, descmax FROM ss13_poll_option WHERE pollid = [pollid]")
var/DBQuery/option_query = GLOB.dbcon.NewQuery("SELECT id, text, minval, maxval, descmin, descmid, descmax FROM ss13_poll_option WHERE pollid = [pollid]")
option_query.Execute()
while(option_query.NextRow())
var/optionid = text2num(option_query.item[1])
@@ -253,7 +253,7 @@
src << browse(output,"window=playerpoll;size=500x500")
if("MULTICHOICE")
var/DBQuery/voted_query = dbcon.NewQuery("SELECT optionid FROM ss13_poll_vote WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT optionid FROM ss13_poll_vote WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
voted_query.Execute()
var/list/votedfor = list()
@@ -266,7 +266,7 @@
var/maxoptionid = 0
var/minoptionid = 0
var/DBQuery/options_query = dbcon.NewQuery("SELECT id, text FROM ss13_poll_option WHERE pollid = [pollid]")
var/DBQuery/options_query = GLOB.dbcon.NewQuery("SELECT id, text FROM ss13_poll_option WHERE pollid = [pollid]")
options_query.Execute()
while(options_query.NextRow())
var/datum/polloption/PO = new()
@@ -326,9 +326,9 @@
if(!isnum(pollid) || !isnum(optionid))
return
if(establish_db_connection(dbcon))
if(establish_db_connection(GLOB.dbcon))
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM ss13_poll_question WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM ss13_poll_question WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
select_query.Execute()
var/validpoll = 0
@@ -346,7 +346,7 @@
to_chat(usr, "<span class='warning'>Poll is not valid.</span>")
return
var/DBQuery/select_query2 = dbcon.NewQuery("SELECT id FROM ss13_poll_option WHERE id = [optionid] AND pollid = [pollid]")
var/DBQuery/select_query2 = GLOB.dbcon.NewQuery("SELECT id FROM ss13_poll_option WHERE id = [optionid] AND pollid = [pollid]")
select_query2.Execute()
var/validoption = 0
@@ -361,7 +361,7 @@
var/alreadyvoted = 0
var/DBQuery/voted_query = dbcon.NewQuery("SELECT id FROM ss13_poll_vote WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT id FROM ss13_poll_vote WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
voted_query.Execute()
while(voted_query.NextRow())
@@ -382,7 +382,7 @@
adminrank = usr.client.holder.rank
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO ss13_poll_vote (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank) VALUES (null, Now(), [pollid], [optionid], '[usr.ckey]', '[usr.client.address]', '[adminrank]')")
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("INSERT INTO ss13_poll_vote (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank) VALUES (null, Now(), [pollid], [optionid], '[usr.ckey]', '[usr.client.address]', '[adminrank]')")
insert_query.Execute()
to_chat(usr, "<span class='notice'>Vote successful.</span>")
@@ -395,9 +395,9 @@
if(!isnum(pollid) || !istext(replytext))
return
if(establish_db_connection(dbcon))
if(establish_db_connection(GLOB.dbcon))
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM ss13_poll_question WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM ss13_poll_question WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
select_query.Execute()
var/validpoll = 0
@@ -414,7 +414,7 @@
var/alreadyvoted = 0
var/DBQuery/voted_query = dbcon.NewQuery("SELECT id FROM ss13_poll_textreply WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT id FROM ss13_poll_textreply WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
voted_query.Execute()
while(voted_query.NextRow())
@@ -439,7 +439,7 @@
to_chat(usr, "The text you entered was blank, contained illegal characters or was too long. Please correct the text and submit again.")
return
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO ss13_poll_textreply (id ,datetime ,pollid ,ckey ,ip ,replytext ,adminrank) VALUES (null, Now(), [pollid], '[usr.ckey]', '[usr.client.address]', '[replytext]', '[adminrank]')")
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("INSERT INTO ss13_poll_textreply (id ,datetime ,pollid ,ckey ,ip ,replytext ,adminrank) VALUES (null, Now(), [pollid], '[usr.ckey]', '[usr.client.address]', '[replytext]', '[adminrank]')")
insert_query.Execute()
to_chat(usr, "<span class='notice'>Feedback logging successful.</span>")
@@ -452,9 +452,9 @@
if(!isnum(pollid) || !isnum(optionid))
return
if(establish_db_connection(dbcon))
if(establish_db_connection(GLOB.dbcon))
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM ss13_poll_question WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM ss13_poll_question WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
select_query.Execute()
var/validpoll = 0
@@ -469,7 +469,7 @@
to_chat(usr, "<span class='warning'>Poll is not valid.</span>")
return
var/DBQuery/select_query2 = dbcon.NewQuery("SELECT id FROM ss13_poll_option WHERE id = [optionid] AND pollid = [pollid]")
var/DBQuery/select_query2 = GLOB.dbcon.NewQuery("SELECT id FROM ss13_poll_option WHERE id = [optionid] AND pollid = [pollid]")
select_query2.Execute()
var/validoption = 0
@@ -484,7 +484,7 @@
var/alreadyvoted = 0
var/DBQuery/voted_query = dbcon.NewQuery("SELECT id FROM ss13_poll_vote WHERE optionid = [optionid] AND ckey = '[usr.ckey]'")
var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT id FROM ss13_poll_vote WHERE optionid = [optionid] AND ckey = '[usr.ckey]'")
voted_query.Execute()
while(voted_query.NextRow())
@@ -500,7 +500,7 @@
adminrank = usr.client.holder.rank
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO ss13_poll_vote (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank, rating) VALUES (null, Now(), [pollid], [optionid], '[usr.ckey]', '[usr.client.address]', '[adminrank]', [(isnull(rating)) ? "null" : rating])")
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("INSERT INTO ss13_poll_vote (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank, rating) VALUES (null, Now(), [pollid], [optionid], '[usr.ckey]', '[usr.client.address]', '[adminrank]', [(isnull(rating)) ? "null" : rating])")
insert_query.Execute()
to_chat(usr, "<span class='notice'>Vote successful.</span>")
@@ -6,7 +6,7 @@
gender = pick(MALE, FEMALE)
else
gender = H.gender
var/datum/species/current_species = all_species[species]
var/datum/species/current_species = GLOB.all_species[species]
if(current_species)
if(current_species.appearance_flags & HAS_SKIN_TONE)
+22 -22
View File
@@ -80,10 +80,10 @@
mind = body.mind //we don't transfer the mind but we keep a reference to it.
if(!T)
if(length(latejoin))
T = pick(latejoin) //Safety in case we cannot find the body's position
else if(current_map.force_spawnpoint && length(force_spawnpoints["Anyone"]))
T = pick(force_spawnpoints["Anyone"])
if(length(GLOB.latejoin))
T = pick(GLOB.latejoin) //Safety in case we cannot find the body's position
else if(current_map.force_spawnpoint && length(GLOB.force_spawnpoints["Anyone"]))
T = pick(GLOB.force_spawnpoints["Anyone"])
else
T = locate(1, 1, 1)
forceMove(T)
@@ -110,7 +110,7 @@
/mob/abstract/observer/Topic(href, href_list)
if (href_list["track"])
if(istype(href_list["track"],/mob))
var/mob/target = locate(href_list["track"]) in mob_list
var/mob/target = locate(href_list["track"]) in GLOB.mob_list
if(target)
ManualFollow(target)
else
@@ -189,7 +189,7 @@ Works together with spawning an observer, noted above.
//Teleports the observer away from z-levels they shouldnt be on, if needed.
/mob/abstract/observer/proc/teleport_if_needed()
//If we dont have a observe restriction we dont need to teleport
if(!config.observe_restriction)
if(!GLOB.config.observe_restriction)
return
//If we are not on a restricted level we dont need to get rid of them
@@ -197,7 +197,7 @@ Works together with spawning an observer, noted above.
return
//If we have observe restriction 1 and they are following a living non-animal mob we dont need to do anything.
if(config.observe_restriction == 1 && following && isliving(following) && !isliving(following))
if(GLOB.config.observe_restriction == 1 && following && isliving(following) && !isliving(following))
return
//In case we have observe restriction 2 (or 1 and they are following something, then teleport them back.)
@@ -235,7 +235,7 @@ Works together with spawning an observer, noted above.
ghost.ckey = ckey
ghost.initialise_postkey(should_set_timer)
if(ghost.client)
if(!ghost.client.holder && !config.antag_hud_allowed) // For new ghosts we remove the verb from even showing up if it's not allowed.
if(!ghost.client.holder && !GLOB.config.antag_hud_allowed) // For new ghosts we remove the verb from even showing up if it's not allowed.
remove_verb(ghost, /mob/abstract/observer/verb/toggle_antagHUD) // Poor guys, don't know what they are missing!
ghost.client.init_verbs()
return ghost
@@ -259,7 +259,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return
src.client.admin_ghost()
else
response = alert(src, "Are you -sure- you want to ghost?\n(You are alive. If you ghost, you won't be able to play this round for another [config.respawn_delay] minutes! You can't change your mind so choose wisely!)", "Are you sure you want to ghost?", "Ghost", "Stay in body")
response = alert(src, "Are you -sure- you want to ghost?\n(You are alive. If you ghost, you won't be able to play this round for another [GLOB.config.respawn_delay] minutes! You can't change your mind so choose wisely!)", "Are you sure you want to ghost?", "Ghost", "Stay in body")
if(response != "Ghost")
return
resting = 1
@@ -344,14 +344,14 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(!client)
return
var/aux_staff = check_rights(R_MOD|R_ADMIN, 0)
if(!config.antag_hud_allowed && (!client.holder || aux_staff))
if(!GLOB.config.antag_hud_allowed && (!client.holder || aux_staff))
to_chat(src, "<span class='warning'>Admins have disabled this for this round.</span>")
return
var/mob/abstract/observer/M = src
if(jobban_isbanned(M, "AntagHUD"))
to_chat(src, "<span class='danger'>You have been banned from using this feature</span>")
return
if(config.antag_hud_restricted && !M.has_enabled_antagHUD && (!client.holder || aux_staff))
if(GLOB.config.antag_hud_restricted && !M.has_enabled_antagHUD && (!client.holder || aux_staff))
var/response = alert(src, "If you turn this on, you will not be able to take any part in the round.","Are you sure you want to turn this feature on?","Yes","No")
if(response == "No") return
M.can_reenter_corpse = 0
@@ -364,7 +364,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
M.antagHUD = 1
to_chat(src, "<span class='notice'><B>AntagHUD Enabled</B></span>")
/mob/abstract/observer/proc/dead_tele(A in ghostteleportlocs)
/mob/abstract/observer/proc/dead_tele(A in GLOB.ghostteleportlocs)
set category = "Ghost"
set name = "Teleport"
set desc= "Teleport to a location"
@@ -373,7 +373,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return
remove_verb(usr, /mob/abstract/observer/proc/dead_tele)
ADD_VERB_IN(usr, 30, /mob/abstract/observer/proc/dead_tele)
var/area/thearea = ghostteleportlocs[A]
var/area/thearea = GLOB.ghostteleportlocs[A]
if(!thearea) return
var/list/L = list()
@@ -420,8 +420,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
stop_following()
following = target
moved_event.register(following, src, TYPE_PROC_REF(/atom/movable, move_to_destination))
destroyed_event.register(following, src, PROC_REF(stop_following))
GLOB.moved_event.register(following, src, TYPE_PROC_REF(/atom/movable, move_to_destination))
GLOB.destroyed_event.register(following, src, PROC_REF(stop_following))
to_chat(src, SPAN_NOTICE("Now following \the <b>[following]</b>."))
move_to_destination(following, following.loc, following.loc)
@@ -430,8 +430,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/abstract/observer/proc/stop_following()
if(following)
to_chat(src, SPAN_NOTICE("No longer following \the <b>[following]</b>."))
moved_event.unregister(following, src)
destroyed_event.unregister(following, src)
GLOB.moved_event.unregister(following, src)
GLOB.destroyed_event.unregister(following, src)
following = null
@@ -635,7 +635,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return ..()
/mob/abstract/observer/proc/try_possession(var/mob/living/M)
if(!config.ghosts_can_possess_animals)
if(!GLOB.config.ghosts_can_possess_animals)
to_chat(usr, "<span class='warning'>Ghosts are not permitted to possess animals.</span>")
return 0
if(!M.can_be_possessed_by(src))
@@ -648,7 +648,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set name = "Write in blood"
set desc = "If the round is sufficiently spooky, write a short message in blood on the floor or a wall. Remember, no IC in OOC or OOC in IC."
if(!(config.cult_ghostwriter))
if(!(GLOB.config.cult_ghostwriter))
to_chat(src, "<span class='warning'>That verb is not currently permitted.</span>")
return
@@ -886,7 +886,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
updateghostimages()
/proc/updateallghostimages()
for (var/mob/abstract/observer/O in player_list)
for (var/mob/abstract/observer/O in GLOB.player_list)
O.updateghostimages()
/mob/abstract/observer/proc/updateghostimages()
@@ -905,7 +905,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/abstract/observer/MayRespawn(var/feedback = 0, var/respawn_type = null)
if(!client)
return 0
if(config.antag_hud_restricted && has_enabled_antagHUD == 1)
if(GLOB.config.antag_hud_restricted && has_enabled_antagHUD == 1)
if(feedback)
to_chat(src, "<span class='warning'>antagHUD restrictions prevent you from respawning.</span>")
return 0
@@ -914,7 +914,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/timedifference = world.time- get_death_time(respawn_type)
var/respawn_time = 0
if (respawn_type == CREW)
respawn_time = config.respawn_delay MINUTES
respawn_time = GLOB.config.respawn_delay MINUTES
else if (respawn_type == ANIMAL)
respawn_time = RESPAWN_ANIMAL
else if (respawn_type == MINISYNTH)
+8 -8
View File
@@ -17,11 +17,11 @@
unauthed[token] = src
remove_verb(client, typesof(/client/verb))
var/uihtml = "<html><head><style>body * {display: block;text-align:center;margin: 14px 0;font-size:24px;text-decoration:none;font-family:Segoe UI,Frutiger,Frutiger Linotype,Dejavu Sans,Helvetica Neue,Arial,sans-serif;}</style></head><body><p>Please select:</p>"
if(config.guests_allowed)
if(GLOB.config.guests_allowed)
uihtml += "<a href='?src=\ref[src];authaction=guest'>Login as guest</a>"
if(config.webint_url && config.external_auth)
if(GLOB.config.webint_url && GLOB.config.external_auth)
uihtml += "<a href='?src=\ref[src];authaction=forums'>Login via forums</a>"
if(!config.guests_allowed && config.webint_url && config.external_auth)
if(!GLOB.config.guests_allowed && GLOB.config.webint_url && GLOB.config.external_auth)
src.OpenForumAuthWindow()
show_browser(src, uihtml, "window=externalauth;size=300x300;border=0;can_close=1;can_resize=0;can_minimize=0;titlebar=1")
timeout_timer = addtimer(CALLBACK(src, PROC_REF(timeout)), 900, TIMER_STOPPABLE)
@@ -51,13 +51,13 @@
del(c)
return
directory -= c.ckey
GLOB.directory -= c.ckey
if(newkey)
c.key = newkey // Try seeting ckey
// ^^^^ THIS INVOKES mob/Login()!
// and also modifies the c.mob to the actual mob they disconnected out of.
directory[c.ckey] = c
GLOB.directory[c.ckey] = c
// Init the client and give it a new_player mob.
// Note that modifying the key variable does not invoke client/New() or client/Login() again.
c.InitClient()
@@ -75,16 +75,16 @@
return
switch(href_list["authaction"])
if("guest")
if(config.guests_allowed)
if(GLOB.config.guests_allowed)
src.ClientLogin(null)
else
qdel(src)
if("forums")
if(config.external_auth)
if(GLOB.config.external_auth)
src.OpenForumAuthWindow()
else
qdel(src)
/mob/abstract/unauthed/proc/OpenForumAuthWindow()
src << link("[config.webint_url]server/auth?token=[token]")
src << link("[GLOB.config.webint_url]server/auth?token=[token]")