Persist terminal command history in game save

Copy the terminal commands into the player object so that they are saved
between game reloads.

Adds a 'history' command to display history, and a 'history -c' command
to clear it from both the current terminal & the player's save.
This commit is contained in:
Martin Fournier
2022-01-15 06:26:58 -05:00
parent 07fe3c1906
commit e7aa977eb0
6 changed files with 46 additions and 0 deletions
+7
View File
@@ -21,6 +21,7 @@ export const TerminalHelpText: string[] = [
" grow Spoof money in a servers bank account, increasing the amount available.",
" hack Hack the current machine",
" help [command] Display this help text, or the help text for a command",
" history [-c] Display the terminal history",
" home Connect to home computer",
" hostname Displays the hostname of the machine",
" kill [script/pid] [args...] Stops the specified script on the current server ",
@@ -255,6 +256,12 @@ export const HelpTexts: IMap<string[]> = {
" help scan-analyze",
" ",
],
history: [
"Usage: history [-c]",
" ",
"Without arguments, displays the terminal command history. To clear the history, pass in the '-c' argument.",
" ",
],
home: [
"Usage: home", " ", "Connect to your home computer. This will work no matter what server you are currently connected to.", " ",
],