Commit Graph

134 Commits

Author SHA1 Message Date
catloversg
a9900072da MISC: Remove support for running NS1 scripts (#2083) 2025-04-11 13:41:48 -07:00
catloversg
23ad55554e UI: Add "Run" action to run current script in editor (#1987) 2025-03-04 02:43:31 -08:00
Yichi Zhang
e6a1c344d3 NETSCRIPT: Log script kill immediately and identify the killing script. (#1907) 2025-01-12 21:07:01 -08:00
catloversg
5b6380a5c3 MISC: Add more error info to error dialog and tail log (#1813) 2025-01-08 18:22:13 -08:00
catloversg
7a4b3e23c1 CODEBASE: Show error dialog when finding out old bugs in pre-v2.4.0 (#1816)
* CODEBASE: Show error dialog when finding out old bugs in pre-v2.4.0

* Only show error dialog once
2024-11-30 15:31:44 -08:00
catloversg
294c9cbf4d MISC: Accept "noscript" as parameter for skipping loading scripts (#1797) 2024-11-24 13:44:30 -08:00
catloversg
05da0efc81 REFACTOR: Mitigate cyclic dependency between Jsonable classes (#1792) 2024-11-23 15:53:31 -08:00
catloversg
90cb8a9551 MISC: Add proper type check to AST walking code (#1757) 2024-11-09 15:34:46 -08:00
catloversg
e3c10e9f0f MISC: Always add script's earnings to its parent (#1754) 2024-11-06 18:44:38 -08:00
Caldwell
ccd9118b93 MISC: add stopFlag check before running main (#1689)
It's possible that before the script starts runn, the stopFlag is set.
2024-10-07 22:57:35 -07:00
G4mingJon4s
651b17739c NETSCRIPT: Add ns.self() as a free info function (#1636)
* added utility info

* moved info to running script

* fix for RAM cost

* description changes

Co-authored-by: David Walker <d0sboots@gmail.com>

* fixed wrong formatting

* Added parent to ignored fields

---------

Co-authored-by: David Walker <d0sboots@gmail.com>
2024-09-07 17:34:24 -07:00
catloversg
864613c616 MISC: Support JSX, TS, TSX script files (#1216) 2024-07-14 14:47:10 -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
373ced2efe GO: Various changes before 2.6.0 (#1120) 2024-02-26 08:05:10 -05:00
omuretsu
40babcb2ee more hotfixing
Hotfixed usage tips for alias
Hotfixed prestigeHomeComputer to avoid crashing prestige
Added checking at startWorkerScript to try and find instances where script is launched on wrong server
Fixed corp issue with multibuy not providing multibenefits
2023-05-26 14:59:42 -04:00
David Walker
e2e9b084bc SETTINGS: Add an autoexec setting (#505) 2023-05-09 00:13:05 -04:00
Snarling
ebae35b1fb CODEBASE: Expand lint rules, and Aliases are stored as maps (#501) 2023-05-05 03:55:59 -04:00
David Walker
8b7166e4ed UI: Fix (most) perf issues in Active Scripts (#498) 2023-04-30 19:31:29 -04:00
David Walker
aa7facd4ba NETSCRIPT: Greatly speed up script launching, and remove the limitation unique args per script (#440)
* Remove the limitation unique args per script
* Internal changes to how runningScripts are stored on the server, to make common usage faster.
2023-04-27 18:21:06 -04:00
Snarling
e0272ad4af FILES: Path rework & typesafety (#479)
* Added new types for various file paths, all in the Paths folder.
* TypeSafety and other helper functions related to these types
* Added basic globbing support with * and ?. Currently only implemented for Script/Text, on nano and download terminal commands
* Enforcing the new types throughout the codebase, plus whatever rewrites happened along the way
* Server.textFiles is now a map
* TextFile no longer uses a fn property, now it is filename
* Added a shared ContentFile interface for shared functionality between TextFile and Script.
* related to ContentFile change above, the player is now allowed to move a text file to a script file and vice versa.
* File paths no longer conditionally start with slashes, and all directory names other than root have ending slashes. The player is still able to provide paths starting with / but this now indicates that the player is specifying an absolute path instead of one relative to root.
* Singularized the MessageFilename and LiteratureName enums
* Because they now only accept correct types, server.writeToXFile functions now always succeed (the only reasons they could fail before were invalid filepath).
* Fix several issues with tab completion, which included pretty much a complete rewrite
* Changed the autocomplete display options so there's less chance it clips outside the display area.
* Turned CompletedProgramName into an enum.
* Got rid of programsMetadata, and programs and DarkWebItems are now initialized immediately instead of relying on initializers called from the engine.
* For any executable (program, cct, or script file) pathing can be used directly to execute without using the run command (previously the command had to start with ./ and it wasn't actually using pathing).
2023-04-24 10:26:57 -04:00
Snarling
0df984eea0 CODEBASE: Add Jsonable Map and Set types, move player.sourceFiles to a map (#473) 2023-04-18 03:19:45 -04:00
Snarling
04d49e3a6d SCRIPTS: Script modules are reused when they are imported (#461)
Also corrects some compile race conditions.
2023-04-07 00:33:51 -04:00
David Walker
2b54c6c9b9 NETSCRIPT: Add ramOverride as a RunOption (#441)
Allows overriding the static ram calculation. Dynamic ram limit still applies.
2023-03-22 10:09:12 -04:00
David Walker
98f7f473b4 NETSCRIPT: Add "temporary" as a RunOption to run/exec/spawn (#432) 2023-03-21 18:54:49 -04:00
Snarling
759f86d6e5 NETSCRIPT: Rework script ram updates (#408) 2023-03-05 22:39:42 -05:00
T.J. Eckman
33f0150d25 BUGFIX: Memory Leak in NetscriptPorts (#399)
Co-authored-by: Snarling <84951833+Snarling@users.noreply.github.com>
2023-02-27 19:54:04 -05:00
Snarling
d3f9554a6e 2.2.2 Release (#378) 2023-02-21 09:44:18 -05:00
David Walker
4eef9eec03 NETSCRIPT: More ns Proxy changes (#297) 2023-01-05 20:41:24 -05:00
Mughur
3281b785ce properly fix leading '/' script bug (#296) 2023-01-05 20:33:30 -05:00
Snarling
31bf0c43d1 v2.2.1 (#293)
* handle enums differently
* Enums are frozen and fed directly to the proxy
* Enums are not included in the NSFull definition, allowing samekeys for RamCostTree<API>, InternalAPI<API>, and ExternalAPI<API>
* Rewrote a lot of the ramcalc test, with better typing thanks to the samekeys above
* Fix ns1 for proxy (args, pid, and enums after above changes were not being added to ns1 scripts.)
* Fixed an overview issue where the bars could display inaccurately.
Update changelog and bump version to 2.2.1
2023-01-04 09:45:17 -05:00
David Walker
5f18b87323 New ns implementation using Proxy (#292) 2023-01-04 08:56:29 -05:00
omuretsu
70b8be9988 Fix args for ns1 2023-01-02 17:56:11 -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
Mughur
556fe8dd33 NETSCRIPT: Added ns.corporation.getConstants, replacing many other corporation getter functions (#260) 2022-12-25 03:33:13 -05:00
Snarling
6af36e3b29 NETSCRIPT: Faster API wrapping on script launch. (#229)
* ns API is wrapped once
* when a new workerscript is created, each layer of ns is stamped with a private workerscript field that allows the functions to work.
* Test has been refactored to account for new method of wrapping
* BREAKING: ns functions need access to `this` value of their parent ns layer (or any ns layer)
* Enums are passed directly to player (no cloning) but are frozen.
2022-11-28 09:11:55 -05:00
Snarling
b275f88053 NETSCRIPT: Expose more enums for player use (#198)
* Add support for enums at other ns layers
* APIWrapper: simplified wrapping algorithm and modified to just use cloneDeep to copy enums instead of recursively wrapping enums as if they were new API layers
* Improve APIWrapper typing
* Changed some typings at RamCostGenerator to allow for enums at different levels without enums needing a ram cost
* Added enums to ns.corporation, removed getter functions that were being used instead.
* Add FactionWorkType for player use
* Add ClassType and CompanyWorkPos enums
* Change netscriptDefinitions to expect members of these new enums where appropriate.
2022-11-09 13:46:21 -05:00
Olivier Gagnon
f6f023eeb4 Fix tons of typos 2022-10-09 01:25:31 -04:00
Snarling
aa80cf6451 See description
Reverted ToastVariant back to an enum internally. Still exposed to player as just possible strings.
Changed all 1-line documentation comments to actually be 1-line. Moved some because they were not providing documentation for the thing they were trying to.
2022-10-04 06:40:10 -04:00
Snarling
3a139518d8 unified errors 2022-09-27 15:53:45 -04:00
Snarling
ba1a10b4f7 Unify error handling 2022-09-27 15:46:34 -04:00
Snarling
7d37736058 unified errors 2022-09-27 15:35:39 -04:00
Snarling
8d0347577d Less hardcoding 2022-09-27 15:34:48 -04:00
Snarling
74be61cbdd remove unnecessary return 2022-09-27 15:34:48 -04:00
Snarling
ad356cf28f format/lint 2022-09-27 15:34:48 -04:00
Snarling
572c68738f Unify error handling 2022-09-27 15:34:47 -04:00
Snarling
5798c4c7d3 Unify error handling 2022-09-27 15:32:09 -04:00
Snarling
21f7b7ad06 Fix ns1 Wrapper 2022-09-27 00:03:16 -04:00
Olivier Gagnon
2a0dd6b6f8 Minor improvements to Netscript Port loading and unloading 2022-09-22 23:55:16 -04:00
hydroflame
0044761fd3 Merge pull request #4073 from Hoekstraa/unlimited-ports
API: More ports (previously max 20, now practically unlimited)
2022-09-23 00:51:50 -03:00
Snarling
a600e05c0d Fix typo 2022-09-05 08:29:03 -04:00