Esempio n. 1
0
        public Person(string fName, string lName, bool male, bool isHacker = false, string handle = null)
        {
            this.firstName = fName;
            this.lastName  = lName;
            this.isMale    = male;
            if (handle == null)
            {
                handle = UsernameGenerator.getName();
            }
            if (handle == null)
            {
                throw new InvalidOperationException();
            }
            this.handle     = handle;
            this.isHacker   = isHacker;
            this.birthplace = WorldLocationLoader.getRandomLocation();
            this.vehicles   = new List <VehicleRegistration>();
            this.degrees    = new List <Degree>();
            this.addRandomDegrees();
            this.addRandomVehicles();
            int num1 = 18;
            int num2 = 72;

            if (isHacker)
            {
                num2 = 45;
            }
            this.DateOfBirth   = DateTime.Now - TimeSpan.FromDays((double)(num1 * 365 + (int)(Utils.random.NextDouble() * (double)(num2 - num1) * 365.0)));
            this.medicalRecord = new MedicalRecord(this.birthplace, this.DateOfBirth);
            if (!Settings.EnableDLC || !DLC1SessionUpgrader.HasDLC1Installed || !isHacker && (double)Utils.randm(1f) >= 0.800000011920929)
            {
                return;
            }
            this.NeopalsAccount = NeopalsAccount.GenerateAccount(handle, Utils.flipCoin() && Utils.flipCoin() && isHacker && handle.ToLower() != "bit");
        }
Esempio n. 2
0
 public override void initFiles()
 {
     base.initFiles();
     this.initFilesystem();
     for (int index = 0; index < 10; ++index)
     {
         this.comp.users.Add(new UserDetail(UsernameGenerator.getName()));
     }
     for (int index = 0; index < this.comp.users.Count; ++index)
     {
         UserDetail user = this.comp.users[index];
         if ((int)user.type == 1 || (int)user.type == 0 || (int)user.type == 2)
         {
             Folder folder = new Folder(user.name);
             folder.files.Add(new FileEntry("Username: "******"\nPassword: "******"AccountInfo"));
             Folder f = new Folder("inbox");
             if (this.shouldGenerateJunkEmails && user.name != this.os.defaultUser.name)
             {
                 this.addJunkEmails(f);
             }
             folder.folders.Add(f);
             folder.folders.Add(new Folder("sent"));
             this.accounts.folders.Add(folder);
         }
     }
     if (this.setupComplete == null)
     {
         return;
     }
     this.setupComplete();
 }
Esempio n. 3
0
 public override void initFiles()
 {
     base.initFiles();
     initFilesystem();
     for (var index = 0; index < 10; ++index)
     {
         comp.users.Add(new UserDetail(UsernameGenerator.getName()));
     }
     for (var index = 0; index < comp.users.Count; ++index)
     {
         var userDetail = comp.users[index];
         if (userDetail.type == 1 || userDetail.type == 0 || userDetail.type == 2)
         {
             var folder = new Folder(userDetail.name);
             folder.files.Add(new FileEntry("Username: "******"\nPassword: "******"AccountInfo"));
             var f = new Folder("inbox");
             addJunkEmails(f);
             folder.folders.Add(f);
             folder.folders.Add(new Folder("sent"));
             accounts.folders.Add(folder);
         }
     }
     if (setupComplete == null)
     {
         return;
     }
     setupComplete();
 }
Esempio n. 4
0
        public static void ReInitPeopleForExtension()
        {
            People.all.Clear();
            People.hackers.Clear();
            People.hubAgents.Clear();
            int    num  = 0;
            string path = Path.Combine(Utils.GetFileLoadPrefix(), "People");

            if (Directory.Exists(path))
            {
                foreach (FileSystemInfo file in new DirectoryInfo(path).GetFiles("*.xml"))
                {
                    Person person = People.loadPersonFromFile(LocalizedFileLoader.GetLocalizedFilepath(path + "/" + Path.GetFileName(file.Name)));
                    if (person != null)
                    {
                        People.all.Insert(0, person);
                        ++num;
                    }
                }
            }
            for (int index = num; index < 200; ++index)
            {
                bool   male    = Utils.flipCoin();
                string fName   = male ? People.maleNames[Utils.random.Next(People.maleNames.Length)] : People.femaleNames[Utils.random.Next(People.femaleNames.Length)];
                string surname = People.surnames[Utils.random.Next(People.surnames.Length)];
                People.all.Add(new Person(fName, surname, male, false, UsernameGenerator.getName()));
            }
            People.hackers = new List <Person>();
            People.generatePeopleForList(People.hackers, 10, true);
            People.hubAgents = new List <Person>();
            People.generatePeopleForList(People.hubAgents, 22, true);
        }
