Commit Graph

136 Commits

Author SHA1 Message Date
omuretsu
00522fb8f3 Fix infinite loop detection
Also debounce it with the ram calc to improve performance
2023-05-16 11:27:11 -04:00
Snarling
ebae35b1fb
CODEBASE: Expand lint rules, and Aliases are stored as maps (#501) 2023-05-05 03:55:59 -04:00
omuretsu
3c996a47ea Fully remove formatCode function (trim on script save) 2023-05-03 07:21:23 -04:00
David Walker
ad5a1c4bac
NETSCRIPT: Revert FormattedCode type (#500) 2023-05-03 07:13:35 -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
David Walker
ed9e6d5ea3
NETSCRIPT: Compiled modules will be even more shared (#468) 2023-04-07 21:08:39 -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
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
Snarling
b4074328ec
UI: Added new locale-aware and configurable number formatting (#354) 2023-02-11 13:18:50 -05:00
David Walker
4eef9eec03
NETSCRIPT: More ns Proxy changes (#297) 2023-01-05 20:41:24 -05:00
David Walker
7b5080a42b
NETSCRIPT: Add undocumented function printRaw() (#277)
This is analagous to tprintRaw (enabled by ns.iKnowWhatImDoing()), but
for logs instead of the terminal. This provides a supported* method of
creating complicated UIs for scripts.

*No actual support, expressed or implied, is provided for use of this
function.
2023-01-05 20:30:34 -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
1dec0d00bd Add documentation for ns.pid 2022-12-13 09:09:12 -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
cbb7f58231 Make the main player object an alias, makes it easier to import 2022-10-09 18:42:14 -04:00
Olivier Gagnon
5d4b72e1d1 Added some purchased server functions 2022-10-09 02:32:13 -04: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
50f14b4f58 Commit1 2022-10-03 12:12:16 -04:00
Snarling
21a2d49de7 Finish removing player passing 2022-09-27 15:35:41 -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
445e365959 debounce updateRAM 2022-08-23 16:38:30 -04:00
Snarling
823cdf70ca Fix compile race conditions 2022-08-19 18:21:31 -04:00
Snarling
95a1c18139 synchronize write and scp 2022-08-17 17:11:59 -04:00
Olivier Gagnon
2d522ea1e6 allbuild commit e9254edf 2022-07-21 15:09:55 -04:00
Olivier Gagnon
d01fd55bde lint fmt 2022-07-21 01:58:47 -04:00
Olivier Gagnon
28b9c821d2 fix few as any 2022-07-20 02:36:21 -04:00
Olivier Gagnon
b4e5829cf8 rm unused arg 2022-07-20 01:21:07 -04:00
Olivier Gagnon
ceb9fa1249 fix more any 2022-07-20 01:13:06 -04:00
Olivier Gagnon
ce2ebf576e fix an any 2022-07-19 22:44:45 -04:00
Olivier Gagnon
e9788536ed yet another any 2022-07-18 02:36:51 -04:00
Olivier Gagnon
5b8eea66d4 rm some any 2022-07-15 23:34:27 -04:00
Olivier Gagnon
4bee746576 rm any 2022-07-15 01:51:30 -04:00
Olivier Gagnon
6b630753f0 nuke some use of any 2022-07-14 19:00:10 -04:00
phyzical
6b48ff8f21 merge base 2022-04-13 18:50:42 +08:00
Olivier Gagnon
eaf0098cc7 move singularity to its own namespace but still support the old. 2022-04-12 20:55:28 -04:00
Olivier Gagnon
48f80f25d6 fmt and lint 2022-04-06 19:30:08 -04:00
phyzical
07c6051004 merge dev 2022-03-30 19:00:57 +08:00
nickofolas
3b32811f5e Grafting API RAM cost & doc update 2022-03-27 15:33:31 -04:00
phyzical
7c5097ee83 added ns functions
* refactored out logic to be reused by api
2022-03-27 15:53:13 +08:00
BB
9c9550ad42 Removed unreachable code 2022-03-20 19:33:10 +01:00
BB
2c3e0985c4 Simplified some relative imports 2022-03-06 05:05:55 +01:00
Olivier Gagnon
77f525c98c rm blob caching 2022-01-20 16:11:48 -05:00
hydroflame
27a54217eb
Merge pull request #2653 from nickofolas/fix/refactor-loops
Refactor `for ... in` loops
2022-01-17 16:01:04 -05:00
hydroflame
8df950721c
Merge pull request #2657 from theit8514/grandparent-script-cache
Remove dependents from cache when dependency updated
2022-01-17 15:56:06 -05:00
theit8514
31ebdbb139 Handle 'export default' in static RAM calculation 2022-01-17 13:16:03 -05:00