Exemplo n.º 1
0
        public static void ReDsicoverAllVisibleNodesInOSCache(object osobj)
        {
            OS    os   = (OS)osobj;
            float num1 = 0.0f;
            float num2 = 8f;
            float num3 = num2 / (float)os.netMap.nodes.Count;

            string[] strArray = os.PreDLCVisibleNodesCache.Split(Utils.commaDelim, StringSplitOptions.RemoveEmptyEntries);
            for (int index = 0; index < strArray.Length; ++index)
            {
                try
                {
                    int nIndex = Convert.ToInt32(strArray[index]);
                    os.delayer.Post(ActionDelayer.Wait((double)num1), (Action)(() =>
                    {
                        os.netMap.visibleNodes.Add(nIndex);
                        os.netMap.nodes[nIndex].highlightFlashTime = 1f;
                        SFX.addCircle(os.netMap.nodes[nIndex].getScreenSpacePosition(), Utils.AddativeWhite * 0.4f, 70f);
                    }));
                    os.delayer.Post(ActionDelayer.Wait((double)num2), (Action)(() => SFX.addCircle(os.netMap.nodes[nIndex].getScreenSpacePosition(), Utils.AddativeWhite * 0.3f, 30f)));
                }
                catch (FormatException ex)
                {
                    Console.WriteLine("Error restoring node " + (object)index);
                }
                num1 += num3;
                os.PreDLCVisibleNodesCache = "";
            }
        }
Exemplo n.º 2
0
        private void StartFullDLCTest()
        {
            this.ExitScreen();
            MainMenu.resetOS();
            if (!Settings.soundDisabled)
            {
                this.ScreenManager.playAlertSound();
            }
            OS     os       = new OS();
            string username = "******";

            SaveFileManager.AddUser(username, "test");
            string fileNameForUsername = SaveFileManager.GetSaveFileNameForUsername(username);

            os.IsDLCConventionDemo = true;
            os.Flags.AddFlag("TutorialComplete");
            Settings.EnableDLC         = true;
            Settings.initShowsTutorial = false;
            os.SaveGameUserName        = fileNameForUsername;
            os.SaveUserAccountName     = username;
            os.initShowsTutorial       = false;
            this.ScreenManager.AddScreen((GameScreen)os, new PlayerIndex?(this.ScreenManager.controllingPlayer));
            SessionAccelerator.AccelerateSessionToDLCStart((object)os);
            os.delayer.Post(ActionDelayer.Wait(0.15), (Action)(() => Game1.getSingleton().IsMouseVisible = true));
        }
Exemplo n.º 3
0
        public override void disconnectionDetected(Computer c, OS os)
        {
            base.disconnectionDetected(c, os);
            double time = 20.0 * Utils.random.NextDouble();

            os.delayer.Post(ActionDelayer.Wait(time), (Action)(() =>
            {
                if (os.connectedComp != null && !(os.connectedComp.ip != c.ip))
                {
                    return;
                }
                for (int index = 0; index < c.ports.Count; ++index)
                {
                    c.closePort(c.ports[index], "LOCAL_ADMIN");
                }
                if (this.ResetsPassword)
                {
                    c.setAdminPassword(PortExploits.getRandomPassword());
                }
                c.adminIP = c.ip;
                if (c.firewall != null)
                {
                    c.firewall.solved = false;
                    c.firewall.resetSolutionProgress();
                }
            }));
        }
Exemplo n.º 4
0
 private void doFolderGui(int width, int height, int indexOffset, Folder f, int recItteration)
 {
     for (var i = 0; i < f.folders.Count; ++i)
     {
         if (Button.doButton(300000 + i + indexOffset, x, y, width, height, "/" + f.folders[i].name, new Color?()))
         {
             var num = 0;
             for (var index = 0; index < os.navigationPath.Count - recItteration; ++index)
             {
                 Action action = () => os.runCommand("cd ..");
                 if (num > 0)
                 {
                     os.delayer.Post(ActionDelayer.Wait(num * 1.0), action);
                 }
                 else
                 {
                     action();
                 }
                 ++num;
             }
             Action action1 = () => os.runCommand("cd " + f.folders[i].name);
             if (num > 0)
             {
                 os.delayer.Post(ActionDelayer.Wait(num * 1.0), action1);
             }
             else
             {
                 action1();
             }
         }
         y += height + 2;
         x += 30;
         if (os.navigationPath.Count - 1 >= recItteration && os.navigationPath[recItteration] == i)
         {
             doFolderGui(width - 30, height, indexOffset + 10000 * (i + 1), f.folders[i], recItteration + 1);
         }
         x -= 30;
     }
     for (var index1 = 0; index1 < f.files.Count; ++index1)
     {
         if (Button.doButton(400000 + index1 + indexOffset / 2 + (index1 + 1) * indexOffset, x, y, width, height,
                             f.files[index1].name, new Color?()))
         {
             for (var index2 = 0; index2 < os.navigationPath.Count - recItteration; ++index2)
             {
                 os.runCommand("cd ..");
             }
             os.runCommand("cat " + f.files[index1].name);
         }
         y += height + 2;
     }
     if (f.folders.Count != 0 || f.files.Count != 0)
     {
         return;
     }
     TextItem.doFontLabel(new Vector2(x, y), "-Empty-", GuiData.tinyfont, new Color?(), width, height);
     y += height + 2;
 }
Exemplo n.º 5
0
 private void doFolderGui(int width, int height, int indexOffset, Folder f, int recItteration)
 {
     for (int i = 0; i < f.folders.Count; ++i)
     {
         if (Button.doButton(300000 + i + indexOffset, this.x, this.y, width, height, "/" + f.folders[i].name, new Color?()))
         {
             int num = 0;
             for (int index = 0; index < this.os.navigationPath.Count - recItteration; ++index)
             {
                 Action action = (Action)(() => this.os.runCommand("cd .."));
                 if (num > 0)
                 {
                     this.os.delayer.Post(ActionDelayer.Wait((double)num * 1.0), action);
                 }
                 else
                 {
                     action();
                 }
                 ++num;
             }
             Action action1 = (Action)(() => this.os.runCommand("cd " + f.folders[i].name));
             if (num > 0)
             {
                 this.os.delayer.Post(ActionDelayer.Wait((double)num * 1.0), action1);
             }
             else
             {
                 action1();
             }
         }
         this.y += height + 2;
         this.x += 30;
         if (this.os.navigationPath.Count - 1 >= recItteration && this.os.navigationPath[recItteration] == i)
         {
             this.doFolderGui(width - 30, height, indexOffset + 10000 * (i + 1), f.folders[i], recItteration + 1);
         }
         this.x -= 30;
     }
     for (int index1 = 0; index1 < f.files.Count; ++index1)
     {
         if (Button.doButton(400000 + index1 + indexOffset / 2 + (index1 + 1) * indexOffset, this.x, this.y, width, height, f.files[index1].name, new Color?()))
         {
             for (int index2 = 0; index2 < this.os.navigationPath.Count - recItteration; ++index2)
             {
                 this.os.runCommand("cd ..");
             }
             this.os.runCommand("cat " + f.files[index1].name);
         }
         this.y += height + 2;
     }
     if (f.folders.Count != 0 || f.files.Count != 0)
     {
         return;
     }
     TextItem.doFontLabel(new Vector2((float)this.x, (float)this.y), "-" + LocaleTerms.Loc("Empty") + "-", GuiData.tinyfont, new Color?(), (float)width, (float)height, false);
     this.y += height + 2;
 }
Exemplo n.º 6
0
        private void CompleteAndReturnToMenu()
        {
            this.os.Flags.AddFlag("Victory");
            Programs.disconnect(new string[0], this.os);
            Computer computer = Programs.getComputer(this.os, "porthackHeart");

            this.os.netMap.visibleNodes.Remove(this.os.netMap.nodes.IndexOf(computer));
            computer.disabled = true;
            computer.daemons.Clear();
            computer.ip = NetworkMap.generateRandomIP();
            this.os.terminal.inputLocked = false;
            this.os.ram.inputLocked      = false;
            this.os.netMap.inputLocked   = false;
            this.os.DisableTopBarButtons = false;
            this.os.canRunContent        = true;
            this.IsActive = false;
            ComputerLoader.loadMission("Content/Missions/CreditsMission.xml", false);
            this.os.threadedSaveExecute(false);
            MediaPlayer.IsRepeating = true;
            MusicManager.playSongImmediatley("Music\\Bit(Ending)");
            if (Settings.isPirateBuild)
            {
                this.os.delayer.Post(ActionDelayer.Wait(15.0), (Action)(() =>
                {
                    try
                    {
                        ComputerLoader.loadMission("Content/Missions/CreditsMission_p.xml", false);
                    }
                    catch (Exception ex)
                    {
                    }
                }));
            }
            if (!Settings.sendsDLC1PromoEmailAtEnd)
            {
                return;
            }
            this.os.delayer.Post(ActionDelayer.Wait(30.0), (Action)(() =>
            {
                try
                {
                    string body = Utils.readEntireFile("Content/LocPost/DLCMessage.txt");
                    string subject = "Labyrinths";
                    string sender = "Matt Trobbiani";
                    string email = MailServer.generateEmail(subject, body, sender);
                    MailServer daemon = this.os.netMap.mailServer.getDaemon(typeof(MailServer)) as MailServer;
                    if (daemon == null)
                    {
                        return;
                    }
                    daemon.addMail(email, this.os.defaultUser.name);
                }
                catch (Exception ex)
                {
                }
            }));
        }
Exemplo n.º 7
0
 private void PrepateToClearCorpusOnNavigateAway()
 {
     this.os.delayer.Post(ActionDelayer.Wait(this.os.lastGameTime.ElapsedGameTime.TotalSeconds * 1.999), (Action)(() =>
     {
         if (!(this.os.display.command != this.name))
         {
             return;
         }
         this.corpus = (Corpus)null;
     }));
 }
Exemplo n.º 8
0
 private void MoveToActiveState()
 {
     state                          = SequencerExeState.Active;
     stateTimer                     = 0.0f;
     targetRamUse                   = BASE_RAM_COST;
     os.warningFlashTimer           = OS.WARNING_FLASH_TIME;
     os.netMap.DimNonConnectedNodes = true;
     os.netMap.discoverNode(targetComp);
     os.runCommand("connect " + targetComp.ip);
     os.delayer.Post(ActionDelayer.Wait(0.05), () => os.runCommand("probe"));
 }
Exemplo n.º 9
0
 public void BreakHeart()
 {
     PlayingHeartbreak       = true;
     os.terminal.inputLocked = true;
     os.netMap.inputLocked   = true;
     os.ram.inputLocked      = true;
     os.DisableTopBarButtons = true;
     MusicManager.transitionToSong("Music/Ambient/AmbientDrone_Clipped");
     SpinDownEffect.Play();
     os.delayer.Post(ActionDelayer.Wait(18.0), () => glowSoundEffect.Play());
 }
Exemplo n.º 10
0
 public override void Update(float t)
 {
     base.Update(t);
     elapsedTime += t;
     if (elapsedTime < BLUESCREEN_TIME / 4.0)
     {
         state = 0;
     }
     else if (elapsedTime < (double)BLUESCREEN_TIME)
     {
         state = 1;
     }
     else if (elapsedTime < BLUESCREEN_TIME + (double)BLACK_TIME)
     {
         state = 2;
     }
     else if (elapsedTime < BLUESCREEN_TIME + (double)BLACK_TIME + BOOT_TIME + bootTextErrorDelay)
     {
         state          = 3;
         bootTextTimer -= t;
         if (bootTextTimer <= 0.0)
         {
             bootTextTimer = bootTextDelay - (float)Utils.random.NextDouble() * bootTextDelay +
                             (float)Utils.random.NextDouble() * bootTextDelay;
             ++bootTextCount;
             if (bootTextCount >= bootText.Length - 1)
             {
                 bootTextCount = bootText.Length - 1;
             }
             if (bootText[bootTextCount].Equals(" "))
             {
                 bootTextTimer = bootTextDelay * 12f;
             }
             if (bootText[bootTextCount].StartsWith("ERROR:"))
             {
                 bootTextTimer = bootTextDelay * 29f;
                 os.thisComputer.bootupTick((float)-(bootTextDelay * 42.0));
                 bootTextErrorDelay += bootTextDelay * 42f;
             }
         }
         if (hasPlayedBeep)
         {
             return;
         }
         beep.Play(0.5f, 0.5f, 0.0f);
         os.delayer.Post(ActionDelayer.Wait(0.1), () => beep.Play(0.5f, 0.5f, 0.0f));
         hasPlayedBeep = true;
     }
     else
     {
         state = 2;
     }
 }
