Exemplo n.º 1
0
        public void method_7(string string_0, uint uint_1, uint uint_2, int int_0)
        {
            CatalogPage @class = this.method_5(int_0);
            CatalogItem class2 = @class.method_1(uint_2);
            uint        num    = this.method_14();
            Item        class3 = this.method_10();

            using (DatabaseClient class4 = GoldTree.GetDatabase().GetClient())
            {
                class4.AddParamWithValue("gift_message", "!" + ChatCommandHandler.smethod_4(GoldTree.DoFilter(string_0, true, true)));
                class4.ExecuteQuery(string.Concat(new object[]
                {
                    "INSERT INTO items (Id,user_id,base_item,extra_data,wall_pos) VALUES ('",
                    num,
                    "','",
                    uint_1,
                    "','",
                    class3.UInt32_0,
                    "',@gift_message,'')"
                }));
                class4.ExecuteQuery(string.Concat(new object[]
                {
                    "INSERT INTO user_presents (item_id,base_id,amount,extra_data) VALUES ('",
                    num,
                    "','",
                    class2.method_0().UInt32_0,
                    "','",
                    class2.int_3,
                    "','')"
                }));
            }
            GameClient class5 = GoldTree.GetGame().GetClientManager().method_2(uint_1);

            if (class5 != null)
            {
                class5.SendNotif("You have received a gift! Check your inventory.");
                class5.GetHabbo().method_23().method_9(true);
            }
        }
