Commit Graph

150 Commits

Author SHA1 Message Date
Snarling
f81297dcd6
ls display is responsive (#492) 2023-04-26 15:18:26 -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
Snarling
759f86d6e5
NETSCRIPT: Rework script ram updates (#408) 2023-03-05 22:39:42 -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
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
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
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
91a69d7d8f format & lint 2022-09-27 15:35:40 -04:00
Snarling
83d357e758 commit1 2022-09-27 15:35:40 -04:00
Snarling
572c68738f Unify error handling 2022-09-27 15:34:47 -04:00
Snarling
6f36e9cdc5 Fix/Unify NS1 wrapper 2022-08-27 20:56:12 -04:00
Olivier Gagnon
326d9fd7ef Move player skills and exp to their struct 2022-07-26 23:54:17 -04:00
Olivier Gagnon
2d522ea1e6 allbuild commit e9254edf 2022-07-21 15:09:55 -04:00
Olivier Gagnon
c9b9c2c55b merge dev 2022-07-20 12:16:42 -04:00
Olivier Gagnon
49f6fda1e4 remove last colon any for now 2022-07-20 01:48:54 -04:00
Olivier Gagnon
810f3a87b9 rm more anys 2022-07-19 21:53:43 -04:00
Olivier Gagnon
4bee746576 rm any 2022-07-15 01:51:30 -04:00
Undeemiss
f8f3c099e0 Formatted/linted (There are some errors, but they aren't mine afaik) 2022-05-28 21:35:20 -05:00
Olivier Gagnon
76ccb0ba36 lint 2022-05-25 11:43:43 -04:00
Olivier Gagnon
bd6705419c lint 2022-05-25 11:15:34 -04:00
Olivier Gagnon
63b0b22f92 Fix tor router from anywhere 2022-05-25 11:14:06 -04:00
hydroflame
084a29dfe4
Merge pull request #3474 from Hoekstraa/mvfix
UI: FIX #3473 'mv' now says destination script is running instead of returning an error
2022-05-19 02:16:33 -04:00
Snarling
fe1dd11269 Only mention number of threads if != 1
Fixes confusion mentioned here: https://discord.com/channels/415207508303544321/921120989000114257/971233305020231722
2022-05-06 09:15:48 -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
Snarling
3f53a1f090 Format+lint 2022-04-20 10:05:55 -04:00
Snarling
16e507127a Allow cd .. into empty directories 2022-04-20 10:03:51 -04:00
JP Sugarbroad
01d7ac6967 make jQuery use explicit 2022-04-19 16:14:16 -07:00
Zoë Hoekstra
43807fb757
Add code for handling when dest. script is running 2022-04-15 19:44:08 +02:00
Chris380
bfa19eb7ba Make .lit and .msg files clickable 2022-04-14 16:23:45 +02:00
hydroflame
0d11a18ca9
Merge pull request #3428 from Chris380/bugfix/2367_reject_cd_to_invalid_folders
Reject cd to invalid folders
2022-04-13 11:27:35 -04:00
Olivier Gagnon
501b69bbc2 tighten messages types wth enums 2022-04-13 11:10:56 -04:00
chris380
d93ab92f69 Reject cd to invalid folders 2022-04-13 16:07:41 +02:00
Olivier Gagnon
48f80f25d6 fmt and lint 2022-04-06 19:30:08 -04:00
phyzical
61fc815a6b added apr1 terminal command
* just opens the rickroll modal
2022-04-02 20:08:57 +08:00
Heinous Tugboat
9b0422f9ee Removes extra asterisk in template 2022-03-30 10:18:07 -04:00
hydroflame
3456acc6a8
Update connect.ts 2022-03-29 11:27:34 -04:00
Thomas B
0a9bded0d8
Clarify Error Message
Co-authored-by: ApamNapat <ApamNapat@users.noreply.github.com>
2022-03-28 08:33:05 -04:00
Thomas B
fe0b6d5982
Clarified error message 2022-03-25 09:41:23 -04:00
hydroflame
d2dedace2e
Merge pull request #3152 from Master-Guy/issues/1944
Issues/1944
2022-03-20 14:21:28 -04:00