Moves TgsInitializationsComplete call to immediately after world/New() (#39771)

* Moves TgsInitializationsComplete call to immediately after world/New()

* Subsystem PreInit data directory audit

* world/New data directory audit

* Needful here too

* Remove SS_NO_INIT from SStitle

* Don't create banlist.bdb for SQL banning

* Stop creating legacy notes file

* Moves iconCache from data to tmp
This commit is contained in:
Jordan Brown
2018-09-15 05:34:14 -04:00
committed by oranges
parent a8f0c95a9c
commit bd7c22dda9
9 changed files with 23 additions and 10 deletions

View File

@@ -51,6 +51,7 @@
// Subsystems shutdown in the reverse of the order they initialize in
// The numbers just define the ordering, they are meaningless otherwise.
#define INIT_ORDER_TITLE 20
#define INIT_ORDER_GARBAGE 19
#define INIT_ORDER_DBCORE 18
#define INIT_ORDER_BLACKBOX 17

View File

@@ -164,12 +164,15 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
// Please don't stuff random bullshit here,
// Make a subsystem, give it the SS_NO_FIRE flag, and do your work in it's Initialize()
/datum/controller/master/Initialize(delay, init_sss)
/datum/controller/master/Initialize(delay, init_sss, tgs_prime)
set waitfor = 0
if(delay)
sleep(delay)
if(tgs_prime)
world.TgsInitializationComplete()
if(init_sss)
init_subtypes(/datum/controller/subsystem, subsystems)
@@ -202,7 +205,6 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
world.fps = CONFIG_GET(number/fps)
var/initialized_tod = REALTIMEOFDAY
world.TgsInitializationComplete()
if(sleep_offline_after_initializations)
world.sleep_offline = TRUE
sleep(1)

View File

@@ -15,6 +15,7 @@ SUBSYSTEM_DEF(job)
var/overflow_role = "Assistant"
/datum/controller/subsystem/job/Initialize(timeofday)
SSmapping.HACK_LoadMapConfig()
if(!occupations.len)
SetupOccupations()
if(CONFIG_GET(flag/load_jobs_from_txt))

View File

@@ -34,17 +34,17 @@ SUBSYSTEM_DEF(mapping)
var/datum/space_level/transit
var/datum/space_level/empty_space
/datum/controller/subsystem/mapping/PreInit()
//dlete dis once #39770 is resolved
/datum/controller/subsystem/mapping/proc/HACK_LoadMapConfig()
if(!config)
#ifdef FORCE_MAP
config = load_map_config(FORCE_MAP)
#else
config = load_map_config(error_if_missing = FALSE)
#endif
return ..()
/datum/controller/subsystem/mapping/Initialize(timeofday)
HACK_LoadMapConfig()
if(initialized)
return
if(config.defaulted)

View File

@@ -1,13 +1,14 @@
SUBSYSTEM_DEF(title)
name = "Title Screen"
flags = SS_NO_FIRE|SS_NO_INIT
flags = SS_NO_FIRE
init_order = INIT_ORDER_TITLE
var/file_path
var/icon/icon
var/icon/previous_icon
var/turf/closed/indestructible/splashscreen/splash_turf
/datum/controller/subsystem/title/PreInit()
/datum/controller/subsystem/title/Initialize()
if(file_path && icon)
return
@@ -21,6 +22,7 @@ SUBSYSTEM_DEF(title)
var/list/title_screens = list()
var/use_rare_screens = prob(1)
SSmapping.HACK_LoadMapConfig()
for(var/S in provisional_title_screens)
var/list/L = splittext(S,"+")
if((L.len == 1 && L[1] != "blank.png")|| (L.len > 1 && ((use_rare_screens && lowertext(L[1]) == "rare") || (lowertext(L[1]) == lowertext(SSmapping.config.map_name)))))
@@ -39,6 +41,8 @@ SUBSYSTEM_DEF(title)
if(splash_turf)
splash_turf.icon = icon
return ..()
/datum/controller/subsystem/title/vv_edit_var(var_name, var_value)
. = ..()
if(.)

View File

@@ -10,7 +10,7 @@ GLOBAL_VAR(restart_counter)
SetupExternalRSC()
GLOB.config_error_log = GLOB.world_manifest_log = GLOB.world_pda_log = GLOB.world_job_debug_log = GLOB.sql_error_log = GLOB.world_href_log = GLOB.world_runtime_log = GLOB.world_attack_log = GLOB.world_game_log = "data/logs/config_error.log" //temporary file used to record errors with loading config, moved to log directory once logging is set bl
GLOB.config_error_log = GLOB.world_manifest_log = GLOB.world_pda_log = GLOB.world_job_debug_log = GLOB.sql_error_log = GLOB.world_href_log = GLOB.world_runtime_log = GLOB.world_attack_log = GLOB.world_game_log = "data/logs/config_error.[GUID()].log" //temporary file used to record errors with loading config, moved to log directory once logging is set bl
make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once)
@@ -45,7 +45,7 @@ GLOBAL_VAR(restart_counter)
if(NO_INIT_PARAMETER in params)
return
Master.Initialize(10, FALSE)
Master.Initialize(10, FALSE, TRUE)
if(TEST_RUN_PARAMETER in params)
HandleTestRun()

View File

@@ -61,6 +61,8 @@ GLOBAL_PROTECT(Banlist)
return 1
/proc/LoadBans()
if(!CONFIG_GET(flag/ban_legacy_system))
return
GLOB.Banlist = new("data/banlist.bdb")
log_admin("Loading Banlist")

View File

@@ -554,6 +554,9 @@
#define NOTESFILE "data/player_notes.sav"
//if the AUTOCONVERT_NOTES is turned on, anytime a player connects this will be run to try and add all their notes to the databas
/proc/convert_notes_sql(ckey)
if(!fexists(NOTESFILE))
return
var/savefile/notesfile = new(NOTESFILE)
if(!notesfile)
log_game("Error: Cannot access [NOTESFILE]")

View File

@@ -3,7 +3,7 @@ For the main html chat area
*********************************/
//Precaching a bunch of shit
GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of icons for the browser output
GLOBAL_DATUM_INIT(iconCache, /savefile, new("tmp/iconCache.sav")) //Cache of icons for the browser output
//On client, created on login
/datum/chatOutput