Ejemplo n.º 1
0
        public static void SaveAccount(MinecraftAccount Account)
        {
            CheckForDataDirectory();

            string Json = JsonConvert.SerializeObject(Account);

            CheckForAccountsDirectory();

            File.WriteAllText("Data/Accounts/" + Account.Email + ".json", Json);
        }
Ejemplo n.º 2
0
        public static void LoadAccounts()
        {
            CheckForDataDirectory();
            CheckForAccountsDirectory();


            foreach (string FileName in Directory.GetFiles("Data/Accounts"))
            {
                if (FileName.Contains(".json"))
                {
                    MinecraftAccount Account = JsonConvert.DeserializeObject <MinecraftAccount>(FileName);
                    LoadedAccounts.Add(Account);
                }
            }
        }