Example #1
0
        public static void LoadAccounts()
        {
            var database = new DBGameDatabase();
            var dbError  = database.Open();

            if (dbError.Number > 0)
            {
                WriteLog(LogType.System, $"Failed to load accounts", LogColor.Red);
                WriteLog(LogType.System, $"Error Number: {dbError.Number}", LogColor.Red);
                WriteLog(LogType.System, $"Error Message: {dbError.Message}", LogColor.Red);
            }
            else
            {
                Accounts = database.GetAccountList();
                database.Close();

                WriteLog(LogType.System, $"{Accounts.Count} accounts loaded", LogColor.Green);
            }
        }