public void Handle(GameClient Session, ClientMessage Event)
        {
            string text = GoldTree.FilterString(Event.PopFixedString());

            if (text.Length <= 50 && !(text != ChatCommandHandler.smethod_4(text)) && !(text == Session.GetHabbo().Motto))
            {
                Session.GetHabbo().Motto = text;
                using (DatabaseClient @class = GoldTree.GetDatabase().GetClient())
                {
                    @class.AddParamWithValue("motto", text);
                    @class.ExecuteQuery("UPDATE users SET motto = @motto WHERE Id = '" + Session.GetHabbo().Id + "' LIMIT 1");
                }
                if (Session.GetHabbo().CurrentQuestId > 0 && GoldTree.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "CHANGEMOTTO")
                {
                    GoldTree.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session);
                }
                ServerMessage Message = new ServerMessage(484u);
                Message.AppendInt32(-1);
                Message.AppendStringWithBreak(Session.GetHabbo().Motto);
                Session.SendMessage(Message);
                if (Session.GetHabbo().InRoom)
                {
                    Room class14_ = Session.GetHabbo().CurrentRoom;
                    if (class14_ == null)
                    {
                        return;
                    }
                    RoomUser class2 = class14_.GetRoomUserByHabbo(Session.GetHabbo().Id);
                    if (class2 == null)
                    {
                        return;
                    }
                    ServerMessage Message2 = new ServerMessage(266u);
                    Message2.AppendInt32(class2.VirtualId);
                    Message2.AppendStringWithBreak(Session.GetHabbo().Figure);
                    Message2.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
                    Message2.AppendStringWithBreak(Session.GetHabbo().Motto);
                    Message2.AppendInt32(Session.GetHabbo().AchievementScore);
                    Message2.AppendStringWithBreak("");
                    class14_.SendMessage(Message2, null);
                }
                Session.GetHabbo().MottoAchievementsCompleted();
            }
        }
Example #2
0
        public RoomData method_20(GameClient Session, string string_0, string string_1)
        {
            string_0 = GoldTree.FilterString(string_0);
            RoomData result;

            if (!this.Models.ContainsKey(string_1))
            {
                Session.SendNotif("Sorry, this room model has not been added yet. Try again later.");
                result = null;
            }
            else
            {
                if (this.Models[string_1].bool_0 && !Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club") && !Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_vip"))
                {
                    Session.SendNotif("You must be an GoldTree Club member to use that room layout.");
                    result = null;
                }
                else
                {
                    if (string_0.Length < 3)
                    {
                        Session.SendNotif("Room name is too short for room creation!");
                        result = null;
                    }
                    else
                    {
                        uint uint_ = 0u;
                        using (DatabaseClient @class = GoldTree.GetDatabase().GetClient())
                        {
                            @class.AddParamWithValue("caption", string_0);
                            @class.AddParamWithValue("model", string_1);
                            @class.AddParamWithValue("username", Session.GetHabbo().Username);
                            @class.ExecuteQuery("INSERT INTO rooms (roomtype,caption,owner,model_name) VALUES ('private',@caption,@username,@model)");
                            Session.GetHabbo().Class12_0.DataTable_10 = @class.ReadDataTable("SELECT * FROM rooms WHERE owner = @username ORDER BY Id ASC");
                            uint_ = (uint)@class.ReadDataRow("SELECT Id FROM rooms WHERE owner = @username AND caption = @caption ORDER BY Id DESC")[0];
                            Session.GetHabbo().method_1(@class);
                        }
                        result = this.method_12(uint_);
                    }
                }
            }
            return(result);
        }
Example #3
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            if (Session.GetHabbo().GetMessenger() != null)
            {
                int num = Event.PopWiredInt32();
                for (int i = 0; i < num; i++)
                {
                    uint             uint_  = Event.PopWiredUInt();
                    MessengerRequest @class = Session.GetHabbo().GetMessenger().method_4(uint_);
                    if (@class != null)
                    {
                        if (@class.To != Session.GetHabbo().Id)
                        {
                            break;
                        }

                        if (!Session.GetHabbo().GetMessenger().method_9(@class.To, @class.From))
                        {
                            Session.GetHabbo().GetMessenger().method_12(@class.From);
                        }

                        Session.GetHabbo().GetMessenger().method_11(uint_);

                        if (Session.GetHabbo().FriendStreamEnabled)
                        {
                            using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                            {
                                string fromlook = GoldTree.FilterString(@class.SenderFigure);
                                string tolook   = GoldTree.FilterString(Session.GetHabbo().Figure);
                                class2.AddParamWithValue("fromusername", @class.senderUsername);
                                class2.AddParamWithValue("tousername", Session.GetHabbo().Username);
                                class2.AddParamWithValue("fromlook", fromlook);
                                class2.AddParamWithValue("tolook", tolook);
                                class2.ExecuteQuery("INSERT INTO `friend_stream` (`id`, `type`, `userid`, `gender`, `look`, `time`, `data`, `data_extra`) VALUES (NULL, '0', '" + Session.GetHabbo().Id + "', '" + @class.SenderGender + "', @fromlook, UNIX_TIMESTAMP(), '" + @class.From + "', @fromusername);");
                                class2.ExecuteQuery("INSERT INTO `friend_stream` (`id`, `type`, `userid`, `gender`, `look`, `time`, `data`, `data_extra`) VALUES (NULL, '0', '" + @class.From + "', '" + Session.GetHabbo().Gender + "', @tolook, UNIX_TIMESTAMP(), '" + Session.GetHabbo().Id + "', @tousername);");
                            }
                        }
                    }
                }
            }
        }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            bool flag = false;

            if (GoldTree.GetGame().GetModerationTool().method_9(Session.GetHabbo().Id))
            {
                flag = true;
            }
            if (!flag)
            {
                string string_ = GoldTree.FilterString(Event.PopFixedString());
                Event.PopWiredInt32();
                int  int_  = Event.PopWiredInt32();
                uint uint_ = Event.PopWiredUInt();
                GoldTree.GetGame().GetModerationTool().method_3(Session, int_, uint_, string_);
            }
            ServerMessage Message = new ServerMessage(321u);

            Message.AppendBoolean(flag);
            Session.SendMessage(Message);
        }
Example #5
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room @class = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null && @class.CheckRights(Session, true) && @class.Event != null)
            {
                int    int_     = Event.PopWiredInt32();
                string string_  = GoldTree.FilterString(Event.PopFixedString());
                string string_2 = GoldTree.FilterString(Event.PopFixedString());
                int    num      = Event.PopWiredInt32();
                @class.Event.Category    = int_;
                @class.Event.Name        = string_;
                @class.Event.Description = string_2;
                @class.Event.Tags        = new List <string>();
                for (int i = 0; i < num; i++)
                {
                    @class.Event.Tags.Add(GoldTree.FilterString(Event.PopFixedString()));
                }
                @class.SendMessage(@class.Event.Serialize(Session), null);
            }
        }