Exemplo n.º 11
0
        public virtual void showSourcePressed()
        {
            var str   = "";
            var count = Programs.getNavigationPathAtPath("", os, root).Count;

            for (var index = 0; index < count; ++index)
            {
                str += "../";
            }
            os.runCommand("cd " + (str + "web"));
            os.delayer.Post(ActionDelayer.Wait(0.1), () => os.runCommand("cat " + lastLoadedFile.name));
        }
Exemplo n.º 12
0
 private void RollCredits()
 {
     IsInCredits = true;
     speechinstance.Stop();
     Settings.soundDisabled = false;
     elapsedTime            = 0.0f;
     os.delayer.Post(ActionDelayer.Wait(1.0), () =>
     {
         MusicManager.playSongImmediatley("Music\\Bit(Ending)");
         MediaPlayer.IsRepeating = false;
         AchievementsManager.Unlock("progress_complete", false);
     });
 }
Exemplo n.º 13
0
        public override void disconnectionDetected(Computer c, OS os)
        {
            base.disconnectionDetected(c, os);
            for (var index = 0; index < c.ports.Count; ++index)
            {
                c.closePort(c.ports[index], "LOCAL_ADMIN");
            }
            if (c.firewall != null)
            {
                c.firewall.resetSolutionProgress();
                c.firewall.solved = false;
            }
            if (c.hasProxy)
            {
                c.proxyActive        = true;
                c.proxyOverloadTicks = c.startingOverloadTicks;
            }
            var    time   = 20.0 * Utils.random.NextDouble();
            Action action = () =>
            {
                if (os.connectedComp != null && !(os.connectedComp.ip != c.ip))
                {
                    return;
                }
                for (var index = 0; index < c.ports.Count; ++index)
                {
                    c.closePort(c.ports[index], "LOCAL_ADMIN");
                }
                if (ResetsPassword)
                {
                    c.setAdminPassword(PortExploits.getRandomPassword());
                }
                c.adminIP = c.ip;
                if (c.firewall == null)
                {
                    return;
                }
                c.firewall.resetSolutionProgress();
            };

            if (IsSuper)
            {
                action();
            }
            else
            {
                os.delayer.Post(ActionDelayer.Wait(time), action);
            }
        }
Exemplo n.º 14
0
 public void BreakHeart()
 {
     if (this.os.TraceDangerSequence.IsActive)
     {
         this.os.TraceDangerSequence.CancelTraceDangerSequence();
     }
     this.os.RequestRemovalOfAllPopups();
     this.PlayingHeartbreak       = true;
     this.os.terminal.inputLocked = true;
     this.os.netMap.inputLocked   = true;
     this.os.ram.inputLocked      = true;
     this.os.DisableTopBarButtons = true;
     MusicManager.transitionToSong("Music/Ambient/AmbientDrone_Clipped");
     this.SpinDownEffect.Play();
     this.os.delayer.Post(ActionDelayer.Wait(18.0), (Action)(() => this.glowSoundEffect.Play()));
 }
Exemplo n.º 15
0
        public virtual void showSourcePressed()
        {
            string str   = "";
            int    count = Programs.getNavigationPathAtPath("", this.os, this.root).Count;

            for (int index = 0; index < count; ++index)
            {
                str += "../";
            }
            this.os.runCommand("cd " + (str + "web"));
            if (this.lastLoadedFile == null)
            {
                return;
            }
            this.os.delayer.Post(ActionDelayer.Wait(0.1), (Action)(() => this.os.runCommand("cat " + this.lastLoadedFile.name)));
        }
Exemplo n.º 16
0
        private void CompleteMailPhaseOut()
        {
            this.os.DisableEmailIcon = true;
            SFX.addCircle(this.os.mailicon.pos + new Vector2(20f, 6f), Utils.AddativeRed * 0.8f, 100f);
            for (int index = 0; index < 12; ++index)
            {
                this.os.delayer.Post(ActionDelayer.Wait((double)index / 7.0), (Action)(() => SFX.addCircle(this.os.mailicon.pos + new Vector2(20f, 6f), Utils.AddativeRed * 0.8f, 400f)));
            }
            Vector2 mailIconPos = this.os.mailicon.pos;

            this.explosion.Explode(1500, new Vector2(-0.1f, 3.241593f), mailIconPos, 1f, 8f, 100f, 1600f, 1000f, 1200f, 3f, 7f);
            this.os.delayer.Post(ActionDelayer.Wait(0.1), (Action)(() => this.explosion.Explode(100, new Vector2(-0.1f, 3.241593f), mailIconPos, 1f, 6f, 100f, 1300f, 1000f, 1300f, 3f, 7f)));
            this.BreakSound.Play();
            this.os.topBarIconsColor = this.originalTopBarIconsColor;
            PostProcessor.EndingSequenceFlashOutActive             = false;
            PostProcessor.EndingSequenceFlashOutPercentageComplete = 0.0f;
            this.os.terminal.reset();
        }
Exemplo n.º 17
0
        private IEnumerator <ActionDelayer.Condition> generateOutputPass(int pass, OS os, Computer target)
        {
            target.firewallAnalysisInProgress = true;
            os.write(string.Format(LocaleTerms.Loc("Firewall Analysis Pass {0}"), (object)this.analysisPasses) + "\n");
            yield return(ActionDelayer.Wait(0.03));

            os.write("--------------------");
            yield return(ActionDelayer.Wait(0.03));

            string preceedeString      = "     ";
            double secondsDelayPerLine = 0.08 + 0.06 * (double)pass + (double)this.additionalDelay;

            for (int i = 0; i < this.solutionLength; ++i)
            {
                os.write(preceedeString + this.generateOutputLine(i));
                yield return(ActionDelayer.Wait(secondsDelayPerLine));
            }
            os.write("--------------------\n");
            target.firewallAnalysisInProgress = false;
        }
Exemplo n.º 18
0
        private IEnumerator <ActionDelayer.Condition> generateOutputPass(int pass, OS os, Computer target)
        {
            target.firewallAnalysisInProgress = true;
            os.write("Firewall Analysis Pass " + analysisPasses + "\n");
            yield return(ActionDelayer.Wait(0.03));

            os.write("--------------------");
            yield return(ActionDelayer.Wait(0.03));

            var preceedeString      = "     ";
            var secondsDelayPerLine = 0.08 + 0.06 * pass + additionalDelay;

            for (var i = 0; i < solutionLength; ++i)
            {
                os.write(preceedeString + generateOutputLine(i));
                yield return(ActionDelayer.Wait(secondsDelayPerLine));
            }
            os.write("--------------------\n");
            target.firewallAnalysisInProgress = false;
        }
Exemplo n.º 19
0
 public override void Completed()
 {
     base.Completed();
     IsComplete = true;
     if (targetComp.attatchedDeviceIDs != null)
     {
         var strArray = targetComp.attatchedDeviceIDs.Split(Utils.commaDelim,
                                                            StringSplitOptions.RemoveEmptyEntries);
         var num = 0.0f;
         for (var index = 0; index < strArray.Length; ++index)
         {
             var device = Programs.getComputer(os, strArray[index]);
             if (device != null)
             {
                 Action action = () =>
                 {
                     os.netMap.discoverNode(device);
                     var loc = os.netMap.GetNodeDrawPos(device.location) +
                               new Vector2(os.netMap.bounds.X, os.netMap.bounds.Y) +
                               new Vector2(NetworkMap.NODE_SIZE / 2);
                     SFX.addCircle(loc, os.highlightColor, 120f);
                     os.delayer.Post(ActionDelayer.Wait(0.2), () => SFX.addCircle(loc, os.highlightColor, 80f));
                     os.delayer.Post(ActionDelayer.Wait(0.4), () => SFX.addCircle(loc, os.highlightColor, 65f));
                     os.write("eOS Device \"" + device.name + "\" opened for connection at " + device.ip);
                     ResultTitles.Add(device.name);
                     ResultBodies.Add(device.ip + " " + device.location + "\n" + Guid.NewGuid());
                 };
                 os.delayer.Post(ActionDelayer.Wait(num), action);
                 ++num;
                 ++devicesFound;
             }
         }
     }
     if (devicesFound != 0)
     {
         return;
     }
     isError = true;
 }
        internal static void Execute(object osobj, Computer source, Computer target)
        {
            Console.WriteLine("Breakin Started!");
            PostProcessor.EndingSequenceFlashOutActive             = true;
            PostProcessor.EndingSequenceFlashOutPercentageComplete = 1f;
            OS       os  = (OS)osobj;
            DateTime now = DateTime.Now;

            os.Flags.AddFlag("startupBreakinTrapActivated");
            os.threadedSaveExecute(true);
            HostileHackerBreakinSequence.CopyHostileFileToLocalSystem();
            Console.WriteLine("Copied files to local system...");
            double totalSeconds = (DateTime.Now - now).TotalSeconds;
            double time         = totalSeconds <= 3.0 ? 4.0 - totalSeconds : 1.5;

            os.delayer.Post(ActionDelayer.Wait(time), (Action)(() =>
            {
                PostProcessor.EndingSequenceFlashOutActive = false;
                PostProcessor.EndingSequenceFlashOutPercentageComplete = 0.0f;
                os.thisComputer.crash(source.ip);
            }));
        }
Exemplo n.º 21
0
 private void RollCredits()
 {
     if (this.os.TraceDangerSequence.IsActive)
     {
         this.os.TraceDangerSequence.CancelTraceDangerSequence();
     }
     this.IsInCredits = true;
     if (this.speechinstance != null)
     {
         this.speechinstance.Stop();
     }
     Settings.soundDisabled = false;
     this.elapsedTime       = 0.0f;
     this.os.delayer.Post(ActionDelayer.Wait(1.0), (Action)(() =>
     {
         MusicManager.playSongImmediatley("Music\\Bit(Ending)");
         MediaPlayer.IsRepeating = false;
         AchievementsManager.Unlock("progress_complete", false);
     }));
     PostProcessor.dangerModeEnabled         = false;
     PostProcessor.dangerModePercentComplete = 0.0f;
 }
Exemplo n.º 22
0
 public override void Completed()
 {
     base.Completed();
     this.IsComplete = true;
     if (this.targetComp.attatchedDeviceIDs != null)
     {
         string[] strArray = this.targetComp.attatchedDeviceIDs.Split(Utils.commaDelim, StringSplitOptions.RemoveEmptyEntries);
         float    num      = 0.0f;
         for (int index = 0; index < strArray.Length; ++index)
         {
             Computer device = Programs.getComputer(this.os, strArray[index]);
             if (device != null)
             {
                 Action action = (Action)(() =>
                 {
                     this.os.netMap.discoverNode(device);
                     Vector2 loc = this.os.netMap.GetNodeDrawPos(device) + new Vector2((float)this.os.netMap.bounds.X, (float)this.os.netMap.bounds.Y) + new Vector2((float)(NetworkMap.NODE_SIZE / 2));
                     SFX.addCircle(loc, this.os.highlightColor, 120f);
                     this.os.delayer.Post(ActionDelayer.Wait(0.2), (Action)(() => SFX.addCircle(loc, this.os.highlightColor, 80f)));
                     this.os.delayer.Post(ActionDelayer.Wait(0.4), (Action)(() => SFX.addCircle(loc, this.os.highlightColor, 65f)));
                     this.os.write(string.Format(LocaleTerms.Loc("eOS Device \"{0}\" opened for connection at {1}"), (object)device.name, (object)device.ip));
                     this.ResultTitles.Add(device.name);
                     this.ResultBodies.Add(device.ip + " " + device.location.ToString() + "\n" + Guid.NewGuid().ToString());
                 });
                 this.os.delayer.Post(ActionDelayer.Wait((double)num), action);
                 ++num;
                 ++this.devicesFound;
             }
         }
     }
     if (this.devicesFound != 0)
     {
         return;
     }
     this.isError = true;
 }
