public override void LoadContent() { base.LoadContent(); infoBar = new Rectangle(bounds.X, bounds.Y, bounds.Width, INFOBAR_HEIGHT); os.shells.Add(this); os.shellIPs.Add(targetIP); compThisShellIsRunningOn = Programs.getComputer(os, targetIP); compThisShellIsRunningOn.log(os.thisComputer.ip + "_Opened_#SHELL"); }
public override void LoadContent() { base.LoadContent(); infoBar = new Rectangle(bounds.X, bounds.Y, bounds.Width, INFOBAR_HEIGHT); os.shells.Add(this); os.shellIPs.Add(targetIP); compThisShellIsRunningOn = Programs.getComputer(os, targetIP); compThisShellIsRunningOn.log(os.thisComputer.ip + "_Opened_#SHELL"); }
public void doGui() { if (state == 2 && ramCost == targetRamUse) { var color = os.highlightColor; if (os.opponentLocation.Equals(targetIP)) { color = os.lockedColor; } if (Button.doButton(95000 + os.exes.IndexOf(this), bounds.X + 10, bounds.Y + 20, bounds.Width - 20, 50, "Trigger", color)) { destComp.forkBombClients(targetIP); completedAction(2); compThisShellIsRunningOn.log("#SHELL_TrapActivate_:_ConnectionsFlooded"); } } doControlButtons(); }
/// <summary> /// Opens a mod port. Doesn't add a port /// </summary> /// <param name="comp">The Computer.</param> /// <param name="port">The Port.Type to search for.</param> /// <param name="ipFrom">The ip responsible for the change.</param> public static void OpenModPort(this Hacknet.Computer comp, Port.Type port, string ipFrom = null) { var i = port.GetWithin(comp); if (i == null) { return; } i.Unlocked |= !comp.silent; if (!string.IsNullOrEmpty(ipFrom)) { comp.log(ipFrom + " Opened Port#" + port.PortName + "/" + port.PortDisplay); } comp.sendNetworkMessage("cPortOpen " + comp.ip + " " + ipFrom + " " + port); }
/// <summary> /// Opens a vanilla port. Doesn't add a port /// </summary> /// <param name="comp">The Computer.</param> /// <param name="info">The ExecutableInfo to search for.</param> /// <param name="ipFrom">The ip responsible for the change.</param> public static void OpenVanillaPort(this Hacknet.Computer comp, ExeInfoManager.ExecutableInfo info, string ipFrom = null) { var i = comp.ports.IndexOf(info.PortNumber); if (i < 0) { return; } if (!comp.silent) { comp.portsOpen[i] = 1; } if (!string.IsNullOrEmpty(ipFrom)) { comp.log(ipFrom + " Opened Port#" + info.PortNumber); } comp.sendNetworkMessage("cPortOpen " + comp.ip + " " + ipFrom + " " + info.PortNumber); }