everything to controllers
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
var/resident_file //the file which this was loaded from, if any
|
||||
var/modified = FALSE //set to TRUE if the default has been overridden by a config entry
|
||||
|
||||
var/deprecated_by //the /datum/config_entry type that supercedes this one
|
||||
|
||||
var/protection = NONE
|
||||
var/abstract_type = /datum/config_entry //do not instantiate if type matches this
|
||||
|
||||
@@ -85,6 +87,9 @@
|
||||
/datum/config_entry/proc/ValidateListEntry(key_name, key_value)
|
||||
return TRUE
|
||||
|
||||
/datum/config_entry/proc/DeprecationUpdate(value)
|
||||
return
|
||||
|
||||
/datum/config_entry/string
|
||||
config_entry_value = ""
|
||||
abstract_type = /datum/config_entry/string
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
var/directory = "config"
|
||||
|
||||
var/warned_deprecated_configs = FALSE
|
||||
var/hiding_entries_by_type = TRUE //Set for readability, admins can set this to FALSE if they want to debug it
|
||||
var/list/entries
|
||||
var/list/entries_by_type
|
||||
@@ -123,11 +124,26 @@
|
||||
if(lockthis)
|
||||
E.protection |= CONFIG_ENTRY_LOCKED
|
||||
|
||||
if(E.deprecated_by)
|
||||
var/datum/config_entry/new_ver = entries_by_type[E.deprecated_by]
|
||||
var/new_value = E.DeprecationUpdate(value)
|
||||
var/good_update = istext(new_value)
|
||||
log_config("Entry [entry] is deprecated and will be removed soon. Migrate to [new_ver.name]![good_update ? " Suggested new value is: [new_value]" : ""]")
|
||||
if(!warned_deprecated_configs)
|
||||
addtimer(CALLBACK(GLOBAL_PROC, /proc/message_admins, "This server is using deprecated configuration settings. Please check the logs and update accordingly."), 0)
|
||||
warned_deprecated_configs = TRUE
|
||||
if(good_update)
|
||||
value = new_value
|
||||
E = new_ver
|
||||
else
|
||||
warning("[new_ver.type] is deprecated but gave no proper return for DeprecationUpdate()")
|
||||
|
||||
var/validated = E.ValidateAndSet(value)
|
||||
if(!validated)
|
||||
log_config("Failed to validate setting \"[value]\" for [entry]")
|
||||
else if(E.modified && !E.dupes_allowed)
|
||||
log_config("Duplicate setting for [entry] ([value], [E.resident_file]) detected! Using latest.")
|
||||
else
|
||||
if(E.modified && !E.dupes_allowed)
|
||||
log_config("Duplicate setting for [entry] ([value], [E.resident_file]) detected! Using latest.")
|
||||
|
||||
E.resident_file = filename
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
|
||||
/datum/config_entry/flag/no_summon_events //Allowed
|
||||
|
||||
/datum/config_entry/flag/no_intercept_report //Whether or not to send a communications intercept report roundstart. This may be overriden by gamemodes.
|
||||
/datum/config_entry/flag/no_intercept_report //Whether or not to send a communications intercept report roundstart. This may be overridden by gamemodes.
|
||||
|
||||
/datum/config_entry/number/arrivals_shuttle_dock_window //Time from when a player late joins on the arrivals shuttle to when the shuttle docks on the station
|
||||
config_entry_value = 55
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
|
||||
/datum/config_entry/flag/log_manifest // log crew manifest to seperate file
|
||||
|
||||
/datum/config_entry/flag/log_job_debug // log roundstart divide occupations debug information to a file
|
||||
|
||||
/datum/config_entry/flag/allow_admin_ooccolor // Allows admins with relevant permissions to have their own ooc colour
|
||||
|
||||
/datum/config_entry/flag/allow_vote_restart // allow votes to restart
|
||||
|
||||
@@ -24,6 +24,17 @@ SUBSYSTEM_DEF(blackbox)
|
||||
|
||||
//poll population
|
||||
/datum/controller/subsystem/blackbox/fire()
|
||||
set waitfor = FALSE //for population query
|
||||
|
||||
CheckPlayerCount()
|
||||
|
||||
if(CONFIG_GET(flag/use_exp_tracking))
|
||||
if((triggertime < 0) || (world.time > (triggertime +3000))) //subsystem fires once at roundstart then once every 10 minutes. a 5 min check skips the first fire. The <0 is midnight rollover check
|
||||
update_exp(10,FALSE)
|
||||
|
||||
/datum/controller/subsystem/blackbox/proc/CheckPlayerCount()
|
||||
set waitfor = FALSE
|
||||
|
||||
if(!SSdbcore.Connect())
|
||||
return
|
||||
var/playercount = 0
|
||||
@@ -33,11 +44,7 @@ SUBSYSTEM_DEF(blackbox)
|
||||
var/admincount = GLOB.admins.len
|
||||
var/datum/DBQuery/query_record_playercount = SSdbcore.NewQuery("INSERT INTO [format_table_name("legacy_population")] (playercount, admincount, time, server_ip, server_port, round_id) VALUES ([playercount], [admincount], '[SQLtime()]', INET_ATON(IF('[world.internet_address]' LIKE '', '0', '[world.internet_address]')), '[world.port]', '[GLOB.round_id]')")
|
||||
query_record_playercount.Execute()
|
||||
|
||||
if(CONFIG_GET(flag/use_exp_tracking))
|
||||
if((triggertime < 0) || (world.time > (triggertime +3000))) //subsystem fires once at roundstart then once every 10 minutes. a 5 min check skips the first fire. The <0 is midnight rollover check
|
||||
update_exp(10,FALSE)
|
||||
|
||||
qdel(query_record_playercount)
|
||||
|
||||
/datum/controller/subsystem/blackbox/Recover()
|
||||
feedback = SSblackbox.feedback
|
||||
@@ -144,7 +151,7 @@ feedback data can be recorded in 5 formats:
|
||||
SSblackbox.record_feedback("text", "example", 1, "other text")
|
||||
json: {"data":["sample text","other text"]}
|
||||
"amount"
|
||||
used to record simple counts of data i.e. the number of ahelps recieved
|
||||
used to record simple counts of data i.e. the number of ahelps received
|
||||
further calls to the same key will add or subtract (if increment argument is a negative) from the saved amount
|
||||
calls: SSblackbox.record_feedback("amount", "example", 8)
|
||||
SSblackbox.record_feedback("amount", "example", 2)
|
||||
@@ -255,6 +262,7 @@ Versioning
|
||||
key_type = new_key_type
|
||||
|
||||
/datum/controller/subsystem/blackbox/proc/ReportDeath(mob/living/L)
|
||||
set waitfor = FALSE
|
||||
if(sealed)
|
||||
return
|
||||
if(!L || !L.key || !L.mind)
|
||||
@@ -267,28 +275,50 @@ Versioning
|
||||
first_death["area"] = "[AREACOORD(L)]"
|
||||
first_death["damage"] = "<font color='#FF5555'>[L.getBruteLoss()]</font>/<font color='orange'>[L.getFireLoss()]</font>/<font color='lightgreen'>[L.getToxLoss()]</font>/<font color='lightblue'>[L.getOxyLoss()]</font>/<font color='pink'>[L.getCloneLoss()]</font>"
|
||||
first_death["last_words"] = L.last_words
|
||||
var/sqlname = L.real_name
|
||||
var/sqlkey = L.ckey
|
||||
var/sqljob = L.mind.assigned_role
|
||||
var/sqlspecial = L.mind.special_role
|
||||
var/sqlpod = get_area_name(L, TRUE)
|
||||
var/laname = L.lastattacker
|
||||
var/lakey = L.lastattackerckey
|
||||
var/sqlbrute = L.getBruteLoss()
|
||||
var/sqlfire = L.getFireLoss()
|
||||
var/sqlbrain = L.getBrainLoss()
|
||||
var/sqloxy = L.getOxyLoss()
|
||||
var/sqltox = L.getToxLoss()
|
||||
var/sqlclone = L.getCloneLoss()
|
||||
var/sqlstamina = L.getStaminaLoss()
|
||||
var/x_coord = L.x
|
||||
var/y_coord = L.y
|
||||
var/z_coord = L.z
|
||||
var/last_words = L.last_words
|
||||
var/suicide = L.suiciding
|
||||
var/map = SSmapping.config.map_name
|
||||
|
||||
if(!SSdbcore.Connect())
|
||||
return
|
||||
var/area/placeofdeath = get_area(L)
|
||||
var/sqlname = sanitizeSQL(L.real_name)
|
||||
var/sqlkey = sanitizeSQL(L.ckey)
|
||||
var/sqljob = sanitizeSQL(L.mind.assigned_role)
|
||||
var/sqlspecial = sanitizeSQL(L.mind.special_role)
|
||||
var/sqlpod = sanitizeSQL(placeofdeath.name)
|
||||
var/laname = sanitizeSQL(L.lastattacker)
|
||||
var/lakey = sanitizeSQL(L.lastattackerckey)
|
||||
var/sqlbrute = sanitizeSQL(L.getBruteLoss())
|
||||
var/sqlfire = sanitizeSQL(L.getFireLoss())
|
||||
var/sqlbrain = sanitizeSQL(L.getBrainLoss())
|
||||
var/sqloxy = sanitizeSQL(L.getOxyLoss())
|
||||
var/sqltox = sanitizeSQL(L.getToxLoss())
|
||||
var/sqlclone = sanitizeSQL(L.getCloneLoss())
|
||||
var/sqlstamina = sanitizeSQL(L.getStaminaLoss())
|
||||
var/x_coord = sanitizeSQL(L.x)
|
||||
var/y_coord = sanitizeSQL(L.y)
|
||||
var/z_coord = sanitizeSQL(L.z)
|
||||
var/last_words = sanitizeSQL(L.last_words)
|
||||
var/suicide = sanitizeSQL(L.suiciding)
|
||||
var/map = sanitizeSQL(SSmapping.config.map_name)
|
||||
|
||||
sqlname = sanitizeSQL(sqlname)
|
||||
sqlkey = sanitizeSQL(sqlkey)
|
||||
sqljob = sanitizeSQL(sqljob)
|
||||
sqlspecial = sanitizeSQL(sqlspecial)
|
||||
sqlpod = sanitizeSQL(sqlpod)
|
||||
laname = sanitizeSQL(laname)
|
||||
lakey = sanitizeSQL(lakey)
|
||||
sqlbrute = sanitizeSQL(sqlbrute)
|
||||
sqlfire = sanitizeSQL(sqlfire)
|
||||
sqlbrain = sanitizeSQL(sqlbrain)
|
||||
sqloxy = sanitizeSQL(sqloxy)
|
||||
sqltox = sanitizeSQL(sqltox)
|
||||
sqlclone = sanitizeSQL(sqlclone)
|
||||
sqlstamina = sanitizeSQL(sqlstamina)
|
||||
x_coord = sanitizeSQL(x_coord)
|
||||
y_coord = sanitizeSQL(y_coord)
|
||||
z_coord = sanitizeSQL(z_coord)
|
||||
last_words = sanitizeSQL(last_words)
|
||||
suicide = sanitizeSQL(suicide)
|
||||
map = sanitizeSQL(map)
|
||||
var/datum/DBQuery/query_report_death = SSdbcore.NewQuery("INSERT INTO [format_table_name("death")] (pod, x_coord, y_coord, z_coord, mapname, server_ip, server_port, round_id, tod, job, special, name, byondkey, laname, lakey, bruteloss, fireloss, brainloss, oxyloss, toxloss, cloneloss, staminaloss, last_words, suicide) VALUES ('[sqlpod]', '[x_coord]', '[y_coord]', '[z_coord]', '[map]', INET_ATON(IF('[world.internet_address]' LIKE '', '0', '[world.internet_address]')), '[world.port]', [GLOB.round_id], '[SQLtime()]', '[sqljob]', '[sqlspecial]', '[sqlname]', '[sqlkey]', '[laname]', '[lakey]', [sqlbrute], [sqlfire], [sqlbrain], [sqloxy], [sqltox], [sqlclone], [sqlstamina], '[last_words]', [suicide])")
|
||||
query_report_death.Execute()
|
||||
query_report_death.Execute()
|
||||
qdel(query_report_death)
|
||||
|
||||
@@ -293,13 +293,13 @@ SUBSYSTEM_DEF(garbage)
|
||||
|
||||
|
||||
if(isnull(D.gc_destroyed))
|
||||
if (D.SendSignal(COMSIG_PARENT_PREQDELETED, force)) // Give the components a chance to prevent their parent from being deleted
|
||||
if (SEND_SIGNAL(D, COMSIG_PARENT_PREQDELETED, force)) // Give the components a chance to prevent their parent from being deleted
|
||||
return
|
||||
D.gc_destroyed = GC_CURRENTLY_BEING_QDELETED
|
||||
var/start_time = world.time
|
||||
var/start_tick = world.tick_usage
|
||||
var/hint = D.Destroy(arglist(args.Copy(2))) // Let our friend know they're about to get fucked up.
|
||||
D.SendSignal(COMSIG_PARENT_QDELETED, force, hint) // Let the (remaining) components know about the result of Destroy
|
||||
SEND_SIGNAL(D, COMSIG_PARENT_QDELETED, force, hint) // Let the (remaining) components know about the result of Destroy
|
||||
if(world.time != start_time)
|
||||
I.slept_destroy++
|
||||
else
|
||||
|
||||
@@ -7,7 +7,6 @@ SUBSYSTEM_DEF(job)
|
||||
var/list/name_occupations = list() //Dict of all jobs, keys are titles
|
||||
var/list/type_occupations = list() //Dict of all jobs, keys are types
|
||||
var/list/unassigned = list() //Players who need jobs
|
||||
var/list/job_debug = list() //Debug info
|
||||
var/initial_players_to_assign = 0 //used for checking against population caps
|
||||
|
||||
var/list/prioritized_jobs = list()
|
||||
@@ -36,6 +35,7 @@ SUBSYSTEM_DEF(job)
|
||||
old_overflow.spawn_positions = initial(old_overflow.spawn_positions)
|
||||
old_overflow.total_positions = initial(old_overflow.total_positions)
|
||||
overflow_role = new_overflow_role
|
||||
JobDebug("Overflow role set to : [new_overflow_role]")
|
||||
|
||||
/datum/controller/subsystem/job/proc/SetupOccupations(faction = "Station")
|
||||
occupations = list()
|
||||
@@ -62,13 +62,6 @@ SUBSYSTEM_DEF(job)
|
||||
return 1
|
||||
|
||||
|
||||
/datum/controller/subsystem/job/proc/Debug(text)
|
||||
if(!GLOB.Debug2)
|
||||
return 0
|
||||
job_debug.Add(text)
|
||||
return 1
|
||||
|
||||
|
||||
/datum/controller/subsystem/job/proc/GetJob(rank)
|
||||
if(!occupations.len)
|
||||
SetupOccupations()
|
||||
@@ -80,12 +73,12 @@ SUBSYSTEM_DEF(job)
|
||||
return type_occupations[jobtype]
|
||||
|
||||
/datum/controller/subsystem/job/proc/AssignRole(mob/dead/new_player/player, rank, latejoin = FALSE)
|
||||
Debug("Running AR, Player: [player], Rank: [rank], LJ: [latejoin]")
|
||||
JobDebug("Running AR, Player: [player], Rank: [rank], LJ: [latejoin]")
|
||||
if(player && player.mind && rank)
|
||||
var/datum/job/job = GetJob(rank)
|
||||
if(!job)
|
||||
return FALSE
|
||||
if(jobban_isbanned(player, rank))
|
||||
if(jobban_isbanned(player, rank) || QDELETED(player))
|
||||
return FALSE
|
||||
if(!job.player_old_enough(player.client))
|
||||
return FALSE
|
||||
@@ -94,41 +87,41 @@ SUBSYSTEM_DEF(job)
|
||||
var/position_limit = job.total_positions
|
||||
if(!latejoin)
|
||||
position_limit = job.spawn_positions
|
||||
Debug("Player: [player] is now Rank: [rank], JCP:[job.current_positions], JPL:[position_limit]")
|
||||
JobDebug("Player: [player] is now Rank: [rank], JCP:[job.current_positions], JPL:[position_limit]")
|
||||
player.mind.assigned_role = rank
|
||||
unassigned -= player
|
||||
job.current_positions++
|
||||
return TRUE
|
||||
Debug("AR has failed, Player: [player], Rank: [rank]")
|
||||
JobDebug("AR has failed, Player: [player], Rank: [rank]")
|
||||
return FALSE
|
||||
|
||||
|
||||
/datum/controller/subsystem/job/proc/FindOccupationCandidates(datum/job/job, level, flag)
|
||||
Debug("Running FOC, Job: [job], Level: [level], Flag: [flag]")
|
||||
JobDebug("Running FOC, Job: [job], Level: [level], Flag: [flag]")
|
||||
var/list/candidates = list()
|
||||
for(var/mob/dead/new_player/player in unassigned)
|
||||
if(jobban_isbanned(player, job.title))
|
||||
Debug("FOC isbanned failed, Player: [player]")
|
||||
if(jobban_isbanned(player, job.title) || QDELETED(player))
|
||||
JobDebug("FOC isbanned failed, Player: [player]")
|
||||
continue
|
||||
if(!job.player_old_enough(player.client))
|
||||
Debug("FOC player not old enough, Player: [player]")
|
||||
JobDebug("FOC player not old enough, Player: [player]")
|
||||
continue
|
||||
if(job.required_playtime_remaining(player.client))
|
||||
Debug("FOC player not enough xp, Player: [player]")
|
||||
JobDebug("FOC player not enough xp, Player: [player]")
|
||||
continue
|
||||
if(flag && (!(flag in player.client.prefs.be_special)))
|
||||
Debug("FOC flag failed, Player: [player], Flag: [flag], ")
|
||||
JobDebug("FOC flag failed, Player: [player], Flag: [flag], ")
|
||||
continue
|
||||
if(player.mind && job.title in player.mind.restricted_roles)
|
||||
Debug("FOC incompatible with antagonist role, Player: [player]")
|
||||
JobDebug("FOC incompatible with antagonist role, Player: [player]")
|
||||
continue
|
||||
if(player.client.prefs.GetJobDepartment(job, level) & job.flag)
|
||||
Debug("FOC pass, Player: [player], Level:[level]")
|
||||
JobDebug("FOC pass, Player: [player], Level:[level]")
|
||||
candidates += player
|
||||
return candidates
|
||||
|
||||
/datum/controller/subsystem/job/proc/GiveRandomJob(mob/dead/new_player/player)
|
||||
Debug("GRJ Giving random job, Player: [player]")
|
||||
JobDebug("GRJ Giving random job, Player: [player]")
|
||||
. = FALSE
|
||||
for(var/datum/job/job in shuffle(occupations))
|
||||
if(!job)
|
||||
@@ -140,32 +133,37 @@ SUBSYSTEM_DEF(job)
|
||||
if(job.title in GLOB.command_positions) //If you want a command position, select it!
|
||||
continue
|
||||
|
||||
if(jobban_isbanned(player, job.title))
|
||||
Debug("GRJ isbanned failed, Player: [player], Job: [job.title]")
|
||||
if(jobban_isbanned(player, job.title) || QDELETED(player))
|
||||
if(QDELETED(player))
|
||||
JobDebug("GRJ isbanned failed, Player deleted")
|
||||
break
|
||||
JobDebug("GRJ isbanned failed, Player: [player], Job: [job.title]")
|
||||
continue
|
||||
|
||||
if(!job.player_old_enough(player.client))
|
||||
Debug("GRJ player not old enough, Player: [player]")
|
||||
JobDebug("GRJ player not old enough, Player: [player]")
|
||||
continue
|
||||
|
||||
if(job.required_playtime_remaining(player.client))
|
||||
Debug("GRJ player not enough xp, Player: [player]")
|
||||
JobDebug("GRJ player not enough xp, Player: [player]")
|
||||
continue
|
||||
|
||||
if(player.mind && job.title in player.mind.restricted_roles)
|
||||
Debug("GRJ incompatible with antagonist role, Player: [player], Job: [job.title]")
|
||||
JobDebug("GRJ incompatible with antagonist role, Player: [player], Job: [job.title]")
|
||||
continue
|
||||
|
||||
if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1)
|
||||
Debug("GRJ Random job given, Player: [player], Job: [job]")
|
||||
JobDebug("GRJ Random job given, Player: [player], Job: [job]")
|
||||
if(AssignRole(player, job.title))
|
||||
return TRUE
|
||||
|
||||
/datum/controller/subsystem/job/proc/ResetOccupations()
|
||||
JobDebug("Occupations reset.")
|
||||
for(var/mob/dead/new_player/player in GLOB.player_list)
|
||||
if((player) && (player.mind))
|
||||
player.mind.assigned_role = null
|
||||
player.mind.special_role = null
|
||||
SSpersistence.antag_rep_change[player.ckey] = 0
|
||||
SetupOccupations()
|
||||
unassigned = list()
|
||||
return
|
||||
@@ -231,7 +229,7 @@ SUBSYSTEM_DEF(job)
|
||||
**/
|
||||
/datum/controller/subsystem/job/proc/DivideOccupations()
|
||||
//Setup new player list and get the jobs list
|
||||
Debug("Running DO")
|
||||
JobDebug("Running DO")
|
||||
|
||||
//Holder for Triumvirate is stored in the SSticker, this just processes it
|
||||
if(SSticker.triai)
|
||||
@@ -247,7 +245,7 @@ SUBSYSTEM_DEF(job)
|
||||
|
||||
initial_players_to_assign = unassigned.len
|
||||
|
||||
Debug("DO, Len: [unassigned.len]")
|
||||
JobDebug("DO, Len: [unassigned.len]")
|
||||
if(unassigned.len == 0)
|
||||
return 0
|
||||
|
||||
@@ -268,28 +266,28 @@ SUBSYSTEM_DEF(job)
|
||||
HandleFeedbackGathering()
|
||||
|
||||
//People who wants to be the overflow role, sure, go on.
|
||||
Debug("DO, Running Overflow Check 1")
|
||||
JobDebug("DO, Running Overflow Check 1")
|
||||
var/datum/job/overflow = GetJob(SSjob.overflow_role)
|
||||
var/list/overflow_candidates = FindOccupationCandidates(overflow, 3)
|
||||
Debug("AC1, Candidates: [overflow_candidates.len]")
|
||||
JobDebug("AC1, Candidates: [overflow_candidates.len]")
|
||||
for(var/mob/dead/new_player/player in overflow_candidates)
|
||||
Debug("AC1 pass, Player: [player]")
|
||||
JobDebug("AC1 pass, Player: [player]")
|
||||
AssignRole(player, SSjob.overflow_role)
|
||||
overflow_candidates -= player
|
||||
Debug("DO, AC1 end")
|
||||
JobDebug("DO, AC1 end")
|
||||
|
||||
//Select one head
|
||||
Debug("DO, Running Head Check")
|
||||
JobDebug("DO, Running Head Check")
|
||||
FillHeadPosition()
|
||||
Debug("DO, Head Check end")
|
||||
JobDebug("DO, Head Check end")
|
||||
|
||||
//Check for an AI
|
||||
Debug("DO, Running AI Check")
|
||||
JobDebug("DO, Running AI Check")
|
||||
FillAIPosition()
|
||||
Debug("DO, AI Check end")
|
||||
JobDebug("DO, AI Check end")
|
||||
|
||||
//Other jobs are now checked
|
||||
Debug("DO, Running Standard Check")
|
||||
JobDebug("DO, Running Standard Check")
|
||||
|
||||
|
||||
// New job giving system by Donkie
|
||||
@@ -313,66 +311,71 @@ SUBSYSTEM_DEF(job)
|
||||
continue
|
||||
|
||||
if(jobban_isbanned(player, job.title))
|
||||
Debug("DO isbanned failed, Player: [player], Job:[job.title]")
|
||||
JobDebug("DO isbanned failed, Player: [player], Job:[job.title]")
|
||||
continue
|
||||
|
||||
if(QDELETED(player))
|
||||
JobDebug("DO player deleted during job ban check")
|
||||
break
|
||||
|
||||
if(!job.player_old_enough(player.client))
|
||||
Debug("DO player not old enough, Player: [player], Job:[job.title]")
|
||||
JobDebug("DO player not old enough, Player: [player], Job:[job.title]")
|
||||
continue
|
||||
|
||||
if(job.required_playtime_remaining(player.client))
|
||||
Debug("DO player not enough xp, Player: [player], Job:[job.title]")
|
||||
JobDebug("DO player not enough xp, Player: [player], Job:[job.title]")
|
||||
continue
|
||||
|
||||
if(player.mind && job.title in player.mind.restricted_roles)
|
||||
Debug("DO incompatible with antagonist role, Player: [player], Job:[job.title]")
|
||||
JobDebug("DO incompatible with antagonist role, Player: [player], Job:[job.title]")
|
||||
continue
|
||||
|
||||
// If the player wants that job on this level, then try give it to him.
|
||||
if(player.client.prefs.GetJobDepartment(job, level) & job.flag)
|
||||
|
||||
// If the job isn't filled
|
||||
if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1)
|
||||
Debug("DO pass, Player: [player], Level:[level], Job:[job.title]")
|
||||
JobDebug("DO pass, Player: [player], Level:[level], Job:[job.title]")
|
||||
AssignRole(player, job.title)
|
||||
unassigned -= player
|
||||
break
|
||||
|
||||
|
||||
JobDebug("DO, Handling unassigned.")
|
||||
// Hand out random jobs to the people who didn't get any in the last check
|
||||
// Also makes sure that they got their preference correct
|
||||
for(var/mob/dead/new_player/player in unassigned)
|
||||
if(PopcapReached())
|
||||
RejectPlayer(player)
|
||||
else if(jobban_isbanned(player, SSjob.overflow_role))
|
||||
GiveRandomJob(player) //you get to roll for random before everyone else just to be sure you don't get overflow. you're so speshul
|
||||
|
||||
for(var/mob/dead/new_player/player in unassigned)
|
||||
if(PopcapReached())
|
||||
RejectPlayer(player)
|
||||
else if(player.client.prefs.joblessrole == BERANDOMJOB)
|
||||
GiveRandomJob(player)
|
||||
|
||||
Debug("DO, Standard Check end")
|
||||
|
||||
Debug("DO, Running AC2")
|
||||
|
||||
// For those who wanted to be assistant if their preferences were filled, here you go.
|
||||
for(var/mob/dead/new_player/player in unassigned)
|
||||
if(PopcapReached())
|
||||
RejectPlayer(player)
|
||||
if(player.client.prefs.joblessrole == BEOVERFLOW)
|
||||
Debug("AC2 Assistant located, Player: [player]")
|
||||
AssignRole(player, SSjob.overflow_role)
|
||||
else // For those who don't want to play if their preference were filled, back you go.
|
||||
RejectPlayer(player)
|
||||
HandleUnassigned(player)
|
||||
|
||||
JobDebug("DO, Handling unrejectable unassigned")
|
||||
//Mop up people who can't leave.
|
||||
for(var/mob/dead/new_player/player in unassigned) //Players that wanted to back out but couldn't because they're antags (can you feel the edge case?)
|
||||
if(!GiveRandomJob(player))
|
||||
AssignRole(player, SSjob.overflow_role) //If everything is already filled, make them an assistant
|
||||
|
||||
return 1
|
||||
|
||||
//We couldn't find a job from prefs for this guy.
|
||||
/datum/controller/subsystem/job/proc/HandleUnassigned(mob/dead/new_player/player)
|
||||
if(PopcapReached())
|
||||
RejectPlayer(player)
|
||||
else if(player.client.prefs.joblessrole == BEOVERFLOW)
|
||||
var/allowed_to_be_a_loser = !jobban_isbanned(player, SSjob.overflow_role)
|
||||
if(QDELETED(player) || !allowed_to_be_a_loser)
|
||||
RejectPlayer(player)
|
||||
else
|
||||
if(!AssignRole(player, SSjob.overflow_role))
|
||||
RejectPlayer(player)
|
||||
else if(player.client.prefs.joblessrole == BERANDOMJOB)
|
||||
if(!GiveRandomJob(player))
|
||||
RejectPlayer(player)
|
||||
else if(player.client.prefs.joblessrole == RETURNTOLOBBY)
|
||||
RejectPlayer(player)
|
||||
else //Something gone wrong if we got here.
|
||||
var/message = "DO: [player] fell through handling unassigned"
|
||||
JobDebug(message)
|
||||
log_game(message)
|
||||
message_admins(message)
|
||||
RejectPlayer(player)
|
||||
//Gives the player the stuff he should have with his rank
|
||||
/datum/controller/subsystem/job/proc/EquipRank(mob/M, rank, joined_late = FALSE)
|
||||
var/mob/dead/new_player/N
|
||||
@@ -448,7 +451,7 @@ SUBSYSTEM_DEF(job)
|
||||
if(ssc > 0)
|
||||
if(J.spawn_positions > 0)
|
||||
var/officer_positions = min(12, max(J.spawn_positions, round(unassigned.len / ssc))) //Scale between configured minimum and 12 officers
|
||||
Debug("Setting open security officer positions to [officer_positions]")
|
||||
JobDebug("Setting open security officer positions to [officer_positions]")
|
||||
J.total_positions = officer_positions
|
||||
J.spawn_positions = officer_positions
|
||||
|
||||
@@ -484,7 +487,7 @@ SUBSYSTEM_DEF(job)
|
||||
for(var/mob/dead/new_player/player in GLOB.player_list)
|
||||
if(!(player.ready == PLAYER_READY_TO_PLAY && player.mind && !player.mind.assigned_role))
|
||||
continue //This player is not ready
|
||||
if(jobban_isbanned(player, job.title))
|
||||
if(jobban_isbanned(player, job.title) || QDELETED(player))
|
||||
banned++
|
||||
continue
|
||||
if(!job.player_old_enough(player.client))
|
||||
@@ -520,7 +523,8 @@ SUBSYSTEM_DEF(job)
|
||||
if(player.mind && player.mind.special_role)
|
||||
return
|
||||
if(PopcapReached())
|
||||
Debug("Popcap overflow Check observer located, Player: [player]")
|
||||
JobDebug("Popcap overflow Check observer located, Player: [player]")
|
||||
JobDebug("Player rejected :[player]")
|
||||
to_chat(player, "<b>You have failed to qualify for any job you desired.</b>")
|
||||
unassigned -= player
|
||||
player.ready = PLAYER_NOT_READY
|
||||
@@ -625,3 +629,6 @@ SUBSYSTEM_DEF(job)
|
||||
for(var/mob/living/carbon/human/player in GLOB.carbon_list)
|
||||
if(player.mind && (player.mind.assigned_role in GLOB.security_positions))
|
||||
. |= player.mind
|
||||
|
||||
/datum/controller/subsystem/job/proc/JobDebug(message)
|
||||
log_job_debug(message)
|
||||
@@ -219,6 +219,7 @@ SUBSYSTEM_DEF(mapping)
|
||||
if(SSdbcore.Connect())
|
||||
var/datum/DBQuery/query_round_map_name = SSdbcore.NewQuery("UPDATE [format_table_name("round")] SET map_name = '[config.map_name]' WHERE id = [GLOB.round_id]")
|
||||
query_round_map_name.Execute()
|
||||
qdel(query_round_map_name)
|
||||
|
||||
#ifndef LOWMEMORYMODE
|
||||
// TODO: remove this when the DB is prepared for the z-levels getting reordered
|
||||
|
||||
@@ -115,38 +115,43 @@ SUBSYSTEM_DEF(overlays)
|
||||
#define NOT_QUEUED_ALREADY (!(flags_1 & OVERLAY_QUEUED_1))
|
||||
#define QUEUE_FOR_COMPILE flags_1 |= OVERLAY_QUEUED_1; SSoverlays.queue += src;
|
||||
/atom/proc/cut_overlays(priority = FALSE)
|
||||
var/list/cached_overlays = our_overlays
|
||||
var/list/cached_priority = priority_overlays
|
||||
LAZYINITLIST(priority_overlays)
|
||||
LAZYINITLIST(remove_overlays)
|
||||
LAZYINITLIST(add_overlays)
|
||||
remove_overlays = overlays.Copy()
|
||||
add_overlays.Cut()
|
||||
|
||||
var/need_compile = FALSE
|
||||
if(priority)
|
||||
priority_overlays.Cut()
|
||||
|
||||
if(LAZYLEN(cached_overlays)) //don't queue empty lists, don't cut priority overlays
|
||||
cached_overlays.Cut() //clear regular overlays
|
||||
need_compile = TRUE
|
||||
|
||||
if(priority && LAZYLEN(cached_priority))
|
||||
cached_priority.Cut()
|
||||
need_compile = TRUE
|
||||
|
||||
if(NOT_QUEUED_ALREADY && need_compile)
|
||||
//If not already queued for work and there are overlays to remove
|
||||
if(NOT_QUEUED_ALREADY && remove_overlays.len)
|
||||
QUEUE_FOR_COMPILE
|
||||
|
||||
/atom/proc/cut_overlay(list/overlays, priority)
|
||||
if(!overlays)
|
||||
return
|
||||
|
||||
overlays = build_appearance_list(overlays)
|
||||
LAZYINITLIST(add_overlays) //always initialized after this point
|
||||
LAZYINITLIST(priority_overlays)
|
||||
LAZYINITLIST(remove_overlays)
|
||||
var/a_len = add_overlays.len
|
||||
var/r_len = remove_overlays.len
|
||||
var/p_len = priority_overlays.len
|
||||
remove_overlays += overlays
|
||||
add_overlays -= overlays
|
||||
|
||||
var/list/cached_overlays = our_overlays //sanic
|
||||
var/list/cached_priority = priority_overlays
|
||||
var/init_o_len = LAZYLEN(cached_overlays)
|
||||
var/init_p_len = LAZYLEN(cached_priority) //starter pokemon
|
||||
|
||||
LAZYREMOVE(cached_overlays, overlays)
|
||||
if(priority)
|
||||
var/list/cached_priority = priority_overlays
|
||||
LAZYREMOVE(cached_priority, overlays)
|
||||
|
||||
if(NOT_QUEUED_ALREADY && ((init_o_len != LAZYLEN(cached_overlays)) || (init_p_len != LAZYLEN(cached_priority))))
|
||||
var/fa_len = add_overlays.len
|
||||
var/fr_len = remove_overlays.len
|
||||
var/fp_len = priority_overlays.len
|
||||
|
||||
//If not already queued and there is work to be done
|
||||
if(NOT_QUEUED_ALREADY && (fa_len != a_len || fr_len != r_len || fp_len != p_len))
|
||||
QUEUE_FOR_COMPILE
|
||||
|
||||
/atom/proc/add_overlay(list/overlays, priority = FALSE)
|
||||
@@ -155,24 +160,21 @@ SUBSYSTEM_DEF(overlays)
|
||||
|
||||
overlays = build_appearance_list(overlays)
|
||||
|
||||
LAZYINITLIST(our_overlays) //always initialized after this point
|
||||
LAZYINITLIST(add_overlays) //always initialized after this point
|
||||
LAZYINITLIST(priority_overlays)
|
||||
|
||||
var/list/cached_overlays = our_overlays //sanic
|
||||
var/list/cached_priority = priority_overlays
|
||||
var/init_o_len = cached_overlays.len
|
||||
var/init_p_len = cached_priority.len //starter pokemon
|
||||
var/need_compile
|
||||
var/a_len = add_overlays.len
|
||||
var/p_len = priority_overlays.len
|
||||
|
||||
if(priority)
|
||||
cached_priority += overlays //or in the image. Can we use [image] = image?
|
||||
need_compile = init_p_len != cached_priority.len
|
||||
priority_overlays += overlays //or in the image. Can we use [image] = image?
|
||||
var/fp_len = priority_overlays.len
|
||||
if(NOT_QUEUED_ALREADY && fp_len != p_len)
|
||||
QUEUE_FOR_COMPILE
|
||||
else
|
||||
cached_overlays += overlays
|
||||
need_compile = init_o_len != cached_overlays.len
|
||||
|
||||
if(NOT_QUEUED_ALREADY && need_compile) //have we caught more pokemon?
|
||||
QUEUE_FOR_COMPILE
|
||||
add_overlays += overlays
|
||||
var/fa_len = add_overlays.len
|
||||
if(NOT_QUEUED_ALREADY && fa_len != a_len)
|
||||
QUEUE_FOR_COMPILE
|
||||
|
||||
/atom/proc/copy_overlays(atom/other, cut_old) //copys our_overlays from another atom
|
||||
if(!other)
|
||||
@@ -180,12 +182,11 @@ SUBSYSTEM_DEF(overlays)
|
||||
cut_overlays()
|
||||
return
|
||||
|
||||
var/list/cached_other = other.our_overlays
|
||||
var/list/cached_other = other.overlays.Copy()
|
||||
if(cached_other)
|
||||
if(cut_old || !LAZYLEN(our_overlays))
|
||||
our_overlays = cached_other.Copy()
|
||||
else
|
||||
our_overlays |= cached_other
|
||||
if(cut_old || !LAZYLEN(overlays))
|
||||
remove_overlays = overlays
|
||||
add_overlays = cached_other
|
||||
if(NOT_QUEUED_ALREADY)
|
||||
QUEUE_FOR_COMPILE
|
||||
else if(cut_old)
|
||||
@@ -196,7 +197,7 @@ SUBSYSTEM_DEF(overlays)
|
||||
|
||||
//TODO: Better solution for these?
|
||||
/image/proc/add_overlay(x)
|
||||
overlays += x
|
||||
overlays |= x
|
||||
|
||||
/image/proc/cut_overlay(x)
|
||||
overlays -= x
|
||||
@@ -210,10 +211,10 @@ SUBSYSTEM_DEF(overlays)
|
||||
cut_overlays()
|
||||
return
|
||||
|
||||
var/list/cached_other = other.our_overlays
|
||||
var/list/cached_other = other.overlays.Copy()
|
||||
if(cached_other)
|
||||
if(cut_old || !overlays.len)
|
||||
overlays = cached_other.Copy()
|
||||
overlays = cached_other
|
||||
else
|
||||
overlays |= cached_other
|
||||
else if(cut_old)
|
||||
|
||||
@@ -611,4 +611,4 @@ SUBSYSTEM_DEF(shuttle)
|
||||
var/obj/machinery/computer/camera_advanced/shuttle_docker/C = V
|
||||
C.update_hidden_docking_ports(remove_images, add_images)
|
||||
|
||||
QDEL_LIST(remove_images)
|
||||
QDEL_LIST(remove_images)
|
||||
|
||||
@@ -42,6 +42,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
|
||||
var/timeLeft //pregame timer
|
||||
var/start_at
|
||||
|
||||
var/gametime_offset = 432000 //Deciseconds to add to world.time for station time.
|
||||
var/station_time_rate_multiplier = 12 //factor of station time progressal vs real time.
|
||||
|
||||
@@ -263,8 +264,8 @@ SUBSYSTEM_DEF(ticker)
|
||||
|
||||
if(!GLOB.Debug2)
|
||||
if(!can_continue)
|
||||
qdel(mode)
|
||||
mode = null
|
||||
log_game("[mode.name] failed pre_setup, cause: [mode.setup_error]")
|
||||
QDEL_NULL(mode)
|
||||
to_chat(world, "<B>Error setting up [GLOB.master_mode].</B> Reverting to pre-game lobby.")
|
||||
SSjob.ResetOccupations()
|
||||
return 0
|
||||
@@ -453,7 +454,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
queued_players -= next_in_line //Client disconnected, remove he
|
||||
queue_delay = 0 //No vacancy: restart timer
|
||||
if(25 to INFINITY) //No response from the next in line when a vacancy exists, remove he
|
||||
to_chat(next_in_line, "<span class='danger'>No response recieved. You have been removed from the line.</span>")
|
||||
to_chat(next_in_line, "<span class='danger'>No response received. You have been removed from the line.</span>")
|
||||
queued_players -= next_in_line
|
||||
queue_delay = 0
|
||||
|
||||
|
||||
@@ -485,6 +485,8 @@ SUBSYSTEM_DEF(timer)
|
||||
if (hash_timer.flags & TIMER_STOPPABLE)
|
||||
. = hash_timer.id
|
||||
return
|
||||
else if(flags & TIMER_OVERRIDE)
|
||||
stack_trace("TIMER_OVERRIDE used without TIMER_UNIQUE")
|
||||
|
||||
|
||||
var/timeToRun = world.time + wait
|
||||
@@ -510,9 +512,6 @@ SUBSYSTEM_DEF(timer)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/controller/subsystem/timer/proc/tump_buckets()
|
||||
reset_buckets()
|
||||
SSticker.tumpedbuckets = TRUE
|
||||
|
||||
#undef BUCKET_LEN
|
||||
#undef BUCKET_POS
|
||||
|
||||
Reference in New Issue
Block a user