-
Notifications
You must be signed in to change notification settings - Fork 362
UI: API Break changes more verbose in terminal. Colorized some commands terminal output. #2235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
03410bc
88bb45c
166cfc4
9abaa65
0ad5adf
fda3add
aaf750c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: "Deploy new pages build" | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
|
|
||
| concurrency: | ||
| group: "pages" | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| deploy: | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| - run: npm ci | ||
| - run: npm run build | ||
| - uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: ".app" | ||
| - name: Deploy to gh pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,18 +42,18 @@ export const Programs: Record<CompletedProgramName, Program> = { | |
| return; | ||
| } | ||
| if (server.hasAdminRights) { | ||
| Terminal.print("You already have root access to this computer. There is no reason to run NUKE.exe"); | ||
| Terminal.print("You can now run scripts on this server."); | ||
| Terminal.warn("You already have root access to this computer. There is no reason to run NUKE.exe"); | ||
| Terminal.success("You can now run scripts on this server."); | ||
| return; | ||
| } | ||
| if (server.openPortCount >= server.numOpenPortsRequired) { | ||
| server.hasAdminRights = true; | ||
| Terminal.print("NUKE successful! Gained root access to " + server.hostname); | ||
| Terminal.print("You can now run scripts on this server."); | ||
| Terminal.success("NUKE successful! Gained root access to " + server.hostname); | ||
| Terminal.success("You can now run scripts on this server."); | ||
| return; | ||
| } | ||
|
|
||
| Terminal.print("NUKE unsuccessful. Not enough ports have been opened"); | ||
| Terminal.error("NUKE unsuccessful. Not enough ports have been opened"); | ||
| }, | ||
| }), | ||
| [CompletedProgramName.bruteSsh]: new Program({ | ||
|
|
@@ -70,12 +70,12 @@ export const Programs: Record<CompletedProgramName, Program> = { | |
| return; | ||
| } | ||
| if (server.sshPortOpen) { | ||
| Terminal.print("SSH Port (22) is already open!"); | ||
| Terminal.warn("SSH Port (22) is already open!"); | ||
| return; | ||
| } | ||
|
|
||
| server.sshPortOpen = true; | ||
| Terminal.print("Opened SSH Port(22)!"); | ||
| Terminal.success("Opened SSH Port(22)!"); | ||
| server.openPortCount++; | ||
| }, | ||
| }), | ||
|
|
@@ -93,12 +93,12 @@ export const Programs: Record<CompletedProgramName, Program> = { | |
| return; | ||
| } | ||
| if (server.ftpPortOpen) { | ||
| Terminal.print("FTP Port (21) is already open!"); | ||
| Terminal.warn("FTP Port (21) is already open!"); | ||
| return; | ||
| } | ||
|
|
||
| server.ftpPortOpen = true; | ||
| Terminal.print("Opened FTP Port (21)!"); | ||
| Terminal.success("Opened FTP Port (21)!"); | ||
| server.openPortCount++; | ||
| }, | ||
| }), | ||
|
|
@@ -116,12 +116,12 @@ export const Programs: Record<CompletedProgramName, Program> = { | |
| return; | ||
| } | ||
| if (server.smtpPortOpen) { | ||
| Terminal.print("SMTP Port (25) is already open!"); | ||
| Terminal.warn("SMTP Port (25) is already open!"); | ||
| return; | ||
| } | ||
|
|
||
| server.smtpPortOpen = true; | ||
| Terminal.print("Opened SMTP Port (25)!"); | ||
| Terminal.success("Opened SMTP Port (25)!"); | ||
| server.openPortCount++; | ||
| }, | ||
| }), | ||
|
|
@@ -139,12 +139,12 @@ export const Programs: Record<CompletedProgramName, Program> = { | |
| return; | ||
| } | ||
| if (server.httpPortOpen) { | ||
| Terminal.print("HTTP Port (80) is already open!"); | ||
| Terminal.warn("HTTP Port (80) is already open!"); | ||
| return; | ||
| } | ||
|
|
||
| server.httpPortOpen = true; | ||
| Terminal.print("Opened HTTP Port (80)!"); | ||
| Terminal.success("Opened HTTP Port (80)!"); | ||
| server.openPortCount++; | ||
| }, | ||
| }), | ||
|
|
@@ -162,12 +162,12 @@ export const Programs: Record<CompletedProgramName, Program> = { | |
| return; | ||
| } | ||
| if (server.sqlPortOpen) { | ||
| Terminal.print("SQL Port (1433) is already open!"); | ||
| Terminal.warn("SQL Port (1433) is already open!"); | ||
| return; | ||
| } | ||
|
|
||
| server.sqlPortOpen = true; | ||
| Terminal.print("Opened SQL Port (1433)!"); | ||
| Terminal.success("Opened SQL Port (1433)!"); | ||
| server.openPortCount++; | ||
| }, | ||
| }), | ||
|
|
@@ -180,8 +180,8 @@ export const Programs: Record<CompletedProgramName, Program> = { | |
| time: CONSTANTS.MillisecondsPerQuarterHour, | ||
| }, | ||
| run: (): void => { | ||
| Terminal.print("This executable cannot be run."); | ||
| Terminal.print("DeepscanV1.exe lets you run 'scan-analyze' with a depth up to 5."); | ||
| Terminal.error("This executable cannot be run."); | ||
| Terminal.warn("DeepscanV1.exe lets you run 'scan-analyze' with a depth up to 5."); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't feel like a warning to me. |
||
| }, | ||
| }), | ||
| [CompletedProgramName.deepScan2]: new Program({ | ||
|
|
@@ -193,8 +193,8 @@ export const Programs: Record<CompletedProgramName, Program> = { | |
| time: CONSTANTS.MillisecondsPer2Hours, | ||
| }, | ||
| run: (): void => { | ||
| Terminal.print("This executable cannot be run."); | ||
| Terminal.print("DeepscanV2.exe lets you run 'scan-analyze' with a depth up to 10."); | ||
| Terminal.error("This executable cannot be run."); | ||
| Terminal.warn("DeepscanV2.exe lets you run 'scan-analyze' with a depth up to 10."); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same. |
||
| }, | ||
| }), | ||
| [CompletedProgramName.serverProfiler]: new Program({ | ||
|
|
@@ -222,9 +222,34 @@ export const Programs: Record<CompletedProgramName, Program> = { | |
| return; | ||
| } | ||
|
|
||
| Terminal.print(targetServer.hostname + ":"); | ||
| if (targetServer.hasAdminRights) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Admin rights are not relevant to hacking. We should leave this out, to avoid furthering this misconception. |
||
| Terminal.success("Server has admin rights."); | ||
| Terminal.success(targetServer.hostname + ":"); | ||
| } else { | ||
| Terminal.error("Server has no admin rights."); | ||
| Terminal.error(targetServer.hostname + ":"); | ||
| } | ||
| Terminal.print("Server base security level: " + targetServer.baseDifficulty); | ||
| Terminal.print("Server current security level: " + targetServer.hackDifficulty); | ||
| if (targetServer.hackDifficulty > targetServer.baseDifficulty) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is complicated and I'm not sure that it's a good idea. Let's revert this part for now, and do a different PR later that focuses on augmenting ServerProfiler if you still want to later. (The built-in.exe tools are intentionally crude to nudge you towards writing your own.) |
||
| Terminal.warn( | ||
| "Server security level: " + | ||
| targetServer.hackDifficulty + | ||
| " (+" + | ||
| (targetServer.hackDifficulty - targetServer.baseDifficulty) + | ||
| ")", | ||
| ); | ||
| } | ||
| if (targetServer.hackDifficulty < targetServer.baseDifficulty) { | ||
| Terminal.success( | ||
| "Server security level: " + | ||
| targetServer.hackDifficulty + | ||
| " (-" + | ||
| (targetServer.baseDifficulty - targetServer.hackDifficulty) + | ||
| ")", | ||
| ); | ||
| } else if (targetServer.hackDifficulty === targetServer.baseDifficulty) { | ||
| Terminal.print("Server security level: " + targetServer.hackDifficulty); | ||
| } | ||
| Terminal.print("Server growth rate: " + targetServer.serverGrowth); | ||
| Terminal.print( | ||
| `Netscript hack() execution time: ${convertTimeMsToTimeElapsedString( | ||
|
|
@@ -255,9 +280,9 @@ export const Programs: Record<CompletedProgramName, Program> = { | |
| time: CONSTANTS.MillisecondsPerQuarterHour, | ||
| }, | ||
| run: (): void => { | ||
| Terminal.print("This executable cannot be run."); | ||
| Terminal.print("AutoLink.exe lets you automatically connect to other servers when using 'scan-analyze'."); | ||
| Terminal.print("When using scan-analyze, click on a server's hostname to connect to it."); | ||
| Terminal.error("This executable cannot be run."); | ||
| Terminal.warn("AutoLink.exe lets you automatically connect to other servers when using 'scan-analyze'."); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm going to comment on all of the following simply with "info" to say that these are informational messages only so I don't think it's appropriate to use .warn |
||
| Terminal.warn("When using scan-analyze, click on a server's hostname to connect to it."); | ||
| }, | ||
| }), | ||
| [CompletedProgramName.formulas]: new Program({ | ||
|
|
@@ -269,8 +294,8 @@ export const Programs: Record<CompletedProgramName, Program> = { | |
| time: CONSTANTS.MillisecondsPer4Hours, | ||
| }, | ||
| run: (): void => { | ||
| Terminal.print("This executable cannot be run."); | ||
| Terminal.print("Formulas.exe lets you use the formulas API."); | ||
| Terminal.error("This executable cannot be run."); | ||
| Terminal.warn("Formulas.exe lets you use the formulas API."); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Info |
||
| }, | ||
| }), | ||
| [CompletedProgramName.bitFlume]: new Program({ | ||
|
|
@@ -300,19 +325,19 @@ export const Programs: Record<CompletedProgramName, Program> = { | |
| Player.augmentations.length >= numAugReq && Player.money >= 1e11 && Player.skills.hacking >= 2500; | ||
| if (!fulfilled) { | ||
| if (Player.augmentations.length >= numAugReq) { | ||
| Terminal.print(`[x] Augmentations: ${Player.augmentations.length} / ${numAugReq}`); | ||
| Terminal.success(`[x] Augmentations: ${Player.augmentations.length} / ${numAugReq}`); | ||
| } else { | ||
| Terminal.print(`[ ] Augmentations: ${Player.augmentations.length} / ${numAugReq}`); | ||
| Terminal.warn(`[ ] Augmentations: ${Player.augmentations.length} / ${numAugReq}`); | ||
| } | ||
| if (Player.money >= 1e11) { | ||
| Terminal.print(`[x] Money: ${formatMoney(Player.money)} / ${formatMoney(1e11)}`); | ||
| Terminal.success(`[x] Money: ${formatMoney(Player.money)} / ${formatMoney(1e11)}`); | ||
| } else { | ||
| Terminal.print(`[ ] Money: ${formatMoney(Player.money)} / ${formatMoney(1e11)}`); | ||
| Terminal.warn(`[ ] Money: ${formatMoney(Player.money)} / ${formatMoney(1e11)}`); | ||
| } | ||
| if (Player.skills.hacking >= 2500) { | ||
| Terminal.print(`[x] Hacking skill: ${Player.skills.hacking} / 2500`); | ||
| Terminal.success(`[x] Hacking skill: ${Player.skills.hacking} / 2500`); | ||
| } else { | ||
| Terminal.print(`[ ] Hacking skill: ${Player.skills.hacking} / 2500`); | ||
| Terminal.warn(`[ ] Hacking skill: ${Player.skills.hacking} / 2500`); | ||
| } | ||
| return; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems accidental? In any case, revert - we already have one of these.