Esempio n. 5
0
        public static void init()
        {
            maleNames =
                Utils.readEntireFile("Content/PersonData/MaleNames.txt").Replace("\r", "").Split(Utils.newlineDelim);
            femaleNames =
                Utils.readEntireFile("Content/PersonData/FemaleNames.txt").Replace("\r", "").Split(Utils.newlineDelim);
            surnames =
                Utils.readEntireFile("Content/PersonData/Surnames.txt").Replace("\r", "").Split(Utils.newlineDelim);
            all = new List <Person>(200);
            var num = 0;

            foreach (FileSystemInfo fileSystemInfo in new DirectoryInfo("Content/People").GetFiles("*.xml"))
            {
                var person = loadPersonFromFile("Content/People/" + Path.GetFileName(fileSystemInfo.Name));
                if (person != null)
                {
                    all.Add(person);
                    ++num;
                }
            }
            for (var index = num; index < 200; ++index)
            {
                var male  = Utils.flipCoin();
                var fName = male
                    ? maleNames[Utils.random.Next(maleNames.Length)]
                    : femaleNames[Utils.random.Next(femaleNames.Length)];
                var lName = surnames[Utils.random.Next(surnames.Length)];
                all.Add(new Person(fName, lName, male, false, UsernameGenerator.getName()));
            }
            hackers = new List <Person>();
            generatePeopleForList(hackers, 10, true);
            hubAgents = new List <Person>();
            generatePeopleForList(hubAgents, 22, true);
        }
Esempio n. 6
0
        public static void init()
        {
            People.maleNames   = Utils.readEntireFile("Content/PersonData/MaleNames.txt").Replace("\r", "").Split(Utils.newlineDelim);
            People.femaleNames = Utils.readEntireFile("Content/PersonData/FemaleNames.txt").Replace("\r", "").Split(Utils.newlineDelim);
            People.surnames    = Utils.readEntireFile("Content/PersonData/Surnames.txt").Replace("\r", "").Split(Utils.newlineDelim);
            People.all         = new List <Person>(200);
            int num = 0;

            FileInfo[]    files      = new DirectoryInfo("Content/People").GetFiles("*.xml");
            List <string> stringList = new List <string>();

            for (int index = 0; index < files.Length; ++index)
            {
                stringList.Add("Content/People/" + Path.GetFileName(files[index].Name));
            }
            if (Settings.EnableDLC && DLC1SessionUpgrader.HasDLC1Installed)
            {
                foreach (FileSystemInfo file in new DirectoryInfo("Content/DLC/People").GetFiles("*.xml"))
                {
                    stringList.Add("Content/DLC/People/" + Path.GetFileName(file.Name));
                }
                People.PeopleWereGeneratedWithDLCAdditions = true;
            }
            for (int index = 0; index < stringList.Count; ++index)
            {
                Person person = People.loadPersonFromFile(LocalizedFileLoader.GetLocalizedFilepath(stringList[index]));
                if (person != null)
                {
                    People.all.Add(person);
                    ++num;
                }
                else
                {
                    Console.WriteLine("Person Load Error: " + stringList[index]);
                }
            }
            for (int index = num; index < 200; ++index)
            {
                bool   male    = Utils.flipCoin();
                string fName   = male ? People.maleNames[Utils.random.Next(People.maleNames.Length)] : People.femaleNames[Utils.random.Next(People.femaleNames.Length)];
                string surname = People.surnames[Utils.random.Next(People.surnames.Length)];
                People.all.Add(new Person(fName, surname, male, false, UsernameGenerator.getName()));
            }
            People.hackers = new List <Person>();
            People.generatePeopleForList(People.hackers, 10, true);
            People.hubAgents = new List <Person>();
            People.generatePeopleForList(People.hubAgents, 22, true);
        }
Esempio n. 7
0
        protected override void LoadContent()
        {
            if (!CanLoadContent)
            {
                return;
            }
            PortExploits.populate();
            sman.controllingPlayer = PlayerIndex.One;
            if (Settings.isConventionDemo)
            {
                setWindowPosition(new Vector2(200f, 200f));
            }
            LoadGraphicsContent();
            LoadRegenSafeContent();
            var content = Content;

            GuiData.font        = content.Load <SpriteFont>("Font23");
            GuiData.titlefont   = content.Load <SpriteFont>("Kremlin");
            GuiData.smallfont   = Content.Load <SpriteFont>("Font12");
            GuiData.UISmallfont = GuiData.smallfont;
            GuiData.tinyfont    = Content.Load <SpriteFont>("Font10");
            GuiData.UITinyfont  = GuiData.tinyfont;
            GuiData.detailfont  = Content.Load <SpriteFont>("Font7");
            GuiData.spriteBatch = sman.SpriteBatch;
            GuiData.font        = content.Load <SpriteFont>("Font23");
            GuiData.titlefont   = content.Load <SpriteFont>("Kremlin");
            GuiData.smallfont   = Content.Load <SpriteFont>("Font12");
            GuiData.UISmallfont = GuiData.smallfont;
            GuiData.tinyfont    = Content.Load <SpriteFont>("Font10");
            GuiData.UITinyfont  = GuiData.tinyfont;
            GuiData.detailfont  = Content.Load <SpriteFont>("Font7");
            GuiData.init(Window);
            GuiData.InitFontOptions(Content);
            VehicleInfo.init();
            WorldLocationLoader.init();
            ThemeManager.init(content);
            MissionGenerationParser.init();
            MissionGenerator.init(content);
            UsernameGenerator.init();
            MusicManager.init(content);
            SFX.init(content);
            OldSystemSaveFileManifest.Load();
            SaveFileManager.Init();
            HasLoadedContent = true;
            LoadInitialScreens();
        }
