Ejemplo n.º 1
0
 public static void LoadProficiencies(Client.GameState client)
 {
     if (client.Entity == null)
         return;
     client.Proficiencies = new System.SafeDictionary<ushort, Interfaces.ISkill>(100);
     MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("skills").Where("Type", "Proficiency").And("EntityID", client.Entity.UID);
     MySqlReader r = new MySqlReader(cmd );
     while (r.Read())
     {
         Interfaces.ISkill proficiency = new Network.GamePackets.Proficiency(true);
         proficiency.ID = r.ReadUInt16("ID");
         proficiency.Level = r.ReadByte("Level");
         proficiency.PreviousLevel = r.ReadByte("PreviousLevel");
         proficiency.Experience = r.ReadUInt32("Experience");
         proficiency.Available = true;
         if (!client.Proficiencies.ContainsKey(proficiency.ID))
             client.Proficiencies.Add(proficiency.ID, proficiency);
     }
     r.Close();
 }
        public static void LoadProficiencies(Client.GameState client, MySql.Data.MySqlClient.MySqlConnection conn)
        {
            if (client.Entity == null)
                return;

            client.Proficiencies = new System.SafeDictionary<ushort, Interfaces.IProf>(100);
            MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("profs").Where("EntityID", client.Entity.UID);
            PhoenixProject.Database.MySqlReader r = new PhoenixProject.Database.MySqlReader(cmd);
            while (r.Read())
            {
                Interfaces.IProf proficiency = new Network.GamePackets.Proficiency(true);
                proficiency.ID = r.ReadUInt16("ID");
                proficiency.Level = r.ReadByte("Level");
                proficiency.PreviousLevel = r.ReadByte("PreviousLevel");
                proficiency.Experience = r.ReadUInt32("Experience");
                proficiency.TempLevel = r.ReadByte("TempLevel");
                proficiency.Available = true;
                if (!client.Proficiencies.ContainsKey(proficiency.ID))
                    client.Proficiencies.Add(proficiency.ID, proficiency);
            }
            r.Close();
            r.Dispose();
        }