public TeleUserData(GameClientMessageHandler pHandler, Habbo pUserRefference, uint RoomId, uint TeleId)
 {
     this.class17_0 = pHandler;
     this.class11_0 = pUserRefference;
     this.uint_0 = RoomId;
     this.uint_1 = TeleId;
 }
 public void method_11()
 {
     if (this.Message1_0 != null)
     {
         this.Message1_0.Dispose();
         this.Message1_0 = null;
     }
     if (this.GetHabbo() != null)
     {
         this.Habbo.method_9();
         this.Habbo = null;
     }
     if (this.method_1() != null)
     {
         this.class17_0.Destroy();
         this.class17_0 = null;
     }
 }
        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 != null && this.GetHabbo() != null && (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"
                        }));
                    }
                }
            }
        }