Commit Graph

111 Commits

Author SHA1 Message Date
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
Snarling
51d019c16c Decache Ram on Tail Run 2022-09-05 08:19:24 -04:00
Zoë Hoekstra
d6e5b45db1
Delete now outdated comment 2022-09-01 16:53:58 +02:00
Zoë Hoekstra
55df97d3d5
Format 2022-09-01 16:27:31 +02:00
Zoë Hoekstra
ec81fb60c3
Create ports on demand. Increase max to infinity. 2022-09-01 16:13:10 +02:00
Snarling
ef1f376c09 format, lint, remove unused "running" property on ws 2022-08-27 22:32:48 -04:00
Snarling
6f36e9cdc5 Fix/Unify NS1 wrapper 2022-08-27 20:56:12 -04:00
Olivier Gagnon
5f41226c21 Fix scp and write in ns1 2022-08-26 17:49:27 -04:00
Snarling
648b7e84bf Some cleanup 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
2d522ea1e6 allbuild commit e9254edf 2022-07-21 15:09:55 -04:00
Olivier Gagnon
1b90b42881 rm more any 2022-07-18 02:28:21 -04:00
Olivier Gagnon
5b8eea66d4 rm some any 2022-07-15 23:34:27 -04:00
Olivier Gagnon
59e55de9ca fix all function being async lmao 2022-07-15 02:11:06 -04:00
Olivier Gagnon
4bee746576 rm any 2022-07-15 01:51:30 -04:00
Snarling
99a0337a14 Dirty fix for available ram float errors
1MB added to available ram when checking if available is sufficient. All actual ram values in game are a multiple of 50MB so an extra 1MB can't ever allow additional script load to be ran.
2022-05-06 08:56:19 -04:00
Olivier Gagnon
a11e2868df fmt 2022-04-11 21:45:55 -04:00
hydroflame
a17b81dff3
Merge pull request #2925 from Ornedan/necro-script-fix
Necro script fix
2022-04-11 21:36:07 -04:00
TheMas3212
433873c5e2
run formater 2022-04-12 08:27:53 +10:00
TheMas3212
8d5632eb3e
fix netscript wrapper to wrap all functions, not just the top level 2022-04-12 08:20:34 +10:00
Olivier Gagnon
48f80f25d6 fmt and lint 2022-04-06 19:30:08 -04:00
Heikki Aitakangas
a6710eb3e5 No need to return WorkerScript from startNetscript*Script promises, their only calling function already has the correct object in a variable 2022-04-02 23:28:23 +03:00
Heikki Aitakangas
cbd59975d4 makeRuntimeRejectMsg expects the 'msg' to be string-like 2022-04-02 23:28:23 +03:00