public static void ReactToFirstSuccesfulBoot(object osobj)
 {
     ((OS)osobj).Flags.AddFlag("startupBreakinTrapPassed");
     MusicManager.loadAsCurrentSong("DLC\\Music\\World_Chase");
 }
Exemple #2
0
        public string checkOSBootFiles(string bootString)
        {
            this.BootLoadErrors = "";
            Folder folder    = this.os.thisComputer.files.root.searchForFolder("sys");
            bool   flag      = true;
            string newValue1 = "ERROR: " + LocaleTerms.Loc("Unable to Load System file os-config.sys") + "\n";

            if (folder.containsFile("os-config.sys"))
            {
                newValue1 = "Loaded os-config.sys : System Config Initialized";
            }
            else
            {
                this.os.failBoot();
                flag = false;
                CrashModule crashModule = this;
                string      str         = crashModule.BootLoadErrors + newValue1 + " \n";
                crashModule.BootLoadErrors = str;
            }
            bootString = bootString.Replace("[OSBoot1]", newValue1);
            string newValue2 = "ERROR: " + LocaleTerms.Loc("Unable to Load System file bootcfg.dll") + "\n";

            if (folder.containsFile("bootcfg.dll"))
            {
                newValue2 = "Loaded bootcfg.dll : Boot Config Module Loaded";
            }
            else
            {
                this.os.failBoot();
                flag = false;
                CrashModule crashModule = this;
                string      str         = crashModule.BootLoadErrors + newValue2 + " \n";
                crashModule.BootLoadErrors = str;
            }
            bootString = bootString.Replace("[OSBoot2]", newValue2);
            string newValue3 = "ERROR: " + LocaleTerms.Loc("Unable to Load System file netcfgx.dll") + "\n";

            if (folder.containsFile("netcfgx.dll"))
            {
                newValue3 = "Loaded netcfgx.dll : Network Config Module Loaded";
            }
            else
            {
                this.os.failBoot();
                flag = false;
                CrashModule crashModule = this;
                string      str         = crashModule.BootLoadErrors + newValue3 + " \n";
                crashModule.BootLoadErrors = str;
            }
            bootString = bootString.Replace("[OSBoot3]", newValue3);
            string newValue4 = "ERROR: " + LocaleTerms.Loc("Unable to Load System file x-server.sys") + "\nERROR: " + LocaleTerms.Loc("Locate and restore a valid x-server file in ~/sys/ folder to restore UX functionality") + "\nERROR: " + LocaleTerms.Loc("Consider examining reports in ~/log/ for problem cause and source") + "\nERROR: " + LocaleTerms.Loc("System UX resources unavailable -- defaulting to terminal mode") + "\n .\n .\n .\n";

            if (folder.containsFile("x-server.sys"))
            {
                newValue4 = "Loaded x-server.sys : UX Graphics Module Loaded";
                ThemeManager.switchTheme((object)this.os, ThemeManager.getThemeForDataString(folder.searchForFile("x-server.sys").data));
                this.graphicsErrorsDetected = false;
            }
            else
            {
                this.os.graphicsFailBoot();
                flag = false;
                this.graphicsErrorsDetected = true;
                CrashModule crashModule = this;
                string      str         = crashModule.BootLoadErrors + newValue4 + " \n";
                crashModule.BootLoadErrors = str;
            }
            bootString = bootString.Replace("[OSBootTheme]", newValue4);
            if (flag)
            {
                if (this.os.Flags.HasFlag("BootFailure") && !this.os.Flags.HasFlag("BootFailureThemeSongChange") && ThemeManager.currentTheme != OSTheme.HacknetBlue)
                {
                    this.os.Flags.AddFlag("BootFailureThemeSongChange");
                    if (MusicManager.isPlaying)
                    {
                        MusicManager.stop();
                    }
                    MusicManager.loadAsCurrentSong("Music\\The_Quickening");
                }
                this.os.sucsesfulBoot();
            }
            else
            {
                this.os.Flags.AddFlag("BootFailure");
            }
            return(bootString);
        }