Exemple #1
0
        public static List <Player> LoadAll()
        {
            List <Player> players = DeserializeFile <List <Player> >(FileDb);

            if (players != null)
            {
                GUIDGenerator.SetGUID(players.Max(p => p.PlayerId));
            }
            return(players ?? new List <Player>());
        }
Exemple #2
0
        public static Dictionary <int, AccountData> LoadAll()
        {
            Dictionary <int, AccountData> accounts = new Dictionary <int, AccountData>();

            foreach (var a in MysqlDB.SelectAll(new MysqlQuery(SELECT_QUERY)))
            {
                AccountData data = new AccountData()
                {
                    Id          = Convert.ToInt32(a["guid"]),
                    Login       = Convert.ToString(a["username"]),
                    Password    = Convert.ToString(a["password"]),
                    AccessLevel = Convert.ToInt32(a["access_level"])
                };
                GUIDGenerator.SetGUID(data.Id);
                accounts.Add(data.Id, data);
            }
            return(accounts);
        }