ArkaliaCore.Game.Database.Tables.AccountInformationsTable.Load C# (CSharp) Метод

Load() публичный статический Метод

public static Load ( ) : void
Результат void
        public static void Load()
        {
            Utilities.Logger.Infos("Loading @account informations@ ...");
            Utilities.ConsoleStyle.EnableLoadingSymbol();

            Cache.Clear();
            var reader = DatabaseManager.Provider.ExecuteReader("SELECT * FROM accounts_data");
            while (reader.Read())
            {
                try
                {
                    var account = new Models.AccountInformationsModel()
                    {
                        ID = reader.GetInt32("ID"),
                        AccountId = reader.GetInt32("AccountID"),
                        Username = reader.GetString("Nickname"),
                        FriendsGuid = reader.GetString("FriendsGuids"),
                    };

                    #region Friends

                    foreach (var friend in account.FriendsGuid.Split(','))
                    {
                        try
                        {
                            if (friend != "")
                            {
                                account.Friends.Add(new Game.Friends.Friend(int.Parse(friend)));
                            }
                        }
                        catch (Exception e)
                        {
                            Utilities.Logger.Error("Can't loade friends for account '" + account.Username + "' : " + e.Message);
                        }
                    }

                    #endregion

                    Guid.Update(account.ID);
                    Cache.Add(account);
                }
                catch (Exception e)
                {
                    Utilities.Logger.Error("Can't load account : " + e.Message);
                }
            }
            reader.Close();

            Utilities.ConsoleStyle.DisabledLoadingSymbol();
            Utilities.Logger.Infos("Loaded @'" + Cache.Count + "'@ account informations");
        }
AccountInformationsTable