Exemplo n.º 23
0
 public static void runCommand(int value, string name)
 {
     assertOS();
     if (name.Equals("addRank"))
     {
         os.currentFaction.addValue(value, os);
         var mail = MailServer.generateEmail("Contract Successful",
             "Congratulations,\nThe client of your recent contract has reported a success, and is pleased with your work.\n" +
             "You are now free to accept further contracts from the contact database.\n" +
             "\nYour Current Ranking is " + os.currentFaction.getRank() + " of " +
             os.currentFaction.getMaxRank() + ".\n" + "\nThankyou,\n -" + os.currentFaction.name,
             os.currentFaction.name + " ReplyBot");
         ((MailServer) os.netMap.mailServer.getDaemon(typeof (MailServer))).addMail(mail, os.defaultUser.name);
     }
     else if (name.StartsWith("addFlags:"))
     {
         foreach (
             var flag in
                 name.Substring("addFlags:".Length)
                     .Split(Utils.commaDelim, StringSplitOptions.RemoveEmptyEntries))
             os.Flags.AddFlag(flag);
     }
     if (name.Equals("triggerThemeHackRevenge"))
         os.delayer.Post(ActionDelayer.Wait(5.0), () =>
         {
             var mail = MailServer.generateEmail("Are you Kidding me?",
                 "Seriously?\n\n" +
                 "You think you can just f**k with my stuff and leave without consequence? Did you think I wouldn't notice?\n" +
                 "\nDid you think I wouldn't FIND you!?\n" +
                 "\nYou're a pathetic scrit kiddie, you couldn't hack a f*****g honeypot without your precious buttons and scrollbars.\n" +
                 "\nSay goodbye to your x-server, idiot." + "\n\nNaix", "*****@*****.**");
             ((MailServer) os.netMap.mailServer.getDaemon(typeof (MailServer))).addMail(mail, os.defaultUser.name);
             os.delayer.Post(ActionDelayer.Wait(24.0), () =>
             {
                 try
                 {
                     HackerScriptExecuter.runScript("ThemeHack.txt", os);
                 }
                 catch (Exception ex)
                 {
                     if (!Settings.recoverFromErrorsSilently)
                         throw ex;
                     os.write("CAUTION: UNSYNDICATED OUTSIDE CONNECTION ATTEMPT");
                     os.write("RECOVERED FROM CONNECTION SUBTERFUGE SUCCESSFULLY");
                     Console.WriteLine("Critical error loading hacker script - aborting");
                 }
             });
         });
     else if (name.Equals("changeSong"))
     {
         switch (value)
         {
             case 2:
                 MusicManager.transitionToSong("Music\\The_Quickening");
                 break;
             case 3:
                 MusicManager.transitionToSong("Music\\TheAlgorithm");
                 break;
             case 4:
                 MusicManager.transitionToSong("Music\\Ryan3");
                 break;
             case 5:
                 MusicManager.transitionToSong("Music\\Bit(Ending)");
                 break;
             case 6:
                 MusicManager.transitionToSong("Music\\Rico_Puestel-Roja_Drifts_By");
                 break;
             case 7:
                 MusicManager.transitionToSong("Music\\out_run_the_wolves");
                 break;
             case 8:
                 MusicManager.transitionToSong("Music\\Irritations");
                 break;
             case 9:
                 MusicManager.transitionToSong("Music\\Broken_Boy");
                 break;
             case 10:
                 MusicManager.transitionToSong("Music\\Ryan10");
                 break;
             case 11:
                 MusicManager.transitionToSong("Music\\tetrameth");
                 break;
             default:
                 MusicManager.transitionToSong("Music\\Revolve");
                 break;
         }
     }
     else if (name.Equals("entropyEndMissionSetup"))
     {
         runCommand(3, "changeSong");
         var comp1 = findComp("corp0#IS");
         var comp2 = findComp("corp0#MF");
         var comp3 = findComp("corp0#BU");
         var fileEntry1 = new FileEntry(Computer.generateBinaryString(5000), "HacknetOS.rar");
         var fileEntry2 = new FileEntry(Computer.generateBinaryString(4000), "HacknetOS_Data.xnb");
         var fileEntry3 = new FileEntry(Computer.generateBinaryString(4000), "HacknetOS_Content.xnb");
         var folder1 = comp1.files.root.folders[2];
         folder1.files.Add(fileEntry1);
         folder1.files.Add(fileEntry2);
         folder1.files.Add(fileEntry3);
         var folder2 = comp2.files.root.folders[2];
         folder2.files.Add(fileEntry1);
         folder2.files.Add(fileEntry2);
         folder2.files.Add(fileEntry3);
         var fileEntry4 = new FileEntry(fileEntry1.data, fileEntry1.name + "_backup");
         var fileEntry5 = new FileEntry(fileEntry2.data, fileEntry2.name + "_backup");
         var fileEntry6 = new FileEntry(fileEntry3.data, fileEntry3.name + "_backup");
         var folder3 = comp3.files.root.folders[2];
         folder3.files.Add(fileEntry4);
         folder3.files.Add(fileEntry5);
         folder3.files.Add(fileEntry6);
         comp1.traceTime = Computer.BASE_TRACE_TIME*7.5f;
         comp3.traceTime = Computer.BASE_TRACE_TIME*7.5f;
         comp2.traceTime = Computer.BASE_TRACE_TIME*7.5f;
         comp2.portsNeededForCrack = 3;
         comp1.portsNeededForCrack = 2;
         comp3.portsNeededForCrack = 2;
         var folder4 = findComp("entropy01").files.root.folders[2];
         folder4.files.Add(new FileEntry(PortExploits.crackExeData[25], "SMTPoverflow.exe"));
         folder4.files.Add(new FileEntry(PortExploits.crackExeData[80], "WebServerWorm.exe"));
     }
     else if (name.Equals("entropyAddSMTPCrack"))
     {
         var f = findComp("entropy01").files.root.folders[2];
         f.files.Add(new FileEntry(PortExploits.crackExeData[25],
             Utils.GetNonRepeatingFilename("SMTPoverflow", ".exe", f)));
         os.saveGame();
     }
     else if (name.Equals("transitionToBitMissions"))
     {
         if (Settings.isDemoMode)
         {
             runCommand(6, "changeSong");
             if (Settings.isPressBuildDemo)
                 ComputerLoader.loadMission("Content/Missions/Demo/PressBuild/DemoMission01.xml");
             else
                 ComputerLoader.loadMission("Content/Missions/Demo/AvconDemo.xml");
         }
         else
             ComputerLoader.loadMission("Content/Missions/BitMission0.xml");
     }
     else if (name.Equals("entropySendCSECInvite"))
         os.delayer.Post(ActionDelayer.Wait(6.0),
             () => ComputerLoader.loadMission("Content/Missions/MainHub/Intro/Intro01.xml"));
     else if (name.Equals("hubBitSetComplete01"))
     {
         os.delayer.Post(ActionDelayer.Wait(4.0), () => runCommand(1, "addRank"));
         runCommand(3, "changeSong");
         os.Flags.AddFlag("csecBitSet01Complete");
     }
     else if (name.Equals("enTechEnableOfflineBackup"))
     {
         var computer = Programs.getComputer(os, "EnTechOfflineBackup");
         Programs.getComputer(os, "EnTechMainframe").links.Add(os.netMap.nodes.IndexOf(computer));
         os.Flags.AddFlag("VaporSequencerEnabled");
         var folder1 = findComp("mainHubAssets").files.root.searchForFolder("bin");
         var folder2 = folder1.searchForFolder("Sequencer");
         if (folder2 == null)
         {
             folder2 = new Folder("Sequencer");
             folder1.folders.Add(folder2);
         }
         if (folder2.searchForFile("Sequencer.exe") != null)
             return;
         folder2.files.Add(new FileEntry(PortExploits.crackExeData[17], "Sequencer.exe"));
     }
     else if (name.Equals("rudeNaixResponse"))
         AchievementsManager.Unlock("rude_response", false);
     else if (name.Equals("assignPlayerToHubServerFaction"))
     {
         os.allFactions.setCurrentFaction("hub", os);
         var computer = Programs.getComputer(os, "mainHub");
         var missionHubServer = (MissionHubServer) computer.getDaemon(typeof (MissionHubServer));
         var userDetail = new UserDetail(os.defaultUser.name, "reptile", 3);
         computer.addNewUser(computer.ip, userDetail);
         missionHubServer.addUser(userDetail);
         os.homeNodeID = "mainHub";
         os.homeAssetServerID = "mainHubAssets";
         runCommand(3, "changeSong");
         os.Flags.AddFlag("CSEC_Member");
         AchievementsManager.Unlock("progress_csec", false);
     }
     else if (name.Equals("assignPlayerToEntropyFaction"))
     {
         runCommand(6, "changeSong");
         AchievementsManager.Unlock("progress_entropy", false);
     }
     else if (name.Equals("assignPlayerToLelzSec"))
     {
         os.homeNodeID = "lelzSecHub";
         os.homeAssetServerID = "lelzSecHub";
         os.Flags.AddFlag("LelzSec_Member");
         AchievementsManager.Unlock("progress_lelz", false);
     }
     else if (name.Equals("lelzSecVictory"))
         AchievementsManager.Unlock("secret_path_complete", false);
     else if (name.Equals("demoFinalMissionEnd"))
     {
         os.exes.Clear();
         PostProcessor.EndingSequenceFlashOutActive = true;
         PostProcessor.EndingSequenceFlashOutPercentageComplete = 1f;
         MusicManager.stop();
         os.delayer.Post(ActionDelayer.Wait(0.2),
             () => os.content.Load<SoundEffect>("Music/Ambient/spiral_gauge_down").Play());
         os.delayer.Post(ActionDelayer.Wait(3.0), () =>
         {
             PostProcessor.dangerModeEnabled = false;
             PostProcessor.dangerModePercentComplete = 0.0f;
             os.ExitScreen();
             os.ScreenManager.AddScreen(new DemoEndScreen());
         });
     }
     else if (name.Equals("demoFinalMissionStart"))
     {
         os.Flags.AddFlag("DemoSequencerEnabled");
         MusicManager.transitionToSong("Music/Ambient/dark_drone_008");
     }
     else if (name.Equals("CSECTesterGameWorldSetup"))
     {
         for (var index = 0; index < PortExploits.services.Count && index < 4; ++index)
             os.thisComputer.files.root.folders[2].files.Add(
                 new FileEntry(PortExploits.crackExeData[PortExploits.portNums[index]],
                     PortExploits.cracks[PortExploits.portNums[index]]));
         for (var index = 0; index < 4; ++index)
         {
             var c = new Computer("DebugShell" + index, NetworkMap.generateRandomIP(),
                 os.netMap.getRandomPosition(), 0, 2, os);
             c.adminIP = os.thisComputer.adminIP;
             os.netMap.nodes.Add(c);
             os.netMap.discoverNode(c);
         }
         os.delayer.Post(ActionDelayer.Wait(0.2), () =>
         {
             os.allFactions.setCurrentFaction("entropy", os);
             os.currentMission = null;
             os.netMap.discoverNode(Programs.getComputer(os, "entropy00"));
             os.netMap.discoverNode(Programs.getComputer(os, "entropy01"));
         });
     }
     else if (name.Equals("EntropyFastFowardSetup"))
     {
         os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[22],
             PortExploits.cracks[22]));
         os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[21],
             PortExploits.cracks[21]));
         for (var index = 0; index < 3; ++index)
         {
             var c = new Computer("DebugShell" + index, NetworkMap.generateRandomIP(),
                 os.netMap.getRandomPosition(), 0, 2, os);
             c.adminIP = os.thisComputer.adminIP;
             os.netMap.nodes.Add(c);
             os.netMap.discoverNode(c);
         }
         os.delayer.Post(ActionDelayer.Wait(0.2), () =>
         {
             os.allFactions.setCurrentFaction("entropy", os);
             os.currentMission = null;
             os.netMap.discoverNode(Programs.getComputer(os, "entropy00"));
             os.netMap.discoverNode(Programs.getComputer(os, "entropy01"));
             var computer = Programs.getComputer(os, "entropy01");
             var userDetail = computer.users[0];
             userDetail.known = true;
             computer.users[0] = userDetail;
             os.allFactions.factions[os.allFactions.currentFaction].playerValue = 2;
             os.delayer.Post(ActionDelayer.Wait(0.2), () =>
             {
                 os.Flags.AddFlag("eosPathStarted");
                 ComputerLoader.loadMission(
                     "Content/Missions/Entropy/StartingSet/eosMissions/eosIntroDelayer.xml");
             });
         });
     }
     else if (name.Equals("CSECFastFowardSetup"))
     {
         os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[22],
             PortExploits.cracks[22]));
         os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[21],
             PortExploits.cracks[21]));
         for (var index = 0; index < 3; ++index)
         {
             var c = new Computer("DebugShell" + index, NetworkMap.generateRandomIP(),
                 os.netMap.getRandomPosition(), 0, 2, os);
             c.adminIP = os.thisComputer.adminIP;
             os.netMap.nodes.Add(c);
             os.netMap.discoverNode(c);
         }
         os.delayer.Post(ActionDelayer.Wait(0.2), () =>
         {
             runCommand(0, "assignPlayerToHubServerFaction");
             os.currentMission = null;
             os.netMap.discoverNode(Programs.getComputer(os, "mainHub"));
             os.netMap.discoverNode(Programs.getComputer(os, "mainHubAssets"));
             var computer = Programs.getComputer(os, "mainHubAssets");
             var userDetail = computer.users[0];
             userDetail.known = true;
             computer.users[0] = userDetail;
         });
     }
     else if (name.Equals("csecAddTraceKill"))
     {
         var folder = findComp("mainHubAssets").files.root.searchForFolder("bin");
         var f = folder.searchForFolder("TK");
         if (f == null)
         {
             f = new Folder("TK");
             folder.folders.Add(f);
         }
         f.files.Add(
             new FileEntry(
                 FileEncrypter.EncryptString(PortExploits.crackExeData[12], "Vapor Trick Enc.", "NULL", "dx122DX",
                     ".exe"), Utils.GetNonRepeatingFilename("TraceKill", ".dec", f)));
         os.Flags.AddFlag("bitPathStarted");
         runCommand(10, "changeSong");
     }
     else if (name.Equals("junebugComplete"))
     {
         var computer = Programs.getComputer(os, "pacemaker01");
         if (computer != null)
         {
             var heartMonitorDaemon = (HeartMonitorDaemon) computer.getDaemon(typeof (HeartMonitorDaemon));
             if (heartMonitorDaemon != null)
                 heartMonitorDaemon.ForceStopBeepSustainSound();
         }
         runCommand(1, "addRank");
     }
     else if (name.Equals("eosIntroMissionSetup"))
     {
         findComp("entropy01")
             .files.root.searchForFolder("bin")
             .files.Add(new FileEntry(PortExploits.crackExeData[13], "eosDeviceScan.exe"));
         os.delayer.Post(ActionDelayer.Wait(8.0), () =>
         {
             var mail = MailServer.generateEmail("Fwd: eOS Stuff",
                 Utils.readEntireFile("Content/Post/eosScannerMail.txt"), "vtfx", new List<string>(new string[1]
                 {
                     "note#%#eOS Security Basics#%#" +
                     ("1: Get admin access to a computer that you suspect has an eOS device sync'd to it\n" +
                      "2: Run eosdevicescanner.exe\nto scan for paired devices and automatically open connection ports\n" +
                      "3: connect to the revealed device\n" +
                      "3: login with\nuser: \"admin\"\npassword: \"alpine\"\n\n" +
                      "The password is the same for all eOS devices!")
                 }));
             ((MailServer) os.netMap.mailServer.getDaemon(typeof (MailServer))).addMail(mail, os.defaultUser.name);
         });
         runCommand(4, "changeSong");
         os.saveGame();
     }
     else
     {
         if (!name.Equals("eosIntroEndFunc"))
             return;
         runCommand(1, "addRank");
         var missionListingServer =
             (MissionListingServer) findComp("entropy00").getDaemon(typeof (MissionListingServer));
         var list = os.branchMissions;
         var m =
             (ActiveMission)
                 ComputerLoader.readMission(
                     "Content/Missions/Entropy/StartingSet/eosMissions/eosAddedMission.xml");
         missionListingServer.addMisison(m);
         os.branchMissions = list;
     }
 }
