mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 15:47:15 +01:00
[MIRROR] World Initialization Refactor [MDB IGNORE] (#20755)
* World Initialization Refactor * Update .github/CODEOWNERS * Update code/__HELPERS/global_lists.dm * Add logging for manually changing your targeted zone (#72814) See title. Surgery hud is exempt from this. Requested by @Mothblocks Signed-off-by: GitHub <noreply@github.com> Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com> Co-authored-by: dragomagol <66640614+dragomagol@users.noreply.github.com> * eee * Update tgstation.dme --------- Signed-off-by: GitHub <noreply@github.com> Co-authored-by: Jordan Dominion <Cyberboss@users.noreply.github.com> Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com> Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com> Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com> Co-authored-by: dragomagol <66640614+dragomagol@users.noreply.github.com> Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
This commit is contained in:
co-authored by
Mothblocks
dragomagol
Jordan Dominion
Tom
Zephyr
Gandalf
parent
11f5514dc7
commit
abf148d62b
@@ -96,6 +96,8 @@
|
||||
LoadChatFilter()
|
||||
if(CONFIG_GET(flag/load_jobs_from_txt))
|
||||
validate_job_config()
|
||||
if(CONFIG_GET(flag/usewhitelist))
|
||||
load_whitelist()
|
||||
|
||||
// SKYRAT EDIT ADDITION START
|
||||
populate_interaction_instances()
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* Pretty much pokes the MC to make sure it's still alive.
|
||||
**/
|
||||
|
||||
// See initialization order in /code/game/world.dm
|
||||
GLOBAL_REAL(Failsafe, /datum/controller/failsafe)
|
||||
|
||||
/datum/controller/failsafe // This thing pretty much just keeps poking the master controller
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// See initialization order in /code/game/world.dm
|
||||
GLOBAL_REAL(GLOB, /datum/controller/global_vars)
|
||||
|
||||
/datum/controller/global_vars
|
||||
@@ -16,8 +17,6 @@ GLOBAL_REAL(GLOB, /datum/controller/global_vars)
|
||||
gvars_datum_in_built_vars = exclude_these.vars + list(NAMEOF(src, gvars_datum_protected_varlist), NAMEOF(src, gvars_datum_in_built_vars), NAMEOF(src, gvars_datum_init_order))
|
||||
QDEL_IN(exclude_these, 0) //signal logging isn't ready
|
||||
|
||||
log_world("[vars.len - gvars_datum_in_built_vars.len] global variables")
|
||||
|
||||
Initialize()
|
||||
|
||||
/datum/controller/global_vars/Destroy(force)
|
||||
@@ -46,9 +45,14 @@ GLOBAL_REAL(GLOB, /datum/controller/global_vars)
|
||||
for(var/I in global_procs)
|
||||
expected_global_procs -= replacetext("[I]", "InitGlobal", "")
|
||||
log_world("Missing procs: [expected_global_procs.Join(", ")]")
|
||||
|
||||
for(var/I in global_procs)
|
||||
var/start_tick = world.time
|
||||
call(src, I)()
|
||||
var/end_tick = world.time
|
||||
if(end_tick - start_tick)
|
||||
warning("Global [replacetext("[I]", "InitGlobal", "")] slept during initialization!")
|
||||
|
||||
// Someone make it so this call isn't necessary
|
||||
make_datum_reference_lists()
|
||||
|
||||
|
||||
@@ -7,19 +7,8 @@
|
||||
*
|
||||
**/
|
||||
|
||||
//Init the debugger datum first so we can debug Master
|
||||
//You might wonder why not just create the debugger datum global in its own file, since its loaded way earlier than this DM file
|
||||
//Well for whatever reason then the Master gets created first and then the debugger when doing that
|
||||
//So thats why this code lives here now, until someone finds out how Byond inits globals
|
||||
GLOBAL_REAL(Debugger, /datum/debugger) = new
|
||||
//This is the ABSOLUTE ONLY THING that should init globally like this
|
||||
//2019 update: the failsafe,config and Global controllers also do it
|
||||
GLOBAL_REAL(Master, /datum/controller/master) = new
|
||||
|
||||
//THIS IS THE INIT ORDER
|
||||
//Master -> SSPreInit -> GLOB -> world -> config -> SSInit -> Failsafe
|
||||
//GOT IT MEMORIZED?
|
||||
|
||||
// See initialization order in /code/game/world.dm
|
||||
GLOBAL_REAL(Master, /datum/controller/master)
|
||||
/datum/controller/master
|
||||
name = "Master"
|
||||
|
||||
@@ -88,7 +77,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
|
||||
|
||||
if(!random_seed)
|
||||
#ifdef UNIT_TESTS
|
||||
random_seed = 29051994
|
||||
random_seed = 29051994 // How about 22475?
|
||||
#else
|
||||
random_seed = rand(1, 1e9)
|
||||
#endif
|
||||
|
||||
@@ -281,7 +281,9 @@ SUBSYSTEM_DEF(dbcore)
|
||||
else
|
||||
log_sql("Database is not enabled in configuration.")
|
||||
|
||||
/datum/controller/subsystem/dbcore/proc/SetRoundID()
|
||||
/datum/controller/subsystem/dbcore/proc/InitializeRound()
|
||||
CheckSchemaVersion()
|
||||
|
||||
if(!Connect())
|
||||
return
|
||||
var/datum/db_query/query_round_initialize = SSdbcore.NewQuery(/* SKYRAT EDIT CHANGE - MULTISERVER */
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#define PROFILER_FILENAME "profiler.json"
|
||||
#define SENDMAPS_FILENAME "sendmaps.json"
|
||||
GLOBAL_REAL_VAR(world_init_maptick_profiler) = world.Profile(PROFILE_RESTART, type = "sendmaps")
|
||||
|
||||
|
||||
SUBSYSTEM_DEF(profiler)
|
||||
name = "Profiler"
|
||||
|
||||
Reference in New Issue
Block a user