public override void Killed() { base.Killed(); if (this.state == ExtensionSequencerExe.SequencerExeState.Active) { this.os.delayer.Post(ActionDelayer.NextTick(), (Action)(() => { this.os.addExe((ExeModule) new ExtensionSequencerExe(this.bounds, this.os, new string[0]) { state = this.state, stateTimer = this.stateTimer, bounds = this.bounds, oldSongName = this.oldSongName, nodeeffects = this.nodeeffects, ramCost = this.ramCost }); })); } else { this.os.netMap.DimNonConnectedNodes = false; this.os.runCommand("disconnect"); if (this.targetComp != null) { this.os.netMap.visibleNodes.Remove(this.os.netMap.nodes.IndexOf(this.targetComp)); } } }
public List <Computer> generateGameNodes() { var list = new List <Computer>(); var computer1 = (Computer)ComputerLoader.loadComputer("Content/Missions/CoreServers/JMailServer.xml"); computer1.location = new Vector2(0.7f, 0.2f); mailServer = computer1; list.Add(computer1); var c1 = new Computer("boatmail.com", "65.55.72.183", new Vector2(0.6f, 0.9f), 4, 3, os); c1.idName = "boatmail"; c1.daemons.Add(new BoatMail(c1, "Boatmail", os)); c1.initDaemons(); list.Add(c1); var c2 = (Computer)ComputerLoader.loadComputer("Content/Missions/CoreServers/InternationalAcademicDatabase.xml"); var academicDatabaseDaemon = new AcademicDatabaseDaemon(c2, "Academic Databse", os); c2.daemons.Add(academicDatabaseDaemon); c2.initDaemons(); academicDatabaseDaemon.initFilesFromPeople(People.all); academicDatabase = c2; list.Add(c2); var computer2 = (Computer)ComputerLoader.loadComputer("Content/Missions/CoreServers/ContractHubAssetsComp.xml"); list.Add(computer2); var ch = (Computer)ComputerLoader.loadComputer("Content/Missions/CoreServers/ContractHubComp.xml"); os.delayer.Post(ActionDelayer.NextTick(), () => { ch.daemons.Add(new MissionHubServer(ch, "CSEC Contract Database", "CSEC", os)); ch.initDaemons(); }); list.Add(ch); computer2.location = ch.location + Corporation.getNearbyNodeOffset(ch.location, 1, 1, this); list.Add(new Computer("Cheater's Stash", "1337.1337.1337.1337", getRandomPosition(), 0, 2, os) { idName = "haxServer", files = { root = { files = { new FileEntry(PortExploits.crackExeData[PortExploits.portNums[0]], PortExploits.cracks[PortExploits.portNums[0]]), new FileEntry(PortExploits.crackExeData[PortExploits.portNums[1]], PortExploits.cracks[PortExploits.portNums[1]]), new FileEntry(PortExploits.crackExeData[PortExploits.portNums[2]], PortExploits.cracks[PortExploits.portNums[2]]), new FileEntry(PortExploits.crackExeData[PortExploits.portNums[3]], PortExploits.cracks[PortExploits.portNums[3]]) } } } }); return(list); }
public List <Computer> generateGameNodes() { List <Computer> computerList = new List <Computer>(); Computer computer1 = (Computer)ComputerLoader.loadComputer("Content/Missions/CoreServers/JMailServer.xml", false, false); computer1.location = new Vector2(0.7f, 0.2f); this.mailServer = computer1; computerList.Add(computer1); Computer c1 = new Computer("boatmail.com", "65.55.72.183", new Vector2(0.6f, 0.9f), 4, (byte)3, this.os); c1.idName = "boatmail"; c1.daemons.Add((Daemon) new BoatMail(c1, "Boatmail", this.os)); c1.initDaemons(); computerList.Add(c1); Computer c2 = (Computer)ComputerLoader.loadComputer("Content/Missions/CoreServers/InternationalAcademicDatabase.xml", false, false); AcademicDatabaseDaemon academicDatabaseDaemon = new AcademicDatabaseDaemon(c2, "Academic Database", this.os); c2.daemons.Add((Daemon)academicDatabaseDaemon); c2.initDaemons(); this.academicDatabase = c2; computerList.Add(c2); Computer computer2 = (Computer)ComputerLoader.loadComputer("Content/Missions/CoreServers/ContractHubAssetsComp.xml", false, false); computerList.Add(computer2); Computer ch = (Computer)ComputerLoader.loadComputer("Content/Missions/CoreServers/ContractHubComp.xml", false, false); this.os.delayer.Post(ActionDelayer.NextTick(), (Action)(() => { ch.daemons.Add((Daemon) new MissionHubServer(ch, "CSEC Contract Database", "CSEC", this.os)); ch.initDaemons(); })); computerList.Add(ch); computer2.location = ch.location + Corporation.getNearbyNodeOffset(ch.location, 1, 1, this, 0.0f, false); computerList.Add(new Computer("Cheater's Stash", "1337.1337.1337.1337", this.getRandomPosition(), 0, (byte)2, this.os) { idName = "haxServer", files = { root = { files = { new FileEntry(PortExploits.crackExeData[PortExploits.portNums[0]], PortExploits.cracks[PortExploits.portNums[0]]), new FileEntry(PortExploits.crackExeData[PortExploits.portNums[1]], PortExploits.cracks[PortExploits.portNums[1]]), new FileEntry(PortExploits.crackExeData[PortExploits.portNums[2]], PortExploits.cracks[PortExploits.portNums[2]]), new FileEntry(PortExploits.crackExeData[PortExploits.portNums[3]], PortExploits.cracks[PortExploits.portNums[3]]), this.GetProgramForNum(1433), this.GetProgramForNum(104), this.GetProgramForNum(9), this.GetProgramForNum(13), this.GetProgramForNum(10) } } } }); return(computerList); }
private void PlayerLostToTraceTimer() { this.os.runCommand("dc"); this.os.runCommand("clear"); this.os.delayer.Post(ActionDelayer.NextTick(), (Action)(() => { this.os.write("-----------------\n\nKT_OVERRIDE_RECOVERY: " + LocaleTerms.Loc("Critical Error - resetting.") + "\n\n----------------"); this.State = DLCIntroExe.IntroState.AssignMission1; this.TimeInThisState = 0.0f; })); }
internal static void loadCustomThemeBackground(OS os, string imagePathName) { if (imagePathName == ThemeManager.customBackgroundImageLoadPath) { ThemeManager.backgroundImage = ThemeManager.lastLoadedCustomBackground; } else { if (ThemeManager.backgroundNeedsDisposal) { Texture2D oldBackground = ThemeManager.backgroundImage; os.delayer.Post(ActionDelayer.NextTick(), (Action)(() => oldBackground.Dispose())); } if (string.IsNullOrWhiteSpace(imagePathName)) { ThemeManager.backgroundImage = (Texture2D)null; } else { string path = Utils.GetFileLoadPrefix() + imagePathName; if (!File.Exists(path)) { path = "Content/" + imagePathName; } if (File.Exists(path)) { try { using (FileStream fileStream = File.OpenRead(path)) { ThemeManager.backgroundImage = Texture2D.FromStream(GuiData.spriteBatch.GraphicsDevice, (Stream)fileStream); ThemeManager.backgroundNeedsDisposal = true; } ThemeManager.lastLoadedCustomBackground = ThemeManager.backgroundImage; ThemeManager.customBackgroundImageLoadPath = imagePathName; } catch (Exception ex) { ThemeManager.backgroundImage = (Texture2D)null; } } else { ThemeManager.backgroundImage = (Texture2D)null; } } } }
public override void initFiles() { this.root = new Folder("ContractHub"); this.missionsFolder = new Folder("Contracts"); this.listingsFolder = new Folder("Listings"); this.listingArchivesFolder = new Folder("Archives"); this.missionsFolder.folders.Add(this.listingsFolder); this.missionsFolder.folders.Add(this.listingArchivesFolder); this.usersFolder = new Folder("Users"); this.root.folders.Add(this.missionsFolder); this.root.folders.Add(this.usersFolder); this.root.files.Add(this.generateConfigFile()); this.root.files.Add(new FileEntry(Computer.generateBinaryString(1024), "net64.sys")); this.populateUserList(); this.os.delayer.Post(ActionDelayer.NextTick(), (Action)(() => this.loadInitialContracts())); this.comp.files.root.folders.Add(this.root); }
public static void AddNoteToOS(string note, OS os, bool isRecursiveSelfAdd = false) { for (var index = 0; index < os.exes.Count; ++index) { var notesExe = os.exes[index] as NotesExe; if (notesExe != null) { notesExe.AddNote(note); return; } } if (!isRecursiveSelfAdd) { os.runCommand("notes"); } Action action = () => AddNoteToOS(note, os, true); os.delayer.Post(ActionDelayer.NextTick(), action); }
public void DisconnectTarget() { this.os.execute("disconnect"); this.os.display.command = "connectiondenied"; this.os.delayer.Post(ActionDelayer.NextTick(), (Action)(() => this.os.display.command = "connectiondenied")); this.os.write(" "); this.os.write(" "); this.os.write("------------------------------"); this.os.write("------------------------------"); this.os.write(" "); this.os.write("--- " + LocaleTerms.Loc("CONNECTION ERROR") + " ---"); this.os.write(" "); this.os.write(LocaleTerms.Loc("Message from Server:")); this.os.write(string.Format(LocaleTerms.Loc("Whitelist Authenticator denied connection from IP {0}"), (object)this.os.thisComputer.ip)); this.os.write(" "); this.os.write("------------------------------"); this.os.write("------------------------------"); this.os.write(" "); }
public override void Killed() { base.Killed(); if (this.State == DLCIntroExe.IntroState.NotStarted || this.State == DLCIntroExe.IntroState.Exiting) { return; } this.os.delayer.Post(ActionDelayer.NextTick(), (Action)(() => { DLCIntroExe dlcIntroExe = new DLCIntroExe(this.bounds, this.os, new string[0]) { State = this.State, TimeInThisState = this.TimeInThisState, LoadedMission = this.LoadedMission, IsOnAssignment1 = this.IsOnAssignment1, AllAssignmentsComplete = this.AllAssignmentsComplete, MissionIsComplete = this.MissionIsComplete, PhaseTitle = this.PhaseTitle, PhaseSubtitle = this.PhaseSubtitle }; if (this.OSTraceTimerOverrideActive) { this.os.traceCompleteOverrideAction = (Action)null; this.os.traceCompleteOverrideAction += new Action(dlcIntroExe.PlayerLostToTraceTimer); } this.os.addExe((ExeModule)dlcIntroExe); })); }
public void doGui(float t) { int num1 = -1; Color highlightColor = this.os.highlightColor; for (int nodeIndex = 0; nodeIndex < this.nodes.Count; ++nodeIndex) { Vector2 nodeDrawPos = this.GetNodeDrawPos(this.nodes[nodeIndex], nodeIndex); if (this.visibleNodes.Contains(nodeIndex) && !this.nodes[nodeIndex].disabled) { for (int index = 0; index < this.nodes[nodeIndex].links.Count; ++index) { if (this.visibleNodes.Contains(this.nodes[nodeIndex].links[index]) && !this.nodes[this.nodes[nodeIndex].links[index]].disabled) { this.drawLine(this.GetNodeDrawPos(this.nodes[nodeIndex], nodeIndex), this.GetNodeDrawPos(this.nodes[this.nodes[nodeIndex].links[index]], this.nodes[nodeIndex].links[index]), new Vector2((float)this.bounds.X, (float)this.bounds.Y)); } } if ((double)this.pulseFade > 0.0) { Color color = this.os.highlightColor * (this.pulseFade * this.pulseFade); if (this.DimNonConnectedNodes) { color = Utils.AddativeRed * 0.5f * (this.pulseFade * this.pulseFade); } this.spriteBatch.Draw(this.circleOutline, new Vector2((float)(this.bounds.X + (int)nodeDrawPos.X + NetworkMap.NODE_SIZE / 2), (float)(this.bounds.Y + (int)nodeDrawPos.Y + NetworkMap.NODE_SIZE / 2)), new Rectangle?(), color, this.rotation, this.circleOrigin, new Vector2(NetworkMap.ADMIN_CIRCLE_SCALE * (float)(2.0 - 2.0 * (double)this.pulseFade)), SpriteEffects.None, 0.5f); } if (this.nodes[nodeIndex].idName == this.os.homeNodeID && !this.nodes[nodeIndex].disabled) { this.spriteBatch.Draw(this.homeNodeCircle, new Vector2((float)(this.bounds.X + (int)nodeDrawPos.X + NetworkMap.NODE_SIZE / 2), (float)(this.bounds.Y + (int)nodeDrawPos.Y + NetworkMap.NODE_SIZE / 2)), new Rectangle?(), this.os.connectedComp == null || this.os.connectedComp != this.nodes[nodeIndex] ? (this.nodes[nodeIndex].Equals((object)this.os.thisComputer) ? this.os.thisComputerNode : this.os.highlightColor) : (this.nodes[nodeIndex].adminIP == this.os.thisComputer.ip ? Utils.AddativeWhite : Utils.AddativeWhite), -1f * this.rotation, this.circleOrigin, new Vector2(NetworkMap.ADMIN_CIRCLE_SCALE), SpriteEffects.None, 0.5f); } if (this.nodes[nodeIndex] == this.lastAddedNode && !this.nodes[nodeIndex].disabled) { float num2 = this.nodes[nodeIndex].adminIP == this.os.thisComputer.ip ? 1f : 4f; this.spriteBatch.Draw(this.targetNodeCircle, new Vector2((float)(this.bounds.X + (int)nodeDrawPos.X + NetworkMap.NODE_SIZE / 2), (float)(this.bounds.Y + (int)nodeDrawPos.Y + NetworkMap.NODE_SIZE / 2)), new Rectangle?(), this.os.connectedComp == null || this.os.connectedComp != this.nodes[nodeIndex] ? (this.nodes[nodeIndex].Equals((object)this.os.thisComputer) ? this.os.thisComputerNode : (this.nodes[nodeIndex].adminIP == this.os.thisComputer.ip ? this.os.highlightColor : Utils.AddativeWhite)) : (this.nodes[nodeIndex].adminIP == this.os.thisComputer.ip ? this.os.highlightColor : Utils.AddativeWhite), -1f * this.rotation, this.circleOrigin, new Vector2(NetworkMap.ADMIN_CIRCLE_SCALE) + Vector2.One * ((float)Math.Sin((double)this.os.timer * 3.0) * num2) / (float)this.targetNodeCircle.Height, SpriteEffects.None, 0.5f); } if (this.nodes[nodeIndex].adminIP == this.os.thisComputer.ip && !this.nodes[nodeIndex].disabled) { this.spriteBatch.Draw(this.nodes[nodeIndex].ip.Equals(this.os.thisComputer.ip) ? this.adminCircle : this.nodeGlow, new Vector2((float)(this.bounds.X + (int)nodeDrawPos.X + NetworkMap.NODE_SIZE / 2), (float)(this.bounds.Y + (int)nodeDrawPos.Y + NetworkMap.NODE_SIZE / 2)), new Rectangle?(), this.nodes[nodeIndex].Equals((object)this.os.thisComputer) ? this.os.thisComputerNode : this.os.highlightColor, this.rotation, this.circleOrigin, new Vector2(NetworkMap.ADMIN_CIRCLE_SCALE), SpriteEffects.None, 0.5f); } } } lock (this.nodes) { for (int nodeIndex = 0; nodeIndex < this.nodes.Count; ++nodeIndex) { if (this.visibleNodes.Contains(nodeIndex) && !this.nodes[nodeIndex].disabled) { Color color; if (this.os.thisComputer.ip == this.nodes[nodeIndex].ip) { color = this.os.thisComputerNode; } else { color = this.os.connectedComp == null ? (!(this.nodes[nodeIndex].adminIP == this.os.thisComputer.ip) || !(this.nodes[nodeIndex].ip == this.os.opponentLocation) ? (!this.os.shellIPs.Contains(this.nodes[nodeIndex].ip) ? this.os.highlightColor : this.os.shellColor) : Color.DarkRed) : (!(this.os.connectedComp.ip == this.nodes[nodeIndex].ip) ? (!(this.nodes[nodeIndex].adminIP == this.os.thisComputer.ip) || !(this.nodes[nodeIndex].ip == this.os.opponentLocation) ? (!this.os.shellIPs.Contains(this.nodes[nodeIndex].ip) ? this.os.highlightColor : this.os.shellColor) : Color.DarkRed) : Color.White); if ((double)this.nodes[nodeIndex].highlightFlashTime > 0.0) { this.nodes[nodeIndex].highlightFlashTime -= t; color = Color.Lerp(color, Utils.AddativeWhite, Utils.QuadraticOutCurve(this.nodes[nodeIndex].highlightFlashTime)); } } Vector2 nodeDrawPos = this.GetNodeDrawPos(this.nodes[nodeIndex], nodeIndex); if (this.DimNonConnectedNodes && this.os.connectedComp != null && this.os.connectedComp.ip != this.nodes[nodeIndex].ip) { color *= 0.3f; } if (Button.doButton(2000 + nodeIndex, this.bounds.X + (int)nodeDrawPos.X, this.bounds.Y + (int)nodeDrawPos.Y, NetworkMap.NODE_SIZE, NetworkMap.NODE_SIZE, "", new Color?(color), this.nodes[nodeIndex].adminIP == this.os.thisComputer.ip ? this.adminNodeCircle : this.nodeCircle) && this.os.inputEnabled) { bool flag = false; if (this.os.terminal.preventingExecution && this.os.terminal.executionPreventionIsInteruptable) { this.os.terminal.executeLine(); flag = true; } int nodeindex = nodeIndex; Action action = (Action)(() => this.os.runCommand("connect " + this.nodes[nodeindex].ip)); if (flag) { this.os.delayer.Post(ActionDelayer.NextTick(), action); } else { action(); } } if (GuiData.hot == 2000 + nodeIndex) { num1 = nodeIndex; } if (this.nodes[nodeIndex].idName == this.os.homeAssetServerID && !this.nodes[nodeIndex].disabled) { this.spriteBatch.Draw(this.assetServerNodeOverlay, new Vector2((float)(this.bounds.X + (int)nodeDrawPos.X + NetworkMap.NODE_SIZE / 2), (float)(this.bounds.Y + (int)nodeDrawPos.Y + NetworkMap.NODE_SIZE / 2)), new Rectangle?(), num1 == nodeIndex ? GuiData.Default_Lit_Backing_Color : (this.os.connectedComp == null || this.os.connectedComp != this.nodes[nodeIndex] ? (this.nodes[nodeIndex].Equals((object)this.os.thisComputer) ? this.os.thisComputerNode : this.os.highlightColor) : Color.Black), -0.5f * this.rotation, new Vector2((float)(this.assetServerNodeOverlay.Width / 2)), new Vector2(NetworkMap.ADMIN_CIRCLE_SCALE - 0.22f), SpriteEffects.None, 0.5f); } } } } int nodeIndex1 = this.os.connectedComp == null ? 0 : this.nodes.IndexOf(this.os.connectedComp); if (this.os.connectedComp != null && !this.os.connectedComp.Equals((object)this.os.thisComputer) && !this.os.connectedComp.adminIP.Equals(this.os.thisComputer.ip)) { GuiData.spriteBatch.Draw(this.nodeGlow, this.GetNodeDrawPos(this.os.connectedComp, nodeIndex1) - new Vector2((float)(this.nodeGlow.Width / 2), (float)(this.nodeGlow.Height / 2)) + new Vector2((float)this.bounds.X, (float)this.bounds.Y) + new Vector2((float)(NetworkMap.NODE_SIZE / 2)), this.os.connectedNodeHighlight); if (this.nodeEffect != null && this.os.connectedComp != null) { this.nodeEffect.draw(this.spriteBatch, this.GetNodeDrawPos(this.os.connectedComp, nodeIndex1) + new Vector2((float)(NetworkMap.NODE_SIZE / 2)) + new Vector2((float)this.bounds.X, (float)this.bounds.Y)); } } else if (this.os.connectedComp != null && !this.os.connectedComp.Equals((object)this.os.thisComputer) && this.adminNodeEffect != null) { this.adminNodeEffect.draw(this.spriteBatch, this.GetNodeDrawPos(this.os.connectedComp, nodeIndex1) + new Vector2((float)(NetworkMap.NODE_SIZE / 2)) + new Vector2((float)this.bounds.X, (float)this.bounds.Y)); } if (num1 != -1) { try { int nodeIndex2 = num1; Vector2 nodeDrawPos = this.GetNodeDrawPos(this.nodes[nodeIndex2], nodeIndex2); Vector2 ttpos = new Vector2((float)(this.bounds.X + (int)nodeDrawPos.X + NetworkMap.NODE_SIZE), (float)(this.bounds.Y + (int)nodeDrawPos.Y)); string text = this.nodes[nodeIndex2].getTooltipString(); Vector2 textSize = GuiData.tinyfont.MeasureString(text); this.os.postFXDrawActions += (Action)(() => { GuiData.spriteBatch.Draw(Utils.white, new Rectangle((int)ttpos.X, (int)ttpos.Y, (int)textSize.X, (int)textSize.Y), this.os.netmapToolTipBackground); TextItem.doFontLabel(ttpos, text, GuiData.tinyfont, new Color?(this.os.netmapToolTipColor), float.MaxValue, float.MaxValue, false); }); } catch (Exception ex) { DebugLog.add(ex.ToString()); } } if (!Settings.debugDrawEnabled) { return; } for (int index = 0; index < Corporation.TestedPositions.Count; ++index) { Vector2 nodeDrawPosDebug = this.GetNodeDrawPosDebug(Corporation.TestedPositions[index]); Vector2 position = new Vector2((float)(this.bounds.X + (int)nodeDrawPosDebug.X + NetworkMap.NODE_SIZE), (float)(this.bounds.Y + (int)nodeDrawPosDebug.Y)); GuiData.spriteBatch.Draw(Utils.white, position, new Rectangle?(), Utils.AddativeRed, 0.0f, Vector2.Zero, Vector2.One, SpriteEffects.None, 0.8f); } }
public void doGui(float t) { var num1 = -1; var color1 = os.highlightColor; for (var index1 = 0; index1 < nodes.Count; ++index1) { var nodeDrawPos = GetNodeDrawPos(nodes[index1].location); if (visibleNodes.Contains(index1) && !nodes[index1].disabled) { for (var index2 = 0; index2 < nodes[index1].links.Count; ++index2) { if (visibleNodes.Contains(nodes[index1].links[index2]) && !nodes[nodes[index1].links[index2]].disabled) { drawLine(GetNodeDrawPos(nodes[index1].location), GetNodeDrawPos(nodes[nodes[index1].links[index2]].location), new Vector2(bounds.X, bounds.Y)); } } if (pulseFade > 0.0) { var color2 = os.highlightColor * (pulseFade * pulseFade); if (DimNonConnectedNodes) { color2 = Utils.AddativeRed * 0.5f * (pulseFade * pulseFade); } spriteBatch.Draw(circleOutline, new Vector2(bounds.X + (int)nodeDrawPos.X + NODE_SIZE / 2, bounds.Y + (int)nodeDrawPos.Y + NODE_SIZE / 2), new Rectangle?(), color2, rotation, circleOrigin, new Vector2(ADMIN_CIRCLE_SCALE * (float)(2.0 - 2.0 * pulseFade)), SpriteEffects.None, 0.5f); } if (nodes[index1].idName == os.homeNodeID && !nodes[index1].disabled) { spriteBatch.Draw(homeNodeCircle, new Vector2(bounds.X + (int)nodeDrawPos.X + NODE_SIZE / 2, bounds.Y + (int)nodeDrawPos.Y + NODE_SIZE / 2), new Rectangle?(), os.connectedComp == null || os.connectedComp != nodes[index1] ? (nodes[index1].Equals(os.thisComputer) ? os.thisComputerNode : os.highlightColor) : (nodes[index1].adminIP == os.thisComputer.ip ? Utils.AddativeWhite : Utils.AddativeWhite), -1f * rotation, circleOrigin, new Vector2(ADMIN_CIRCLE_SCALE), SpriteEffects.None, 0.5f); } if (nodes[index1] == lastAddedNode && !nodes[index1].disabled) { var num2 = nodes[index1].adminIP == os.thisComputer.ip ? 1f : 4f; spriteBatch.Draw(targetNodeCircle, new Vector2(bounds.X + (int)nodeDrawPos.X + NODE_SIZE / 2, bounds.Y + (int)nodeDrawPos.Y + NODE_SIZE / 2), new Rectangle?(), os.connectedComp == null || os.connectedComp != nodes[index1] ? (nodes[index1].Equals(os.thisComputer) ? os.thisComputerNode : (nodes[index1].adminIP == os.thisComputer.ip ? os.highlightColor : Utils.AddativeWhite)) : (nodes[index1].adminIP == os.thisComputer.ip ? os.highlightColor : Utils.AddativeWhite), -1f * rotation, circleOrigin, new Vector2(ADMIN_CIRCLE_SCALE) + Vector2.One * ((float)Math.Sin(os.timer * 3.0) * num2) / targetNodeCircle.Height, SpriteEffects.None, 0.5f); } } if (nodes[index1].adminIP == os.thisComputer.ip && !nodes[index1].disabled) { spriteBatch.Draw(nodes[index1].ip.Equals(os.thisComputer.ip) ? adminCircle : nodeGlow, new Vector2(bounds.X + (int)nodeDrawPos.X + NODE_SIZE / 2, bounds.Y + (int)nodeDrawPos.Y + NODE_SIZE / 2), new Rectangle?(), nodes[index1].Equals(os.thisComputer) ? os.thisComputerNode : os.highlightColor, rotation, circleOrigin, new Vector2(ADMIN_CIRCLE_SCALE), SpriteEffects.None, 0.5f); } } lock (nodes) { for (var local_7 = 0; local_7 < nodes.Count; ++local_7) { if (visibleNodes.Contains(local_7) && !nodes[local_7].disabled) { Color local_1_1; if (os.thisComputer.ip == nodes[local_7].ip) { local_1_1 = os.thisComputerNode; } else { local_1_1 = os.connectedComp == null ? (!(nodes[local_7].adminIP == os.thisComputer.ip) || !(nodes[local_7].ip == os.opponentLocation) ? (!os.shellIPs.Contains(nodes[local_7].ip) ? os.highlightColor : os.shellColor) : Color.DarkRed) : (!(os.connectedComp.ip == nodes[local_7].ip) ? (!(nodes[local_7].adminIP == os.thisComputer.ip) || !(nodes[local_7].ip == os.opponentLocation) ? (!os.shellIPs.Contains(nodes[local_7].ip) ? os.highlightColor : os.shellColor) : Color.DarkRed) : Color.White); if (nodes[local_7].highlightFlashTime > 0.0) { nodes[local_7].highlightFlashTime -= t; local_1_1 = Color.Lerp(local_1_1, Utils.AddativeWhite, Utils.QuadraticOutCurve(nodes[local_7].highlightFlashTime)); } } var local_8 = GetNodeDrawPos(nodes[local_7].location); if (DimNonConnectedNodes && os.connectedComp != null && os.connectedComp.ip != nodes[local_7].ip) { local_1_1 *= 0.3f; } if ( Button.doButton(2000 + local_7, bounds.X + (int)local_8.X, bounds.Y + (int)local_8.Y, NODE_SIZE, NODE_SIZE, "", local_1_1, nodes[local_7].adminIP == os.thisComputer.ip ? adminNodeCircle : nodeCircle) && os.inputEnabled) { var local_9 = false; if (os.terminal.preventingExecution && os.terminal.executionPreventionIsInteruptable) { os.terminal.executeLine(); local_9 = true; } var nodeindex = local_7; Action local_10 = () => os.runCommand("connect " + nodes[nodeindex].ip); if (local_9) { os.delayer.Post(ActionDelayer.NextTick(), local_10); } else { local_10(); } } if (GuiData.hot == 2000 + local_7) { num1 = local_7; } if (nodes[local_7].idName == os.homeAssetServerID && !nodes[local_7].disabled) { spriteBatch.Draw(assetServerNodeOverlay, new Vector2(bounds.X + (int)local_8.X + NODE_SIZE / 2, bounds.Y + (int)local_8.Y + NODE_SIZE / 2), new Rectangle?(), num1 == local_7 ? GuiData.Default_Lit_Backing_Color : (os.connectedComp == null || os.connectedComp != nodes[local_7] ? (nodes[local_7].Equals(os.thisComputer) ? os.thisComputerNode : os.highlightColor) : Color.Black), -0.5f * rotation, new Vector2(assetServerNodeOverlay.Width / 2), new Vector2(ADMIN_CIRCLE_SCALE - 0.22f), SpriteEffects.None, 0.5f); } } } } if (os.connectedComp != null && !os.connectedComp.Equals(os.thisComputer) && !os.connectedComp.adminIP.Equals(os.thisComputer.ip)) { GuiData.spriteBatch.Draw(nodeGlow, GetNodeDrawPos(os.connectedComp.location) - new Vector2(nodeGlow.Width / 2, nodeGlow.Height / 2) + new Vector2(bounds.X, bounds.Y) + new Vector2(NODE_SIZE / 2), os.connectedNodeHighlight); if (nodeEffect != null && os.connectedComp != null) { nodeEffect.draw(spriteBatch, GetNodeDrawPos(os.connectedComp.location) + new Vector2(NODE_SIZE / 2) + new Vector2(bounds.X, bounds.Y)); } } else if (os.connectedComp != null && !os.connectedComp.Equals(os.thisComputer) && adminNodeEffect != null) { adminNodeEffect.draw(spriteBatch, GetNodeDrawPos(os.connectedComp.location) + new Vector2(NODE_SIZE / 2) + new Vector2(bounds.X, bounds.Y)); } if (num1 != -1) { try { var index = num1; var nodeDrawPos = GetNodeDrawPos(nodes[index].location); var ttpos = new Vector2(bounds.X + (int)nodeDrawPos.X + NODE_SIZE, bounds.Y + (int)nodeDrawPos.Y); var text = nodes[index].getTooltipString(); var textSize = GuiData.tinyfont.MeasureString(text); os.postFXDrawActions += () => { GuiData.spriteBatch.Draw(Utils.white, new Rectangle((int)ttpos.X, (int)ttpos.Y, (int)textSize.X, (int)textSize.Y), os.netmapToolTipBackground); TextItem.doFontLabel(ttpos, text, GuiData.tinyfont, os.netmapToolTipColor, float.MaxValue, float.MaxValue); }; } catch (Exception ex) { DebugLog.add(ex.ToString()); } } if (!Settings.debugDrawEnabled) { return; } for (var index = 0; index < Corporation.TestedPositions.Count; ++index) { var nodeDrawPos = GetNodeDrawPos(Corporation.TestedPositions[index]); var position = new Vector2(bounds.X + (int)nodeDrawPos.X + NODE_SIZE, bounds.Y + (int)nodeDrawPos.Y); GuiData.spriteBatch.Draw(Utils.white, position, new Rectangle?(), Utils.AddativeRed, 0.0f, Vector2.Zero, Vector2.One, SpriteEffects.None, 0.8f); } }