[MIRROR] Updated Transcore Data Dump (#12898)

Co-authored-by: Will <7099514+Willburd@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2026-07-11 10:50:30 -07:00
committed by GitHub
parent dbbae9093a
commit aaa0f2c79f
5 changed files with 72 additions and 12 deletions
+2 -2
View File
@@ -295,8 +295,8 @@ SUBSYSTEM_DEF(transcore)
// Moves all mind records from the databaes into the disk and shuts down all backup canary processing.
/datum/transcore_db/proc/core_dump(obj/item/disk/transcore/disk)
ASSERT(disk)
GLOB.global_announcer.autosay("An emergency core dump has been initiated!", "TransCore Oversight", "Command")
GLOB.global_announcer.autosay("An emergency core dump has been initiated!", "TransCore Oversight", "Medical")
GLOB.global_announcer.autosay("An emergency core dump has been completed!", "TransCore Oversight", "Command")
GLOB.global_announcer.autosay("An emergency core dump has been completed!", "TransCore Oversight", "Medical")
disk.stored += backed_up
backed_up.Cut()
+33 -8
View File
@@ -2,6 +2,8 @@
#define MENU_BODY 2
#define MENU_MIND 3
#define TRANSCORE_DUMP_TIME 30 SECONDS
/obj/machinery/computer/transhuman/resleeving
name = "resleeving control console"
catalogue_data = list(/datum/category_item/catalogue/technology/resleeving)
@@ -34,6 +36,7 @@
var/datum/transcore_db/our_db // These persist all round and are never destroyed, just keep a hard ref
var/gene_sequencing = FALSE // Traitgenes edit - create a dna injector for fixing dna, but don't let it be abusable
var/dump_in_progress_timer = null
/obj/machinery/computer/transhuman/resleeving/Initialize(mapload)
. = ..()
@@ -47,6 +50,8 @@
releasepods()
current_br = null
current_mr = null
deltimer(dump_in_progress_timer)
dump_in_progress_timer = null
return ..()
/obj/machinery/computer/transhuman/resleeving/proc/updatemodules()
@@ -184,7 +189,8 @@
))
data["sleevers"] = resleevers
data["coredumped"] = our_db.core_dumped
data["dump_progress"] = (!our_db.core_dumped && dump_in_progress_timer) ? (timeleft(dump_in_progress_timer, SStimer) / (TRANSCORE_DUMP_TIME)) : 0
data["coredumped"] = !dump_in_progress_timer && our_db.core_dumped
data["emergency"] = disk
data["temp"] = temp
data["selected_pod"] = REF(selected_pod)
@@ -255,15 +261,20 @@
current_mr = null
. = TRUE
if("coredump")
if(disk)
our_db.core_dump(disk)
sleep(5)
visible_message(span_warning("\The [src] spits out \the [disk]."))
current_br = null
disk.forceMove(get_turf(src))
disk = null
var/area/find_area = get_area(src)
if(!find_area)
find_area = "Unknown"
if(disk && !dump_in_progress_timer)
GLOB.global_announcer.autosay("An emergency core dump has been started in \the [find_area]!", "TransCore Oversight", "Command")
GLOB.global_announcer.autosay("An emergency core dump has been started in \the [find_area]!", "TransCore Oversight", "Medical")
dump_in_progress_timer = addtimer(CALLBACK(src, PROC_REF(dump_transcore_database)), TRANSCORE_DUMP_TIME, TIMER_STOPPABLE)
. = TRUE
if("ejectdisk")
if(dump_in_progress_timer)
GLOB.global_announcer.autosay("An emergency core dump has been canceled!", "TransCore Oversight", "Command")
GLOB.global_announcer.autosay("An emergency core dump has been canceled!", "TransCore Oversight", "Medical")
deltimer(dump_in_progress_timer)
dump_in_progress_timer = null
current_br = null
disk.forceMove(get_turf(src))
disk = null
@@ -599,6 +610,20 @@
else
set_temp("Error: Record missing.", "danger")
/obj/machinery/computer/transhuman/resleeving/proc/dump_transcore_database()
dump_in_progress_timer = null
our_db.core_dump(disk)
visible_message(span_warning("\The [src] spits out \the [disk]."))
current_br = null
var/area/find_area = get_area(src)
if(!find_area)
find_area = "Unknown"
disk.name += " \[[find_area]\]"
disk.forceMove(get_turf(src))
disk = null
#undef MENU_MAIN
#undef MENU_BODY
#undef MENU_MIND
#undef TRANSCORE_DUMP_TIME
@@ -1,5 +1,13 @@
import { useBackend } from 'tgui/backend';
import { Box, Button, Dimmer, Icon, Stack } from 'tgui-core/components';
import {
Box,
Button,
Dimmer,
Icon,
ProgressBar,
Stack,
} from 'tgui-core/components';
import type { Data } from './types';
export const ResleevingConsoleCoreDump = (props) => {
return (
@@ -62,3 +70,25 @@ export const PulsingWarningTriangle = (props) => {
/>
);
};
export const ResleevingConsoleDumpProgress = (props) => {
const { act, data } = useBackend<Data>();
const { dump_progress } = data;
return (
<Dimmer textAlign="center">
<Box color="bad">
<h1>TRANSCORE DUMP IN PROGRESS</h1>
</Box>
<Box color="bad">
<h2>!!WARNING!!</h2>
</Box>
<PulsingWarningTriangle />
<ProgressBar value={1 - dump_progress} maxValue={1} color="bad" />
<Box mt={4}>
<Button icon="eject" color="good" onClick={() => act('ejectdisk')}>
Eject Disk
</Button>
</Box>
</Dimmer>
);
};
@@ -7,6 +7,7 @@ import { MindRecordModal } from './MindRecordModal';
import {
ResleevingConsoleCoreDump,
ResleevingConsoleDiskPrep,
ResleevingConsoleDumpProgress,
} from './ResleevingConsoleCoreDump';
import {
ResleevingConsoleBody,
@@ -18,7 +19,7 @@ import type { Data } from './types';
export const ResleevingConsole = (props) => {
const { data } = useBackend<Data>();
const { coredumped, emergency } = data;
const { coredumped, dump_progress, emergency } = data;
let body: React.JSX.Element = (
<Stack fill vertical>
<ResleevingConsoleTemp />
@@ -41,6 +42,9 @@ export const ResleevingConsole = (props) => {
if (emergency) {
body = <ResleevingConsoleDiskPrep />;
}
if (dump_progress) {
body = <ResleevingConsoleDumpProgress />;
}
return (
<Window width={640} height={520}>
{data.active_b_rec && (
@@ -18,6 +18,7 @@ export type Data = {
occupied: BooleanLike;
occupant: string;
}[];
dump_progress: number;
coredumped: BooleanLike;
emergency: BooleanLike;
temp: { text: string; style: string } | null;