diff options
| author | MichaelTheShifter <[email protected]> | 2016-05-25 20:50:35 -0400 |
|---|---|---|
| committer | MichaelTheShifter <[email protected]> | 2016-05-25 20:50:35 -0400 |
| commit | c43d82eebd5e71ff5860fb2797bc4ebaa90e541e (patch) | |
| tree | 89ded82085a904e10a503f3c4454d1ed140fa996 /source/WindowsFormsApplication1/Terminal.cs | |
| parent | e2d2829ce94c81ad5c36e0fc59cac63438520d67 (diff) | |
| download | shiftos-c--c43d82eebd5e71ff5860fb2797bc4ebaa90e541e.tar.gz shiftos-c--c43d82eebd5e71ff5860fb2797bc4ebaa90e541e.tar.bz2 shiftos-c--c43d82eebd5e71ff5860fb2797bc4ebaa90e541e.zip | |
Release Candidate 2
We're almost there...
Diffstat (limited to 'source/WindowsFormsApplication1/Terminal.cs')
| -rw-r--r-- | source/WindowsFormsApplication1/Terminal.cs | 213 |
1 files changed, 60 insertions, 153 deletions
diff --git a/source/WindowsFormsApplication1/Terminal.cs b/source/WindowsFormsApplication1/Terminal.cs index 5bff0e2..8bda511 100644 --- a/source/WindowsFormsApplication1/Terminal.cs +++ b/source/WindowsFormsApplication1/Terminal.cs @@ -1451,46 +1451,60 @@ Password: z7fjsd3"); } break; case "endgame_test": - try + if (API.DeveloperMode) { - switch(args[1]) + try { - case "choice_screen": - var cscreen = new ShiftOS.FinalMission.ChooseYourApproach(); - cscreen.WindowState = FormWindowState.Maximized; - //cscreen.TopMost = true; - cscreen.Show(); - break; - case "limitedmode": - API.LimitedMode = !API.LimitedMode; - WriteLine($"Limited mode set to {API.LimitedMode}."); - break; + switch (args[1]) + { + case "choice_screen": + var cscreen = new ShiftOS.FinalMission.ChooseYourApproach(); + cscreen.WindowState = FormWindowState.Maximized; + //cscreen.TopMost = true; + cscreen.Show(); + break; + case "limitedmode": + API.LimitedMode = !API.LimitedMode; + WriteLine($"Limited mode set to {API.LimitedMode}."); + break; + } + } + catch + { + WriteLine("Invalid arguments."); } } - catch + else { - WriteLine("Invalid arguments."); + wrongcommand(); } break; case "fake_buy": - try + if (API.DeveloperMode) { - if(API.Upgrades.ContainsKey(args[1])) + try { - API.Upgrades[args[1]] = true; - WriteLine($"Bought upgrade {args[1]}."); - API.CurrentSession.SetupAppLauncher(); - API.UpdateWindows(); - SaveSystem.Utilities.saveGame(); + if (API.Upgrades.ContainsKey(args[1])) + { + API.Upgrades[args[1]] = true; + WriteLine($"Bought upgrade {args[1]}."); + API.CurrentSession.SetupAppLauncher(); + API.UpdateWindows(); + SaveSystem.Utilities.saveGame(); + } + else + { + WriteLine("Upgrade not found."); + } } - else + catch { - WriteLine("Upgrade not found."); + WriteLine("fake_buy: Bad arguments."); } } - catch + else { - WriteLine("fake_buy: Bad arguments."); + wrongcommand(); } break; case "connections": @@ -1571,21 +1585,9 @@ Password: z7fjsd3"); else { wrongcommand(); } break; case "htutorial": - ShiftOS.Hacking.StartBattleTutorial(); - break; - case "lua_test": - if(API.DeveloperMode == true) + if (API.DeveloperMode) { - if(Lua_API.UseLuaAPI == true) - { - WriteLine("Lua API disabled, 'saa' command uses old Modding API"); - Lua_API.UseLuaAPI = false; - } - else - { - WriteLine("ShiftOS Lua API enabled. 'saa' command now parses Lua code and interprets it."); - Lua_API.UseLuaAPI = true; - } + ShiftOS.Hacking.StartBattleTutorial(); } else { @@ -1613,15 +1615,22 @@ Password: z7fjsd3"); } break; case "toggle_music": - if(Audio.Enabled == false) + if (API.DeveloperMode) { - WriteLine(@"Music enabled. + if (Audio.Enabled == false) + { + WriteLine(@"Music enabled. Warning: The music player code in ShiftOS has a memory leak issue and is quite CPU-intensive. If your CPU fan starts to spin up while listening to a song, that's why. Warning: Music is not embedded within the game. You must download the external resources directory at http://playshiftos.ml/shiftos/resources.zip to have applications play their music."); + } + Audio.Enabled = !Audio.Enabled; + } + else + { + wrongcommand(); } - Audio.Enabled = !Audio.Enabled; break; case "linux": if(API.DeveloperMode) @@ -1651,22 +1660,6 @@ Warning: Music is not embedded within the game. You must download the external r wrongcommand(); } break; - case "enemy_test": - var e = new EnemyHacker("DevX", "I am the god of this world.", "I am the god of this world.", 100, 100, "Hard"); - e.AddModule(new Module(SystemType.Antivirus, 4, "you_can't_stop_me")); - e.AddModule(new Module(SystemType.Antivirus, 4, "not_happening")); - e.AddModule(new Module(SystemType.DedicatedDDoS, 2, "dos")); - e.AddModule(new Module(SystemType.Turret, 4, "remotehost")); - e.AddModule(new Module(SystemType.Turret, 2, "boom")); - string json = JsonConvert.SerializeObject(e); - var tp = new TextPad(); - API.CreateForm(tp, "Enemy JSON", API.GetIcon("TextPad")); - tp.txtuserinput.Text = json; - break; - case "htest": - var hui = new HackUI(); - hui.Show(); - break; case "lua": if(API.DeveloperMode == true) { @@ -1720,18 +1713,7 @@ Warning: Music is not embedded within the game. You must download the external r wrongcommand(); } break; - case "unitytest": - if (API.DeveloperMode == true) - { - var u = new AlternateDesktop(); - u.Show(); - } - else - { - wrongcommand(); - } - break; - case "virusscanner": + case "virusscanner": case "vscan": if(API.Upgrades["virusscanner"] == true) { @@ -1792,27 +1774,17 @@ Warning: Music is not embedded within the game. You must download the external r wrongcommand(); } break; - case "infect": - try { - if (API.DeveloperMode == true) - { - Viruses.InfectRandom(); - WriteLine("A random file has been infected."); - } - else - { - wrongcommand(); - } + case "binarywater": + if (API.DeveloperMode) + { + ShiftOS.Hacking.AddCharacter(new Character("Philip Adams", "Hello, and welcome to another episode of OSFirstTimer.", 100, 100, 0)); + WriteLine("Philip Adams is now in the list of hirable hackers."); } - catch(Exception ex) + else { - WriteLine("infect: Error. Probably a mess-up with the virus scanner."); + WriteLine("I see you went in the ShiftOS source code... ummm yeah... this isn't a developer mode release so I can't just give you a full-skilled hacker even if you beg."); } break; - case "binarywater": - ShiftOS.Hacking.AddCharacter(new Character("Philip Adams", "Hello, and welcome to another episode of OSFirstTimer.", 100, 100, 0)); - WriteLine("Philip Adams is now in the list of hirable hackers."); - break; case "color": try { @@ -2159,75 +2131,11 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o { showhelp(args[1]); } - catch (Exception ex) + catch { showhelp(); } break; - case "kill": - if(API.Upgrades["shiftnet"] == true) - { - List<Process> cleanup = new List<Process>(); - try - { - foreach (Process mod in API.RunningModProcesses) - { - try - { - if (args[1] == mod.Id.ToString() || args[1].ToLower() == mod.ProcessName.Remove(0, 1).Replace(".exe", "").ToLower()) - { - WriteLine("[" + mod.Id.ToString() + "] - Killed."); - cleanup.Add(mod); - mod.Kill(); - } - } - catch (Exception ex) - { - - } - } - } - catch(Exception ex) - { - WriteLine("kill: Missing argument."); - } - foreach (Process prc in cleanup) - { - try - { - API.RunningModProcesses.Remove(prc); - } - catch (Exception ex) - { - - } - } - } - else - { - wrongcommand(); - } - break; - case "proclist": - if(API.Upgrades["shiftnet"] == true) - { - WriteLine("Running Applications:"); - foreach(Process mod in API.RunningModProcesses) - { - try { - WriteLine("[" + mod.Id.ToString() + "] " + mod.ProcessName.Replace(".exe", "")); - } - catch(Exception ex) - { - - } - } - } - else - { - wrongcommand(); - } - break; case "codepoints": case "cp": WriteLine("You have " + API.Codepoints.ToString() + " Codepoints."); @@ -2383,7 +2291,6 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o } break; } - //cmds(UBound(cmds)) = command } private void StartChoice1EndStory() |
