Пример #1
0
        public void LoadEquipment(GameClient Client)
        {
            SQLiteCommand Command = GetConnection().CreateCommand();

            Command.CommandText = "SELECT * FROM Equipments WHERE EntityUID = @UID;";
            Command.Parameters.Add("@UID", DbType.Int32).Value = Client.Entity.UID;

            SQLiteDataReader Reader = Command.ExecuteReader();

            while (Reader.Read())
            {
                ConquerItem Item = new ConquerItem(Client);
                Item.ID            = Convert.ToUInt32(Reader["ItemID"]);
                Item.Plus          = Convert.ToByte(Reader["Plus"]);
                Item.SocketOne     = Convert.ToByte(Reader["SocketOne"]);
                Item.SocketTwo     = Convert.ToByte(Reader["SocketTwo"]);
                Item.Mode          = Convert.ToUInt16(Reader["Mode"]);
                Item.Durability    = Convert.ToUInt16(Reader["Durability"]);
                Item.MaxDurability = Convert.ToUInt16(Reader["MaxDurability"]);
                Item.Effect        = Convert.ToUInt16(Reader["Effect"]);
                Item.Position      = (ItemPosition)Convert.ToByte(Reader["Position"]);

                Client.AddEquipment(Item, Item.Position);
            }
            Reader.Close();
        }
Пример #2
0
        public void LoadEquipment(GameClient Client)
        {
            SQLiteCommand Command = GetConnection().CreateCommand();
            Command.CommandText = "SELECT * FROM Equipments WHERE EntityUID = @UID;";
            Command.Parameters.Add("@UID", DbType.Int32).Value = Client.Entity.UID;

            SQLiteDataReader Reader = Command.ExecuteReader();
            while (Reader.Read())
            {
                ConquerItem Item = new ConquerItem(Client);
                Item.ID = Convert.ToUInt32(Reader["ItemID"]);
                Item.Plus = Convert.ToByte(Reader["Plus"]);
                Item.SocketOne = Convert.ToByte(Reader["SocketOne"]);
                Item.SocketTwo = Convert.ToByte(Reader["SocketTwo"]);
                Item.Mode = Convert.ToUInt16(Reader["Mode"]);
                Item.Durability = Convert.ToUInt16(Reader["Durability"]);
                Item.MaxDurability = Convert.ToUInt16(Reader["MaxDurability"]);
                Item.Effect = Convert.ToUInt16(Reader["Effect"]);
                Item.Position = (ItemPosition)Convert.ToByte(Reader["Position"]);

                Client.AddEquipment(Item, Item.Position);
            }
            Reader.Close();
        }