Exemplo n.º 24
0
        public static void runCommand(int value, string name)
        {
            MissionFunctions.assertOS();
            if (name.ToLower().Trim() == "none")
            {
                return;
            }
            if (name.Equals("addRank"))
            {
                if (!OS.TestingPassOnly || MissionFunctions.os.currentFaction != null)
                {
                    MissionFunctions.os.currentFaction.addValue(value, (object)MissionFunctions.os);
                    string email = MailServer.generateEmail(LocaleTerms.Loc("Contract Successful"), string.Format(Utils.readEntireFile("Content/LocPost/MissionCompleteEmail.txt"), (object)MissionFunctions.os.currentFaction.getRank(), (object)MissionFunctions.os.currentFaction.getMaxRank(), (object)MissionFunctions.os.currentFaction.name), MissionFunctions.os.currentFaction.name + " ReplyBot");
                    ((MailServer)MissionFunctions.os.netMap.mailServer.getDaemon(typeof(MailServer))).addMail(email, MissionFunctions.os.defaultUser.name);
                }
                else if (OS.DEBUG_COMMANDS && MissionFunctions.os.currentFaction == null)
                {
                    MissionFunctions.os.write("----------");
                    MissionFunctions.os.write("----------");
                    MissionFunctions.os.write("ERROR IN FUNCTION 'addRank'");
                    MissionFunctions.os.write("Player is not assigned to a faction, so rank cannot be added!");
                    MissionFunctions.os.write("Make sure you have assigned a player a faction with the 'SetFaction' function before using this!");
                    MissionFunctions.os.write("----------");
                    MissionFunctions.os.write("----------");
                }
            }
            else if (name.Equals("addRankSilent"))
            {
                if (OS.TestingPassOnly && MissionFunctions.os.currentFaction == null)
                {
                    return;
                }
                MissionFunctions.os.currentFaction.addValue(value, (object)MissionFunctions.os);
            }
            else if (name.StartsWith("addFlags:"))
            {
                foreach (string flag in name.Substring("addFlags:".Length).Split(Utils.commaDelim, StringSplitOptions.RemoveEmptyEntries))
                {
                    MissionFunctions.os.Flags.AddFlag(flag);
                }
                CustomFaction currentFaction = MissionFunctions.os.currentFaction as CustomFaction;
                if (currentFaction == null)
                {
                    return;
                }
                currentFaction.CheckForAllCustomActionsToRun((object)MissionFunctions.os);
            }
            else if (name.StartsWith("removeFlags:"))
            {
                string[] strArray = name.Substring("removeFlags:".Length).Split(Utils.commaDelim, StringSplitOptions.RemoveEmptyEntries);
                for (int index = 0; index < strArray.Length; ++index)
                {
                    if (MissionFunctions.os.Flags.HasFlag(strArray[index]))
                    {
                        MissionFunctions.os.Flags.RemoveFlag(strArray[index]);
                    }
                }
                CustomFaction currentFaction = MissionFunctions.os.currentFaction as CustomFaction;
                if (currentFaction == null)
                {
                    return;
                }
                currentFaction.CheckForAllCustomActionsToRun((object)MissionFunctions.os);
            }
            else if (name.StartsWith("setFaction:"))
            {
                string newFaction = name.Substring("setFaction:".Length);
                bool   flag       = false;
                foreach (KeyValuePair <string, Faction> faction in MissionFunctions.os.allFactions.factions)
                {
                    if (faction.Value.idName.ToLower() == newFaction.ToLower())
                    {
                        MissionFunctions.os.allFactions.setCurrentFaction(newFaction, MissionFunctions.os);
                        flag = true;
                        break;
                    }
                }
                if (!flag && OS.TestingPassOnly)
                {
                    throw new NullReferenceException("Faction " + newFaction + "not found for setFaction action!");
                }
            }
            else if (name.StartsWith("loadConditionalActions:"))
            {
                RunnableConditionalActions.LoadIntoOS(name.Substring("loadConditionalActions:".Length), (object)MissionFunctions.os);
            }
            else if (name.Equals("triggerThemeHackRevenge"))
            {
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(5.0), (Action)(() =>
                {
                    string email = MailServer.generateEmail(LocaleTerms.Loc("Are you Kidding me?"), Utils.readEntireFile("Content/LocPost/NaixEmail.txt"), "*****@*****.**");
                    ((MailServer)MissionFunctions.os.netMap.mailServer.getDaemon(typeof(MailServer))).addMail(email, MissionFunctions.os.defaultUser.name);
                    MissionFunctions.os.delayer.Post(ActionDelayer.Wait(24.0), (Action)(() =>
                    {
                        try
                        {
                            HackerScriptExecuter.runScript("HackerScripts/ThemeHack.txt", (object)MissionFunctions.os, (string)null, (string)null);
                        }
                        catch (Exception ex)
                        {
                            if (!Settings.recoverFromErrorsSilently)
                            {
                                throw ex;
                            }
                            MissionFunctions.os.write("CAUTION: UNSYNDICATED OUTSIDE CONNECTION ATTEMPT");
                            MissionFunctions.os.write("RECOVERED FROM CONNECTION SUBTERFUGE SUCCESSFULLY");
                            Console.WriteLine("Critical error loading hacker script - aborting");
                        }
                    }));
                }));
            }
            else if (name.Equals("changeSong"))
            {
                switch (value)
                {
                case 2:
                    MusicManager.transitionToSong("Music\\The_Quickening");
                    break;

                case 3:
                    MusicManager.transitionToSong("Music\\TheAlgorithm");
                    break;

                case 4:
                    MusicManager.transitionToSong("Music\\Ryan3");
                    break;

                case 5:
                    MusicManager.transitionToSong("Music\\Bit(Ending)");
                    break;

                case 6:
                    MusicManager.transitionToSong("Music\\Rico_Puestel-Roja_Drifts_By");
                    break;

                case 7:
                    MusicManager.transitionToSong("Music\\out_run_the_wolves");
                    break;

                case 8:
                    MusicManager.transitionToSong("Music\\Irritations");
                    break;

                case 9:
                    MusicManager.transitionToSong("Music\\Broken_Boy");
                    break;

                case 10:
                    MusicManager.transitionToSong("Music\\Ryan10");
                    break;

                case 11:
                    MusicManager.transitionToSong("Music\\tetrameth");
                    break;

                default:
                    MusicManager.transitionToSong("Music\\Revolve");
                    break;
                }
            }
            else if (name.Equals("entropyEndMissionSetup"))
            {
                MissionFunctions.runCommand(3, "changeSong");
                Computer  comp1      = MissionFunctions.findComp("corp0#IS");
                Computer  comp2      = MissionFunctions.findComp("corp0#MF");
                Computer  comp3      = MissionFunctions.findComp("corp0#BU");
                FileEntry fileEntry1 = new FileEntry(Computer.generateBinaryString(5000), "HacknetOS.rar");
                FileEntry fileEntry2 = new FileEntry(Computer.generateBinaryString(4000), "HacknetOS_Data.xnb");
                FileEntry fileEntry3 = new FileEntry(Computer.generateBinaryString(4000), "HacknetOS_Content.xnb");
                Folder    folder1    = comp1.files.root.folders[2];
                folder1.files.Add(fileEntry1);
                folder1.files.Add(fileEntry2);
                folder1.files.Add(fileEntry3);
                Folder folder2 = comp2.files.root.folders[2];
                folder2.files.Add(fileEntry1);
                folder2.files.Add(fileEntry2);
                folder2.files.Add(fileEntry3);
                FileEntry fileEntry4 = new FileEntry(fileEntry1.data, fileEntry1.name + "_backup");
                FileEntry fileEntry5 = new FileEntry(fileEntry2.data, fileEntry2.name + "_backup");
                FileEntry fileEntry6 = new FileEntry(fileEntry3.data, fileEntry3.name + "_backup");
                Folder    folder3    = comp3.files.root.folders[2];
                folder3.files.Add(fileEntry4);
                folder3.files.Add(fileEntry5);
                folder3.files.Add(fileEntry6);
                comp1.traceTime           = Computer.BASE_TRACE_TIME * 7.5f;
                comp3.traceTime           = Computer.BASE_TRACE_TIME * 7.5f;
                comp2.traceTime           = Computer.BASE_TRACE_TIME * 7.5f;
                comp2.portsNeededForCrack = 3;
                comp1.portsNeededForCrack = 2;
                comp3.portsNeededForCrack = 2;
                Folder folder4 = MissionFunctions.findComp("entropy01").files.root.folders[2];
                folder4.files.Add(new FileEntry(PortExploits.crackExeData[25], "SMTPoverflow.exe"));
                folder4.files.Add(new FileEntry(PortExploits.crackExeData[80], "WebServerWorm.exe"));
            }
            else if (name.Equals("entropyAddSMTPCrack"))
            {
                Folder folder = MissionFunctions.findComp("entropy01").files.root.folders[2];
                bool   flag   = false;
                for (int index = 0; index < folder.files.Count; ++index)
                {
                    if (folder.files[index].data == PortExploits.crackExeData[25] || folder.files[index].name == "SMTPoverflow.exe")
                    {
                        flag = true;
                    }
                }
                if (!flag)
                {
                    folder.files.Add(new FileEntry(PortExploits.crackExeData[25], Utils.GetNonRepeatingFilename("SMTPoverflow", ".exe", folder)));
                }
                MissionFunctions.os.Flags.AddFlag("ThemeHackTransitionAssetsAdded");
            }
            else if (name.Equals("transitionToBitMissions"))
            {
                if (Settings.isDemoMode)
                {
                    MissionFunctions.runCommand(6, "changeSong");
                    if (Settings.isPressBuildDemo)
                    {
                        ComputerLoader.loadMission("Content/Missions/Demo/PressBuild/DemoMission01.xml", false);
                    }
                    else
                    {
                        ComputerLoader.loadMission("Content/Missions/Demo/AvconDemo.xml", false);
                    }
                }
                else
                {
                    ComputerLoader.loadMission("Content/Missions/BitMission0.xml", false);
                }
            }
            else if (name.Equals("entropySendCSECInvite"))
            {
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(6.0), (Action)(() => ComputerLoader.loadMission("Content/Missions/MainHub/Intro/Intro01.xml", false)));
            }
            else if (name.Equals("hubBitSetComplete01"))
            {
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(4.0), (Action)(() => MissionFunctions.runCommand(1, "addRank")));
                MissionFunctions.runCommand(3, "changeSong");
                MissionFunctions.os.Flags.AddFlag("csecBitSet01Complete");
            }
            else if (name.Equals("enTechEnableOfflineBackup"))
            {
                Programs.getComputer(MissionFunctions.os, "EnTechOfflineBackup");
                MissionFunctions.os.Flags.AddFlag("VaporSequencerEnabled");
                Folder folder1 = MissionFunctions.findComp("mainHubAssets").files.root.searchForFolder("bin");
                Folder folder2 = folder1.searchForFolder("Sequencer");
                if (folder2 == null)
                {
                    folder2 = new Folder("Sequencer");
                    folder1.folders.Add(folder2);
                }
                if (folder2.searchForFile("Sequencer.exe") != null)
                {
                    return;
                }
                folder2.files.Add(new FileEntry(PortExploits.crackExeData[17], "Sequencer.exe"));
            }
            else if (name.Equals("rudeNaixResponse"))
            {
                AchievementsManager.Unlock("rude_response", false);
            }
            else if (name.Equals("assignPlayerToHubServerFaction"))
            {
                MissionFunctions.os.allFactions.setCurrentFaction("hub", MissionFunctions.os);
                Computer         computer   = Programs.getComputer(MissionFunctions.os, "mainHub");
                MissionHubServer daemon     = (MissionHubServer)computer.getDaemon(typeof(MissionHubServer));
                UserDetail       userDetail = new UserDetail(MissionFunctions.os.defaultUser.name, "reptile", (byte)3);
                computer.addNewUser(computer.ip, userDetail);
                daemon.addUser(userDetail);
                MissionFunctions.os.homeNodeID        = "mainHub";
                MissionFunctions.os.homeAssetServerID = "mainHubAssets";
                MissionFunctions.runCommand(3, "changeSong");
                MissionFunctions.os.Flags.AddFlag("CSEC_Member");
                AchievementsManager.Unlock("progress_csec", false);
                if (!MissionFunctions.os.HasLoadedDLCContent || !Settings.EnableDLC || MissionFunctions.os.Flags.HasFlag("dlc_complete"))
                {
                    return;
                }
                daemon.AddMissionToListings("Content/DLC/Missions/BaseGameConnectors/Missions/CSEC_DLCConnectorIntro.xml", 1);
            }
            else if (name.Equals("assignPlayerToEntropyFaction"))
            {
                MissionFunctions.runCommand(6, "changeSong");
                MissionFunctions.os.homeNodeID        = "entropy00";
                MissionFunctions.os.homeAssetServerID = "entropy01";
                AchievementsManager.Unlock("progress_entropy", false);
            }
            else if (name.Equals("assignPlayerToLelzSec"))
            {
                MissionFunctions.os.homeNodeID        = "lelzSecHub";
                MissionFunctions.os.homeAssetServerID = "lelzSecHub";
                MissionFunctions.os.Flags.AddFlag("LelzSec_Member");
                AchievementsManager.Unlock("progress_lelz", false);
            }
            else if (name.Equals("lelzSecVictory"))
            {
                AchievementsManager.Unlock("secret_path_complete", false);
            }
            else if (name.Equals("demoFinalMissionEnd"))
            {
                MissionFunctions.os.exes.Clear();
                PostProcessor.EndingSequenceFlashOutActive             = true;
                PostProcessor.EndingSequenceFlashOutPercentageComplete = 1f;
                MusicManager.stop();
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.2), (Action)(() => MissionFunctions.os.content.Load <SoundEffect>("Music/Ambient/spiral_gauge_down").Play()));
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(3.0), (Action)(() =>
                {
                    PostProcessor.dangerModeEnabled = false;
                    PostProcessor.dangerModePercentComplete = 0.0f;
                    MissionFunctions.os.ExitScreen();
                    MissionFunctions.os.ScreenManager.AddScreen((GameScreen) new DemoEndScreen());
                }));
            }
            else if (name.Equals("demoFinalMissionEndDLC"))
            {
                if (!Settings.isDemoMode)
                {
                    return;
                }
                MissionFunctions.os.exes.Clear();
                PostProcessor.EndingSequenceFlashOutActive             = true;
                PostProcessor.EndingSequenceFlashOutPercentageComplete = 1f;
                MusicManager.stop();
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.0), (Action)(() => MissionFunctions.os.content.Load <SoundEffect>("SFX/BrightFlash").Play()));
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.4), (Action)(() => MissionFunctions.os.content.Load <SoundEffect>("SFX/TraceKill").Play()));
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(1.6), (Action)(() =>
                {
                    MusicManager.playSongImmediatley("DLC/Music/DreamHead");
                    PostProcessor.dangerModeEnabled = false;
                    PostProcessor.dangerModePercentComplete = 0.0f;
                    MissionFunctions.os.ScreenManager.AddScreen((GameScreen) new DemoEndScreen()
                    {
                        StopsMusic = false,
                        IsDLCDemoScreen = true
                    });
                    MissionFunctions.os.ExitScreen();
                }));
            }
            else if (name.Equals("demoFinalMissionStart"))
            {
                MissionFunctions.os.Flags.AddFlag("DemoSequencerEnabled");
                MusicManager.transitionToSong("Music/Ambient/dark_drone_008");
            }
            else if (name.Equals("CSECTesterGameWorldSetup"))
            {
                for (int index = 0; index < PortExploits.services.Count && index < 4; ++index)
                {
                    MissionFunctions.os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[PortExploits.portNums[index]], PortExploits.cracks[PortExploits.portNums[index]]));
                }
                for (int index = 0; index < 4; ++index)
                {
                    Computer c = new Computer("DebugShell" + (object)index, NetworkMap.generateRandomIP(), MissionFunctions.os.netMap.getRandomPosition(), 0, (byte)2, MissionFunctions.os);
                    c.adminIP = MissionFunctions.os.thisComputer.adminIP;
                    MissionFunctions.os.netMap.nodes.Add(c);
                    MissionFunctions.os.netMap.discoverNode(c);
                }
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.2), (Action)(() =>
                {
                    MissionFunctions.os.allFactions.setCurrentFaction("entropy", MissionFunctions.os);
                    MissionFunctions.os.currentMission = (ActiveMission)null;
                    MissionFunctions.os.netMap.discoverNode(Programs.getComputer(MissionFunctions.os, "entropy00"));
                    MissionFunctions.os.netMap.discoverNode(Programs.getComputer(MissionFunctions.os, "entropy01"));
                }));
            }
            else if (name.Equals("EntropyFastFowardSetup"))
            {
                MissionFunctions.os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[22], PortExploits.cracks[22]));
                MissionFunctions.os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[21], PortExploits.cracks[21]));
                for (int index = 0; index < 3; ++index)
                {
                    Computer c = new Computer("DebugShell" + (object)index, NetworkMap.generateRandomIP(), MissionFunctions.os.netMap.getRandomPosition(), 0, (byte)2, MissionFunctions.os);
                    c.adminIP = MissionFunctions.os.thisComputer.adminIP;
                    MissionFunctions.os.netMap.nodes.Add(c);
                    MissionFunctions.os.netMap.discoverNode(c);
                }
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.2), (Action)(() =>
                {
                    MissionFunctions.os.allFactions.setCurrentFaction("entropy", MissionFunctions.os);
                    MissionFunctions.os.currentMission = (ActiveMission)null;
                    MissionFunctions.os.netMap.discoverNode(Programs.getComputer(MissionFunctions.os, "entropy00"));
                    MissionFunctions.os.netMap.discoverNode(Programs.getComputer(MissionFunctions.os, "entropy01"));
                    Computer computer = Programs.getComputer(MissionFunctions.os, "entropy01");
                    UserDetail user = computer.users[0];
                    user.known = true;
                    computer.users[0] = user;
                    MissionFunctions.os.allFactions.factions[MissionFunctions.os.allFactions.currentFaction].playerValue = 2;
                    MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.2), (Action)(() =>
                    {
                        MissionFunctions.os.Flags.AddFlag("eosPathStarted");
                        ComputerLoader.loadMission("Content/Missions/Entropy/StartingSet/eosMissions/eosIntroDelayer.xml", false);
                    }));
                }));
            }
            else if (name.Equals("CSECFastFowardSetup"))
            {
                MissionFunctions.os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[22], PortExploits.cracks[22]));
                MissionFunctions.os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[21], PortExploits.cracks[21]));
                for (int index = 0; index < 3; ++index)
                {
                    Computer c = new Computer("DebugShell" + (object)index, NetworkMap.generateRandomIP(), MissionFunctions.os.netMap.getRandomPosition(), 0, (byte)2, MissionFunctions.os);
                    c.adminIP = MissionFunctions.os.thisComputer.adminIP;
                    MissionFunctions.os.netMap.nodes.Add(c);
                    MissionFunctions.os.netMap.discoverNode(c);
                }
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.2), (Action)(() =>
                {
                    MissionFunctions.runCommand(0, "assignPlayerToHubServerFaction");
                    MissionFunctions.os.currentMission = (ActiveMission)null;
                    MissionFunctions.os.netMap.discoverNode(Programs.getComputer(MissionFunctions.os, "mainHub"));
                    MissionFunctions.os.netMap.discoverNode(Programs.getComputer(MissionFunctions.os, "mainHubAssets"));
                    Computer computer = Programs.getComputer(MissionFunctions.os, "mainHubAssets");
                    UserDetail user = computer.users[0];
                    user.known = true;
                    computer.users[0] = user;
                }));
            }
            else if (name.Equals("csecAddTraceKill"))
            {
                Folder folder = MissionFunctions.findComp("mainHubAssets").files.root.searchForFolder("bin");
                Folder f      = folder.searchForFolder("TK");
                if (f == null)
                {
                    f = new Folder("TK");
                    folder.folders.Add(f);
                }
                f.files.Add(new FileEntry(FileEncrypter.EncryptString(PortExploits.crackExeData[12], "Vapor Trick Enc.", "NULL", "dx122DX", ".exe"), Utils.GetNonRepeatingFilename("TraceKill", ".dec", f)));
                MissionFunctions.os.Flags.AddFlag("bitPathStarted");
                MissionFunctions.runCommand(10, "changeSong");
            }
            else if (name.Equals("junebugComplete"))
            {
                Computer computer = Programs.getComputer(MissionFunctions.os, "pacemaker01");
                if (computer != null)
                {
                    HeartMonitorDaemon daemon = (HeartMonitorDaemon)computer.getDaemon(typeof(HeartMonitorDaemon));
                    if (daemon != null)
                    {
                        daemon.ForceStopBeepSustainSound();
                    }
                }
                MissionFunctions.runCommand(1, "addRank");
            }
            else if (name.Equals("eosIntroMissionSetup"))
            {
                MissionFunctions.findComp("entropy01").files.root.searchForFolder("bin").files.Add(new FileEntry(PortExploits.crackExeData[13], "eosDeviceScan.exe"));
                MissionFunctions.os.delayer.Post(ActionDelayer.Wait(8.0), (Action)(() =>
                {
                    string email = MailServer.generateEmail("Fwd: eOS Stuff", Utils.readEntireFile("Content/Post/eosScannerMail.txt"), "vtfx", new List <string>((IEnumerable <string>) new string[1] {
                        "note#%#" + LocaleTerms.Loc("eOS Security Basics") + "#%#" + Utils.readEntireFile("Content/LocPost/eOSNote.txt")
                    }));
                    ((MailServer)MissionFunctions.os.netMap.mailServer.getDaemon(typeof(MailServer))).addMail(email, MissionFunctions.os.defaultUser.name);
                    MissionFunctions.os.saveGame();
                }));
                MissionFunctions.runCommand(4, "changeSong");
                MissionFunctions.os.saveGame();
            }
            else if (name.Equals("eosIntroEndFunc"))
            {
                MissionFunctions.runCommand(1, "addRank");
                MissionListingServer daemon         = (MissionListingServer)MissionFunctions.findComp("entropy00").getDaemon(typeof(MissionListingServer));
                List <ActiveMission> branchMissions = MissionFunctions.os.branchMissions;
                ActiveMission        m = (ActiveMission)ComputerLoader.readMission("Content/Missions/Entropy/StartingSet/eosMissions/eosAddedMission.xml");
                daemon.addMisison(m, false);
                MissionFunctions.os.branchMissions = branchMissions;
            }
            else if (name.Equals("changeSongDLC"))
            {
                switch (value)
                {
                case 2:
                    MusicManager.transitionToSong("DLC\\Music\\snidelyWhiplash");
                    break;

                case 3:
                    MusicManager.transitionToSong("DLC\\Music\\Slow_Motion");
                    break;

                case 4:
                    MusicManager.transitionToSong("DLC\\Music\\World_Chase");
                    break;

                case 5:
                    MusicManager.transitionToSong("DLC\\Music\\HOME_Resonance");
                    break;

                case 6:
                    MusicManager.transitionToSong("DLC\\Music\\Remi_Finale");
                    break;

                case 7:
                    MusicManager.transitionToSong("DLC\\Music\\RemiDrone");
                    break;

                case 8:
                    MusicManager.transitionToSong("DLC\\Music\\DreamHead");
                    break;

                case 9:
                    MusicManager.transitionToSong("DLC\\Music\\Userspacelike");
                    break;

                case 10:
                    MusicManager.transitionToSong("DLC\\Music\\CrashTrack");
                    break;

                default:
                    MusicManager.transitionToSong("DLC\\Music\\Remi2");
                    break;
                }
            }
            else if (name.Equals("scanAndStartDLCVenganceHack"))
            {
                Computer comp = MissionFunctions.findComp("dAttackTarget");
                if (comp == null)
                {
                    return;
                }
                Folder folder = comp.files.root.searchForFolder("log");
                bool   flag   = false;
                for (int index = 0; index < folder.files.Count; ++index)
                {
                    if (folder.files[index].data.Contains(MissionFunctions.os.thisComputer.ip))
                    {
                        SARunFunction saRunFunction = new SARunFunction()
                        {
                            DelayHost = "dhs", FunctionName = "triggerDLCHackRevenge", FunctionValue = 1
                        };
                        ((DLCHubServer)Programs.getComputer(MissionFunctions.os, "dhs").getDaemon(typeof(DLCHubServer))).DelayedActions.AddAction((SerializableAction)saRunFunction, 16f);
                        break;
                    }
                }
                if (!flag)
                {
                    MissionFunctions.runCommand(4, "changeSongDLC");
                }
            }
            else if (name.Equals("triggerDLCHackRevenge"))
            {
                try
                {
                    HackerScriptExecuter.runScript("DLC/ActionScripts/Hackers/SystemHack.txt", (object)MissionFunctions.os, (string)null, (string)null);
                }
                catch (Exception ex)
                {
                    if (!Settings.recoverFromErrorsSilently)
                    {
                        throw ex;
                    }
                    MissionFunctions.os.write("CAUTION: UNSYNDICATED OUTSIDE CONNECTION ATTEMPT");
                    MissionFunctions.os.write("RECOVERED FROM CONNECTION SUBTERFUGE SUCCESSFULLY");
                    Console.WriteLine("Critical error loading hacker script - aborting\r\n" + Utils.GenerateReportFromException(ex));
                }
            }
            else if (name.Equals("activateAircraftStatusOverlay"))
            {
                MissionFunctions.os.AircraftInfoOverlay.Activate();
                MissionFunctions.os.AircraftInfoOverlay.IsMonitoringDLCEndingCases = true;
            }
            else if (name.Equals("activateAircraftStatusOverlayLabyrinthsMonitoring"))
            {
                MissionFunctions.os.AircraftInfoOverlay.IsMonitoringDLCEndingCases = true;
            }
            else if (name.Equals("deActivateAircraftStatusOverlay"))
            {
                MissionFunctions.os.AircraftInfoOverlay.IsActive = false;
                MissionFunctions.os.AircraftInfoOverlay.IsMonitoringDLCEndingCases = false;
                MissionFunctions.os.Flags.AddFlag("AircraftInfoOverlayDeactivated");
            }
            else if (name.Equals("defAttackAircraft"))
            {
                Computer computer = Programs.getComputer(MissionFunctions.os, "dair_crash");
                Folder   folder   = computer.files.root.searchForFolder("FlightSystems");
                for (int index = 0; index < folder.files.Count; ++index)
                {
                    if (folder.files[index].name == "747FlightOps.dll")
                    {
                        folder.files.RemoveAt(index);
                        break;
                    }
                }
                ((AircraftDaemon)computer.getDaemon(typeof(AircraftDaemon))).StartReloadFirmware();
                if (MissionFunctions.os.AircraftInfoOverlay.IsActive)
                {
                    return;
                }
                MissionFunctions.os.AircraftInfoOverlay.Activate();
                MissionFunctions.os.AircraftInfoOverlay.IsMonitoringDLCEndingCases = true;
            }
            else if (name.Equals("playAirlineCrashSongSequence"))
            {
                MusicManager.playSongImmediatley("DLC\\Music\\Remi_Finale");
                MediaPlayer.IsRepeating = false;
            }
            else if (name.Equals("flashUI"))
            {
                MissionFunctions.os.warningFlash();
            }
            else if (name.Equals("addRankSilent"))
            {
                MissionFunctions.os.currentFaction.addValue(value, (object)MissionFunctions.os);
            }
            else if (name.StartsWith("addRankFaction:"))
            {
                string str = name.Substring("addRankFaction:".Length);
                foreach (KeyValuePair <string, Faction> faction in MissionFunctions.os.allFactions.factions)
                {
                    if (faction.Value.idName.ToLower() == str.ToLower())
                    {
                        faction.Value.addValue(value, (object)MissionFunctions.os);
                        break;
                    }
                }
            }
            else if (name.StartsWith("setHubServer:"))
            {
                string str = name.Substring("setHubServer:".Length);
                MissionFunctions.os.homeNodeID = str;
            }
            else if (name.StartsWith("setAssetServer:"))
            {
                string str = name.Substring("setAssetServer:".Length);
                MissionFunctions.os.homeAssetServerID = str;
            }
            else if (name.StartsWith("playCustomSong:"))
            {
                string songName = Utils.GetFileLoadPrefix() + name.Substring("playCustomSong:".Length);
                if (songName.EndsWith(".ogg"))
                {
                    songName = songName.Substring(0, songName.Length - ".ogg".Length);
                }
                if (songName.StartsWith("Content"))
                {
                    songName = songName.Substring("Content/".Length);
                }
                else if (songName.StartsWith("Extensions"))
                {
                    songName = "../" + songName;
                }
                MusicManager.transitionToSong(songName);
            }
            else if (name.StartsWith("playCustomSongImmediatley:"))
            {
                string songname = Utils.GetFileLoadPrefix() + name.Substring("playCustomSongImmediatley:".Length);
                if (songname.EndsWith(".ogg"))
                {
                    songname = songname.Substring(0, songname.Length - ".ogg".Length);
                }
                if (songname.StartsWith("Content"))
                {
                    songname = songname.Substring("Content/".Length);
                }
                else if (songname.StartsWith("Extensions"))
                {
                    songname = "../" + songname;
                }
                MusicManager.playSongImmediatley(songname);
            }
            else
            {
                if (OS.TestingPassOnly && !string.IsNullOrWhiteSpace(name))
                {
                    throw new FormatException("No Command Function " + name);
                }
                if (MissionFunctions.ReportErrorInCommand != null)
                {
                    MissionFunctions.ReportErrorInCommand("No command found for \"" + name + "\" with value \"" + (object)value + "\"");
                }
            }
        }