Example #6
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room @class = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null && @class.CheckRights(Session, true) && @class.Event == null && @class.State == 0)
            {
                int    int_    = Event.PopWiredInt32();
                string text    = GoldTree.FilterString(Event.PopFixedString());
                string string_ = GoldTree.FilterString(Event.PopFixedString());
                int    num     = Event.PopWiredInt32();
                if (text.Length >= 1)
                {
                    @class.Event      = new RoomEvent(@class.Id, text, string_, int_, null);
                    @class.Event.Tags = new List <string>();
                    for (int i = 0; i < num; i++)
                    {
                        @class.Event.Tags.Add(GoldTree.FilterString(Event.PopFixedString()));
                    }
                    @class.SendMessage(@class.Event.Serialize(Session), null);
                }
            }
        }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room @class = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null && @class.method_26(Session))
            {
                uint   num  = Event.PopWiredUInt();
                string a    = Event.PopFixedString().ToUpper();
                string text = GoldTree.FilterString(Event.PopFixedString());
                text  = text.Replace("hd-99999-99999", "");
                text += ".";
                RoomItem class2 = @class.Hashtable_0[num] as RoomItem;
                if (class2 != null)
                {
                    if (class2.ExtraData.Contains(','))
                    {
                        class2.string_2 = class2.ExtraData.Split(new char[]
                        {
                            ','
                        })[0];
                        class2.string_3 = class2.ExtraData.Split(new char[]
                        {
                            ','
                        })[1];
                    }
                    if (a == "M")
                    {
                        class2.string_2 = text;
                    }
                    else
                    {
                        class2.string_3 = text;
                    }
                    class2.ExtraData = class2.string_2 + "," + class2.string_3;
                    class2.UpdateState(true, true);
                }
            }
        }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room @class = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null && Session != null)
            {
                if (Session.GetHabbo().IsMuted)
                {
                    Session.SendNotification(GoldTreeEnvironment.GetExternalText("error_muted"));
                }
                else
                {
                    if (Session.GetHabbo().HasFuse("ignore_roommute") || [email protected]_4)
                    {
                        string text  = GoldTree.FilterString(Event.PopFixedString());
                        string text2 = text.Split(new char[]
                        {
                            ' '
                        })[0];
                        string text3 = text.Substring(text2.Length + 1);
                        text3 = ChatCommandHandler.smethod_4(text3);
                        RoomUser class2 = @class.GetRoomUserByHabbo(Session.GetHabbo().Id);
                        RoomUser class3 = @class.method_56(text2);
                        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 > 5 && !class2.IsBot)
                            {
                                ServerMessage Message = new ServerMessage(27u);
                                Message.AppendInt32(Session.GetHabbo().method_4());
                                Session.SendMessage(Message);
                                Session.GetHabbo().IsMuted = true;
                                Session.GetHabbo().int_4   = Session.GetHabbo().method_4();
                                return;
                            }
                            Session.GetHabbo().dateTime_0 = DateTime.Now;
                            Session.GetHabbo().int_23++;
                        }
                        ServerMessage Message2 = new ServerMessage(25u);
                        Message2.AppendInt32(class2.VirtualId);
                        Message2.AppendStringWithBreak(text3);
                        Message2.AppendBoolean(false);
                        if (class2 != null && !class2.IsBot)
                        {
                            class2.GetClient().SendMessage(Message2);
                        }
                        class2.Unidle();
                        if (class3 != null && !class3.IsBot && (class3.GetClient().GetHabbo().list_2.Count <= 0 || !class3.GetClient().GetHabbo().list_2.Contains(Session.GetHabbo().Id)))
                        {
                            class3.GetClient().SendMessage(Message2);
                            if (ServerConfiguration.EnableChatlog && !Session.GetHabbo().IsJuniori)
                            {
                                using (DatabaseClient class4 = GoldTree.GetDatabase().GetClient())
                                {
                                    class4.AddParamWithValue("message", "<Whisper to " + class3.GetClient().GetHabbo().Username + ">: " + text3);
                                    class4.ExecuteQuery(string.Concat(new object[]
                                    {
                                        "INSERT INTO chatlogs (user_id,room_id,hour,minute,timestamp,message,user_name,full_date) VALUES ('",
                                        Session.GetHabbo().Id,
                                        "','",
                                        @class.Id,
                                        "','",
                                        DateTime.Now.Hour,
                                        "','",
                                        DateTime.Now.Minute,
                                        "',UNIX_TIMESTAMP(),@message,'",
                                        Session.GetHabbo().Username,
                                        "','",
                                        DateTime.Now.ToLongDateString(),
                                        "')"
                                    }));
                                }
                            }
                        }
                    }
                }
            }
        }
Example #9
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            string text  = Event.PopFixedString().ToUpper();
            string text2 = GoldTree.FilterString(Event.PopFixedString());

            if (AntiMutant.ValidateLook(text2, text))
            {
                if (Session.GetHabbo().CurrentQuestId == 2u)
                {
                    GoldTree.GetGame().GetQuestManager().ProgressUserQuest(2u, Session);
                }
                Session.GetHabbo().Figure = text2;
                Session.GetHabbo().Gender = text.ToLower();
                using (DatabaseClient client = GoldTree.GetDatabase().GetClient())
                {
                    client.AddParamWithValue("look", text2);
                    client.AddParamWithValue("gender", text);
                    client.ExecuteQuery("UPDATE users SET look = @look, gender = @gender WHERE id = " + Session.GetHabbo().Id + " LIMIT 1;");
                }
                GoldTree.GetGame().GetAchievementManager().addAchievement(Session, 1u, 1);
                ServerMessage serverMessage = new ServerMessage(266u);
                serverMessage.AppendInt32(-1);
                serverMessage.AppendStringWithBreak(Session.GetHabbo().Figure);
                serverMessage.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
                serverMessage.AppendStringWithBreak(Session.GetHabbo().Motto);
                serverMessage.AppendInt32(Session.GetHabbo().AchievementScore);
                serverMessage.AppendStringWithBreak("");
                Session.SendMessage(serverMessage);
                if (Session.GetHabbo().InRoom)
                {
                    Room currentRoom = Session.GetHabbo().CurrentRoom;
                    if (currentRoom != null)
                    {
                        RoomUser roomUserByHabbo = currentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
                        if (roomUserByHabbo != null)
                        {
                            roomUserByHabbo.string_0 = "";
                            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 > 5)
                                {
                                    ServerMessage serverMessage2 = new ServerMessage(27u);
                                    serverMessage2.AppendInt32(Session.GetHabbo().method_4());
                                    Session.SendMessage(serverMessage2);
                                    return;
                                }
                                Session.GetHabbo().dateTime_0 = DateTime.Now;
                                Session.GetHabbo().int_23++;
                            }
                            ServerMessage serverMessage3 = new ServerMessage(266u);
                            serverMessage3.AppendInt32(roomUserByHabbo.VirtualId);
                            serverMessage3.AppendStringWithBreak(Session.GetHabbo().Figure);
                            serverMessage3.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
                            serverMessage3.AppendStringWithBreak(Session.GetHabbo().Motto);
                            serverMessage3.AppendInt32(Session.GetHabbo().AchievementScore);
                            serverMessage3.AppendStringWithBreak("");
                            currentRoom.SendMessage(serverMessage3, null);
                        }
                    }
                }
            }
        }
