Commit Graph

50 Commits

Author SHA1 Message Date
catloversg ee2949418f API: Expose charged effects of active fragments (#2638) 2026-04-08 14:45:17 -07:00
David Walker b51ed8fd59 BUG: Fix missed cases in offline server handling (#2495)
There were two large holes in the existing offline server handling:

1. It didn't include IPs, so scripts that used IPs instead of hostnames
   would get exceptions thrown for "server not found."
2. Coverage was very low for non-Darknet APIs. Maybe most of them don't
   need to be covered, but many obvious ones like "ps", "killall" and
   "hasRootAccess" were missing. IMO the only reliable answer is one
   that enforces *all* are covered via the type system.

To accomplish the second part, helpers.getServer() was changed to return
null when a server is offline. This intentionally breaks a lot of its
utility, which was to return a server unconditionally. To compensate,
its utility was increased - it now also does unknown argument
processing, allowing it to subsume a common line that all callers were
repeating.

Some callers switched to ctx.workerScript.getServer(), because they
didn't actually need to be using helpers.getServer(). Similarly, a few
callsites switched to GetServerOrThrow(), for the cases where it should
be guaranteed that the server is valid. The rest are returning a
default/failure response when the server is offline. (Except for
contracts, which threw on failure already anyway.)
2026-02-15 10:29:47 -08:00
catloversg 174e160348 API: Make ActiveFragment extend Fragment (#2373)
* DOCUMENTATION: Fix wrong return type of ns.stanek.activeFragments

* Make ActiveFragment extend Fragment
2025-10-30 10:27:58 -07:00
catloversg 030be41df9 CODEBASE: Refactor Stanek's Gift UI code and change internal FragmentType enum (#2346) 2025-10-12 13:23:45 -07:00
catloversg b2093a2419 MISC: Clarify conditions of activating Gang, Bladeburner, Stanek's Gift (#2053) 2025-03-31 13:37:35 -07:00
catloversg 8fe0ea1615 MISC: Warn player that they cannot accept Stanek's Gift after joining Bladeburner with SF7.3 (#2005) 2025-03-07 15:14:15 -08:00
Snarling 373ced2efe GO: Various changes before 2.6.0 (#1120) 2024-02-26 08:05:10 -05:00
Jesse Clark 8742df9588 fix for stanek.acceptGift not working (#1001) 2024-01-02 09:12:14 -05:00
Jesse Clark 473217ef31 API: Programming-friendly interface to getFactionInviteRequirements (#953) 2023-12-16 04:27:22 -05:00
TheAimMan 89fc22f28f IMPROVEMENT: Apply core bonus for share and stanek (#913) 2023-12-07 20:10:21 -05:00
Snarling 6732549196 ENUMS: Initial Enum Helper rework + Reorganization (#596) 2023-06-12 00:34:20 -04:00
Snarling 51bf0d1904 Stanek performance boost + bonus time rework (#410) 2023-03-07 14:45:22 -05:00
Snarling fb1f95c26e VARIOUS: Various changes prior to release 2.2 (#271)
See PR #271 description
2022-12-29 20:28:53 -05:00
omuretsu 7a384d53f4 typefix netscriptFunctions (see desc)
* Types for InternalFunction and ExternalFunction have been modified to actually typecheck ns functions against docs.
* Internal functions are required to use unknown for any params on the inner function.
* Return types for internal function inner-function must match the respective external function.
* Added new typecheck assertion function for asserting dynamic object types, to allow unknownifying params that were previously hardcoded objec structures.
* Because type assertion for parameter types and return types is enforced by InternalAPI, removed all duplicate type declarations on NetscriptFunction params and returns.
2022-10-12 08:49:27 -04:00
Snarling 21a2d49de7 Finish removing player passing 2022-09-27 15:35:41 -04:00
Mughur 4c5adc8dfb More hasAugmentation fixes 2022-09-14 21:21:49 +03:00
Snarling 931ea730a5 Move entire ns object to top-level 2022-08-09 18:09:26 -04:00
Snarling 01e63b10a1 move ctx.log to NetscriptHelpers 2022-08-09 18:09:26 -04:00
Snarling 208495e269 Initial commit 2022-08-09 18:09:24 -04:00
Snarling 3a2e676c9b Move error functionality to new wrapper 2022-08-09 18:09:24 -04:00
Olivier Gagnon c977a9def7 tidy up eslint.js 2022-07-19 12:19:32 -04:00
Olivier Gagnon c2b4a5b52a Update codebase for stanek 2022-05-19 02:48:50 -04:00
Undeemiss 58be301d06 Fixed broken stanek error 2022-05-15 20:06:52 -05:00
Undeemiss 8a68633d9c Throw an error when trying to charge stanek booster fragments 2022-05-09 14:29:42 -05:00
Undeemiss 6d55bfe795 Removed redundant check for whether the player is in CotMG 2022-04-19 13:39:56 -05:00
Undeemiss b3e83dd976 Added check for aug status to stanek.acceptGift
Added a check to stanek.acceptGift for aug status. It's not
particularly elegant, but I copied the checks from the ui. Also
changed the way CotMG status is checked to be more robust.
2022-04-19 13:33:07 -05:00
Undeemiss 46a90e6271 Added ns function stanek.acceptGift
Added a new ns function stanek.acceptGift to the game, with a ram
cost of 2gb. The function attempts to join the CotMG and install
the gift, then returns true iff the player is in the CotMG and has
the gift installed.
2022-04-19 12:08:38 -05:00
Olivier Gagnon 5cbeae9353 lint 2022-04-11 14:17:27 -04:00
TheMas3212 b2e7817a0b format 2022-04-08 10:02:59 +10:00
TheMas3212 9b53896732 slight change on how wrapping work based on discussion in #development 2022-04-08 09:57:16 +10:00
TheMas3212 f0cfc8700a run formater 2022-04-07 10:23:52 +10:00
TheMas3212 8c58f0676d Improve Typesafety on API Wrapper 2022-04-07 10:23:52 +10:00
TheMas3212 40f74e4a98 add wrapped helpers to ctx
add ramcheck into wrapper
2022-04-07 10:23:52 +10:00
TheMas3212 ea2b444b87 Initial API Wrapper Work
onlying wrapping Stanek api currently as test sample
(Rebased onto upstream/dev)
2022-04-07 10:23:46 +10:00
phyzical 18af3f8413 moved updateRam to first call to avoid lack of mocks for tests
* added wrapper funcs to simplify updateRam
* added static parser tests and skiped what isnt worker still for next person to try and fix
2022-03-31 21:41:19 +08:00
Olivier Gagnon 443b0b6a89 rename functions in staneks gift 2022-03-29 14:20:40 -04:00
Olivier Gagnon 8c9603d903 more unknown 2022-03-17 14:00:22 -04:00
phyzical ec927fe1f4 added ram charge for stanek width and height 2022-03-08 17:28:45 +08:00
Heinous Tugboat c7a3ac216f Replaces anys in Stanek with unknown 2022-01-27 20:48:37 -05:00
Heikki Aitakangas c6ff982b1d Remove stopFlag checks made redundant by the netscriptDelay change 2022-01-09 02:42:36 +02:00
Olivier Gagnon c59a267437 change sf4 2022-01-04 19:09:34 -05:00
Olivier Gagnon d4ebc46a19 merge dev 2021-12-03 15:35:45 -05:00
Olivier Gagnon ae9ad4430e Increase rep gains 2 2021-11-17 10:59:15 -05:00
Olivier Gagnon 43a6521403 more work on bn13 2021-11-13 23:45:26 -05:00
Olivier Gagnon 56ddcd9a45 more work on bn13 2021-11-13 22:44:17 -05:00
Olivier Gagnon 35a5e2f343 change the way charge works 2021-10-17 18:59:37 -04:00
Olivier Gagnon 092d5146b4 rotation! 2021-10-16 17:12:04 -04:00
Olivier Gagnon 4355420349 made staneks gift work with prestiges 2021-10-08 03:16:51 -04:00
Olivier Gagnon 2f677c7ec8 more work 2021-10-04 23:51:39 -04:00
Olivier Gagnon c5e29dafc4 fix mc 2021-10-04 22:31:07 -04:00