Tg 1 28 sync testing/confirmation (#5178)
* maps, tgui, tools * defines and helpers * onclick and controllers * datums fucking caught that hulk reversal too. * game and shuttle modular * module/admin * oh god they fucking moved antag shit again * haaaaate. Haaaaaaaaaate. * enables moff wings * more modules things * tgstation.dme before I forget something important * some mob stuff * s'more mob/living stuff * some carbon stuff * ayy lmaos and kitchen meat * Human stuff * species things moff wings have a 'none' version too * the rest of the module stuff. * some strings * misc * mob icons * some other icons. * It compiles FUCK BORERS FUCK BORERS
This commit is contained in:
+57
-5
@@ -40,13 +40,27 @@ GLOBAL_PROTECT(security_mode)
|
||||
GLOB.restart_counter = text2num(trim(file2text(RESTART_COUNTER_PATH)))
|
||||
fdel(RESTART_COUNTER_PATH)
|
||||
|
||||
if("no-init" in params)
|
||||
if(NO_INIT_PARAMETER in params)
|
||||
return
|
||||
|
||||
cit_initialize()
|
||||
|
||||
Master.Initialize(10, FALSE)
|
||||
|
||||
if(TEST_RUN_PARAMETER in params)
|
||||
HandleTestRun()
|
||||
|
||||
/world/proc/HandleTestRun()
|
||||
//trigger things to run the whole process
|
||||
Master.sleep_offline_after_initializations = FALSE
|
||||
SSticker.start_immediately = TRUE
|
||||
CONFIG_SET(number/round_end_countdown, 0)
|
||||
#ifdef UNIT_TESTS
|
||||
SSticker.OnRoundstart(CALLBACK(GLOBAL_PROC, /proc/RunUnitTests))
|
||||
#else
|
||||
SSticker.force_ending = TRUE
|
||||
#endif
|
||||
|
||||
/world/proc/SetupExternalRSC()
|
||||
#if (PRELOAD_RSC == 0)
|
||||
GLOB.external_rsc_urls = world.file2list("[global.config.directory]/external_rsc_urls.txt","\n")
|
||||
@@ -59,11 +73,15 @@ GLOBAL_PROTECT(security_mode)
|
||||
#endif
|
||||
|
||||
/world/proc/SetupLogs()
|
||||
GLOB.log_directory = "data/logs/[time2text(world.realtime, "YYYY/MM/DD")]/round-"
|
||||
if(GLOB.round_id)
|
||||
GLOB.log_directory += "[GLOB.round_id]"
|
||||
var/override_dir = params[OVERRIDE_LOG_DIRECTORY_PARAMETER]
|
||||
if(!override_dir)
|
||||
GLOB.log_directory = "data/logs/[time2text(world.realtime, "YYYY/MM/DD")]/round-"
|
||||
if(GLOB.round_id)
|
||||
GLOB.log_directory += "[GLOB.round_id]"
|
||||
else
|
||||
GLOB.log_directory += "[replacetext(time_stamp(), ":", ".")]"
|
||||
else
|
||||
GLOB.log_directory += "[replacetext(time_stamp(), ":", ".")]"
|
||||
GLOB.log_directory = "data/logs/[override_dir]"
|
||||
GLOB.world_game_log = file("[GLOB.log_directory]/game.log")
|
||||
GLOB.world_attack_log = file("[GLOB.log_directory]/attack.log")
|
||||
GLOB.world_runtime_log = file("[GLOB.log_directory]/runtime.log")
|
||||
@@ -72,6 +90,10 @@ GLOBAL_PROTECT(security_mode)
|
||||
GLOB.world_pda_log = file("[GLOB.log_directory]/pda.log")
|
||||
GLOB.sql_error_log = file("[GLOB.log_directory]/sql.log")
|
||||
GLOB.manifest_log = file("[GLOB.log_directory]/manifest.log")
|
||||
#ifdef UNIT_TESTS
|
||||
GLOB.test_log = file("[GLOB.log_directory]/tests.log")
|
||||
WRITE_FILE(GLOB.test_log, "\n\nStarting up round ID [GLOB.round_id]. [time_stamp()]\n---------------------")
|
||||
#endif
|
||||
WRITE_FILE(GLOB.world_game_log, "\n\nStarting up round ID [GLOB.round_id]. [time_stamp()]\n---------------------")
|
||||
WRITE_FILE(GLOB.world_attack_log, "\n\nStarting up round ID [GLOB.round_id]. [time_stamp()]\n---------------------")
|
||||
WRITE_FILE(GLOB.world_runtime_log, "\n\nStarting up round ID [GLOB.round_id]. [time_stamp()]\n---------------------")
|
||||
@@ -135,6 +157,27 @@ GLOBAL_PROTECT(security_mode)
|
||||
for(var/client/C in GLOB.clients)
|
||||
C.AnnouncePR(final_composed)
|
||||
|
||||
/world/proc/FinishTestRun()
|
||||
set waitfor = FALSE
|
||||
var/list/fail_reasons
|
||||
if(GLOB)
|
||||
if(GLOB.total_runtimes != 0)
|
||||
fail_reasons = list("Total runtimes: [GLOB.total_runtimes]")
|
||||
#ifdef UNIT_TESTS
|
||||
if(GLOB.failed_any_test)
|
||||
LAZYADD(fail_reasons, "Unit Tests failed!")
|
||||
#endif
|
||||
if(!GLOB.log_directory)
|
||||
LAZYADD(fail_reasons, "Missing GLOB.log_directory!")
|
||||
else
|
||||
fail_reasons = list("Missing GLOB!")
|
||||
if(!fail_reasons)
|
||||
text2file("Success!", "[GLOB.log_directory]/clean_run.lk")
|
||||
else
|
||||
log_world("Test run failed!\n[fail_reasons.Join("\n")]")
|
||||
sleep(0) //yes, 0, this'll let Reboot finish and prevent byond memes
|
||||
qdel(src) //shut it down
|
||||
|
||||
/world/Reboot(reason = 0, fast_track = FALSE)
|
||||
SERVER_TOOLS_ON_REBOOT
|
||||
if (reason || fast_track) //special reboot, do none of the normal stuff
|
||||
@@ -146,6 +189,10 @@ GLOBAL_PROTECT(security_mode)
|
||||
to_chat(world, "<span class='boldannounce'>Rebooting world...</span>")
|
||||
Master.Shutdown() //run SS shutdowns
|
||||
|
||||
if(TEST_RUN_PARAMETER in params)
|
||||
FinishTestRun()
|
||||
return
|
||||
|
||||
if(SERVER_TOOLS_PRESENT)
|
||||
var/do_hard_reboot
|
||||
// check the hard reboot counter
|
||||
@@ -225,3 +272,8 @@ GLOBAL_PROTECT(security_mode)
|
||||
hub_password = "kMZy3U5jJHSiBQjr"
|
||||
else
|
||||
hub_password = "SORRYNOPASSWORD"
|
||||
|
||||
/world/proc/incrementMaxZ()
|
||||
maxz++
|
||||
SSmobs.MaxZChanged()
|
||||
SSidlenpcpool.MaxZChanged()
|
||||
|
||||
Reference in New Issue
Block a user