Commit Graph

49 Commits

Author SHA1 Message Date
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
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
Snarling 759f86d6e5 NETSCRIPT: Rework script ram updates (#408) 2023-03-05 22:39:42 -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 572c68738f Unify error handling 2022-09-27 15:34:47 -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 28b9c821d2 fix few as any 2022-07-20 02:36:21 -04:00
Olivier Gagnon ce2ebf576e fix an any 2022-07-19 22:44:45 -04:00
Olivier Gagnon 6b630753f0 nuke some use of any 2022-07-14 19:00:10 -04:00
Olivier Gagnon 77f525c98c rm blob caching 2022-01-20 16:11:48 -05:00
theit8514 423efe19e1 Remove dependents from cache when dependency updated 2022-01-17 12:02:00 -05:00
Jeffrey A. Robinson 5f864c123b When saving we were not saving the script content 2022-01-14 19:01:11 -08:00
Martin Fournier aec2763b27 Ignore trailing whitespace for dirty file asterisk
Saved scripts is stored on servers with its starting & trailing whitespace removed, so
comparison would fail and show the file as dirty when there was a
trailing newline in the script.
2022-01-14 05:34:33 -05:00
Martin Fournier 4b06bdd89c Add detailed ram cost to mem command 2022-01-05 16:41:48 -05:00
Olivier Gagnon c59a267437 change sf4 2022-01-04 19:09:34 -05:00
theit8514 8f77f720e6 Cache the blobs generated by scripts 2021-12-23 23:06:01 -05:00
Alain Bryden ef23033b2c #1773 - Fix duplicate file extensions
For some time now, filenames have included the extension, so there's no need to append ".js" either on a single-file download or zip download.

While I was in the area, I also fixed .txt files in a folder - they had the same bug as scripts used to (appear in the zip as an underscore). I consolidated the code since it was the same for script files and text files.

I also added the ability to download *.js and *.ns (previously only supported *, *.script, and *.txt)

I also made the wildcard matching just a bit more flexible, so if someone really wanted to, they could go "download *blah.js" and get all scripts ending with that pattern ¯\_(ツ)_/¯
2021-11-25 23:06:13 -04:00
Olivier Gagnon 6543e73f6f Fix blade corp gang equal 0 2021-10-12 19:23:36 -04:00
Olivier Gagnon 8e4722c5e7 write can be awaited in order to wait for the ram calculation to go through 2021-10-08 14:05:47 -04:00
Olivier Gagnon 7d0536a4d2 finish convert to hostname 2021-10-07 17:55:49 -04:00
Olivier Gagnon c47a5bc8cc added grow, weaken, and time compression 2021-10-04 19:58:34 -04:00
Olivier Gagnon 06f716c0fa moved a bunch of files 2021-09-25 14:42:57 -04:00
Olivier Gagnon 5c6c472b64 Augmentations in mui 2021-09-25 01:06:17 -04:00
Olivier Gagnon 45f2f85a30 big work 2021-09-17 19:43:08 -04:00
Olivier Gagnon 89ea9aaff5 oops 2021-09-17 02:58:02 -04:00
Olivier Gagnon 2a13db39c7 fix sleeve memory bug 2021-09-08 23:47:34 -04:00
Olivier Gagnon a18bdd6afc prettify, sorry for the big ass commit 2021-09-04 19:09:30 -04:00
Olivier Gagnon d745150c45 all the lints 2021-05-01 03:17:31 -04:00
Olivier Gagnon 3fad505096 run auto fix lint 2021-04-29 23:52:56 -04:00
Olivier Gagnon cd972dabe3 crash now prints ns stack trace, workerscript now does the shouldLog check on its own, many ns function are way simpler. 2021-03-11 03:02:05 -05:00
Olivier Gagnon e2a353fc8a Attempt at logging line number on netscript error 2021-03-10 01:27:14 -05:00
danielyxie 8398fd47f0 Changed the way stock market cycles occur. Stock second-order forecast now changes normally like before 2019-06-02 23:29:56 -07:00
J 2f8eac07ee fix indentation 2019-06-02 23:53:07 -04:00
J 3eaefa01f9 Merge branch 'dev' into ns2_recompile_when_script_write 2019-06-02 23:50:57 -04:00
James Aguilar d45689c7df use sequence numbers rather than timestamps for script expiration 2019-06-02 20:26:06 -04:00
James Aguilar 1236ad252b markUpdated() for Script 2019-06-02 15:32:35 -04:00
James Aguilar 65331ab22e recompile ns2 scripts if dependencies change 2019-06-02 15:21:08 -04:00
danielyxie 3b7f9c9fb0 Fixed issues with Active Scripts UI. Implemented event emitter for Active Scripts UI 2019-05-17 13:41:16 -07:00
danielyxie b0918d7bd3 Fixed numerous reported bugs. Refactored some of the directory-related code. Added documentation for MasonDs changes to hack/grow/weaken 2019-05-11 19:20:20 -07:00
danielyxie cdb5dfec62 Resolved more circular dependencies. Installed acorn-walk and imported it in RamCalculations using ES6 modules. Fixed bugs in stock market rework 2019-05-06 18:01:06 -07:00
danielyxie 8a5b6f6cbc Refactored stock buying/selling code into its own file. Refactored WorkerScript & NetscriptEnvironment into their own Typescript classes. Refactored a ton of code to remove circular dependencies 2019-05-04 21:03:40 -07:00
danielyxie 473f0f1447 Refactored Server/Script/Files code to TypeScript 2019-03-04 17:40:28 -08:00
danielyxie e1b8a23f1e Started server code refactor 2019-03-02 19:15:10 -08:00