Commit Graph

22 Commits

Author SHA1 Message Date
David Walker
5b2a4eafcb MISC: Improve several things relating to PID lookups (#1594)
findRunningScriptByPid needlessly took a "server" argument. This caused
there to be a "getRunningScriptByPid" version that did *not*, and it was
looping through all servers in order to function, which is needlessly
inefficient.

By removing the parameter and the needless inefficient helper method,
the following changes:
- Many Netscript functions such as isRunning() and getScript() become faster.
- The terminal "tail" command now works by pid regardless of the current
  server. Note that "kill" already worked this way.

I also improved the docs around "tail", since the pid argument wasn't
in the help.
2024-08-17 14:03:00 -07:00
catloversg
289f60d8c8 BLADEBURNER: Add API to calculate max upgrade count of skill (#1475) 2024-08-16 13:15:20 -07:00
catloversg
783120c886 FEATURE: BitNode options (#1411) 2024-07-14 14:30:30 -07:00
David Walker
9c9a69f2e2 NETSCRIPT: Add ramOverride() function (#1346)
This adds a way to dynamically change the static RAM limit of a script,
which is also its current RAM usage. This makes it possible for scripts
to dynamically change their memory footprint, opening up new strategies
beyond current ram-dodging.

Calling functions still permanently increases the *dynamic* memory
limit; RAM-dodging is still the optimal strategy for avoiding RAM costs,
in that sense.

This also adds dynamicRamUsage to the info returned by
`getRunningScript`, to allow introspection on the currently needed ram.
2024-06-28 18:42:20 -07:00
David Walker
1c20a24079 MISC: Make spawn able to have 0 delay (#1333)
This eliminates a hole where spawn was unrelaible, because other scripts
could jump in and steal the RAM. It's not an API break, because 0 used
to be an invalid value.
2024-06-28 18:41:41 -07:00
David Walker
06d742a7f3 BUGFIX: Fix rounding issues due to ramOverride edge cases (#1339)
*All* RAM calculations must take place in units of hundredths-of-a-GB in
order for there not to be issues.

Also adds slightly more verbose logging when the dynamic RAM check
fails.
2024-06-28 17:58:17 -07:00
David Walker
384d1c1a2b NETSCRIPT: A minorly breaking change around script launch, and refactoring. (#1213) 2024-04-23 20:21:05 -04:00
Snarling
6669c4da6a BLADEBURNER: Typesafety / refactoring (#1154) 2024-03-28 21:52:37 -04:00
Snarling
373ced2efe GO: Various changes before 2.6.0 (#1120) 2024-02-26 08:05:10 -05:00
Caldwell
fccc27fe58 MISC: HGWOptions accepts non integer (#1035) 2024-02-10 07:24:11 -05:00
Caldwell
4d551915b3 MISC: move server constants into their own constant (#1075) 2024-02-10 04:13:42 -05:00
DJMatch3000
a6436ca4b3 MISC: Revert default HGW threads from 1 to number of script threads (#978) 2023-12-16 04:38:39 -05:00
David Walker
61ffed9b3a BUGFIX: Fix additionalMsec overflow issue (#941) 2023-12-07 20:34:49 -05:00
TheAimMan
eed2c5d6d4 BUGFIX: Update NetscriptHelpers.tsx to verify servers are on network when getServer is called (#855) 2023-10-23 04:37:19 -04:00
muesli4brekkies
c5e2f65cb0 API: Added spawnDelay parameter to ns.spawn options, allowing user defined delay (#807) 2023-09-27 01:31:47 -04:00
David Walker
875bddbbdb BUGFIX: Patch a minor hole in RAM calculation (#820) 2023-09-21 21:44:32 -04:00
Michael Ficocelli
25dae7ec8b UI: Basic Map and Set support in ns.print/tprint (#756) 2023-09-12 01:07:41 -04:00
Meggal
bc00a1c134 Fix bug smaller than a tardigrate (#653) 2023-06-28 16:21:15 -04:00
Aleksei Bezrodnov
1d5a735941 MISC: enforce eslint react checks (#640) 2023-06-26 22:29:44 -04:00
Snarling
a4b826683e TYPESAFETY: Strict internal typing for AugmentationName (#608) 2023-06-16 17:52:42 -04:00
Snarling
6732549196 ENUMS: Initial Enum Helper rework + Reorganization (#596) 2023-06-12 00:34:20 -04:00
David Walker
4503da6226 UI: LogBox overhaul (#508) 2023-05-26 08:07:37 -04:00