Esempio n. 8
0
 private static void generatePeopleForList(List <Person> list, int numberToGenerate, bool areHackers = false)
 {
     for (int index = 0; index < numberToGenerate; ++index)
     {
         bool male = Utils.flipCoin();
         if (areHackers)
         {
             male = !male || !Utils.flipCoin();
         }
         Person person = new Person(male ? People.maleNames[Utils.random.Next(People.maleNames.Length)] : People.femaleNames[Utils.random.Next(People.femaleNames.Length)], People.surnames[Utils.random.Next(People.surnames.Length)], male, areHackers, UsernameGenerator.getName());
         list.Add(person);
         People.all.Add(person);
     }
 }
Esempio n. 9
0
        protected override void LoadContent()
        {
            if (!this.CanLoadContent)
            {
                return;
            }
            PortExploits.populate();
            this.sman.controllingPlayer = PlayerIndex.One;
            if (Settings.isConventionDemo)
            {
                this.setWindowPosition(new Vector2(200f, 200f));
            }
            this.LoadGraphicsContent();
            this.LoadRegenSafeContent();
            ContentManager content = this.Content;

            GuiData.font        = content.Load <SpriteFont>("Font23");
            GuiData.titlefont   = content.Load <SpriteFont>("Kremlin");
            GuiData.smallfont   = this.Content.Load <SpriteFont>("Font12");
            GuiData.UISmallfont = GuiData.smallfont;
            GuiData.tinyfont    = this.Content.Load <SpriteFont>("Font10");
            GuiData.UITinyfont  = this.Content.Load <SpriteFont>("Font10");
            GuiData.detailfont  = this.Content.Load <SpriteFont>("Font7");
            GuiData.spriteBatch = this.sman.SpriteBatch;
            GuiData.InitFontOptions(this.Content);
            GuiData.init(this.Window);
            DLC1SessionUpgrader.CheckForDLCFiles();
            VehicleInfo.init();
            WorldLocationLoader.init();
            ThemeManager.init(content);
            MissionGenerationParser.init();
            MissionGenerator.init(content);
            UsernameGenerator.init();
            MusicManager.init(content);
            SFX.init(content);
            OldSystemSaveFileManifest.Load();
            try
            {
                SaveFileManager.Init(true);
            }
            catch (UnauthorizedAccessException ex)
            {
                MainMenu.AccumErrors += " ---- WARNING ---\nHacknet cannot access the Save File Folder (Path Below) to read/write save files.\nNO PROGRESS WILL BE SAVED.\n";
                MainMenu.AccumErrors += "Check folder permissions, run Hacknet.exe as Administrator, and try again.\n";
                MainMenu.AccumErrors += "If Errors Persist, search for \"Hacknet Workaround\" for a steam forums thread with more options.\n";
                MainMenu.AccumErrors  = MainMenu.AccumErrors + ":: Error Details ::\n" + Utils.GenerateReportFromException((Exception)ex);
            }
            if (this.NeedsSettingsLocaleActivation)
            {
                if (!Settings.ForceEnglish)
                {
                    string forActiveLanguage = PlatformAPISettings.GetCodeForActiveLanguage(LocaleActivator.SupportedLanguages);
                    LocaleActivator.ActivateLocale(forActiveLanguage, this.Content);
                    Settings.ActiveLocale = forActiveLanguage;
                }
            }
            else if (SettingsLoader.didLoad && Settings.ActiveLocale != "en-us")
            {
                LocaleActivator.ActivateLocale(Settings.ActiveLocale, this.Content);
            }
            Helpfile.init();
            FileEntry.init(this.Content);
            this.HasLoadedContent = true;
            this.LoadInitialScreens();
            if (!WebRenderer.Enabled)
            {
                return;
            }
            XNAWebRenderer.XNAWR_Initialize("file:///nope.html", WebRenderer.textureUpdated, 512, 512);
            WebRenderer.setSize(512, 512);
        }