Exemplo n.º 2
0
        public ServerMessage method_19(CatalogPage class48_0)
        {
            ServerMessage Message = new ServerMessage(127u);

            Message.AppendInt32(class48_0.Int32_0);
            string string_ = class48_0.string_1;

            switch (string_)
            {
            case "frontpage":
                Message.AppendStringWithBreak("frontpage3");
                Message.AppendInt32(3);
                Message.AppendStringWithBreak(class48_0.string_2);
                Message.AppendStringWithBreak(class48_0.string_3);
                Message.AppendStringWithBreak("");
                Message.AppendInt32(11);
                Message.AppendStringWithBreak(class48_0.string_5);
                Message.AppendStringWithBreak(class48_0.string_9);
                Message.AppendStringWithBreak(class48_0.string_6);
                Message.AppendStringWithBreak(class48_0.string_7);
                Message.AppendStringWithBreak(class48_0.string_10);
                Message.AppendStringWithBreak("#FAF8CC");
                Message.AppendStringWithBreak("#FAF8CC");
                Message.AppendStringWithBreak("Read More >");
                Message.AppendStringWithBreak("magic.credits");
                goto IL_47F;

            case "recycler_info":
                Message.AppendStringWithBreak(class48_0.string_1);
                Message.AppendInt32(2);
                Message.AppendStringWithBreak(class48_0.string_2);
                Message.AppendStringWithBreak(class48_0.string_3);
                Message.AppendInt32(3);
                Message.AppendStringWithBreak(class48_0.string_5);
                Message.AppendStringWithBreak(class48_0.string_6);
                Message.AppendStringWithBreak(class48_0.string_7);
                goto IL_47F;

            case "recycler_prizes":
                Message.AppendStringWithBreak("recycler_prizes");
                Message.AppendInt32(1);
                Message.AppendStringWithBreak("catalog_recycler_headline3");
                Message.AppendInt32(1);
                Message.AppendStringWithBreak(class48_0.string_5);
                goto IL_47F;

            case "spaces":
                Message.AppendStringWithBreak("spaces_new");
                Message.AppendInt32(1);
                Message.AppendStringWithBreak(class48_0.string_2);
                Message.AppendInt32(1);
                Message.AppendStringWithBreak(class48_0.string_5);
                goto IL_47F;

            case "recycler":
                Message.AppendStringWithBreak(class48_0.string_1);
                Message.AppendInt32(2);
                Message.AppendStringWithBreak(class48_0.string_2);
                Message.AppendStringWithBreak(class48_0.string_3);
                Message.AppendInt32(1);
                Message.AppendStringWithBreak(class48_0.string_5, 10);
                Message.AppendStringWithBreak(class48_0.string_6);
                Message.AppendStringWithBreak(class48_0.string_7);
                goto IL_47F;

            case "trophies":
                Message.AppendStringWithBreak("trophies");
                Message.AppendInt32(1);
                Message.AppendStringWithBreak(class48_0.string_2);
                Message.AppendInt32(2);
                Message.AppendStringWithBreak(class48_0.string_5);
                Message.AppendStringWithBreak(class48_0.string_7);
                goto IL_47F;

            case "pets":
                Message.AppendStringWithBreak("pets");
                Message.AppendInt32(2);
                Message.AppendStringWithBreak(class48_0.string_2);
                Message.AppendStringWithBreak(class48_0.string_3);
                Message.AppendInt32(4);
                Message.AppendStringWithBreak(class48_0.string_5);
                Message.AppendStringWithBreak("");
                Message.AppendStringWithBreak("Pick a color:");
                Message.AppendStringWithBreak("Pick a race:");
                goto IL_47F;

            case "club_buy":
                Message.AppendStringWithBreak("club_buy");
                Message.AppendInt32(1);
                Message.AppendStringWithBreak("habboclub_2");
                Message.AppendInt32(1);
                goto IL_47F;

            case "club_gifts":
                Message.AppendStringWithBreak("club_gifts");
                Message.AppendInt32(1);
                Message.AppendStringWithBreak("habboclub_2");
                Message.AppendInt32(1);
                Message.AppendStringWithBreak("");
                Message.AppendInt32(1);
                goto IL_47F;

            case "soundmachine":
                Message.AppendStringWithBreak(class48_0.string_1);
                Message.AppendInt32(2);
                Message.AppendStringWithBreak(class48_0.string_2);
                Message.AppendStringWithBreak(class48_0.string_3);
                Message.AppendInt32(2);
                Message.AppendStringWithBreak(class48_0.string_5);
                Message.AppendStringWithBreak(class48_0.string_7);
                goto IL_47F;
            }
            Message.AppendStringWithBreak(class48_0.string_1);
            Message.AppendInt32(3);
            Message.AppendStringWithBreak(class48_0.string_2);
            Message.AppendStringWithBreak(class48_0.string_3);
            Message.AppendStringWithBreak(class48_0.string_4);
            Message.AppendInt32(3);
            Message.AppendStringWithBreak(class48_0.string_5);
            Message.AppendStringWithBreak(class48_0.string_7);
            Message.AppendStringWithBreak(class48_0.string_8);
IL_47F:
            Message.AppendInt32(class48_0.list_0.Count);
            foreach (CatalogItem current in class48_0.list_0)
            {
                current.method_1(Message);
            }
            return(Message);
        }