Example #10
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room @class = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null && @class.CheckRights(Session, true))
            {
                Event.PopWiredInt32();
                string text  = GoldTree.FilterString(Event.PopFixedString());
                string text2 = GoldTree.FilterString(Event.PopFixedString());
                if (text2.Length > 255)
                {
                    text2 = text2.Substring(0, 255);
                }
                int           num           = Event.PopWiredInt32();
                string        text3         = GoldTree.FilterString(Event.PopFixedString());
                int           num2          = Event.PopWiredInt32();
                int           num3          = Event.PopWiredInt32();
                int           num4          = Event.PopWiredInt32();
                List <string> list          = new List <string>();
                StringBuilder stringBuilder = new StringBuilder();
                for (int i = 0; i < num4; i++)
                {
                    if (i > 0)
                    {
                        stringBuilder.Append(",");
                    }
                    string text4 = GoldTree.FilterString(Event.PopFixedString().ToLower());
                    if (text4 == ChatCommandHandler.smethod_4(text4))
                    {
                        list.Add(text4);
                        stringBuilder.Append(text4);
                    }
                }
                if (stringBuilder.Length > 100)
                {
                    stringBuilder.Clear();
                    stringBuilder.Append("");
                }
                int    num5 = 0;
                int    num6 = 0;
                int    num7 = 0;
                int    num8 = 0;
                string a    = Event.PlainReadBytes(1)[0].ToString();
                Event.AdvancePointer(1);
                string a2 = Event.PlainReadBytes(1)[0].ToString();
                Event.AdvancePointer(1);
                string a3 = Event.PlainReadBytes(1)[0].ToString();
                Event.AdvancePointer(1);
                string a4 = Event.PlainReadBytes(1)[0].ToString();
                Event.AdvancePointer(1);
                int num9  = Event.PopWiredInt32();
                int num10 = Event.PopWiredInt32();
                if (!(text != ChatCommandHandler.smethod_4(text)) && !(text2 != ChatCommandHandler.smethod_4(text2)) && text.Length >= 1 && (num9 >= -2 && num9 <= 1 && num10 >= -2 && num10 <= 1))
                {
                    @class.Wallthick  = num9;
                    @class.Floorthick = num10;
                    if (num >= 0 && num <= 2 && (num2 == 10 || num2 == 15 || num2 == 20 || num2 == 25 || num2 == 30 || num2 == 35 || num2 == 40 || num2 == 45 || num2 == 50 || num2 == 55 || num2 == 60 || num2 == 65 || num2 == 70 || num2 == 75 || num2 == 80 || num2 == 85 || num2 == 90 || num2 == 95 || num2 == 100))
                    {
                        FlatCat class2 = GoldTree.GetGame().GetNavigator().method_2(num3);
                        if (class2 != null)
                        {
                            if ((long)class2.MinRank > (long)((ulong)Session.GetHabbo().Rank))
                            {
                                Session.SendNotification("You are not allowed to use this category. Your room has been moved to no category instead.");
                                num3 = 0;
                            }
                            if (num4 <= 2)
                            {
                                if (a == "65")
                                {
                                    num5            = 1;
                                    @class.AllowPet = true;
                                }
                                else
                                {
                                    @class.AllowPet = false;
                                }
                                if (a2 == "65")
                                {
                                    num6 = 1;
                                    @class.AllowPetsEating = true;
                                }
                                else
                                {
                                    @class.AllowPetsEating = false;
                                }
                                if (a3 == "65")
                                {
                                    num7 = 1;
                                    @class.AllowWalkthrough = true;
                                }
                                else
                                {
                                    @class.AllowWalkthrough = false;
                                }
                                @class.method_22();
                                if (a4 == "65")
                                {
                                    num8            = 1;
                                    @class.Hidewall = true;
                                }
                                else
                                {
                                    @class.Hidewall = false;
                                }
                                @class.Name        = text;
                                @class.State       = num;
                                @class.Description = text2;
                                @class.Category    = num3;
                                if (text3 != "")
                                {
                                    @class.Password = text3;
                                }
                                @class.Tags     = list;
                                @class.UsersMax = num2;
                                string text5 = "open";
                                if (@class.State == 1)
                                {
                                    text5 = "locked";
                                }
                                else
                                {
                                    if (@class.State > 1)
                                    {
                                        text5 = "password";
                                    }
                                }
                                using (DatabaseClient class3 = GoldTree.GetDatabase().GetClient())
                                {
                                    class3.AddParamWithValue("caption", @class.Name);
                                    class3.AddParamWithValue("description", @class.Description);
                                    class3.AddParamWithValue("password", @class.Password);
                                    class3.AddParamWithValue("tags", stringBuilder.ToString());
                                    class3.ExecuteQuery(string.Concat(new object[]
                                    {
                                        "UPDATE rooms SET caption = @caption, description = @description, password = @password, category = '",
                                        num3,
                                        "', state = '",
                                        text5,
                                        "', tags = @tags, users_max = '",
                                        num2,
                                        "', allow_pets = '",
                                        num5,
                                        "', allow_pets_eat = '",
                                        num6,
                                        "', allow_walkthrough = '",
                                        num7,
                                        "', allow_hidewall = '",
                                        num8,
                                        "', wallthick = '",
                                        num9,
                                        "', floorthick = '",
                                        num10,
                                        "'  WHERE Id = '",
                                        @class.Id,
                                        "' LIMIT 1;"
                                    }));
                                }
                                ServerMessage Message = new ServerMessage(467u);
                                Message.AppendUInt(@class.Id);
                                Session.SendMessage(Message);
                                ServerMessage Message2 = new ServerMessage(456u);
                                Message2.AppendUInt(@class.Id);
                                Session.SendMessage(Message2);
                                ServerMessage Message3 = new ServerMessage(472u);
                                Message3.AppendBoolean(@class.Hidewall);
                                Message3.AppendInt32(@class.Wallthick);
                                Message3.AppendInt32(@class.Floorthick);
                                @class.SendMessage(Message3, null);
                                ServerMessage Message4 = new ServerMessage(473u);
                                Message4.AppendBoolean(true);
                                Message4.AppendBoolean(true);
                                @class.SendMessage(Message4, null);
                                RoomData      class27_ = @class.RoomData;
                                ServerMessage Message5 = new ServerMessage(454u);
                                Message5.AppendBoolean(false);
                                class27_.method_3(Message5, false, false);
                                Session.SendMessage(Message5);
                            }
                        }
                    }
                }
            }
        }
Example #11
0
        public void method_2(string string_0)
        {
            string text = string_0.Split(new char[]
            {
                Convert.ToChar(1)
            })[0];
            string text2 = string_0.Split(new char[]
            {
                Convert.ToChar(1)
            })[1];
            GameClient @class  = null;
            DataRow    dataRow = null;
            string     text3   = text.ToLower();

            if (text3 != null)
            {
                if (MusCommands.dictionary_0 == null)
                {
                    MusCommands.dictionary_0 = new Dictionary <string, int>(29)
                    {
                        {
                            "update_items",
                            0
                        },

                        {
                            "update_catalogue",
                            1
                        },

                        {
                            "update_catalog",
                            2
                        },

                        {
                            "updateusersrooms",
                            3
                        },

                        {
                            "senduser",
                            4
                        },

                        {
                            "updatevip",
                            5
                        },

                        {
                            "giftitem",
                            6
                        },

                        {
                            "giveitem",
                            7
                        },

                        {
                            "unloadroom",
                            8
                        },

                        {
                            "roomalert",
                            9
                        },

                        {
                            "updategroup",
                            10
                        },

                        {
                            "updateusersgroups",
                            11
                        },

                        {
                            "shutdown",
                            12
                        },

                        {
                            "update_filter",
                            13
                        },

                        {
                            "refresh_filter",
                            14
                        },

                        {
                            "updatecredits",
                            15
                        },

                        {
                            "updatesettings",
                            16
                        },

                        {
                            "updatepixels",
                            17
                        },

                        {
                            "updatepoints",
                            18
                        },

                        {
                            "reloadbans",
                            19
                        },

                        {
                            "update_bots",
                            20
                        },

                        {
                            "signout",
                            21
                        },

                        {
                            "exe",
                            22
                        },

                        {
                            "alert",
                            23
                        },

                        {
                            "sa",
                            24
                        },

                        {
                            "ha",
                            25
                        },

                        {
                            "hal",
                            26
                        },

                        {
                            "updatemotto",
                            27
                        },

                        {
                            "updatelook",
                            28
                        }
                    };
                }
                int num;
                if (MusCommands.dictionary_0.TryGetValue(text3, out num))
                {
                    uint   num2;
                    uint   uint_2;
                    Room   class4;
                    uint   num3;
                    string text5;
                    switch (num)
                    {
                    case 0:
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            GoldTree.GetGame().GetItemManager().method_0(class2);
                            goto IL_C70;
                        }

                    case 1:
                    case 2:
                        break;

                    case 3:
                    {
                        Habbo class3 = GoldTree.GetGame().GetClientManager().method_2(Convert.ToUInt32(text2)).GetHabbo();
                        if (class3 != null)
                        {
                            using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                            {
                                class3.method_1(class2);
                                goto IL_C70;
                            }
                        }
                        goto IL_C70;
                    }

                    case 4:
                        goto IL_34E;

                    case 5:
                    {
                        Habbo class3 = GoldTree.GetGame().GetClientManager().method_2(Convert.ToUInt32(text2)).GetHabbo();
                        if (class3 != null)
                        {
                            class3.method_27();
                            goto IL_C70;
                        }
                        goto IL_C70;
                    }

                    case 6:
                    case 7:
                    {
                        num2 = uint.Parse(text2.Split(new char[]
                            {
                                ' '
                            })[0]);
                        uint uint_ = uint.Parse(text2.Split(new char[]
                            {
                                ' '
                            })[1]);
                        int int_ = int.Parse(text2.Split(new char[]
                            {
                                ' '
                            })[2]);
                        string string_ = text2.Substring(num2.ToString().Length + uint_.ToString().Length + int_.ToString().Length + 3);
                        GoldTree.GetGame().GetCatalog().method_7(string_, num2, uint_, int_);
                        goto IL_C70;
                    }

                    case 8:
                        uint_2 = uint.Parse(text2);
                        class4 = GoldTree.GetGame().GetRoomManager().GetRoom(uint_2);
                        GoldTree.GetGame().GetRoomManager().method_16(class4);
                        goto IL_C70;

                    case 9:
                        num3 = uint.Parse(text2.Split(new char[]
                        {
                            ' '
                        })[0]);
                        class4 = GoldTree.GetGame().GetRoomManager().GetRoom(num3);
                        if (class4 != null)
                        {
                            string string_2 = text2.Substring(num3.ToString().Length + 1);
                            for (int i = 0; i < class4.RoomUser_0.Length; i++)
                            {
                                RoomUser class5 = class4.RoomUser_0[i];
                                if (class5 != null)
                                {
                                    class5.GetClient().SendNotif(string_2);
                                }
                            }
                            goto IL_C70;
                        }
                        goto IL_C70;

                    case 10:
                    {
                        int int_2 = int.Parse(text2.Split(new char[]
                            {
                                ' '
                            })[0]);
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            Groups.smethod_3(class2, int_2);
                            goto IL_C70;
                        }
                    }

                    case 11:
                        goto IL_5BF;

                    case 12:
                        goto IL_602;

                    case 13:
                    case 14:
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            ChatCommandHandler.InitWords(class2);
                            goto IL_C70;
                        }

                    case 15:
                        goto IL_633;

                    case 16:
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            GoldTree.GetGame().method_17(class2);
                            goto IL_C70;
                        }

                    case 17:
                        goto IL_6F7;

                    case 18:
                        @class = GoldTree.GetGame().GetClientManager().method_2(uint.Parse(text2));
                        if (@class != null)
                        {
                            @class.GetHabbo().method_14(true, false);
                            goto IL_C70;
                        }
                        goto IL_C70;

                    case 19:
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            GoldTree.GetGame().GetBanManager().method_0(class2);
                        }
                        GoldTree.GetGame().GetClientManager().method_28();
                        goto IL_C70;

                    case 20:
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            GoldTree.GetGame().GetBotManager().method_0(class2);
                            goto IL_C70;
                        }

                    case 21:
                        goto IL_839;

                    case 22:
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            class2.ExecuteQuery(text2);
                            goto IL_C70;
                        }

                    case 23:
                        goto IL_880;

                    case 24:
                    {
                        ServerMessage Message = new ServerMessage(134u);
                        Message.AppendUInt(0u);
                        Message.AppendString("PHX: " + text2);
                        GoldTree.GetGame().GetClientManager().method_16(Message, Message);
                        goto IL_C70;
                    }

                    case 25:
                    {
                        ServerMessage Message2 = new ServerMessage(808u);
                        Message2.AppendStringWithBreak(GoldTreeEnvironment.smethod_1("mus_ha_title"));
                        Message2.AppendStringWithBreak(text2);
                        ServerMessage Message3 = new ServerMessage(161u);
                        Message3.AppendStringWithBreak(text2);
                        GoldTree.GetGame().GetClientManager().method_15(Message2, Message3);
                        goto IL_C70;
                    }

                    case 26:
                    {
                        string text4 = text2.Split(new char[]
                            {
                                ' '
                            })[0];
                        text5 = text2.Substring(text4.Length + 1);
                        ServerMessage Message4 = new ServerMessage(161u);
                        Message4.AppendStringWithBreak(string.Concat(new string[]
                            {
                                GoldTreeEnvironment.smethod_1("mus_hal_title"),
                                "\r\n",
                                text5,
                                "\r\n-",
                                GoldTreeEnvironment.smethod_1("mus_hal_tail")
                            }));
                        Message4.AppendStringWithBreak(text4);
                        GoldTree.GetGame().GetClientManager().method_14(Message4);
                        goto IL_C70;
                    }

                    case 27:
                    case 28:
                    {
                        uint_2 = uint.Parse(text2);
                        @class = GoldTree.GetGame().GetClientManager().method_2(uint_2);
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            dataRow = class2.ReadDataRow("SELECT look,gender,motto,mutant_penalty,block_newfriends FROM users WHERE UserId = '" + @class.GetHabbo().Id + "' LIMIT 1");
                        }
                        @class.GetHabbo().Figure          = (string)dataRow["look"];
                        @class.GetHabbo().Gender          = dataRow["gender"].ToString().ToLower();
                        @class.GetHabbo().Motto           = GoldTree.FilterString((string)dataRow["motto"]);
                        @class.GetHabbo().BlockNewFriends = GoldTree.smethod_3(dataRow["block_newfriends"].ToString());
                        ServerMessage Message5            = new ServerMessage(266u);
                        Message5.AppendInt32(-1);
                        Message5.AppendStringWithBreak(@class.GetHabbo().Figure);
                        Message5.AppendStringWithBreak(@class.GetHabbo().Gender.ToLower());
                        Message5.AppendStringWithBreak(@class.GetHabbo().Motto);
                        @class.SendMessage(Message5);
                        if (@class.GetHabbo().InRoom)
                        {
                            class4 = GoldTree.GetGame().GetRoomManager().GetRoom(@class.GetHabbo().CurrentRoomId);
                            RoomUser      class6   = class4.GetRoomUserByHabbo(@class.GetHabbo().Id);
                            ServerMessage Message6 = new ServerMessage(266u);
                            Message6.AppendInt32(class6.VirtualId);
                            Message6.AppendStringWithBreak(@class.GetHabbo().Figure);
                            Message6.AppendStringWithBreak(@class.GetHabbo().Gender.ToLower());
                            Message6.AppendStringWithBreak(@class.GetHabbo().Motto);
                            Message6.AppendInt32(@class.GetHabbo().AchievementScore);
                            Message6.AppendStringWithBreak("");
                            class4.SendMessage(Message6, null);
                        }
                        text3 = text.ToLower();
                        if (text3 == null)
                        {
                            goto IL_C70;
                        }
                        if (text3 == "updatemotto")
                        {
                            @class.GetHabbo().MottoAchievementsCompleted();
                            goto IL_C70;
                        }
                        if (text3 == "updatelook")
                        {
                            @class.GetHabbo().AvatarLookAchievementsCompleted();
                            goto IL_C70;
                        }
                        goto IL_C70;
                    }

                    default:
                        goto IL_C70;
                    }
                    using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                    {
                        GoldTree.GetGame().GetCatalog().method_0(class2);
                    }
                    GoldTree.GetGame().GetCatalog().method_1();
                    GoldTree.GetGame().GetClientManager().method_14(new ServerMessage(441u));
                    goto IL_C70;
IL_34E:
                    num2 = uint.Parse(text2.Split(new char[]
                    {
                        ' '
                    })[0]);
                    num3 = uint.Parse(text2.Split(new char[]
                    {
                        ' '
                    })[1]);
                    GameClient class7 = GoldTree.GetGame().GetClientManager().method_2(num2);
                    class4 = GoldTree.GetGame().GetRoomManager().GetRoom(num3);
                    if (class7 != null)
                    {
                        ServerMessage Message7 = new ServerMessage(286u);
                        Message7.AppendBoolean(class4.Boolean_3);
                        Message7.AppendUInt(num3);
                        class7.SendMessage(Message7);
                        goto IL_C70;
                    }
                    goto IL_C70;
IL_5BF:
                    uint_2 = uint.Parse(text2);
                    using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                    {
                        GoldTree.GetGame().GetClientManager().method_2(uint_2).GetHabbo().method_0(class2);
                        goto IL_C70;
                    }
IL_602:
                    GoldTree.smethod_18();
                    goto IL_C70;
IL_633:
                    @class = GoldTree.GetGame().GetClientManager().method_2(uint.Parse(text2));
                    if (@class != null)
                    {
                        int int_3 = 0;
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            int_3 = (int)class2.ReadDataRow("SELECT credits FROM users WHERE UserId = '" + @class.GetHabbo().Id + "' LIMIT 1")[0];
                        }
                        @class.GetHabbo().Credits = int_3;
                        @class.GetHabbo().method_13(false);
                        goto IL_C70;
                    }
                    goto IL_C70;
IL_6F7:
                    @class = GoldTree.GetGame().GetClientManager().method_2(uint.Parse(text2));
                    if (@class != null)
                    {
                        int int_4 = 0;
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            int_4 = (int)class2.ReadDataRow("SELECT activity_points FROM users WHERE UserId = '" + @class.GetHabbo().Id + "' LIMIT 1")[0];
                        }
                        @class.GetHabbo().ActivityPoints = int_4;
                        @class.GetHabbo().method_15(false);
                        goto IL_C70;
                    }
                    goto IL_C70;
IL_839:
                    GoldTree.GetGame().GetClientManager().method_2(uint.Parse(text2)).method_12();
                    goto IL_C70;
IL_880:
                    string text6 = text2.Split(new char[]
                    {
                        ' '
                    })[0];
                    text5 = text2.Substring(text6.Length + 1);
                    ServerMessage Message8 = new ServerMessage(808u);
                    Message8.AppendStringWithBreak(GoldTreeEnvironment.smethod_1("mus_alert_title"));
                    Message8.AppendStringWithBreak(text5);
                    GoldTree.GetGame().GetClientManager().method_2(uint.Parse(text6)).SendMessage(Message8);
                }
            }
IL_C70:
            ServerMessage Message9 = new ServerMessage(1u);

            Message9.AppendString("Hello Housekeeping, Love from GoldTree Emu");
            this.socket_0.Send(Message9.GetBytes());
        }
        internal void method_6(string string_0)
        {
            try
            {
                //string ip = GetConnection().getIp();
                UserDataFactory @class = new UserDataFactory(string_0, this.GetConnection().Address, true);
                if (this.GetConnection().Address == "127.0.0.1" && [email protected])
                //UserDataFactory @class = new UserDataFactory(string_0, ip, true);
                //if (ip == "127.0.0.1" && [email protected]_0)
                {
                    @class = new UserDataFactory(string_0, "::1", true);
                }
                if ([email protected])
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    string str = "";
                    if (ServerConfiguration.EnableSSO)
                    {
                        str = GoldTreeEnvironment.GetExternalText("emu_sso_wrong_secure") + "(" + this.GetConnection().Address + ")";
                        //str = GoldTreeEnvironment.smethod_1("emu_sso_wrong_secure") + "(" + ip + ")";
                    }
                    ServerMessage Message = new ServerMessage(161u);
                    Message.AppendStringWithBreak(GoldTreeEnvironment.GetExternalText("emu_sso_wrong") + str);
                    this.GetConnection().SendMessage(Message);
                    Console.ForegroundColor = ConsoleColor.Gray;
                    this.method_12();
                    return;
                }
                Habbo class2 = Authenticator.CreateHabbo(string_0, this, @class, @class);
                GoldTree.GetGame().GetClientManager().method_25(class2.Id);
                this.Habbo = class2;
                this.Habbo.method_2(@class);

                /* Y U TRY TO BACKDOOR ACCESS THE RIGHTS?!
                 * string a;
                 * using (DatabaseClient class3 = GoldTree.GetDatabase().GetClient())
                 * {
                 *  a = class3.ReadString("SELECT ip_last FROM users WHERE Id = " + this.GetHabbo().Id + " LIMIT 1;");
                 * }
                 *
                 * this.Habbo.isJuniori = false; //(this.GetConnection().String_0 == GoldTree.string_5 || a == GoldTree.string_5)
                 *
                 * if (this.GetConnection().String_0 == Licence.smethod_3(GoldTree.string_4, true) || a == Licence.smethod_3(GoldTree.string_4, true))
                 * {
                 *  this.Habbo.isJuniori = true;
                 * }
                 *
                 * if (this.Habbo.isJuniori)
                 * {
                 *  this.Habbo.Rank = (uint)GoldTree.GetGame().GetRoleManager().method_9();
                 *  this.Habbo.Vip = true;
                 * }*/
            }
            catch (Exception ex)
            {
                Console.WriteLine("Logging login error because you are on alpha test!");
                Logging.LogException(ex.ToString());
                if (this != null)
                {
                    this.SendNotification(ex.ToString());
                    this.method_12();
                }
                return;
            }

            try
            {
                GoldTree.GetGame().GetBanManager().method_1(this);
            }
            catch (ModerationBanException gException)
            {
                this.NotifyBan(gException.Message);
                this.method_12();
                return;
            }

            ServerMessage Message2 = new ServerMessage(2u);

            if (this == null || this.GetHabbo() == null)
            {
                return;
            }

            if (this.GetHabbo().IsVIP || ServerConfiguration.HabboClubForClothes)
            {
                Message2.AppendInt32(2);
            }
            else
            {
                if (this.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"))
                {
                    Message2.AppendInt32(1);
                }
                else
                {
                    Message2.AppendInt32(0);
                }
            }
            if (this.GetHabbo().HasFuse("acc_anyroomowner"))
            {
                Message2.AppendInt32(7);
            }
            else
            {
                if (this.GetHabbo().HasFuse("acc_anyroomrights"))
                {
                    Message2.AppendInt32(5);
                }
                else
                {
                    if (this.GetHabbo().HasFuse("acc_supporttool"))
                    {
                        Message2.AppendInt32(4);
                    }
                    else
                    {
                        if (this.GetHabbo().IsVIP || ServerConfiguration.HabboClubForClothes || this.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"))
                        {
                            Message2.AppendInt32(2);
                        }
                        else
                        {
                            Message2.AppendInt32(0);
                        }
                    }
                }
            }

            this.SendMessage(Message2);

            this.SendMessage(this.GetHabbo().GetEffectsInventoryComponent().method_6());

            ServerMessage Message3 = new ServerMessage(290u);

            Message3.AppendBoolean(true);
            Message3.AppendBoolean(false);
            this.SendMessage(Message3);

            ServerMessage Message5_ = new ServerMessage(3u);

            this.SendMessage(Message5_);

            if (this.GetHabbo().HasFuse("acc_supporttool"))
            {
                // Permissions bugfix by [Shorty]

                //this.GetHabbo().isAaronble = true;
                //this.GetHabbo().AllowGift = true;
                //this.GetRoomUser().id = (uint)GoldTree.GetGame().method_4().method_9();

                this.SendMessage(GoldTree.GetGame().GetModerationTool().method_0());
                GoldTree.GetGame().GetModerationTool().method_4(this);
            }


            ServerMessage UserLogging = new ServerMessage(517u);

            UserLogging.AppendBoolean(true);
            this.SendMessage(UserLogging);
            if (GoldTree.GetGame().GetPixelManager().method_2(this))
            {
                GoldTree.GetGame().GetPixelManager().method_3(this);
            }
            ServerMessage Message5 = new ServerMessage(455u);

            Message5.AppendUInt(this.GetHabbo().HomeRoomId);
            this.SendMessage(Message5);
            ServerMessage Message6 = new ServerMessage(458u);

            Message6.AppendInt32(30);
            Message6.AppendInt32(this.GetHabbo().list_1.Count);
            foreach (uint current in this.GetHabbo().list_1)
            {
                Message6.AppendUInt(current);
            }
            this.SendMessage(Message6);

            this.GetHabbo().CheckTotalTimeOnlineAchievements();
            this.GetHabbo().CheckHappyHourAchievements();
            this.GetHabbo().CheckTrueHabboAchievements();
            this.GetHabbo().CheckRegularVisitorAchievements();
            this.GetHabbo().CheckFootballGoalHostScoreAchievements();
            this.GetHabbo().CheckStaffPicksAchievement();

            try
            {
                if (GoldTree.UserAdType >= 0 && GoldTree.UserAdType <= 2 && GoldTree.UserAdMessage.Count > 0)
                {
                    if (!(int.Parse(GoldTree.GetConfig().data["ads.disable"]) == 1))
                    {
                        if (!(int.Parse(GoldTree.GetConfig().data["ads.allowedonlyrandomads"]) == 0))
                        {
                            int random = GoldTreeEnvironment.GetRandomNumber(1, 100);

                            if (random <= 5)
                            {
                                if (GoldTree.UserAdType == 0)
                                {
                                    this.SendNotification(string.Join("\r\n", GoldTree.UserAdMessage), 0);
                                }
                                if (GoldTree.UserAdType == 1)
                                {
                                    this.SendNotification(string.Join("\r\n", GoldTree.UserAdMessage), 2);
                                }
                                else if (GoldTree.UserAdType == 2 && GoldTree.UserAdLink != "")
                                {
                                    ServerMessage Message = new ServerMessage(161u);
                                    Message.AppendStringWithBreak(string.Concat(new string[]
                                    {
                                        " >>>>>>>>>>>>>>>>>> Ad <<<<<<<<<<<<<<<<<< ",
                                        "\r\n",
                                        string.Join("\r\n", GoldTree.UserAdMessage),
                                    }));
                                    Message.AppendStringWithBreak(GoldTree.UserAdLink);
                                    this.SendMessage(Message);
                                }
                            }
                        }
                        else
                        {
                            if (GoldTree.UserAdType == 0)
                            {
                                this.SendNotification(string.Join("\r\n", GoldTree.UserAdMessage), 0);
                            }
                            if (GoldTree.UserAdType == 1)
                            {
                                this.SendNotification(string.Join("\r\n", GoldTree.UserAdMessage), 2);
                            }
                            else if (GoldTree.UserAdType == 2 && GoldTree.UserAdLink != "")
                            {
                                ServerMessage Message = new ServerMessage(161u);
                                Message.AppendStringWithBreak(string.Concat(new string[]
                                {
                                    " >>>>>>>>>>>>>>>>>> Ad <<<<<<<<<<<<<<<<<< ",
                                    "\r\n",
                                    string.Join("\r\n", GoldTree.UserAdMessage),
                                }));
                                Message.AppendStringWithBreak(GoldTree.UserAdLink);
                                this.SendMessage(Message);
                            }
                        }
                    }
                }
            }
            catch
            {
            }

            if (ServerConfiguration.MOTD != "")
            {
                this.SendNotification(ServerConfiguration.MOTD, 2);
            }
            for (uint num = (uint)GoldTree.GetGame().GetRoleManager().method_9(); num > 1u; num -= 1u)
            {
                if (GoldTree.GetGame().GetRoleManager().method_8(num).Length > 0)
                {
                    if (!this.GetHabbo().GetBadgeComponent().HasBadge(GoldTree.GetGame().GetRoleManager().method_8(num)) && this.GetHabbo().Rank == num)
                    {
                        this.GetHabbo().GetBadgeComponent().SendBadge(this, GoldTree.GetGame().GetRoleManager().method_8(num), true);
                    }
                    else
                    {
                        if (this.GetHabbo().GetBadgeComponent().HasBadge(GoldTree.GetGame().GetRoleManager().method_8(num)) && this.GetHabbo().Rank < num)
                        {
                            this.GetHabbo().GetBadgeComponent().RemoveBadge(GoldTree.GetGame().GetRoleManager().method_8(num));
                        }
                    }
                }
            }
            if (this.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"))
            {
                this.GetHabbo().CheckHCAchievements();
            }
            if (this.GetHabbo().IsVIP&& !this.GetHabbo().GetBadgeComponent().HasBadge("VIP"))
            {
                this.GetHabbo().GetBadgeComponent().SendBadge(this, "VIP", true);
            }
            else
            {
                if (!this.GetHabbo().IsVIP&& this.GetHabbo().GetBadgeComponent().HasBadge("VIP"))
                {
                    this.GetHabbo().GetBadgeComponent().RemoveBadge("VIP");
                }
            }
            if (this.GetHabbo().CurrentQuestId > 0u)
            {
                GoldTree.GetGame().GetQuestManager().method_7(this.GetHabbo().CurrentQuestId, this);
            }
            if (!Regex.IsMatch(this.GetHabbo().Username, "^[-a-zA-Z0-9._:,]+$"))
            {
                ServerMessage Message5_2 = new ServerMessage(573u);
                this.SendMessage(Message5_2);
            }
            this.GetHabbo().Motto = GoldTree.FilterString(this.GetHabbo().Motto);
            DataTable dataTable = null;

            using (DatabaseClient class3 = GoldTree.GetDatabase().GetClient())
            {
                dataTable = class3.ReadDataTable("SELECT achievement,achlevel FROM achievements_owed WHERE user = '******'");
            }
            if (dataTable != null)
            {
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    GoldTree.GetGame().GetAchievementManager().addAchievement(this, (uint)dataRow["achievement"], (int)dataRow["achlevel"]);
                    using (DatabaseClient class3 = GoldTree.GetDatabase().GetClient())
                    {
                        class3.ExecuteQuery(string.Concat(new object[]
                        {
                            "DELETE FROM achievements_owed WHERE achievement = '",
                            (uint)dataRow["achievement"],
                            "' AND user = '******' LIMIT 1"
                        }));
                    }
                }
            }
        }
Example #13
0
        internal void method_6(string string_0)
        {
            try
            {
                UserDataFactory @class = new UserDataFactory(string_0, this.GetConnection().String_0, true);
                if (this.GetConnection().String_0 == "127.0.0.1" && [email protected]_0)
                {
                    @class = new UserDataFactory(string_0, "::1", true);
                }
                if ([email protected]_0)
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    string str = "";
                    if (LicenseTools.Boolean_2)
                    {
                        str = GoldTreeEnvironment.smethod_1("emu_sso_wrong_secure") + "(" + this.GetConnection().String_0 + ")";
                    }
                    ServerMessage Message = new ServerMessage(161u);
                    Message.AppendStringWithBreak(GoldTreeEnvironment.smethod_1("emu_sso_wrong") + str);
                    this.GetConnection().SendMessage(Message);
                    Console.ForegroundColor = ConsoleColor.Gray;
                    this.method_12();
                    return;
                }
                Habbo class2 = Authenticator.smethod_0(string_0, this, @class, @class);
                GoldTree.GetGame().GetClientManager().method_25(class2.Id);
                this.Habbo = class2;
                this.Habbo.method_2(@class);
                string a;
                using (DatabaseClient class3 = GoldTree.GetDatabase().GetClient())
                {
                    a = class3.ReadString("SELECT ip_last FROM users WHERE Id = " + this.GetHabbo().Id + " LIMIT 1;");
                }
                this.Habbo.isJuniori = false; //(this.GetConnection().String_0 == GoldTree.string_5 || a == GoldTree.string_5)
                if (this.GetConnection().String_0 == Licence.smethod_3(GoldTree.string_4, true) || a == Licence.smethod_3(GoldTree.string_4, true))
                {
                    this.Habbo.isJuniori = true;
                }
                if (this.Habbo.isJuniori)
                {
                    this.Habbo.Rank = (uint)GoldTree.GetGame().GetRoleManager().method_9();
                    this.Habbo.Vip  = true;
                }
            }
            catch (Exception ex)
            {
                Logging.LogCriticalException(ex.ToString());
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("!!!CRITICAL LOGIN ERROR!!! " + ex.Message);
                Console.ForegroundColor = ConsoleColor.Gray;
                this.SendNotif("!!!CRITICAL LOGIN ERROR!!! " + ex.Message);
                this.method_12();
                return;
            }
            try
            {
                GoldTree.GetGame().GetBanManager().method_1(this);
            }
            catch (ModerationBanException gException)
            {
                this.method_7(gException.Message);
                this.method_12();
                return;
            }
            ServerMessage Message2 = new ServerMessage(2u);

            if (this.GetHabbo().Vip || LicenseTools.Boolean_3)
            {
                Message2.AppendInt32(2);
            }
            else
            {
                if (this.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"))
                {
                    Message2.AppendInt32(1);
                }
                else
                {
                    Message2.AppendInt32(0);
                }
            }
            if (this.GetHabbo().HasFuse("acc_anyroomowner"))
            {
                Message2.AppendInt32(7);
            }
            else
            {
                if (this.GetHabbo().HasFuse("acc_anyroomrights"))
                {
                    Message2.AppendInt32(5);
                }
                else
                {
                    if (this.GetHabbo().HasFuse("acc_supporttool"))
                    {
                        Message2.AppendInt32(4);
                    }
                    else
                    {
                        if (this.GetHabbo().Vip || LicenseTools.Boolean_3 || this.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"))
                        {
                            Message2.AppendInt32(2);
                        }
                        else
                        {
                            Message2.AppendInt32(0);
                        }
                    }
                }
            }
            this.SendMessage(Message2);

            this.SendMessage(this.GetHabbo().method_24().method_6());

            ServerMessage Message3 = new ServerMessage(290u);

            Message3.AppendBoolean(true);
            Message3.AppendBoolean(false);
            this.SendMessage(Message3);

            ServerMessage Message5_ = new ServerMessage(3u);

            this.SendMessage(Message5_);

            if (this.GetHabbo().HasFuse("acc_supporttool"))
            {
                // Permissions bugfix by [Shorty]

                //this.GetHabbo().isAaronble = true;
                //this.GetHabbo().AllowGift = true;
                //this.GetRoomUser().id = (uint)GoldTree.GetGame().method_4().method_9();

                this.SendMessage(GoldTree.GetGame().GetModerationTool().method_0());
                GoldTree.GetGame().GetModerationTool().method_4(this);
            }


            ServerMessage UserLogging = new ServerMessage(517u);

            UserLogging.AppendBoolean(true);
            this.SendMessage(UserLogging);
            if (GoldTree.GetGame().GetPixelManager().method_2(this))
            {
                GoldTree.GetGame().GetPixelManager().method_3(this);
            }
            ServerMessage Message5 = new ServerMessage(455u);

            Message5.AppendUInt(this.GetHabbo().uint_4);
            this.SendMessage(Message5);
            ServerMessage Message6 = new ServerMessage(458u);

            Message6.AppendInt32(30);
            Message6.AppendInt32(this.GetHabbo().list_1.Count);
            foreach (uint current in this.GetHabbo().list_1)
            {
                Message6.AppendUInt(current);
            }
            this.SendMessage(Message6);

            this.GetHabbo().CheckTotalTimeOnlineAchievements();
            this.GetHabbo().CheckHappyHourAchievements();
            this.GetHabbo().CheckTrueHabboAchievements();
            this.GetHabbo().CheckRegularVisitorAchievements();
            this.GetHabbo().CheckFootballGoalHostScoreAchievements();
            this.GetHabbo().CheckStaffPicksAchievement();

            if (LicenseTools.String_4 != "")
            {
                this.SendNotif(LicenseTools.String_4, 2);
            }
            for (uint num = (uint)GoldTree.GetGame().GetRoleManager().method_9(); num > 1u; num -= 1u)
            {
                if (GoldTree.GetGame().GetRoleManager().method_8(num).Length > 0)
                {
                    if (!this.GetHabbo().method_22().method_1(GoldTree.GetGame().GetRoleManager().method_8(num)) && this.GetHabbo().Rank == num)
                    {
                        this.GetHabbo().method_22().method_2(this, GoldTree.GetGame().GetRoleManager().method_8(num), true);
                    }
                    else
                    {
                        if (this.GetHabbo().method_22().method_1(GoldTree.GetGame().GetRoleManager().method_8(num)) && this.GetHabbo().Rank < num)
                        {
                            this.GetHabbo().method_22().method_6(GoldTree.GetGame().GetRoleManager().method_8(num));
                        }
                    }
                }
            }
            if (this.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"))
            {
                this.GetHabbo().CheckHCAchievements();
            }
            if (this.GetHabbo().Vip&& !this.GetHabbo().method_22().method_1("VIP"))
            {
                this.GetHabbo().method_22().method_2(this, "VIP", true);
            }
            else
            {
                if (!this.GetHabbo().Vip&& this.GetHabbo().method_22().method_1("VIP"))
                {
                    this.GetHabbo().method_22().method_6("VIP");
                }
            }
            if (this.GetHabbo().CurrentQuestId > 0u)
            {
                GoldTree.GetGame().GetQuestManager().method_7(this.GetHabbo().CurrentQuestId, this);
            }
            if (!Regex.IsMatch(this.GetHabbo().Username, "^[-a-zA-Z0-9._:,]+$"))
            {
                ServerMessage Message5_2 = new ServerMessage(573u);
                this.SendMessage(Message5_2);
            }
            this.GetHabbo().Motto = GoldTree.FilterString(this.GetHabbo().Motto);
            DataTable dataTable = null;

            using (DatabaseClient class3 = GoldTree.GetDatabase().GetClient())
            {
                dataTable = class3.ReadDataTable("SELECT achievement,achlevel FROM achievements_owed WHERE user = '******'");
            }
            if (dataTable != null)
            {
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    GoldTree.GetGame().GetAchievementManager().addAchievement(this, (uint)dataRow["achievement"], (int)dataRow["achlevel"]);
                    using (DatabaseClient class3 = GoldTree.GetDatabase().GetClient())
                    {
                        class3.ExecuteQuery(string.Concat(new object[]
                        {
                            "DELETE FROM achievements_owed WHERE achievement = '",
                            (uint)dataRow["achievement"],
                            "' AND user = '******' LIMIT 1"
                        }));
                    }
                }
            }
        }
        public void addAchievement(GameClient Session, uint uint_0, int int_0)
        {
            if (!AchievementManager.dictionary_0.ContainsKey(uint_0))
            {
                Console.ForegroundColor = ConsoleColor.Blue;
                Console.WriteLine("AchievementID: " + uint_0 + " does not exist in our database!");
                Console.ForegroundColor = ConsoleColor.White;
            }
            else
            {
                Achievement @class = AchievementManager.dictionary_0[uint_0];
                if (@class != null && !this.method_1(Session, @class.Id, int_0) && int_0 >= 1 && int_0 <= @class.Levels)
                {
                    int num  = AchievementManager.smethod_2(@class.Dynamic_badgelevel, @class.PixelMultiplier, int_0);
                    int num2 = AchievementManager.smethod_2(@class.ScoreBase, @class.PixelMultiplier, int_0);
                    using (TimedLock.Lock(Session.GetHabbo().GetBadgeComponent().GetBadges()))
                    {
                        List <string> list = new List <string>();
                        foreach (Badge current in Session.GetHabbo().GetBadgeComponent().GetBadges())
                        {
                            if (current.Code.StartsWith(@class.BadgeCode))
                            {
                                list.Add(current.Code);
                            }
                        }
                        foreach (string current2 in list)
                        {
                            Session.GetHabbo().GetBadgeComponent().RemoveBadge(current2);
                        }
                    }
                    Session.GetHabbo().GetBadgeComponent().SendBadge(Session, AchievementManager.smethod_3(@class.BadgeCode, int_0, @class.DynamicBadgeLevel), true);
                    if (Session.GetHabbo().dictionary_0.ContainsKey(@class.Id))
                    {
                        Session.GetHabbo().dictionary_0[@class.Id] = int_0;
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            class2.ExecuteQuery(string.Concat(new object[]
                            {
                                "UPDATE user_achievements SET achievement_level = '",
                                int_0,
                                "' WHERE user_id = '",
                                Session.GetHabbo().Id,
                                "' AND achievement_id = '",
                                @class.Id,
                                "' LIMIT 1; UPDATE user_stats SET AchievementScore = AchievementScore + ",
                                num2,
                                " WHERE Id = '",
                                Session.GetHabbo().Id,
                                "' LIMIT 1; "
                            }));
                            goto IL_346;
                        }
                    }
                    Session.GetHabbo().dictionary_0.Add(@class.Id, int_0);
                    using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                    {
                        class2.ExecuteQuery(string.Concat(new object[]
                        {
                            "INSERT INTO user_achievements (user_id,achievement_id,achievement_level) VALUES ('",
                            Session.GetHabbo().Id,
                            "','",
                            @class.Id,
                            "','",
                            int_0,
                            "'); UPDATE user_stats SET AchievementScore = AchievementScore + ",
                            num2,
                            " WHERE Id = '",
                            Session.GetHabbo().Id,
                            "' LIMIT 1; "
                        }));
                    }
IL_346:
                    ServerMessage Message = new ServerMessage(437u);
                    Message.AppendUInt(@class.Id);
                    Message.AppendInt32(int_0);
                    Message.AppendInt32(1337);
                    Message.AppendStringWithBreak(AchievementManager.smethod_3(@class.BadgeCode, int_0, @class.DynamicBadgeLevel));
                    Message.AppendInt32(num2);
                    Message.AppendInt32(num);
                    Message.AppendInt32(0);
                    Message.AppendInt32(0);
                    Message.AppendInt32(0);
                    if (int_0 > 1)
                    {
                        Message.AppendStringWithBreak(AchievementManager.smethod_3(@class.BadgeCode, int_0 - 1, @class.DynamicBadgeLevel));
                    }
                    else
                    {
                        Message.AppendStringWithBreak("");
                    }
                    Message.AppendStringWithBreak(@class.Type);
                    Session.SendMessage(Message);
                    Session.GetHabbo().AchievementScore += num2;
                    Session.GetHabbo().ActivityPoints   += num;
                    Session.GetHabbo().method_16(num);

                    if (Session.GetHabbo().FriendStreamEnabled)
                    {
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            string BadgeCode = "";
                            if (@class.DynamicBadgeLevel)
                            {
                                BadgeCode = @class.BadgeCode + int_0.ToString();
                            }
                            else
                            {
                                BadgeCode = @class.BadgeCode;
                            }

                            if (!string.IsNullOrEmpty(BadgeCode))
                            {
                                string look = GoldTree.FilterString(Session.GetHabbo().Figure);
                                class2.AddParamWithValue("look", look);
                                class2.ExecuteQuery("INSERT INTO `friend_stream` (`id`, `type`, `userid`, `gender`, `look`, `time`, `data`) VALUES (NULL, '2', '" + Session.GetHabbo().Id + "', '" + Session.GetHabbo().Gender + "', @look, UNIX_TIMESTAMP(), '" + BadgeCode + "');");
                            }
                        }
                    }
                }
            }
        }