コード例 #1
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room @class = HabboIM.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 = HabboIM.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);
                        }
                    }
                }
            }
        }
コード例 #2
0
        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)))
            {
                text = HabboIM.DoFilter(text, true, false);
                if (HabboIM.GetGame().AntiWerberStatus)
                {
                    text = ChatCommandHandler.smethod_4b(Session, text, "Chat");
                }
                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 = HabboIM.GetGame().GetClientManager().method_2(current);
                        if (@class == null)
                        {
                            break;
                        }


                        if (Session.GetHabbo().jail == 0)
                        {
                            @class.SendMessage(Message);
                        }
                        else
                        {
                            Session.SendNotification("Als Inhaftierter kannst du niemanden einladen.");
                        }
                    }
                }
            }
        }
コード例 #3
0
        public void method_7(string string_0, uint uint_1, uint uint_2, int int_0)
        {
            CatalogItem catalogItem = this.method_5(int_0).method_1(uint_2);
            uint        num         = this.method_14();
            Item        obj         = this.method_10();

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

            if (gameClient == null)
            {
                return;
            }
            gameClient.SendNotification("Du hast ein Geschenk in Inventar erhalten!");
            gameClient.GetHabbo().GetInventoryComponent().method_9(true);
        }
コード例 #4
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)
        {
            int         num1        = 0;
            int         num2        = 0;
            CatalogPage catalogPage = this.method_5(int_0);

            if (catalogPage == null || !catalogPage.bool_1 || !catalogPage.bool_0 || catalogPage.uint_0 > Session.GetHabbo().Rank || catalogPage.bool_2 && (!Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club") || !Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_vip")))
            {
                return(false);
            }
            CatalogItem catalogItem = catalogPage.method_1(uint_1);

            if (catalogItem == null)
            {
                return(false);
            }
            uint id = 0;

            if (bool_0)
            {
                if (Session.GetHabbo().jail == 1)
                {
                    Session.SendNotification("Du bist gebannt und kannst keine Geschenke versenden!");
                    return(false);
                }

                if (!catalogItem.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 client = HabboIM.GetDatabase().GetClient())
                {
                    client.AddParamWithValue("gift_user", (object)string_1);
                    try
                    {
                        id = (uint)client.ReadDataRow("SELECT Id FROM users WHERE username = @gift_user LIMIT 1", 30)[0];
                    }
                    catch (Exception ex)
                    {
                    }
                }
                if ((int)id == 0)
                {
                    ServerMessage Message5_0 = new ServerMessage(76U);
                    Message5_0.AppendBoolean(true);
                    Message5_0.AppendStringWithBreak(string_1);
                    Session.SendMessage(Message5_0);
                    return(false);
                }
            }
            if (catalogItem.IsLimited)
            {
                if (catalogItem.LimitedSold >= catalogItem.LimitedCount)
                {
                    Session.SendNotification("Dieses Möbelstück war limitiert und ist leider ausverkauft.");
                    return(false);
                }
                ++catalogItem.LimitedSold;
                using (DatabaseClient client = HabboIM.GetDatabase().GetClient())
                    client.ExecuteQuery(string.Concat(new object[4]
                    {
                        (object)"UPDATE catalog_items SET limited_sold = ",
                        (object)catalogItem.LimitedSold,
                        (object)" WHERE id = ",
                        (object)catalogItem.uint_0
                    }), 30);
                num2 = catalogItem.LimitedSold;
                num1 = catalogItem.LimitedCount;
                catalogPage.method_0();
                Session.SendMessage(catalogPage.message5_0);
            }
            bool Bool1 = false;
            bool Bool2 = false;
            int  num3  = catalogItem.int_2;

            if (Session.GetHabbo().Credits < catalogItem.int_0)
            {
                Bool1 = true;
            }
            if (num3 == 0 && Session.GetHabbo().ActivityPoints < catalogItem.int_1 || num3 > 0 && Session.GetHabbo().VipPoints < catalogItem.int_1)
            {
                Bool2 = true;
            }
            if (Bool1 || Bool2)
            {
                ServerMessage Message5_0 = new ServerMessage(68U);
                Message5_0.AppendBoolean(Bool1);
                Message5_0.AppendBoolean(Bool2);
                Session.SendMessage(Message5_0);
                return(false);
            }
            if (bool_0 && (int)catalogItem.method_0().Type == 101)
            {
                Session.SendNotification("Du kannst diese Item nicht als Geschenk kaufen.");
                return(false);
            }
            switch (catalogItem.method_0().InteractionType.ToLower())
            {
            case "pet":
                try
                {
                    string[] strArray   = string_0.Split('\n');
                    string   string_0_1 = strArray[0];
                    string   s          = strArray[1];
                    string   str        = strArray[2];
                    int.Parse(s);
                    if (!this.method_8(string_0_1) || s.Length > 2)
                    {
                        return(false);
                    }
                    if (str.Length != 6)
                    {
                        return(false);
                    }
                    break;
                }
                catch (Exception ex)
                {
                    return(false);
                }

            case "roomeffect":
                double num4 = 0.0;
                try
                {
                    num4 = double.Parse(string_0);
                }
                catch (Exception ex)
                {
                }
                string_0 = num4.ToString().Replace(',', '.');
                break;

            case "postit":
                string_0 = "FFFF33";
                break;

            case "dimmer":
                string_0 = "1,1,1,#000000,255";
                break;

            case "trophy":
                string_0 = Session.GetHabbo().Username + (object)Convert.ToChar(9) + (object)DateTime.Now.Day + "-" + (object)DateTime.Now.Month + "-" + (object)DateTime.Now.Year + (object)Convert.ToChar(9) + ChatCommandHandler.smethod_4(HabboIM.DoFilter(string_0, true, true));
                break;

            case "musicdisc":
                string_0 = catalogItem.song_id.ToString();
                break;

            default:
                if (catalogItem.string_0.StartsWith("disc_"))
                {
                    string_0 = catalogItem.string_0.Split('_')[1];
                    break;
                }
                string_0 = "";
                break;
            }
            if (catalogItem.int_0 > 0)
            {
                Session.GetHabbo().Credits -= catalogItem.int_0;
                Session.GetHabbo().UpdateCredits(true);
            }
            if (catalogItem.int_1 > 0 && num3 == 0)
            {
                Session.GetHabbo().ActivityPoints -= catalogItem.int_1;
                Session.GetHabbo().UpdateActivityPoints(true);
            }
            else if (catalogItem.int_1 > 0 && num3 > 0)
            {
                Session.GetHabbo().VipPoints -= catalogItem.int_1;
                Session.GetHabbo().method_16(0);
                Session.GetHabbo().UpdateVipPoints(false, true);
            }
            ServerMessage Message5_0_1 = new ServerMessage(67U);

            Message5_0_1.AppendUInt(catalogItem.method_0().UInt32_0);
            Message5_0_1.AppendStringWithBreak(catalogItem.method_0().Name);
            Message5_0_1.AppendInt32(catalogItem.int_0);
            Message5_0_1.AppendInt32(catalogItem.int_1);
            Message5_0_1.AppendInt32(catalogItem.int_2);
            if (bool_1)
            {
                Message5_0_1.AppendInt32(1);
            }
            else
            {
                Message5_0_1.AppendInt32(0);
            }
            Message5_0_1.AppendStringWithBreak(catalogItem.method_0().Type.ToString());
            Message5_0_1.AppendInt32(catalogItem.method_0().Sprite);
            Message5_0_1.AppendStringWithBreak("");
            Message5_0_1.AppendInt32(1);
            Message5_0_1.AppendInt32(-1);
            Message5_0_1.AppendStringWithBreak("");
            Session.SendMessage(Message5_0_1);
            if (bool_0)
            {
                uint num5 = this.method_14();
                Item obj  = this.method_10();
                using (DatabaseClient client = HabboIM.GetDatabase().GetClient())
                {
                    client.AddParamWithValue("gift_message", (object)("!" + ChatCommandHandler.smethod_4(HabboIM.DoFilter(string_2, true, true)) + " - " + Session.GetHabbo().Username));
                    client.AddParamWithValue("extra_data", (object)string_0);
                    client.ExecuteQuery("INSERT INTO items (Id,user_id,base_item,wall_pos) VALUES ('" + (object)num5 + "','" + (object)id + "','" + (object)obj.UInt32_0 + "','')", 30);
                    client.ExecuteQuery(string.Concat(new object[3]
                    {
                        (object)"INSERT INTO items_extra_data (item_id,extra_data) VALUES ('",
                        (object)num5,
                        (object)"',@gift_message)"
                    }), 30);
                    client.ExecuteQuery("INSERT INTO user_presents (item_id,base_id,amount,extra_data) VALUES ('" + (object)num5 + "','" + (object)catalogItem.method_0().UInt32_0 + "','" + (object)catalogItem.int_3 + "',@extra_data)", 30);
                }
                GameClient gameClient = HabboIM.GetGame().GetClientManager().method_2(id);
                if (gameClient != null)
                {
                    gameClient.SendNotification("Du hast ein Geschenk bekommen! Überprüfe dein Inventar.");
                    gameClient.GetHabbo().GetInventoryComponent().method_9(true);
                    ++gameClient.GetHabbo().GiftsReceived;
                    gameClient.GetHabbo().CheckGiftReceivedAchievements();
                }
                ++Session.GetHabbo().GiftsGiven;
                Session.GetHabbo().CheckGiftGivenAchievements();
                Session.SendNotification("Geschenk erfolgreich gesendet.");
                return(true);
            }
            this.method_9(Session, catalogItem.method_0(), catalogItem.int_3, string_0, true, 0U);
            if (catalogItem.uint_2 > 0U)
            {
                HabboIM.GetGame().GetAchievementManager().addAchievement(Session, catalogItem.uint_2, 1);
            }
            if (!string.IsNullOrEmpty(catalogItem.BadgeID))
            {
                Session.GetHabbo().GetBadgeComponent().SendBadge(Session, catalogItem.BadgeID, true);
            }
            return(true);
        }
