Skip to content
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

NETSCRIPT: Log script kill immediately and identify the guilty script. #1818

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

yichizhng
Copy link
Contributor

This PR changes the timing of script death messages; the "Script killed" message is logged immediately by killWorkerScriptByPid, instead of waiting for the ScriptDeath exception on the next Netscript function call. The current behavior causes confusing log timings, e.g. if a script is killed during asleep.

Demo at https://yichizhng.github.io/bitburner-src/

@yichizhng yichizhng changed the title Log script kill immediately and identify the guilty script. NETSCRIPT: Log script kill immediately and identify the guilty script. Dec 1, 2024
@d0sboots
Copy link
Collaborator

d0sboots commented Dec 1, 2024

FYI I'm holding off on PRs right now while we ensure 2.7 is stable, and also I think this might conflict with #1813 (which I'll merge first most likely)

@catloversg
Copy link
Contributor

scriptKill also needs to be patched.

killWorkerScriptByPid(pid);

Optional: Change the messages of spawn ("About to exit...") and exit ("Exiting...") to "Script killed.".

  • Before: Those messages are followed by "Script killed." due to the catch block in src\NetscriptWorker.ts.
  • After: The catch block in src\NetscriptWorker.ts is changed, so there is no "Script killed." message.

Printing only "Exiting..." may be confusing for the player: "It's exiting, but when will the "exit" finish?".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants