From 200cfd12ff4cbbda3696b99355aa181ecdf7b9d1 Mon Sep 17 00:00:00 2001 From: Jamie D <993128+JamieD1@users.noreply.github.com> Date: Sat, 11 Sep 2021 16:06:35 +0100 Subject: [PATCH 1/4] Round End Sounds start on "Rebooting in 10 Seconds now" --- code/controllers/subsystem/ticker.dm | 12 ++++++++---- code/controllers/subsystem/title.dm | 11 ++++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index b534e44da916..cc53bb3bfeb7 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -672,6 +672,8 @@ SUBSYSTEM_DEF(ticker) //yogs end - yogs tickets to_chat(world, "Rebooting World in [DisplayTimeText(delay)]. [reason]") + play_roundend() + SStitle.fadeout() webhook_send_roundstatus("endgame") //yogs - webhook support var/start_wait = world.time @@ -695,10 +697,7 @@ SUBSYSTEM_DEF(ticker) world.Reboot() -/datum/controller/subsystem/ticker/Shutdown() - gather_newscaster() //called here so we ensure the log is created even upon admin reboot - save_admin_data() - update_everything_flag_in_db() +/datum/controller/subsystem/ticker/play_roundend() if(!round_end_sound) round_end_sound = pick(\ 'sound/roundend/newroundsexy.ogg', @@ -722,3 +721,8 @@ SUBSYSTEM_DEF(ticker) SEND_SOUND(world, sound(round_end_sound)) text2file(login_music, "data/last_round_lobby_music.txt") + +/datum/controller/subsystem/ticker/Shutdown() + gather_newscaster() //called here so we ensure the log is created even upon admin reboot + save_admin_data() + update_everything_flag_in_db() diff --git a/code/controllers/subsystem/title.dm b/code/controllers/subsystem/title.dm index 5bbc2b45ea6c..8d4941943a93 100644 --- a/code/controllers/subsystem/title.dm +++ b/code/controllers/subsystem/title.dm @@ -51,17 +51,18 @@ SUBSYSTEM_DEF(title) if(splash_turf) splash_turf.icon = icon -/datum/controller/subsystem/title/Shutdown() - if(file_path) - var/F = file("data/previous_title.dat") - WRITE_FILE(F, file_path) - +/datum/controller/subsystem/title/fadeout() for(var/thing in GLOB.clients) if(!thing) continue var/obj/screen/splash/S = new(thing, FALSE) S.Fade(FALSE,FALSE) +/datum/controller/subsystem/title/Shutdown() + if(file_path) + var/F = file("data/previous_title.dat") + WRITE_FILE(F, file_path) + /datum/controller/subsystem/title/Recover() icon = SStitle.icon splash_turf = SStitle.splash_turf From 835414ae626ad5388c4e6d806f1144ecaf3fb543 Mon Sep 17 00:00:00 2001 From: Jamie D <993128+JamieD1@users.noreply.github.com> Date: Sat, 11 Sep 2021 16:47:09 +0100 Subject: [PATCH 2/4] e --- code/controllers/subsystem/ticker.dm | 3 +-- code/controllers/subsystem/title.dm | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index cc53bb3bfeb7..15074fe7456d 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -675,7 +675,6 @@ SUBSYSTEM_DEF(ticker) play_roundend() SStitle.fadeout() webhook_send_roundstatus("endgame") //yogs - webhook support - var/start_wait = world.time UNTIL(round_end_sound_sent || (world.time - start_wait) > (delay * 2)) //don't wait forever sleep(delay - (world.time - start_wait)) @@ -697,7 +696,7 @@ SUBSYSTEM_DEF(ticker) world.Reboot() -/datum/controller/subsystem/ticker/play_roundend() +/datum/controller/subsystem/ticker/proc/play_roundend() if(!round_end_sound) round_end_sound = pick(\ 'sound/roundend/newroundsexy.ogg', diff --git a/code/controllers/subsystem/title.dm b/code/controllers/subsystem/title.dm index 8d4941943a93..18b065ac7670 100644 --- a/code/controllers/subsystem/title.dm +++ b/code/controllers/subsystem/title.dm @@ -51,7 +51,7 @@ SUBSYSTEM_DEF(title) if(splash_turf) splash_turf.icon = icon -/datum/controller/subsystem/title/fadeout() +/datum/controller/subsystem/title/proc/fadeout() for(var/thing in GLOB.clients) if(!thing) continue From 3b0d6767a78516682099802939990bbace8c823a Mon Sep 17 00:00:00 2001 From: Jamie D <993128+JamieD1@users.noreply.github.com> Date: Mon, 13 Sep 2021 00:07:31 +0100 Subject: [PATCH 3/4] JANK --- code/controllers/subsystem/ticker.dm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 15074fe7456d..c725e378cafd 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -652,7 +652,6 @@ SUBSYSTEM_DEF(ticker) if(!check_rights(R_SERVER, TRUE)) return // yogs end - if(!delay) delay = CONFIG_GET(number/round_end_countdown) * 10 @@ -670,30 +669,31 @@ SUBSYSTEM_DEF(ticker) else to_chat(world, "Round ended, but there were still active tickets. Please submit a player complaint if you did not receive a response.") //yogs end - yogs tickets - to_chat(world, "Rebooting World in [DisplayTimeText(delay)]. [reason]") - play_roundend() - SStitle.fadeout() webhook_send_roundstatus("endgame") //yogs - webhook support var/start_wait = world.time UNTIL(round_end_sound_sent || (world.time - start_wait) > (delay * 2)) //don't wait forever - sleep(delay - (world.time - start_wait)) - + var/newdelay = (delay - (world.time - start_wait) - 10 SECONDS) + if(delay > 10 SECONDS) /// JJJJJJJJJJJJJJJJJJJJAAAAAAAAANNNNNNNNKKKKKKKKK + sleep(newdelay) if(delay_end && !skip_delay) to_chat(world, "Reboot was cancelled by an admin.") return + play_roundend() + SStitle.fadeout() + if(newdelay) + sleep(10 SECONDS) + else + sleep(delay - (world.time - start_wait)) if(end_string) end_state = end_string - var/statspage = CONFIG_GET(string/roundstatsurl) var/gamelogloc = CONFIG_GET(string/gamelogurl) if(statspage) to_chat(world, "Round statistics and logs can be viewed at this website!") else if(gamelogloc) to_chat(world, "Round logs can be located at this website!") - log_game("Rebooting World. [reason]") - world.Reboot() /datum/controller/subsystem/ticker/proc/play_roundend() From ab1ad1946c495cb0866d42f40d46c1ac1d6d1382 Mon Sep 17 00:00:00 2001 From: Jamie D <993128+JamieD1@users.noreply.github.com> Date: Mon, 13 Sep 2021 00:24:20 +0100 Subject: [PATCH 4/4] e --- code/controllers/subsystem/ticker.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index c725e378cafd..6bb9bfb8f7d2 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -680,8 +680,7 @@ SUBSYSTEM_DEF(ticker) to_chat(world, "Reboot was cancelled by an admin.") return play_roundend() - SStitle.fadeout() - if(newdelay) + if(newdelay > 0) sleep(10 SECONDS) else sleep(delay - (world.time - start_wait)) @@ -719,6 +718,7 @@ SUBSYSTEM_DEF(ticker) ) SEND_SOUND(world, sound(round_end_sound)) + SStitle.fadeout() text2file(login_music, "data/last_round_lobby_music.txt") /datum/controller/subsystem/ticker/Shutdown()