コード例 #5
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room @class = HabboIM.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null)
            {
                RoomItem class2 = @class.method_28(Event.PopWiredUInt());
                if (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 = HabboIM.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);
                }
            }
        }
コード例 #6
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            try
            {
                Room     @class = HabboIM.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 = HabboIM.DoFilter(text2, false, true);
                    text2 = ChatCommandHandler.smethod_4(text2);
                    if (!(text2 == class2.string_2))
                    {
                        string string_ = text2.Split(new char[]
                            {
                                ':'
                            })[0].ToLower();
                        if (HabboIM.GetGame().GetRoleManager().method_12(string_, Session))
                        {
                            class2.string_2 = text2;
                        }
                        else
                        {
                            Session.GetHabbo().Whisper(HabboIMEnvironment.GetExternalText("wired_error_permissions"));
                        }
                    }
                    break;
                }

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

                case "wf_act_saymsg":
                {
                    Event.PopWiredBoolean();
                    string text2 = Event.PopFixedString();
                    text2 = HabboIM.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 = HabboIM.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
            {
            }
        }
コード例 #7
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            string text = HabboIM.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.GetClientMessageHandler().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   = HabboIM.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 = HabboIM.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;
                                        HabboIM.GetGame().GetRoomManager().method_16(HabboIM.GetGame().GetRoomManager().GetRoom(current.Id));
                                    }
                                }
                                using (DatabaseClient class3 = HabboIM.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"
                                    }));
                                    HabboIM.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().OwnedRooms)
                                    {
                                        current2.Owner = text;
                                    }
                                }
                                Session.GetHabbo().ChangeNamaAchievementsCompleted();
                            }
                        }
                    }
                }
            }
        }