Exemplo n.º 25
0
 public override void Update(float t)
 {
     base.Update(t);
     this.elapsedTime += t;
     if (this.IsInHostileFileCrash)
     {
         if ((double)this.elapsedTime % 0.5 < 0.0333333350718021)
         {
             ++this.extraErrors;
         }
         if ((double)this.elapsedTime < 15.0)
         {
             return;
         }
         if (Settings.EnableDLC && DLC1SessionUpgrader.HasDLC1Installed)
         {
             this.os.BootAssitanceModule.IsActive = true;
         }
         this.reset();
         this.os.canRunContent = false;
         this.os.bootingUp     = false;
     }
     else if ((double)this.elapsedTime < (double)CrashModule.BLUESCREEN_TIME / 4.0)
     {
         this.state = 0;
     }
     else if ((double)this.elapsedTime < (double)CrashModule.BLUESCREEN_TIME)
     {
         this.state = 1;
     }
     else if ((double)this.elapsedTime < (double)CrashModule.BLUESCREEN_TIME + (double)CrashModule.BLACK_TIME)
     {
         this.state = 2;
     }
     else if ((double)this.elapsedTime < (double)CrashModule.BLUESCREEN_TIME + (double)CrashModule.BLACK_TIME + (double)CrashModule.BOOT_TIME + (double)this.bootTextErrorDelay)
     {
         this.state          = 3;
         this.bootTextTimer -= t;
         if ((double)this.bootTextTimer <= 0.0)
         {
             this.bootTextTimer = this.bootTextDelay - (float)Utils.random.NextDouble() * this.bootTextDelay + (float)Utils.random.NextDouble() * this.bootTextDelay;
             ++this.bootTextCount;
             if (this.bootTextCount >= this.bootText.Length - 1)
             {
                 this.bootTextCount = this.bootText.Length - 1;
             }
             if (this.bootText[this.bootTextCount].Equals(" "))
             {
                 this.bootTextTimer = this.bootTextDelay * 12f;
             }
             if (this.bootText[this.bootTextCount].StartsWith("ERROR:"))
             {
                 this.bootTextTimer = this.bootTextDelay * 29f;
                 this.os.thisComputer.bootupTick((float)-((double)this.bootTextDelay * 42.0));
                 this.bootTextErrorDelay += this.bootTextDelay * 42f;
             }
             if (this.bootTextCount == 50 && HostileHackerBreakinSequence.IsInBlockingHostileFileState((object)this.os))
             {
                 this.bootTextTimer             = 999999f;
                 this.os.thisComputer.bootTimer = 9999f;
                 this.IsInHostileFileCrash      = true;
                 this.elapsedTime = 0.2f;
             }
         }
         if (!this.hasPlayedBeep)
         {
             if (!Settings.soundDisabled)
             {
                 CrashModule.beep.Play(0.5f, 0.5f, 0.0f);
                 this.os.delayer.Post(ActionDelayer.Wait(0.1), (Action)(() => CrashModule.beep.Play(0.5f, 0.5f, 0.0f)));
             }
             this.hasPlayedBeep = true;
         }
     }
     else
     {
         this.state = 2;
     }
 }