Exemplo n.º 3
0
        public bool method_6(GameClient Session, int int_0, uint uint_1, string string_0, bool bool_0, string string_1, string string_2, bool bool_1)
        {
            CatalogPage @class = this.method_5(int_0);

            if (@class == null || [email protected]_1 || [email protected]_0 || @class.uint_0 > Session.GetHabbo().Rank)
            {
                return(false);
            }
            else
            {
                if (@class.bool_2 && (!Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club") || !Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_vip")))
                {
                    return(false);
                }
                else
                {
                    CatalogItem class2 = @class.method_1(uint_1);
                    if (class2 == null)
                    {
                        return(false);
                    }
                    else
                    {
                        uint num = 0u;
                        if (bool_0)
                        {
                            if (!class2.method_0().AllowGift)
                            {
                                return(false);
                            }
                            if (Session.GetHabbo().method_4() > 0)
                            {
                                TimeSpan timeSpan = DateTime.Now - Session.GetHabbo().dateTime_0;
                                if (timeSpan.Seconds > 4)
                                {
                                    Session.GetHabbo().int_23 = 0;
                                }
                                if (timeSpan.Seconds < 4 && Session.GetHabbo().int_23 > 3)
                                {
                                    Session.GetHabbo().bool_15 = true;
                                    return(false);
                                }
                                if (Session.GetHabbo().bool_15&& timeSpan.Seconds < Session.GetHabbo().method_4())
                                {
                                    return(false);
                                }
                                Session.GetHabbo().bool_15    = false;
                                Session.GetHabbo().dateTime_0 = DateTime.Now;
                                Session.GetHabbo().int_23++;
                            }
                            using (DatabaseClient class3 = GoldTree.GetDatabase().GetClient())
                            {
                                class3.AddParamWithValue("gift_user", string_1);
                                try
                                {
                                    num = (uint)class3.ReadDataRow("SELECT Id FROM users WHERE username = @gift_user LIMIT 1")[0];
                                }
                                catch (Exception)
                                {
                                }
                            }
                            if (num == 0u)
                            {
                                ServerMessage Message = new ServerMessage(76u);
                                Message.AppendBoolean(true);
                                Message.AppendStringWithBreak(string_1);
                                Session.SendMessage(Message);
                                return(false);
                            }
                        }
                        bool flag  = false;
                        bool flag2 = false;
                        int  int_  = class2.int_2;
                        if (Session.GetHabbo().Credits < class2.int_0)
                        {
                            flag = true;
                        }
                        if ((int_ == 0 && Session.GetHabbo().ActivityPoints < class2.int_1) || (int_ > 0 && Session.GetHabbo().VipPoints < class2.int_1))
                        {
                            flag2 = true;
                        }
                        if (flag || flag2)
                        {
                            ServerMessage Message2 = new ServerMessage(68u);
                            Message2.AppendBoolean(flag);
                            Message2.AppendBoolean(flag2);
                            Session.SendMessage(Message2);
                            return(false);
                        }
                        else
                        {
                            if (bool_0 && class2.method_0().Type == 'e')
                            {
                                Session.SendNotif("You can not send this item as a gift.");
                                return(false);
                            }
                            else
                            {
                                string text = class2.method_0().InteractionType.ToLower();
                                if (text != null)
                                {
                                    if (!(text == "pet"))
                                    {
                                        if (text == "roomeffect")
                                        {
                                            double num2 = 0.0;
                                            try
                                            {
                                                num2 = double.Parse(string_0);
                                            }
                                            catch (Exception)
                                            {
                                            }
                                            string_0 = num2.ToString().Replace(',', '.');
                                            goto IL_4FC;
                                        }
                                        if (text == "postit")
                                        {
                                            string_0 = "FFFF33";
                                            goto IL_4FC;
                                        }
                                        if (text == "dimmer")
                                        {
                                            string_0 = "1,1,1,#000000,255";
                                            goto IL_4FC;
                                        }
                                        if (text == "trophy")
                                        {
                                            string_0 = string.Concat(new object[]
                                            {
                                                Session.GetHabbo().Username,
                                                Convert.ToChar(9),
                                                DateTime.Now.Day,
                                                "-",
                                                DateTime.Now.Month,
                                                "-",
                                                DateTime.Now.Year,
                                                Convert.ToChar(9),
                                                ChatCommandHandler.smethod_4(GoldTree.DoFilter(string_0, true, true))
                                            });
                                            goto IL_4FC;
                                        }
                                        if (text == "musicdisc")
                                        {
                                            string_0 = class2.song_id.ToString();
                                            goto IL_4FC;
                                        }
                                    }
                                    else
                                    {
                                        try
                                        {
                                            string[] array = string_0.Split(new char[]
                                            {
                                                '\n'
                                            });
                                            string string_3 = array[0];
                                            string text2    = array[1];
                                            string text3    = array[2];
                                            int.Parse(text2);
                                            if (!this.method_8(string_3))
                                            {
                                                return(false);
                                            }
                                            if (text2.Length > 2)
                                            {
                                                return(false);
                                            }
                                            if (text3.Length != 6)
                                            {
                                                return(false);
                                            }
                                            goto IL_4FC;
                                        }
                                        catch (Exception)
                                        {
                                            return(false);
                                        }
                                    }
                                }
                                if (class2.string_0.StartsWith("disc_"))
                                {
                                    string_0 = class2.string_0.Split(new char[]
                                    {
                                        '_'
                                    })[1];
                                }
                                else
                                {
                                    string_0 = "";
                                }
IL_4FC:
                                if (class2.int_0 > 0)
                                {
                                    Session.GetHabbo().Credits -= class2.int_0;
                                    Session.GetHabbo().method_13(true);
                                }
                                if (class2.int_1 > 0 && int_ == 0)
                                {
                                    Session.GetHabbo().ActivityPoints -= class2.int_1;
                                    Session.GetHabbo().method_15(true);
                                }
                                else
                                {
                                    if (class2.int_1 > 0 && int_ > 0)
                                    {
                                        Session.GetHabbo().VipPoints -= class2.int_1;
                                        Session.GetHabbo().method_16(0);
                                        Session.GetHabbo().method_14(false, true);
                                    }
                                }
                                ServerMessage Message3 = new ServerMessage(67u);
                                Message3.AppendUInt(class2.method_0().UInt32_0);
                                Message3.AppendStringWithBreak(class2.method_0().Name);
                                Message3.AppendInt32(class2.int_0);
                                Message3.AppendInt32(class2.int_1);
                                Message3.AppendInt32(class2.int_2);
                                if (bool_1)
                                {
                                    Message3.AppendInt32(1);
                                }
                                else
                                {
                                    Message3.AppendInt32(0);
                                }
                                Message3.AppendStringWithBreak(class2.method_0().Type.ToString());
                                Message3.AppendInt32(class2.method_0().Sprite);
                                Message3.AppendStringWithBreak("");
                                Message3.AppendInt32(1);
                                Message3.AppendInt32(-1);
                                Message3.AppendStringWithBreak("");
                                Session.SendMessage(Message3);
                                if (bool_0)
                                {
                                    uint num3   = this.method_14();
                                    Item class4 = this.method_10();
                                    using (DatabaseClient class3 = GoldTree.GetDatabase().GetClient())
                                    {
                                        class3.AddParamWithValue("gift_message", "!" + ChatCommandHandler.smethod_4(GoldTree.DoFilter(string_2, true, true)) + " - " + Session.GetHabbo().Username);
                                        class3.AddParamWithValue("extra_data", string_0);
                                        class3.ExecuteQuery(string.Concat(new object[]
                                        {
                                            "INSERT INTO items (Id,user_id,base_item,extra_data,wall_pos) VALUES ('",
                                            num3,
                                            "','",
                                            num,
                                            "','",
                                            class4.UInt32_0,
                                            "',@gift_message,'')"
                                        }));
                                        class3.ExecuteQuery(string.Concat(new object[]
                                        {
                                            "INSERT INTO user_presents (item_id,base_id,amount,extra_data) VALUES ('",
                                            num3,
                                            "','",
                                            class2.method_0().UInt32_0,
                                            "','",
                                            class2.int_3,
                                            "',@extra_data)"
                                        }));
                                    }
                                    GameClient class5 = GoldTree.GetGame().GetClientManager().method_2(num);
                                    if (class5 != null)
                                    {
                                        class5.SendNotif("You have received a gift! Check your inventory.");
                                        class5.GetHabbo().method_23().method_9(true);
                                        class5.GetHabbo().GiftsReceived++;
                                        class5.GetHabbo().CheckGiftReceivedAchievements();
                                    }
                                    Session.GetHabbo().GiftsGiven++;
                                    Session.GetHabbo().CheckGiftGivenAchievements();
                                    Session.SendNotif("Gift sent successfully!");
                                    return(true);
                                }
                                else
                                {
                                    this.method_9(Session, class2.method_0(), class2.int_3, string_0, true, 0u);
                                    if (class2.uint_2 > 0u)
                                    {
                                        GoldTree.GetGame().GetAchievementManager().addAchievement(Session, class2.uint_2, 1);
                                    }
                                    if (!string.IsNullOrEmpty(class2.BadgeID))
                                    {
                                        Session.GetHabbo().method_22().method_2(Session, class2.BadgeID, true);
                                    }
                                    return(true);
                                }
                            }
                        }
                    }
                }
            }
        }