Exemple #1
0
        public void method_1(int int_1)
        {
            AvatarEffect @class = this.method_5(int_1, true);

            if (@class != null && @class.Boolean_0)
            {
                using (DatabaseClient class2 = Essential.GetDatabase().GetClient())
                {
                    class2.ExecuteQuery(string.Concat(new object[]
                    {
                        "DELETE FROM user_effects WHERE user_id = '",
                        this.uint_0,
                        "' AND effect_id = '",
                        int_1,
                        "' AND is_activated = '1' LIMIT 1"
                    }));
                }
                this.list_0.Remove(@class);
                ServerMessage Message = new ServerMessage(Outgoing.StopEffect); // Updated
                Message.AppendInt32(int_1);
                this.method_8().SendMessage(Message);
                if (this.int_0 >= 0)
                {
                    this.method_2(-1, false);
                }
            }
        }
Exemple #2
0
        public void method_3(int int_1)
        {
            AvatarEffect @class = this.method_5(int_1, false);

            if (@class != null && [email protected]_0 && [email protected]_0 && (this.method_8() != null && this.method_8().GetHabbo() != null))
            {
                Room class2 = this.method_9();
                if (class2 != null)
                {
                    RoomUser class3 = class2.GetRoomUserByHabbo(this.method_8().GetHabbo().Id);
                    if (class3.byte_1 <= 0 && class3.class34_1 == null)
                    {
                        using (DatabaseClient class4 = Essential.GetDatabase().GetClient())
                        {
                            class4.ExecuteQuery(string.Concat(new object[]
                            {
                                "UPDATE user_effects SET is_activated = '1', activated_stamp = '",
                                Essential.GetUnixTimestamp(),
                                "' WHERE user_id = '",
                                this.uint_0,
                                "' AND effect_id = '",
                                int_1,
                                "' LIMIT 1"
                            }));
                        }
                        @class.method_0();
                        ServerMessage Message = new ServerMessage(Outgoing.EnableEffect); // Updated
                        Message.AppendInt32(@class.int_0);
                        Message.AppendInt32(@class.int_1);
                        this.method_8().SendMessage(Message);
                    }
                }
            }
        }
Exemple #3
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());
                }
            }
        }
		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());
				}
			}
		}