Commit Graph

41 Commits

Author SHA1 Message Date
Snarling
fb1f95c26e
VARIOUS: Various changes prior to release 2.2 (#271)
See PR #271 description
2022-12-29 20:28:53 -05:00
Snarling
5ff2cd5357
VERSION: Update game version to 2.2 (#240)
Includes some bug fixes:
* Fix sleeve shock internal/display discrepancy (0-100 vs 0-100)
* Special error message if ns function called without a this
* Change whitespace to pre-wrap for dialog box.
* Fix bug where idle sleeves do not consume cycles but still recover shock from those cycles. Now they do not recover during idle.
* attempted to tag commit as v2.2.0
2022-12-01 16:07:46 -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
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
Olivier Gagnon
f6f023eeb4 Fix tons of typos 2022-10-09 01:25:31 -04:00
Snarling
8d0347577d Less hardcoding 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
f1f7be6adc Remove unused types 2022-08-10 10:02:41 -04:00
Snarling
28d9c70796 format&lint 2022-08-09 19:04:05 -04:00
Snarling
c6cb4ca033 Type correctness 2022-08-09 19:02:33 -04: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
894929efdb fix ustring issue 2022-07-20 11:41:02 -04:00
Olivier Gagnon
e0a24cf381 fix args not beign passed to scripts 2022-07-20 11:34:49 -04:00
Olivier Gagnon
0e74b1a5d6 remove last colon any for now 2022-07-20 01:37:41 -04:00
Olivier Gagnon
70d5390e4d most anys in NetFunc 2022-07-19 19:04:06 -04:00
Olivier Gagnon
c3a10d5d95 fix more anys 2022-07-19 18:25:06 -04:00
Olivier Gagnon
2442402af5 fix more anys 2022-07-19 16:46:03 -04:00
Olivier Gagnon
4bee746576 rm any 2022-07-15 01:51:30 -04:00
Olivier Gagnon
e86a42716c lint 2022-07-11 15:58:23 -04:00
Olivier Gagnon
6a2e5b06ad fix manualHack 2022-05-25 20:19:42 -04:00
Olivier Gagnon
216055b3e0 allbuild commit b60f3da8 2022-05-25 18:38:01 -04:00
Olivier Gagnon
cb7f3b17be fix ns1 scripts 2022-05-25 16:01:28 -04:00
Olivier Gagnon
972abcbdc8 Wrap all the API 2022-05-24 20:16:39 -04:00
Olivier Gagnon
ae38b11ede made static ram cost typecheck that it's missing no property. 2022-05-24 18:34:00 -04:00
Olivier Gagnon
0da2e74d12 more work on wrapping formulas 2022-05-24 17:51:48 -04:00
Olivier Gagnon
ce61f06319 allbuild commit 8159dad5 2022-05-24 16:57:25 -04:00
Olivier Gagnon
8159dad5fa allbuild commit de644247 2022-05-24 08:12:49 -04:00
Olivier Gagnon
fb08139903 Implemented infinite loop safety net. 2022-05-07 17:43:45 -04:00
TheMas3212
b2689eaa5a
Wrap Singularity API with wrapper
also refactored the RamCosts IMap as it didnt quite work properly due to
how the wrapper calculates function names
2022-04-12 16:51:10 +10:00
TheMas3212
f53c90b21c
Change Signature of InternalFunction
Mark properties of Wrapped NetscriptAPI as readonly
2022-04-09 15:15:45 +10: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