Merge branch 'master' into afk-subsystem-2

This commit is contained in:
farie82
2020-06-06 07:01:34 +02:00
committed by GitHub
228 changed files with 2597 additions and 2933 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ SUBSYSTEM_DEF(afk)
/datum/controller/subsystem/afk/fire()
var/list/toRemove = list()
for(var/mob/living/carbon/human/H in GLOB.living_mob_list)
for(var/mob/living/carbon/human/H in GLOB.alive_mob_list)
if(!H?.ckey) // Useless non ckey creatures
continue
+3 -2
View File
@@ -497,13 +497,14 @@ SUBSYSTEM_DEF(jobs)
job.after_spawn(H)
//Gives glasses to the vision impaired
if(H.disabilities & DISABILITY_FLAG_NEARSIGHTED)
if(NEARSIGHTED in H.mutations)
var/equipped = H.equip_to_slot_or_del(new /obj/item/clothing/glasses/regular(H), slot_glasses)
if(equipped != 1)
var/obj/item/clothing/glasses/G = H.glasses
if(istype(G) && !G.prescription)
G.prescription = 1
G.prescription = TRUE
G.name = "prescription [G.name]"
H.update_nearsighted_effects()
return H
+6 -6
View File
@@ -11,7 +11,7 @@ SUBSYSTEM_DEF(mobs)
var/static/list/cubemonkeys = list()
/datum/controller/subsystem/mobs/stat_entry()
..("P:[GLOB.mob_list.len]")
..("P:[GLOB.mob_living_list.len]")
/datum/controller/subsystem/mobs/Initialize(start_timeofday)
clients_by_zlevel = new /list(world.maxz,0)
@@ -21,17 +21,17 @@ SUBSYSTEM_DEF(mobs)
/datum/controller/subsystem/mobs/fire(resumed = 0)
var/seconds = wait * 0.1
if(!resumed)
src.currentrun = GLOB.mob_list.Copy()
src.currentrun = GLOB.mob_living_list.Copy()
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun
var/times_fired = src.times_fired
while(currentrun.len)
var/mob/M = currentrun[currentrun.len]
var/mob/living/L = currentrun[currentrun.len]
currentrun.len--
if(M)
M.Life(seconds, times_fired)
if(L)
L.Life(seconds, times_fired)
else
GLOB.mob_list.Remove(M)
GLOB.mob_living_list.Remove(L)
if(MC_TICK_CHECK)
return
+28
View File
@@ -0,0 +1,28 @@
SUBSYSTEM_DEF(statistics)
name = "Statistics"
wait = 6000 // 10 minute delay between fires
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME // Only count time actually ingame to avoid logging pre-round dips
offline_implications = "Player count and admin count statistics will no longer be logged to the database. No immediate action is needed."
/datum/controller/subsystem/statistics/Initialize(start_timeofday)
if(!config.sql_enabled)
flags |= SS_NO_FIRE // Disable firing if SQL is disabled
return ..()
/datum/controller/subsystem/statistics/fire(resumed = 0)
sql_poll_players()
/datum/controller/subsystem/statistics/proc/sql_poll_players()
if(!config.sql_enabled)
return
var/playercount = GLOB.clients.len
var/admincount = GLOB.admins.len
if(!GLOB.dbcon.IsConnected())
log_game("SQL ERROR during player polling. Failed to connect.")
else
var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss")
var/DBQuery/query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("legacy_population")] (playercount, admincount, time) VALUES ([playercount], [admincount], '[sqltime]')")
if(!query.Execute())
var/err = query.ErrorMsg()
log_game("SQL ERROR during playercount polling. Error: \[[err]\]\n")
+8 -19
View File
@@ -29,7 +29,7 @@ SUBSYSTEM_DEF(ticker)
var/pregame_timeleft // This is used for calculations
var/delay_end = 0 //if set to nonzero, the round will not restart on it's own
var/triai = 0//Global holder for Triumvirate
var/initialtpass = 0 //holder for inital autotransfer vote timer
var/next_autotransfer = 0 //holder for inital autotransfer vote timer
var/obj/screen/cinematic = null //used for station explosion cinematic
var/round_end_announced = 0 // Spam Prevention. Announce round end only once.
var/ticker_going = TRUE // This used to be in the unused globals, but it turns out its actually used in a load of places. Its now a ticker var because its related to round stuff, -aa
@@ -90,6 +90,11 @@ SUBSYSTEM_DEF(ticker)
delay_end = 0 // reset this in case round start was delayed
mode.process()
mode.process_job_tasks()
if(world.time > next_autotransfer)
SSvote.autotransfer()
next_autotransfer = world.time + config.vote_autotransfer_interval
var/game_finished = SSshuttle.emergency.mode >= SHUTTLE_ENDGAME || mode.station_was_nuked
if(config.continuous_rounds)
mode.check_finished() // some modes contain var-changing code in here, so call even if we don't uses result
@@ -111,19 +116,6 @@ SUBSYSTEM_DEF(ticker)
else
world.Reboot("Round ended.", "end_proper", "proper completion")
/datum/controller/subsystem/ticker/proc/votetimer()
var/timerbuffer = 0
if(initialtpass == 0)
timerbuffer = config.vote_autotransfer_initial
else
timerbuffer = config.vote_autotransfer_interval
spawn(timerbuffer)
SSvote.autotransfer()
initialtpass = 1
votetimer()
/datum/controller/subsystem/ticker/proc/setup()
cultdat = setupcult()
//Create and announce mode
@@ -281,11 +273,8 @@ SUBSYSTEM_DEF(ticker)
auto_toggle_ooc(0) // Turn it off
round_start_time = world.time
if(config.sql_enabled)
spawn(3000)
statistic_cycle() // Polls population totals regularly and stores them in an SQL DB
votetimer()
// Sets the auto shuttle vote to happen after the config duration
next_autotransfer = world.time + config.vote_autotransfer_initial
for(var/mob/new_player/N in GLOB.mob_list)
if(N.client)
+1 -1
View File
@@ -20,7 +20,7 @@ SUBSYSTEM_DEF(weather)
var/datum/weather/W = V
if(W.aesthetic || W.stage != MAIN_STAGE)
continue
for(var/i in GLOB.living_mob_list)
for(var/i in GLOB.mob_living_list)
var/mob/living/L = i
if(W.can_weather_act(L))
W.weather_act(L)