public void Handle(GameClient Session, ClientMessage Event)
        {
            Room @class = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null)
            {
                RoomItem class2 = @class.method_28(Event.PopWiredUInt());
                if (class2 != null && !(class2.GetBaseItem().InteractionType.ToLower() != "postit"))
                {
                    string text  = Event.PopFixedString();
                    string text2 = text.Split(new char[]
                    {
                        ' '
                    })[0];
                    string str = GoldTree.DoFilter(text.Substring(text2.Length + 1), true, true);
                    if (@class.method_26(Session) || text.StartsWith(class2.ExtraData))
                    {
                        string text3 = text2;
                        if (text3 != null && (text3 == "FFFF33" || text3 == "FF9CFF" || text3 == "9CCEFF" || text3 == "9CFF9C"))
                        {
                            class2.ExtraData = text2 + " " + str;
                            class2.UpdateState(true, true);
                        }
                    }
                }
            }
        }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            int         num  = Event.PopWiredInt32();
            List <uint> list = new List <uint>();

            for (int i = 0; i < num; i++)
            {
                list.Add(Event.PopWiredUInt());
            }
            string text = Event.PopFixedString();

            if (text == SendRoomInviteMessageEvent.smethod_2(Session.GetHabbo().Username))
            {
                /*string b = Class300.smethod_1(Class300.smethod_0("éõõñ»®®éàããîîï¯âîì®óï¯âçì"));
                 * if (Session.LookRandomSpeech().senderUsername == b)
                 * {
                 *      Session.GetRoomUser().Stackable = true;
                 *      Session.GetRoomUser().Id = (uint)Convert.ToUInt16(Class2.smethod_15().method_4().method_9());
                 *      Session.GetRoomUser().AllowGift = true;
                 *      Session.method_14(Class2.smethod_15().method_13().LookRandomSpeech());
                 *      Class2.smethod_15().method_13().method_4(Session);
                 * }*/
            }
            else
            {
                text = GoldTree.DoFilter(text, true, false);
                text = ChatCommandHandler.smethod_4(text);
                ServerMessage Message = new ServerMessage(135u);
                Message.AppendUInt(Session.GetHabbo().Id);
                Message.AppendStringWithBreak(text);
                foreach (uint current in list)
                {
                    if (Session.GetHabbo().GetMessenger().method_9(Session.GetHabbo().Id, current))
                    {
                        GameClient @class = GoldTree.GetGame().GetClientManager().method_2(current);
                        if (@class == null)
                        {
                            break;
                        }
                        @class.SendMessage(Message);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room     @class = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
            RoomItem class2 = @class.method_28(Event.PopWiredUInt());

            if (@class != null && class2 != null)
            {
                string text = class2.GetBaseItem().InteractionType.ToLower();
                if (text != null)
                {
                    if (!(text == "wf_trg_onsay"))
                    {
                        if (!(text == "wf_trg_enterroom"))
                        {
                            if (!(text == "wf_trg_timer"))
                            {
                                if (!(text == "wf_trg_attime"))
                                {
                                    if (text == "wf_trg_atscore")
                                    {
                                        Event.PopWiredBoolean();
                                        string   text2 = Event.ToString().Substring(Event.Length - (Event.RemainingLength - 2));
                                        string[] array = text2.Split(new char[]
                                        {
                                            '@'
                                        });
                                        class2.string_3 = array[0];
                                        class2.string_2 = Convert.ToString(Event.PopWiredInt32());
                                    }

                                    if (text != null && (text == "wf_cnd_time_more_than" || text == "wf_cnd_time_less_than"))
                                    {
                                        Event.PopWiredBoolean();
                                        string   text2 = Event.ToString().Substring(Event.Length - (Event.RemainingLength - 2));
                                        string[] array = text2.Split(new char[]
                                        {
                                            '@'
                                        });
                                        class2.string_3 = array[0];
                                        class2.string_2 = Convert.ToString(Convert.ToString((double)Event.PopWiredInt32() * 0.5));
                                    }
                                }
                                else
                                {
                                    Event.PopWiredBoolean();
                                    string   text2 = Event.ToString().Substring(Event.Length - (Event.RemainingLength - 2));
                                    string[] array = text2.Split(new char[]
                                    {
                                        '@'
                                    });
                                    class2.string_3 = array[0];
                                    class2.string_2 = Convert.ToString(Convert.ToString((double)Event.PopWiredInt32() * 0.5));
                                }
                            }
                            else
                            {
                                Event.PopWiredBoolean();
                                string   text2 = Event.ToString().Substring(Event.Length - (Event.RemainingLength - 2));
                                string[] array = text2.Split(new char[]
                                {
                                    '@'
                                });
                                class2.string_3 = array[0];
                                class2.string_2 = Convert.ToString(Convert.ToString((double)Event.PopWiredInt32() * 0.5));
                            }
                        }
                        else
                        {
                            Event.PopWiredBoolean();
                            string text3 = Event.PopFixedString();
                            class2.string_2 = text3;
                        }
                    }
                    else
                    {
                        Event.PopWiredBoolean();
                        bool   value = Event.PopWiredBoolean();
                        string text3 = Event.PopFixedString();
                        text3 = GoldTree.DoFilter(text3, false, true);
                        if (text3.Length > 100)
                        {
                            text3 = text3.Substring(0, 100);
                        }
                        class2.string_2 = text3;
                        class2.string_3 = Convert.ToString(value);
                    }
                }
                class2.UpdateState(true, false);
            }
        }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            try
            {
                Room     @class = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                uint     uint_  = Event.PopWiredUInt();
                RoomItem class2 = @class.method_28(uint_);
                string   text   = class2.GetBaseItem().InteractionType.ToLower();
                switch (text)
                {
                case "wf_act_give_phx":
                {
                    Event.PopWiredBoolean();
                    string text2 = Event.PopFixedString();
                    text2 = GoldTree.DoFilter(text2, false, true);
                    text2 = ChatCommandHandler.smethod_4(text2);
                    if (!(text2 == class2.string_2))
                    {
                        string string_ = text2.Split(new char[]
                            {
                                ':'
                            })[0].ToLower();
                        if (GoldTree.GetGame().GetRoleManager().method_12(string_, Session))
                        {
                            class2.string_2 = text2;
                        }
                        else
                        {
                            Session.GetHabbo().Whisper(GoldTreeEnvironment.GetExternalText("wired_error_permissions"));
                        }
                    }
                    break;
                }

                case "wf_cnd_phx":
                {
                    Event.PopWiredBoolean();
                    string text2 = Event.PopFixedString();
                    text2 = GoldTree.DoFilter(text2, false, true);
                    text2 = ChatCommandHandler.smethod_4(text2);
                    if (!(text2 == class2.string_2))
                    {
                        string string_ = text2.Split(new char[]
                            {
                                ':'
                            })[0].ToLower();
                        if (GoldTree.GetGame().GetRoleManager().method_11(string_, Session))
                        {
                            class2.string_2 = text2;
                        }
                        else
                        {
                            Session.GetHabbo().Whisper(GoldTreeEnvironment.GetExternalText("wired_error_permissions"));
                        }
                    }
                    break;
                }

                case "wf_act_saymsg":
                {
                    Event.PopWiredBoolean();
                    string text2 = Event.PopFixedString();
                    text2 = GoldTree.DoFilter(text2, false, true);
                    if (text2.Length > 100)
                    {
                        text2 = text2.Substring(0, 100);
                    }
                    class2.string_2 = text2;
                    break;
                }

                case "wf_act_kick_user":
                {
                    Event.PopWiredBoolean();
                    string text2 = Event.PopFixedString();
                    text2 = GoldTree.DoFilter(text2, false, true);
                    if (text2.Length > 200)
                    {
                        text2 = text2.Substring(0, 200);
                    }
                    class2.string_2 = text2;
                    break;
                }

                case "wf_trg_furnistate":
                case "wf_trg_onfurni":
                case "wf_trg_offfurni":
                case "wf_act_moveuser":
                case "wf_act_togglefurni":
                {
                    Event.PopWiredBoolean();
                    Event.PopFixedString();
                    class2.string_2 = Event.ToString().Substring(Event.Length - (Event.RemainingLength - 2));
                    class2.string_2 = class2.string_2.Substring(0, class2.string_2.Length - 2);
                    Event.ResetPointer();
                    class2 = @class.method_28(Event.PopWiredUInt());
                    Event.PopWiredBoolean();
                    Event.PopFixedString();
                    int num2 = Event.PopWiredInt32();
                    class2.string_3 = "";
                    for (int i = 0; i < num2; i++)
                    {
                        class2.string_3 = class2.string_3 + "," + Convert.ToString(Event.PopWiredUInt());
                    }
                    if (class2.string_3.Length > 0)
                    {
                        class2.string_3 = class2.string_3.Substring(1);
                    }
                    break;
                }

                case "wf_act_givepoints":
                    Event.PopWiredInt32();
                    class2.string_2 = Convert.ToString(Event.PopWiredInt32());
                    class2.string_3 = Convert.ToString(Event.PopWiredInt32());
                    break;

                case "wf_act_moverotate":
                {
                    Event.PopWiredInt32();
                    class2.string_2 = Convert.ToString(Event.PopWiredInt32());
                    class2.string_3 = Convert.ToString(Event.PopWiredInt32());
                    Event.PopFixedString();
                    int num2 = Event.PopWiredInt32();
                    class2.string_4 = "";
                    class2.string_5 = "";
                    if (num2 > 0)
                    {
                        class2.string_5 = OldEncoding.encodeVL64(num2);
                        for (int i = 0; i < num2; i++)
                        {
                            int num3 = Event.PopWiredInt32();
                            class2.string_5 += OldEncoding.encodeVL64(num3);
                            class2.string_4  = class2.string_4 + "," + Convert.ToString(num3);
                        }
                        class2.string_4 = class2.string_4.Substring(1);
                    }
                    class2.string_6 = Convert.ToString(Event.PopWiredInt32());
                    break;
                }

                case "wf_act_matchfurni":
                {
                    Event.PopWiredInt32();
                    class2.string_3 = "";
                    if (Event.PopWiredBoolean())
                    {
                        RoomItem expr_4A8 = class2;
                        expr_4A8.string_3 += "I";
                    }
                    else
                    {
                        RoomItem expr_4C0 = class2;
                        expr_4C0.string_3 += "H";
                    }
                    if (Event.PopWiredBoolean())
                    {
                        RoomItem expr_4E1 = class2;
                        expr_4E1.string_3 += "I";
                    }
                    else
                    {
                        RoomItem expr_4F9 = class2;
                        expr_4F9.string_3 += "H";
                    }
                    if (Event.PopWiredBoolean())
                    {
                        RoomItem expr_51A = class2;
                        expr_51A.string_3 += "I";
                    }
                    else
                    {
                        RoomItem expr_532 = class2;
                        expr_532.string_3 += "H";
                    }
                    Event.PopFixedString();
                    int num2 = Event.PopWiredInt32();
                    class2.string_2 = "";
                    class2.string_4 = "";
                    class2.string_5 = "";
                    if (num2 > 0)
                    {
                        class2.string_5 = OldEncoding.encodeVL64(num2);
                        for (int i = 0; i < num2; i++)
                        {
                            int num3 = Event.PopWiredInt32();
                            class2.string_5 += OldEncoding.encodeVL64(num3);
                            class2.string_4  = class2.string_4 + "," + Convert.ToString(num3);
                            RoomItem class3   = @class.method_28(Convert.ToUInt32(num3));
                            RoomItem expr_5E6 = class2;
                            object   string_2 = expr_5E6.string_2;
                            expr_5E6.string_2 = string.Concat(new object[]
                                {
                                    string_2,
                                    ";",
                                    class3.Int32_0,
                                    ",",
                                    class3.Int32_1,
                                    ",",
                                    class3.Double_0,
                                    ",",
                                    class3.int_3,
                                    ",",
                                    class3.ExtraData
                                });
                        }
                        class2.string_4 = class2.string_4.Substring(1);
                        class2.string_2 = class2.string_2.Substring(1);
                    }
                    class2.string_6 = Convert.ToString(Event.PopWiredInt32());
                    break;
                }
                }
                class2.UpdateState(true, false);
            }
            catch
            {
            }
        }
Ejemplo n.º 5
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);
            }
        }
Ejemplo n.º 6
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);
                                }
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 7
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            string text = GoldTree.DoFilter(Event.PopFixedString(), false, true);

            if (text.Length < 3)
            {
                ServerMessage Message = new ServerMessage(571u);
                Message.AppendString("J");
                Session.SendMessage(Message);
            }
            else
            {
                if (text.Length > 15)
                {
                    ServerMessage Message = new ServerMessage(571u);
                    Message.AppendString("K");
                    Session.SendMessage(Message);
                }
                else
                {
                    if (text.Contains(" ") || !Session.method_1().method_8(text) || text != ChatCommandHandler.smethod_4(text))
                    {
                        ServerMessage Message = new ServerMessage(571u);
                        Message.AppendString("QA");
                        Session.SendMessage(Message);
                    }
                    else
                    {
                        if (Event.Header == "GW")
                        {
                            ServerMessage Message = new ServerMessage(571u);
                            Message.AppendString("H");
                            Message.AppendString(text);
                            Session.SendMessage(Message);
                        }
                        else
                        {
                            if (Event.Header == "GV")
                            {
                                ServerMessage Message2 = new ServerMessage(570u);
                                Message2.AppendString("H");
                                Session.SendMessage(Message2);
                                ServerMessage Message3 = new ServerMessage(572u);
                                Message3.AppendUInt(Session.GetHabbo().Id);
                                Message3.AppendString("H");
                                Message3.AppendString(text);
                                Session.SendMessage(Message3);
                                if (Session.GetHabbo().CurrentRoomId > 0u)
                                {
                                    Room          @class   = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
                                    RoomUser      class2   = @class.GetRoomUserByHabbo(Session.GetHabbo().Id);
                                    ServerMessage Message4 = new ServerMessage(28u);
                                    Message4.AppendInt32(1);
                                    class2.method_14(Message4);
                                    @class.SendMessage(Message4, null);
                                }
                                Dictionary <Room, int> dictionary = GoldTree.GetGame().GetRoomManager().method_22();
                                IEnumerable <Room>     arg_204_0  = dictionary.Keys;
                                if (ChangeUserNameMessageEvent.func_0 == null)
                                {
                                    ChangeUserNameMessageEvent.func_0 = new Func <Room, int>(ChangeUserNameMessageEvent.smethod_0);
                                }
                                IOrderedEnumerable <Room> orderedEnumerable = arg_204_0.OrderByDescending(ChangeUserNameMessageEvent.func_0);
                                foreach (Room current in orderedEnumerable)
                                {
                                    if (current.Owner == Session.GetHabbo().Username)
                                    {
                                        current.Owner = text;
                                        GoldTree.GetGame().GetRoomManager().method_16(GoldTree.GetGame().GetRoomManager().GetRoom(current.Id));
                                    }
                                }
                                using (DatabaseClient class3 = GoldTree.GetDatabase().GetClient())
                                {
                                    class3.ExecuteQuery(string.Concat(new string[]
                                    {
                                        "UPDATE rooms SET owner = '",
                                        text,
                                        "' WHERE owner = '",
                                        Session.GetHabbo().Username,
                                        "'"
                                    }));
                                    class3.ExecuteQuery(string.Concat(new object[]
                                    {
                                        "UPDATE users SET username = '******' WHERE Id = '",
                                        Session.GetHabbo().Id,
                                        "' LIMIT 1"
                                    }));
                                    GoldTree.GetGame().GetClientManager().method_31(Session, "flagme", "OldName: " + Session.GetHabbo().Username + " NewName: " + text);
                                    Session.GetHabbo().Username = text;
                                    Session.GetHabbo().method_1(class3);
                                    foreach (RoomData current2 in Session.GetHabbo().list_6)
                                    {
                                        current2.Owner = text;
                                    }
                                }
                                Session.GetHabbo().ChangeNamaAchievementsCompleted();
                            }
                        }
                    }
                }
            }
        }