예제 #1
0
        public AvatarEffectsInventoryComponent(uint uint_1, GameClient class16_1, UserDataFactory class12_0)
        {
            this.Session = class16_1;
            this.list_0  = new List <AvatarEffect>();
            this.uint_0  = uint_1;
            this.int_0   = -1;
            this.list_0.Clear();
            DataTable     dataTable_    = class12_0.GetEffects();
            StringBuilder stringBuilder = new StringBuilder();

            foreach (DataRow dataRow in dataTable_.Rows)
            {
                AvatarEffect @class = new AvatarEffect((int)dataRow["effect_id"], (int)dataRow["total_duration"], Essential.StringToBoolean(dataRow["is_activated"].ToString()), (double)dataRow["activated_stamp"]);
                if (@class.Boolean_0)
                {
                    stringBuilder.Append(string.Concat(new object[]
                    {
                        "DELETE FROM user_effects WHERE user_id = '",
                        uint_1,
                        "' AND effect_id = '",
                        @class.int_0,
                        "' LIMIT 1; "
                    }));
                }
                else
                {
                    this.list_0.Add(@class);
                }
            }
            if (stringBuilder.Length > 0)
            {
                using (DatabaseClient class2 = Essential.GetDatabase().GetClient())
                {
                    class2.ExecuteQuery(stringBuilder.ToString());
                }
            }
        }