bitburner-official / bitburner-src

Bitburner source code.
Other
837 stars 273 forks source link

Add "upload" terminal command #1522

Open ravenwolf397 opened 4 months ago

ravenwolf397 commented 4 months ago

Summary: Add a terminal command upload which uploads file(s) from your IRL computer to the game. This is the inverse of the download command.

Currently there exists a command download in the terminal:

download [script/text file]      Downloads scripts or text files to your computer

which downloads files from the game to your IRL computer. If you download multiple files, they will be zipped.

However, no corresponding command exists to upload files from your IRL computer to the game. This means that the download command isn't as useful as it could be, because it cannot effectively be used for:

This issue is a suggestion to create a command upload which allows the player to select file(s)/folders to upload from their IRL computer to the game. This would be the inverse of the download command.

Effects:

Save file: any Scripts: at least one Steps: none Version: v2.6.2 (633da3830)

EDIT: Apologies, I can't seem to figure out how to add a label to this - this should be an "enhancement" I think.

d0sboots commented 4 months ago

This command already exists: It is wget. However, it is (intentionally) locked down for file:// URLs, because all access to that URL space is blackholed to prevent real-life exploits. But if you keep your scripts on GitHub (for instance), you can easily wget them into the game from there.

ravenwolf397 commented 4 months ago

If it's locked down for file:// URLS then does it really count? I don't want to have to upload my files just to re-download them. That seems a bit silly.

AFAIK file:// access is restricted because it could be accessed without user consent (ie. it allows exploits like you mentioned). This is a restriction performed by the browser ... but the browser still allows normal file uploads, just like it allows normal file downloads. You just have use the system file picking dialog instead of (nonfunctional) URL access.

Right?

d0sboots commented 4 months ago

but the browser still allows normal file uploads, just like it allows normal file downloads. You just have use the system file picking dialog instead of (nonfunctional) URL access.

That is true; we already use that method with the "import game" dialog, for instance.

But this is a rough for a command-line utility - both for immersion reasons, and also general ergonomics, it would be awkward to start out with upload my_script.js and then have that pop up a file selector dialog. Also, it's an awkward workflow in general to try and use - it's more convenient to use ctrl-A ctrl-C and ctrl-A ctrl-V to copy-paste the whole script into the in-game editor if you want to keep a single file synced without setting up the external integration.

On the whole, I think the combination of copy-paste and wget are going to remain the solutions to this need, although if someone went and implemented an upload command I wouldn't turn it down.

ravenwolf397 commented 4 months ago

Hmmm ... I think I get your point about the workflow.

Thank you for your detailed responses; I really appreciate it.

:)

mctylr-gh commented 3 months ago

Should it support xmodem, zmodem, 7bit, even or odd parity?