Exemplo n.º 26
0
        public static void RunShellReopenerExe(string[] args, object osObj, Computer target)
        {
            OS   os    = (OS)osObj;
            bool flag1 = false;
            bool flag2 = false;

            if (args.Length > 1)
            {
                if (args[1].ToLower() == "-s")
                {
                    flag2 = true;
                }
                else if (args[1].ToLower() == "-o")
                {
                    flag1 = true;
                }
            }
            if (!flag1 && !flag2)
            {
                os.write("--------------------------------------");
                os.write("OpShell " + LocaleTerms.Loc("ERROR: Not enough arguments!"));
                os.write(LocaleTerms.Loc("Usage:") + " OpShell [-" + LocaleTerms.Loc("option") + "]");
                os.write(LocaleTerms.Loc("Valid Options:") + " [-s (" + LocaleTerms.Loc("Save state") + ")] [-o (" + LocaleTerms.Loc("Re-open") + ")]");
                os.write("--------------------------------------");
            }
            else
            {
                Folder          folder       = os.thisComputer.files.root.searchForFolder("sys");
                FileEntry       fileEntry    = folder.searchForFile("ShellSources.txt");
                List <ShellExe> shellExeList = new List <ShellExe>();
                for (int index = 0; index < os.exes.Count; ++index)
                {
                    ShellExe ex = os.exes[index] as ShellExe;
                    if (ex != null)
                    {
                        shellExeList.Add(ex);
                    }
                }
                if (flag1)
                {
                    if (fileEntry == null)
                    {
                        os.write("--------------------------------------");
                        os.write("OpShell " + LocaleTerms.Loc("ERROR: No shell sources saved. Save a setup first."));
                        os.write("--------------------------------------");
                    }
                    else
                    {
                        string[] lines = fileEntry.data.Split(Utils.robustNewlineDelim, StringSplitOptions.RemoveEmptyEntries);
                        double   time1 = 0.2;
                        os.runCommand("disconnect");
                        for (int index1 = 1; index1 < lines.Length; ++index1)
                        {
                            int index = index1;
                            os.delayer.Post(ActionDelayer.Wait(time1), (Action)(() => os.runCommand("connect " + lines[index])));
                            double time2 = time1 + 0.2;
                            os.delayer.Post(ActionDelayer.Wait(time2), (Action)(() => os.runCommand("shell")));
                            time1 = time2 + 0.2;
                        }
                        os.delayer.Post(ActionDelayer.Wait(time1), (Action)(() =>
                        {
                            os.runCommand("disconnect");
                            os.write("--------------------------------------");
                            os.write("OpShell : " + LocaleTerms.Loc("Operation complete - ran shell on " + (object)(lines.Length - 1) + " nodes"));
                            os.write("--------------------------------------");
                        }));
                    }
                }
                else if (flag2)
                {
                    if (shellExeList.Count <= 0)
                    {
                        os.write("--------------------------------------");
                        os.write("OpShell " + LocaleTerms.Loc("ERROR: No active shells"));
                        os.write("--------------------------------------");
                    }
                    else
                    {
                        StringBuilder stringBuilder = new StringBuilder();
                        stringBuilder.Append("#OpShell_IP_SourceCache\n");
                        for (int index = 0; index < shellExeList.Count; ++index)
                        {
                            stringBuilder.Append(shellExeList[index].targetIP + "\n");
                        }
                        if (fileEntry != null)
                        {
                            fileEntry.data = stringBuilder.ToString();
                        }
                        else
                        {
                            folder.files.Add(new FileEntry(stringBuilder.ToString(), "ShellSources.txt"));
                        }
                        os.write("--------------------------------------");
                        os.write("OpShell : " + string.Format(LocaleTerms.Loc("Saved {0} active shell sources successfully"), (object)shellExeList.Count));
                        os.write("--------------------------------------");
                    }
                }
            }
        }
