Пример #1
0
        public static void LoadSpellsToLearn()
        {
            lock (DatabaseProvider.Locker)
            {
                var sqlText = "SELECT * FROM spells_learn";
                var sqlCommand = new MySqlCommand(sqlText, DatabaseProvider.Connection);

                var sqlReader = sqlCommand.ExecuteReader();

                while (sqlReader.Read())
                {
                    var spell = new Entities.Models.Spells.SpellToLearnModel()
                    {
                        Race = sqlReader.GetInt16("Classe"),
                        Level = sqlReader.GetInt16("Level"),
                        SpellID = sqlReader.GetInt16("SpellId"),
                        Pos = sqlReader.GetInt16("Position"),
                    };

                    SpellsToLearnList.Add(spell);
                }

                sqlReader.Close();
            }

            Utilities.Loggers.Status.Write(string.Format("Loaded '{0}' spells to learn from the database !", SpellsToLearnList.Count));
        }
Пример #2
0
        public static void LoadSpellsToLearn()
        {
            var sqlText    = "SELECT * FROM spells_learn";
            var sqlCommand = new MySqlCommand(sqlText, Program.DBHelper.Use());

            var sqlReader = sqlCommand.ExecuteReader();

            while (sqlReader.Read())
            {
                var spell = new Entities.Models.Spells.SpellToLearnModel()
                {
                    Race    = sqlReader.GetInt16("Classe"),
                    Level   = sqlReader.GetInt16("Level"),
                    SpellID = sqlReader.GetInt16("SpellId"),
                    Pos     = sqlReader.GetInt16("Position"),
                };

                SpellsToLearnList.Add(spell);
            }

            sqlReader.Close();

            Utilities.Loggers.Status.Write(string.Format("Loaded '{0}' spells to learn from the database !", SpellsToLearnList.Count));
        }