Commit Graph

350 Commits

Author SHA1 Message Date
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 f81297dcd6 ls display is responsive (#492) 2023-04-26 15:18:26 -04:00
Snarling 62adaf3006 Various bugfix/cleanup (#489)
* parseCommands no longer removes excess whitespace (it was unneeded and also had a bug in it relating to commands that ended in a quote mark)
* more documentation and some variable renaming
* Fix script editor focus bug on navigating to the editor from sidebar
* Fix initialization for lastNodeReset and lastAugReset
2023-04-24 15:48:49 -04:00
omuretsu 9004b12256 Actually fix quoted string args 2023-04-24 13:21:58 -04:00
omuretsu c4776753f1 Fix quoted section detection 2023-04-24 13:05:50 -04:00
omuretsu 3106c03b5b Fix broken run command 2023-04-24 12:54:09 -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
Snarling 6290ce562a Prevent errors thrown from terminal (#443)
At least from getFilepath function
2023-03-23 12:01:58 -04:00
omuretsu b9ffb9e42e Add triggers for faction invite check
Manually check for faction invites whenever a server is backdoored, and whenever the player uses ns.singularity.checkFactionInvites
2023-03-07 19:31:54 -05:00
Snarling 759f86d6e5 NETSCRIPT: Rework script ram updates (#408) 2023-03-05 22:39:42 -05:00
LiamGeorge1999 b1af58d6a6 Fixed speechmarks not making numeric terminal arguments into strings (#391) 2023-02-25 08:17:01 -05:00
Snarling d3f9554a6e 2.2.2 Release (#378) 2023-02-21 09:44:18 -05:00
Snarling 08e71c732b Threads are a positive integer (#366)
* Added new positive integer ns validation helper
* `run`, `exec`, and `spawn` verify threads as a positive integer.
* `run` terminal command also fails if the provided threadcount is not a positive integer.
* Removed some references to .script files in various documentation, and removed some of the NS1 example blocks
2023-02-14 01:32:01 -05:00
Snarling 6a6043c509 CODEBASE: Add custom useRerender hook (#359) 2023-02-11 13:22:55 -05:00
Snarling b4074328ec UI: Added new locale-aware and configurable number formatting (#354) 2023-02-11 13:18:50 -05:00
omuretsu 0ec4ef31ab 2.2 2023-01-02 13:20:25 -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
David Walker 49f732d1ee Revert "Revert "Add keycode table and switch to event.code in select places" (#224)" (#242) 2022-12-03 22:56:42 -05:00
David Walker 70fadde222 Revert "Add keycode table and switch to event.code in select places" (#224)
Using code instead of key is strongly warned against at MDN and causes issues with nonstandard layouts:
https://developer.mozilla.org/en-US/docs/Web/API/Element/keydown_event#keyboardevent.code

This also fixes ScriptEditorRoot.tsx, where some code snuck in that
wasn't using *any* of the constants.

This reverts commit 016a9a873f.
2022-11-26 08:51:09 -05:00
Snarling 88d51e9a7e MISC: A bunch of enums stuff. (#212)
* Some game enums moved to utils/enums. Others can eventually be moved there as well.
* findEnumMember function for performing fuzzy matching of player input with enum members, without needing separate fuzzy functions for every enum.
* Also used findEnumMember for safely loading save games (allows case changes in enum values)
* Changed capitalization on some enums.
* BREAKING: removed classGains work formulas function
* Split ClassType enum into UniversityClassType and GymType.
* Added universityGains and gymGains work formulas functions
* Provided the new split enums to the player on ns.enums.
2022-11-20 08:37:11 -05:00
quacksouls 55b2cbb549 UI: cat: proper line breaks when showing .js, .script, or .txt files (#192)
Currently, the HTML line break sequence `<br /><br />` is hardcoded into the dialog box message when showing the content of these file types: ".js", ".script", and ".txt".  By default, the function `dialogBoxCreate()` currently assumes that its first parameter is not HTML, but a text string, so whatever is in the string will appear in the dialog box.  Use the newline character instead for line break.
2022-11-04 07:23:33 -04:00
Snarling 239834dba6 Connect to owned servers from anywhere (#159)
* purchasedByPlayer allows connect-from-anywhere as if the server was backdoored.
* Also added optional backdoorInstalled variable to type for BaseServer. This has no runtime effect, but it allows accessing that variable without TS needing us to verify whether it's instanceof Server first.
2022-10-25 17:48:46 -04:00
Olivier Gagnon af1a1ac58d Rename lots of reference from old to new repo 2022-10-20 03:56:59 +11:00
hydroflame d0fe28f8fb Merge pull request #4220 from cptpiepmatz/fix-nano-not-opening-root-script-if-in-dir
UI: Fixed `nano` not correctly opening a script in root of a server if `cd`'d into a directory
2022-10-12 23:58:59 -04:00
Olivier Gagnon cbb7f58231 Make the main player object an alias, makes it easier to import 2022-10-09 18:42:14 -04:00
Tim Hesse 7121b456f4 fix: nano does not open root script if cd'd into a dir 2022-10-09 14:49:18 +02: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 068533cd2f format, lint, more enums, revert fn rename 2022-10-05 14:52:48 -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 dcd9023b93 Remove more unused interfaces 2022-09-27 15:35:41 -04:00
Snarling 21a2d49de7 Finish removing player passing 2022-09-27 15:35:41 -04:00
Snarling 91a69d7d8f format & lint 2022-09-27 15:35:40 -04:00
Snarling 83d357e758 commit1 2022-09-27 15:35:40 -04:00
Snarling 83c62bbc63 silent fail for tabcompletion compile error 2022-09-27 15:35:39 -04:00
Snarling 572c68738f Unify error handling 2022-09-27 15:34:47 -04:00
Mughur d99d37f191 Bunch of corporation fixes 2022-09-23 13:13:33 +03:00
G4mingJon4s 22a35af6b6 Added hover style change for better recognition 2022-09-14 15:59:55 +02:00
G4mingJon4s c29b4cfda9 Fixes #2795, adding better underlines for links 2022-09-13 20:09:58 +02:00
Olivier Gagnon 759de85559 Fix unique key problem with ascii elements 2022-08-29 16:59:38 -04:00
Snarling 6f36e9cdc5 Fix/Unify NS1 wrapper 2022-08-27 20:56:12 -04:00
hydroflame d553a1d2f4 Merge pull request #3981 from Snarling/B&AFix
FILES: FIX #3979 Allow characters & and ' in filenames
2022-08-23 12:25:55 -03:00
Snarling 823cdf70ca Fix compile race conditions 2022-08-19 18:21:31 -04:00
Snarling 9e2e459cc2 Allow & and ' in filenames 2022-08-17 08:14:15 -04:00
Snarling 931ea730a5 Move entire ns object to top-level 2022-08-09 18:09:26 -04:00
Olivier Gagnon 326d9fd7ef Move player skills and exp to their struct 2022-07-26 23:54:17 -04:00
hydroflame 9e25833796 Merge pull request #3606 from RevanProdigalKnight/feature/enhanced-terminal-argument-parsing
MISC: #3596 Enhanced terminal command parsing
2022-07-21 18:36:54 -04:00