Exemplo n.º 27
0
 private void HookUpCreationEvents()
 {
     this.loginScreen.RequestGoBack += (Action)(() => this.State = MainMenu.MainMenuState.Normal);
     this.loginScreen.StartNewGameForUsernameAndPass += (Action <string, string>)((username, pass) =>
     {
         if (SaveFileManager.AddUser(username, pass))
         {
             string filePathForLogin = SaveFileManager.GetFilePathForLogin(username, pass);
             this.ExitScreen();
             MainMenu.resetOS();
             if (!Settings.soundDisabled)
             {
                 this.ScreenManager.playAlertSound();
             }
             try
             {
                 OS os = new OS();
                 os.SaveGameUserName    = filePathForLogin;
                 os.SaveUserAccountName = username;
                 if (this.NextStartedGameShouldBeDLCAccelerated)
                 {
                     os.IsDLCConventionDemo = true;
                     os.Flags.AddFlag("TutorialComplete");
                     Settings.EnableDLC         = true;
                     Settings.initShowsTutorial = false;
                     os.initShowsTutorial       = false;
                 }
                 this.ScreenManager.AddScreen((GameScreen)os, new PlayerIndex?(this.ScreenManager.controllingPlayer));
                 os.Flags.AddFlag("startVer:" + MainMenu.OSVersion);
                 if (!this.NextStartedGameShouldBeDLCAccelerated)
                 {
                     return;
                 }
                 SessionAccelerator.AccelerateSessionToDLCStart((object)os);
                 os.delayer.Post(ActionDelayer.Wait(0.15), (Action)(() => Game1.getSingleton().IsMouseVisible = true));
                 this.NextStartedGameShouldBeDLCAccelerated = false;
             }
             catch (Exception ex)
             {
                 this.UpdateUIForSaveCreationFailed(ex);
             }
         }
         else
         {
             this.loginScreen.ResetForNewAccount();
             this.loginScreen.WriteToHistory(" ERROR: Username invalid or already in use.");
         }
     });
     this.loginScreen.LoadGameForUserFileAndUsername += (Action <string, string>)((userFile, username) =>
     {
         this.ExitScreen();
         MainMenu.resetOS();
         if (SaveFileManager.StorageMethods[0].FileExists(userFile))
         {
             OS.WillLoadSave = true;
             OS os = new OS();
             os.SaveGameUserName    = userFile;
             os.SaveUserAccountName = username;
             try
             {
                 this.ScreenManager.AddScreen((GameScreen)os, new PlayerIndex?(this.ScreenManager.controllingPlayer));
             }
             catch (XmlException ex)
             {
                 this.UpdateUIForSaveCorruption(userFile, (Exception)ex);
             }
             catch (FormatException ex)
             {
                 this.UpdateUIForSaveCorruption(userFile, (Exception)ex);
             }
             catch (NullReferenceException ex)
             {
                 this.UpdateUIForSaveCorruption(userFile, (Exception)ex);
             }
             catch (FileNotFoundException ex)
             {
                 this.UpdateUIForSaveMissing(userFile, (Exception)ex);
             }
             catch (ContentLoadException ex1)
             {
                 string str = Utils.ReadEntireContentsOfStream(SaveFileManager.StorageMethods[0].GetFileReadStream(userFile));
                 if (str.Contains("DigiPets"))
                 {
                     string data = str.Replace("DigiPets", "Neopals").Replace("DigiPoints", "Neopoints");
                     for (int index = 0; index < 3; ++index)
                     {
                         try
                         {
                             Thread.Sleep(200);
                             SaveFileManager.StorageMethods[0].WriteFileData(userFile, data);
                             break;
                         }
                         catch (IOException ex2)
                         {
                         }
                         Thread.Sleep(500);
                     }
                     MainMenu.AccumErrors = "-- Savefile Automatically Upgraded - Try again! --";
                 }
                 else
                 {
                     this.UpdateUIForSaveCorruption(userFile, (Exception)ex1);
                 }
             }
         }
         else
         {
             OS.WillLoadSave = false;
             this.UpdateUIForSaveMissing(userFile, (Exception) new FileNotFoundException());
         }
     });
     this.attractModeScreen.Start += (Action)(() =>
     {
         try
         {
             this.ExitScreen();
             MainMenu.resetOS();
             if (!Settings.soundDisabled)
             {
                 this.ScreenManager.playAlertSound();
             }
             this.ScreenManager.AddScreen((GameScreen) new OS(), new PlayerIndex?(this.ScreenManager.controllingPlayer));
         }
         catch (Exception ex)
         {
             Utils.writeToFile("OS Load Error: " + ex.ToString() + "\n\n" + ex.StackTrace, "crashLog.txt");
         }
     });
     this.attractModeScreen.StartDLC += (Action)(() =>
     {
         try
         {
             this.ExitScreen();
             MainMenu.resetOS();
             Settings.EnableDLC = true;
             Settings.initShowsTutorial = false;
             if (!Settings.soundDisabled)
             {
                 this.ScreenManager.playAlertSound();
             }
             OS os = new OS();
             os.IsDLCConventionDemo = true;
             os.Flags.AddFlag("TutorialComplete");
             os.SaveGameUserName = "******" + Settings.ConventionLoginName + ".xml";
             os.SaveUserAccountName = Settings.ConventionLoginName;
             this.ScreenManager.AddScreen((GameScreen)os, new PlayerIndex?(this.ScreenManager.controllingPlayer));
             os.allFactions.setCurrentFaction("Bibliotheque", os);
             ThemeManager.setThemeOnComputer((object)os.thisComputer, "DLC/Themes/RiptideClassicTheme.xml");
             ThemeManager.switchTheme((object)os, "DLC/Themes/RiptideClassicTheme.xml");
             for (int index1 = 0; index1 < 60; ++index1)
             {
                 int index2;
                 do
                 {
                     index2 = Utils.random.Next(os.netMap.nodes.Count);
                 }while (os.netMap.nodes[index2].idName == "mainHub" || os.netMap.nodes[index2].idName == "entropy00" || os.netMap.nodes[index2].idName == "entropy01");
                 os.netMap.discoverNode(os.netMap.nodes[index2]);
             }
             os.delayer.Post(ActionDelayer.Wait(0.15), (Action)(() =>
             {
                 Game1.getSingleton().IsMouseVisible = true;
                 os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[22], "SSHCrack.exe"));
                 os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[21], "FTPBounce.exe"));
                 MissionFunctions.runCommand(7, "changeSong");
                 MusicManager.stop();
             }));
             os.delayer.Post(ActionDelayer.Wait(38.0), (Action)(() => ComputerLoader.loadMission("Content/DLC/Missions/Demo/DLCDemointroMission1.xml", false)));
         }
         catch (Exception ex)
         {
             Utils.writeToFile("OS Load Error: " + ex.ToString() + "\n\n" + ex.StackTrace, "crashLog.txt");
         }
     });
     this.extensionsScreen.ExitClicked += (Action)(() => this.State = MainMenu.MainMenuState.Normal);
     this.extensionsScreen.CreateNewAccountForExtension_UserAndPass += (Action <string, string>)((user, pass) => MainMenu.CreateNewAccountForExtensionAndStart(user, pass, this.ScreenManager, (GameScreen)this, this.extensionsScreen));
     this.extensionsScreen.LoadAccountForExtension_FileAndUsername  += (Action <string, string>)((userFile, username) =>
     {
         this.ExitScreen();
         MainMenu.resetOS();
         Settings.IsInExtensionMode = true;
         OS.WillLoadSave            = SaveFileManager.StorageMethods[0].FileExists(userFile);
         this.ScreenManager.AddScreen((GameScreen) new OS()
         {
             SaveGameUserName    = userFile,
             SaveUserAccountName = username
         }, new PlayerIndex?(this.ScreenManager.controllingPlayer));
     });
 }
Exemplo n.º 28
0
        private void drawTestingMainMenuButtons(bool canRun)
        {
            SpriteFont tinyfont = GuiData.tinyfont;
            string     text     = "FONT:";

            for (int index = 0; index < tinyfont.Characters.Count; ++index)
            {
                text += (string)(object)tinyfont.Characters[index];
                if (index % 20 == 0)
                {
                    text += "\n";
                }
            }
            if (true)
            {
                text = "Labyrinths Testers:\nPress \"Start Full DLC Test\" to begin\n\n" + text;
            }
            GuiData.spriteBatch.DrawString(tinyfont, text, new Vector2(867f, 200f), Color.White);
            if (Button.doButton(8801, 634, 200, 225, 23, "New Test Session", new Color?(MainMenu.buttonColor)) && canRun && canRun)
            {
                this.ExitScreen();
                MainMenu.resetOS();
                if (!Settings.soundDisabled)
                {
                    this.ScreenManager.playAlertSound();
                }
                OS os = new OS();
                os.SaveGameUserName    = "******";
                os.SaveUserAccountName = "__test";
                this.ScreenManager.AddScreen((GameScreen)os, new PlayerIndex?(this.ScreenManager.controllingPlayer));
                os.Flags.AddFlag("TutorialComplete");
                os.delayer.RunAllDelayedActions();
                os.threadedSaveExecute(false);
                this.ScreenManager.RemoveScreen((GameScreen)os);
                OS.WillLoadSave = true;
                MainMenu.resetOS();
                os = new OS();
                os.SaveGameUserName    = "******";
                os.SaveUserAccountName = "__test";
                this.ScreenManager.AddScreen((GameScreen)os, new PlayerIndex?(this.ScreenManager.controllingPlayer));
                os.delayer.Post(ActionDelayer.Wait(0.1), (Action)(() => Game1.getSingleton().IsMouseVisible = true));
                os.delayer.Post(ActionDelayer.Wait(0.4), (Action)(() =>
                {
                    os.runCommand("debug");
                    ComputerLoader.loadMission("Content/Missions/MainHub/Intro/Intro01.xml", false);
                }));
                if (!Settings.EnableDLC)
                {
                    ComputerLoader.loadMission("Content/Missions/BitMission0.xml", false);
                }
            }
            if (Button.doButton(8803, 634, 225, 225, 23, "New DLC Test Session", new Color?(Settings.EnableDLC ? Color.Gray : MainMenu.buttonColor)) && canRun && canRun)
            {
                this.ExitScreen();
                MainMenu.resetOS();
                if (!Settings.soundDisabled)
                {
                    this.ScreenManager.playAlertSound();
                }
                OS os1 = new OS();
                os1.SaveGameUserName    = "******";
                os1.SaveUserAccountName = "__test";
                this.ScreenManager.AddScreen((GameScreen)os1, new PlayerIndex?(this.ScreenManager.controllingPlayer));
                SessionAccelerator.AccelerateSessionToDLCHA((object)os1);
                os1.threadedSaveExecute(false);
                this.ScreenManager.RemoveScreen((GameScreen)os1);
                OS.WillLoadSave = true;
                MainMenu.resetOS();
                Settings.initShowsTutorial = false;
                OS os2 = new OS();
                os2.SaveGameUserName    = "******";
                os2.SaveUserAccountName = "__test";
                this.ScreenManager.AddScreen((GameScreen)os2, new PlayerIndex?(this.ScreenManager.controllingPlayer));
                os2.delayer.Post(ActionDelayer.Wait(0.15), (Action)(() => Game1.getSingleton().IsMouseVisible = true));
            }
            if (Button.doButton(8806, 634, 250, 225, 23, "Run Test Suite", new Color?(MainMenu.buttonColor)))
            {
                this.testSuiteResult = TestSuite.RunTestSuite(this.ScreenManager, false);
            }
            if (Button.doButton(8809, 634, 275, 225, 23, "Run Quick Tests", new Color?(MainMenu.buttonColor)))
            {
                this.testSuiteResult = TestSuite.RunTestSuite(this.ScreenManager, true);
            }
            else
            {
                if (Button.doButton(8812, 634, 300, 225, 23, "Start Full DLC Test", new Color?(MainMenu.buttonColor)) && canRun)
                {
                    this.StartFullDLCTest();
                }
                if (this.testSuiteResult == null)
                {
                    return;
                }
                TextItem.doFontLabel(new Vector2(635f, 325f), Utils.SuperSmartTwimForWidth(this.testSuiteResult, 600, GuiData.tinyfont), GuiData.tinyfont, new Color?(this.testSuiteResult.Length > 950 ? Utils.AddativeRed : Utils.AddativeWhite), float.MaxValue, float.MaxValue, false);
            }
        }
