Exemplo n.º 1
0
        public override void Trigger(object os_obj)
        {
            OS       os       = (OS)os_obj;
            Computer computer = Programs.getComputer(os, this.TargetComp);

            if (computer == null)
            {
                throw new NullReferenceException("Computer " + this.TargetComp + " could not be found for SAAddMissionToHubServer Function, adding mission: " + this.MissionFilepath);
            }
            MissionHubServer daemon1 = computer.getDaemon(typeof(MissionHubServer)) as MissionHubServer;

            if (daemon1 != null)
            {
                daemon1.AddMissionToListings(Utils.GetFileLoadPrefix() + this.MissionFilepath, -1);
            }
            else
            {
                DLCHubServer daemon2 = computer.getDaemon(typeof(DLCHubServer)) as DLCHubServer;
                if (daemon2 != null)
                {
                    daemon2.AddMission(Utils.GetFileLoadPrefix() + this.MissionFilepath, this.AssignmentTag, this.StartsComplete);
                }
                else
                {
                    MissionListingServer daemon3 = computer.getDaemon(typeof(MissionListingServer)) as MissionListingServer;
                    if (daemon3 == null)
                    {
                        throw new NullReferenceException("Computer " + this.TargetComp + " does not contain a MissionHubServer, MissionListingServer or DLCHubServer daemon for addMission function adding mission: " + this.MissionFilepath);
                    }
                    List <ActiveMission> branchMissions = os.branchMissions;
                    ActiveMission        m = (ActiveMission)ComputerLoader.readMission(Utils.GetFileLoadPrefix() + this.MissionFilepath);
                    os.branchMissions = branchMissions;
                    daemon3.addMisison(m, this.AssignmentTag.ToLower() == "top");
                }
            }
        }
Exemplo n.º 2
0
        public static void FixSavesWithTerribleHacks(object osObj)
        {
            OS       os        = (OS)osObj;
            Computer computer1 = Programs.getComputer(os, "mainHubAssets");

            if (computer1 != null)
            {
                Folder folder1 = computer1.files.root.searchForFolder("bin");
                if (folder1 != null)
                {
                    Folder folder2 = folder1.searchForFolder("Sequencer");
                    if (folder2 != null)
                    {
                        FileEntry fileEntry = folder2.searchForFile("Sequencer.exe");
                        if (fileEntry == null)
                        {
                            folder2.files.Add(new FileEntry(PortExploits.crackExeData[17], "Sequencer.exe"));
                        }
                        else
                        {
                            fileEntry.data = PortExploits.crackExeData[17];
                        }
                    }
                }
            }
            Computer computer2 = Programs.getComputer(os, "pacemakerSW_BE");

            if (computer2 != null)
            {
                Console.WriteLine("Searching for pacemaker comp");
                Folder folder1 = computer2.files.root.searchForFolder("projects");
                if (folder1 != null)
                {
                    Console.WriteLine("Searching for pacemaker projects");
                    Folder folder2 = folder1.searchForFolder("KellisBT");
                    if (folder2 != null)
                    {
                        Folder folder3 = folder2.searchForFolder("Tests");
                        if (folder3 != null)
                        {
                            Console.WriteLine("Searching for pacemaker file");
                            FileEntry fileEntry = folder3.searchForFile("PacemakerFirmware_Cycle_Test.dll");
                            if (fileEntry == null)
                            {
                                folder3.files.Add(new FileEntry(PortExploits.DangerousPacemakerFirmware, "PacemakerFirmware_Cycle_Test.dll"));
                            }
                            else
                            {
                                fileEntry.data = PortExploits.DangerousPacemakerFirmware;
                            }
                        }
                    }
                }
            }
            if (!os.HasLoadedDLCContent)
            {
                return;
            }
            List <Computer> computerList = new List <Computer>();

            if (Programs.getComputer(os, "dPets_MF").links.Count == 0)
            {
                ComputerLoader.postAllLoadedActions = (Action)null;
                List <string> dlcList = BootLoadList.getDLCList();
                for (int index = 0; index < dlcList.Count; ++index)
                {
                    Computer computer3 = (Computer)ComputerLoader.loadComputer(dlcList[index], true, true);
                    computerList.Add(computer3);
                }
                ComputerLoader.postAllLoadedActions();
            }
            for (int index = 0; index < computerList.Count; ++index)
            {
                Programs.getComputer(os, computerList[index].idName).links = computerList[index].links;
            }
            Folder folder = Programs.getComputer(os, "dPets_MF").files.root.searchForFolder("Database");
            bool   flag   = false;

            if (folder.files.Count > 0 && folder.files[0].data.Contains("DigiPet"))
            {
                for (int index = 0; index < folder.files.Count; ++index)
                {
                    folder.files[index].data = folder.files[index].data.Replace("DigiPet", "Neopal");
                    if (folder.files[index].data.Contains("Minx"))
                    {
                        flag = true;
                    }
                }
                if (flag)
                {
                    ;
                }
                DLCHubServer daemon = (DLCHubServer)Programs.getComputer(os, "dhs").getDaemon(typeof(DLCHubServer));
                daemon.navigatedTo();
                if (daemon.ActiveMissions.Count == 0)
                {
                    daemon.AddMission(os.currentMission, os.defaultUser.name, false);
                }
            }
            if (os.Flags.HasFlag("KaguyaTrialComplete") && !os.netMap.visibleNodes.Contains(os.netMap.nodes.IndexOf(Programs.getComputer(os, "dhs"))))
            {
                os.Flags.RemoveFlag("KaguyaTrialComplete");
            }
        }