From f4e39bb9117a692c543ecf17e79ed98c95ffc70e Mon Sep 17 00:00:00 2001 From: william341 Date: Thu, 27 Jul 2017 19:36:46 -0700 Subject: hacking works like actually it does kindof --- ShiftOS_TheReturn/Hacking.cs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'ShiftOS_TheReturn') diff --git a/ShiftOS_TheReturn/Hacking.cs b/ShiftOS_TheReturn/Hacking.cs index a691767..337ac04 100644 --- a/ShiftOS_TheReturn/Hacking.cs +++ b/ShiftOS_TheReturn/Hacking.cs @@ -95,6 +95,8 @@ namespace ShiftOS.Engine hsys.MillisecondsCountdown = 0; } hsys.PortsToUnlock = new List(); + hsys.VectorsUnlocked = new List(); + hsys.PayloadExecuted = new List(); foreach(Objects.Port porttocheck in Ports) { if (data.SystemType.HasFlag(porttocheck.AttachTo)) @@ -109,6 +111,7 @@ namespace ShiftOS.Engine throw new NaughtyDeveloperException("Someone tried to fail a non-existent hack."); if (CurrentHackable.IsPwn3d) throw new NaughtyDeveloperException("A developer tried to un-pwn a pwn3d hackable."); + Console.WriteLine("[sploitset] [FAIL] disconnected - connection terminated by remote machine "); if (!string.IsNullOrWhiteSpace(CurrentHackable.Data.OnHackFailedStoryEvent)) Story.Start(CurrentHackable.Data.OnHackFailedStoryEvent); if (Objects.ShiftFS.Utils.Mounts.Contains(CurrentHackable.Filesystem)) @@ -116,6 +119,28 @@ namespace ShiftOS.Engine CurrentHackable = null; } + public static void EndHack() + { + if (CurrentHackable == null) + throw new NaughtyDeveloperException("Someone tried to end a non-existent hack."); + if (Objects.ShiftFS.Utils.Mounts.Contains(CurrentHackable.Filesystem)) + Objects.ShiftFS.Utils.Mounts.Remove(CurrentHackable.Filesystem); + Console.WriteLine("[sploitset] [FAIL] disconnected for unknown reason"); + CurrentHackable = null; + } + + public static void FinishHack() + { + if (CurrentHackable == null) + throw new NaughtyDeveloperException("Someone tried to finish a non-existent hack."); + if (!string.IsNullOrWhiteSpace(CurrentHackable.Data.OnHackCompleteStoryEvent)) + Story.Start(CurrentHackable.Data.OnHackCompleteStoryEvent); + if (Objects.ShiftFS.Utils.Mounts.Contains(CurrentHackable.Filesystem)) + Objects.ShiftFS.Utils.Mounts.Remove(CurrentHackable.Filesystem); + Console.WriteLine("[sploitset] disconnected with payload applied"); + CurrentHackable = null; + } + public static void Initiate() { foreach(var type in ReflectMan.Types.Where(x => x.GetInterfaces().Contains(typeof(IHackableProvider)))) @@ -188,6 +213,8 @@ namespace ShiftOS.Engine { public Objects.Hackable Data { get; set; } public List PortsToUnlock { get; set; } + public List VectorsUnlocked { get; set; } + public List PayloadExecuted { get; set; } public bool FirewallCracked { get; set; } public Objects.ShiftFS.Directory Filesystem { get; set; } public double MillisecondsCountdown { get; set; } -- cgit v1.2.3