Skip to content

Commit

Permalink
Merge pull request #3252 from Thorium-Sim/Hacking-Notifications
Browse files Browse the repository at this point in the history
feat: Add notifications for hacking controls. Closes #3251
  • Loading branch information
alexanderson1993 authored Oct 5, 2022
2 parents a6c1def + 378bf98 commit 661203b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions server/typeDefs/computerCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,15 @@ const resolver = {
performAction(id, (sys: ComputerCore) => {
if (state === "scanning") {
sys.hackingLog.unshift("Ports scanned by fe80::4c3:2e73:2557:c71a");
pubsub.publish("notify", {
id: uuid.v4(),
simulatorId: sys.simulatorId,
station: "Core",
type: "Hacking",
title: `Hacking Port Scan`,
body: "",
color: "info",
});
if (sys.training) {
setTimeout(() => {
sys.hackingState = "hacking";
Expand All @@ -264,6 +273,15 @@ const resolver = {
sys.hackingLog.unshift(
"Unauthorized connection established with fe80::4c3:2e73:2557:c71a",
);
pubsub.publish("notify", {
id: uuid.v4(),
simulatorId: sys.simulatorId,
station: "Core",
type: "Hacking",
title: `Hacking Connected`,
body: "",
color: "info",
});
}
sys.hackingState = state;
});
Expand Down
1 change: 1 addition & 0 deletions src/components/core/menubar/notificationConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const notifyComponents = [
"Docking",
"Engines",
"External Sensors",
"Hacking",
"Handheld Scanner",
"Interception",
"Internal Comm",
Expand Down

0 comments on commit 661203b

Please sign in to comment.