Exemplo n.º 29
0
        public override void draw(Rectangle bounds, SpriteBatch sb)
        {
            base.draw(bounds, sb);
            bounds = Utils.InsetRectangle(bounds, 1);
            int num1    = 90;
            int height1 = 30;

            TextItem.doCenteredFontLabel(new Rectangle(bounds.X, bounds.Y + height1, bounds.Width, num1 - height1), this.OverrideTitle == null ? LocaleTerms.Loc("Labyrinths Project") : this.OverrideTitle, GuiData.font, Color.White, false);
            Rectangle rectangle = new Rectangle(bounds.X, bounds.Y + num1 + height1, bounds.Width, bounds.Height - (num1 + 2 * height1));

            if (this.showingCredits)
            {
                this.timeInCredits += (float)this.os.lastGameTime.ElapsedGameTime.TotalSeconds;
                float timeInCredits = this.timeInCredits;
                float num2          = ((double)timeInCredits > 5.0 ? timeInCredits - 4f : Utils.CubicInCurve(timeInCredits / 5f)) % 165f;
                Utils.FillEverywhereExcept(rectangle, Utils.GetFullscreen(), sb, Color.Black * 0.5f);
                float num3 = 20f;
                float num4 = (float)(rectangle.Y - height1 + rectangle.Height) - num2 * num3;
                for (int index = 0; index < this.CreditsData.Length; ++index)
                {
                    int        height2 = 22;
                    SpriteFont font    = GuiData.smallfont;
                    Color      color   = Color.LightGray * 0.9f;
                    string     text    = this.CreditsData[index];
                    if (text.StartsWith("%"))
                    {
                        text    = text.Substring(1);
                        height2 = 45;
                        font    = GuiData.font;
                        color   = Utils.AddativeWhite * 0.9f;
                    }
                    else if (text.StartsWith("^"))
                    {
                        text    = text.Substring(1);
                        height2 = 30;
                        font    = GuiData.font;
                        color   = Color.White;
                    }
                    if ((double)num4 >= (double)(rectangle.Y - height1))
                    {
                        TextItem.doCenteredFontLabel(new Rectangle(rectangle.X, (int)num4, rectangle.Width, height2), text, font, color, false);
                    }
                    num4 += (float)(height2 + 2);
                    if ((double)num4 > (double)(rectangle.Y + rectangle.Height))
                    {
                        break;
                    }
                }
                if ((double)this.timeInCredits > 40.0 && Button.doButton(18394902, rectangle.X + rectangle.Width / 4, rectangle.Y + rectangle.Height - 23, rectangle.Width / 2, 20, LocaleTerms.Loc("Proceed"), new Color?((double)this.timeInCredits > 65.0 ? this.os.highlightColor : Color.Black)))
                {
                    this.os.display.command = "connect";
                }
            }
            else if (this.isInResetSequence)
            {
                this.timeInReset += (float)this.os.lastGameTime.ElapsedGameTime.TotalSeconds;
                if ((double)this.timeInReset >= 5.0)
                {
                    this.showingCredits = true;
                    PostProcessor.EndingSequenceFlashOutActive             = false;
                    PostProcessor.EndingSequenceFlashOutPercentageComplete = 0.0f;
                    if (!Settings.IsInExtensionMode)
                    {
                        this.EndDLC();
                        if (!this.hasCuedFinaleSong)
                        {
                            this.os.delayer.Post(ActionDelayer.Wait(2.0), (Action)(() => MusicManager.playSongImmediatley("DLC\\Music\\DreamHead")));
                            this.hasCuedFinaleSong = true;
                        }
                        MediaPlayer.IsRepeating = true;
                        for (int index = 0; index < 9; ++index)
                        {
                            this.os.delayer.Post(ActionDelayer.Wait((double)index / 7.0), (Action)(() => SFX.addCircle(this.os.mailicon.pos + new Vector2(20f, 6f), Utils.AddativeWhite * 0.8f, 400f)));
                        }
                    }
                }
                else
                {
                    float num2 = Math.Min(this.timeInReset, 1f);
                    Utils.FillEverywhereExcept(rectangle, Utils.GetFullscreen(), sb, Color.Black * 0.5f * num2);
                    PatternDrawer.draw(rectangle, 0.3f, Color.Transparent, Color.Black * 0.7f, sb, PatternDrawer.binaryTile);
                    this.AddRadialMailLine();
                    PostProcessor.EndingSequenceFlashOutActive             = true;
                    PostProcessor.EndingSequenceFlashOutPercentageComplete = num2;
                    if (!this.hasCuedBuildup && (double)this.timeInReset > 2.8)
                    {
                        this.buildup.Play();
                        this.hasCuedBuildup = true;
                    }
                    TextItem.doCenteredFontLabel(rectangle, LocaleTerms.Loc("Disabling..."), GuiData.font, Color.White, false);
                }
            }
            else
            {
                PatternDrawer.draw(rectangle, 0.3f, Color.Transparent, Color.Black * 0.7f, sb, PatternDrawer.binaryTile);
                string text = this.OverrideButtonText == null?LocaleTerms.Loc("Disable Agent Monitoring") : this.OverrideButtonText;

                bool flag = this.OverrideButtonText != null;
                if (Button.doButton(38101920, rectangle.X + 50, rectangle.Y + rectangle.Height / 2 - 13, rectangle.Width - 100, 26, text, new Color?(this.os.highlightColor)))
                {
                    if (!flag)
                    {
                        this.isInResetSequence = true;
                        this.timeInReset       = 0.0f;
                        if (MusicManager.currentSongName == "DLC/Music/RemiDrone")
                        {
                            MusicManager.stop();
                        }
                        this.spindownImpact.Play();
                        if (this.spindown != null)
                        {
                            this.os.delayer.Post(ActionDelayer.Wait(1.1), (Action)(() => this.spindown.Play()));
                        }
                        DLC1SessionUpgrader.ReDsicoverAllVisibleNodesInOSCache((object)this.os);
                    }
                    else
                    {
                        this.isInResetSequence = false;
                        this.showingCredits    = true;
                        if (this.ConditionalActionsToLoadOnButtonPress != null)
                        {
                            RunnableConditionalActions.LoadIntoOS(this.ConditionalActionsToLoadOnButtonPress, (object)this.os);
                        }
                    }
                }
            }
            Rectangle destinationRectangle = new Rectangle(bounds.X, bounds.Y + num1, bounds.Width, height1);

            sb.Draw(Utils.white, destinationRectangle, Utils.VeryDarkGray);
            destinationRectangle.Y = bounds.Y + num1 + height1 + rectangle.Height;
            sb.Draw(Utils.white, destinationRectangle, Utils.VeryDarkGray);
        }
Exemplo n.º 30
0
 private void drawTestingMainMenuButtons(bool canRun)
 {
     if (Button.doButton(8801, 634, 200, 225, 23, "New Test Session", buttonColor) && canRun)
     {
         ExitScreen();
         resetOS();
         if (!Settings.soundDisabled)
         {
             ScreenManager.playAlertSound();
         }
         var os = new OS();
         ScreenManager.AddScreen(os, ScreenManager.controllingPlayer);
         os.delayer.RunAllDelayedActions();
         os.threadedSaveExecute();
         ScreenManager.RemoveScreen(os);
         OS.WillLoadSave = true;
         resetOS();
         ScreenManager.AddScreen(new OS(), ScreenManager.controllingPlayer);
     }
     if (Button.doButton(8803, 634, 225, 225, 23, "New Entropy Accelerated Session", buttonColor) && canRun)
     {
         ExitScreen();
         resetOS();
         if (!Settings.soundDisabled)
         {
             ScreenManager.playAlertSound();
         }
         var os1 = new OS();
         os1.SaveGameUserName    = "******";
         os1.SaveUserAccountName = "entropyTest";
         ScreenManager.AddScreen(os1, ScreenManager.controllingPlayer);
         os1.Flags.AddFlag("TutorialComplete");
         os1.delayer.RunAllDelayedActions();
         os1.threadedSaveExecute();
         ScreenManager.RemoveScreen(os1);
         OS.WillLoadSave = true;
         resetOS();
         Settings.initShowsTutorial = false;
         var os2 = new OS();
         ScreenManager.AddScreen(os2, ScreenManager.controllingPlayer);
         MissionFunctions.runCommand(0, "EntropyFastFowardSetup");
         os2.delayer.Post(ActionDelayer.Wait(1.0), () => Game1.GetSingleton().IsMouseVisible = true);
     }
     if (Button.doButton(8806, 634, 250, 225, 23, "Run Test Suite", buttonColor))
     {
         testSuiteResult = TestSuite.TestSaveLoadOnFile(ScreenManager);
     }
     if (Button.doButton(8809, 634, 275, 225, 23, "Export Animation", buttonColor))
     {
         var TitleFill = new Rectangle(0, 0, 300, 100);
         AnimatedSpriteExporter.ExportAnimation("OutNowAnim", "OutNow", TitleFill.Width, TitleFill.Height, 24f,
                                                40f, GuiData.spriteBatch.GraphicsDevice, t => new OS
         {
             highlightColor = new Color(166, byte.MaxValue, 215)
         }.timer += t, (sb, dest) =>
         {
             sb.Draw(Utils.white, dest, new Color(13, 13, 13));
             FlickeringTextEffect.DrawFlickeringText(TitleFill, "OUT NOW", 8f, 0.7f, titleFont, null,
                                                     new Color(216, 216, 216));
         }, 1);
     }
     if (Button.doButton(8812, 634, 300, 225, 23, "New CSEC Accel Session", buttonColor) && canRun)
     {
         ExitScreen();
         resetOS();
         if (!Settings.soundDisabled)
         {
             ScreenManager.playAlertSound();
         }
         var os1 = new OS();
         ScreenManager.AddScreen(os1, ScreenManager.controllingPlayer);
         os1.Flags.AddFlag("TutorialComplete");
         os1.delayer.RunAllDelayedActions();
         os1.threadedSaveExecute();
         ScreenManager.RemoveScreen(os1);
         OS.WillLoadSave = true;
         resetOS();
         Settings.initShowsTutorial = false;
         var os2 = new OS();
         ScreenManager.AddScreen(os2, ScreenManager.controllingPlayer);
         MissionFunctions.runCommand(0, "CSECFastFowardSetup");
         os2.delayer.Post(ActionDelayer.Wait(1.0), () => Game1.GetSingleton().IsMouseVisible = true);
     }
     if (testSuiteResult == null)
     {
         return;
     }
     TextItem.doFontLabel(new Vector2(635f, 325f),
                          Utils.SuperSmartTwimForWidth(testSuiteResult, 600, GuiData.tinyfont), GuiData.tinyfont,
                          testSuiteResult.Length > 250 ? Utils.AddativeRed : Utils.AddativeWhite, float.MaxValue, float.MaxValue);
 }