public static void HandleConnectTo(WorldClass session, ushort port = 3724, byte conn = 0, WorldClass2 session2 = null)
        {
            PacketWriter packetWriter = new PacketWriter(ServerMessage.ConnectTo, true);

            while (true)
            {
IL_65:
                uint arg_48_0 = 1189851645u;
                while (true)
                {
                    uint num;
                    switch ((num = (arg_48_0 ^ 117810876u)) % 4u)
                    {
                    case 0u:
                        goto IL_65;

                    case 1u:
                        packetWriter.WriteUInt64(12330219965770517405uL);
                        arg_48_0 = (num * 886289363u ^ 1599573856u);
                        continue;

                    case 3u:
                        packetWriter.WriteUInt32(14u);
                        arg_48_0 = (num * 798883457u ^ 2791294625u);
                        continue;
                    }
                    goto Block_1;
                }
            }
Block_1:
            RsaCrypt rsaCrypt = new RsaCrypt();

            try
            {
                rsaCrypt.InitializeEncryption <byte[]>(RsaStore.D, RsaStore.P, RsaStore.Q, RsaStore.DP, RsaStore.DQ, RsaStore.InverseQ, false);
                while (true)
                {
IL_53C:
                    uint arg_4A2_0 = 1950399364u;
                    while (true)
                    {
                        uint num;
                        switch ((num = (arg_4A2_0 ^ 117810876u)) % 35u)
                        {
                        case 0u:
                        {
                            byte[] array;
                            int    num2;
                            array[num2] = (byte)AuthenticationHandler.payloadOrder[num2];
                            arg_4A2_0   = 778837338u;
                            continue;
                        }

                        case 1u:
                        {
                            byte[] array2;
                            array2[10] = 0;
                            array2[11] = 0;
                            arg_4A2_0  = (num * 3426925493u ^ 1622493560u);
                            continue;
                        }

                        case 2u:
                        {
                            byte[] array2;
                            array2[18] = 0;
                            arg_4A2_0  = (num * 3672511218u ^ 2614652434u);
                            continue;
                        }

                        case 3u:
                        {
                            byte[] array2;
                            array2[0] = 67;
                            arg_4A2_0 = (num * 70935332u ^ 306833328u);
                            continue;
                        }

                        case 4u:
                        {
                            byte[] array2;
                            byte[] array3;
                            array2[22] = array3[1];
                            arg_4A2_0  = (num * 3674763274u ^ 3649142947u);
                            continue;
                        }

                        case 5u:
                        {
                            byte[] array2;
                            array2[13] = 0;
                            array2[14] = 0;
                            arg_4A2_0  = (num * 788135060u ^ 2778562157u);
                            continue;
                        }

                        case 6u:
                            goto IL_53C;

                        case 7u:
                        {
                            byte[] array2;
                            array2[1] = 253;
                            array2[2] = 184;
                            arg_4A2_0 = (num * 4034181865u ^ 116591846u);
                            continue;
                        }

                        case 8u:
                        {
                            byte[] array2;
                            array2[15] = 0;
                            array2[16] = 0;
                            arg_4A2_0  = (num * 1808574983u ^ 3232411455u);
                            continue;
                        }

                        case 9u:
                        {
                            byte[] array2 = new byte[255];
                            arg_4A2_0 = (num * 3052653591u ^ 3793484446u);
                            continue;
                        }

                        case 10u:
                            arg_4A2_0 = (num * 566048763u ^ 581218626u);
                            continue;

                        case 11u:
                        {
                            byte[] array2;
                            array2[233] = 42;
                            arg_4A2_0   = (num * 3199619518u ^ 4104188893u);
                            continue;
                        }

                        case 12u:
                        {
                            byte[] array2;
                            array2[5] = 127;
                            arg_4A2_0 = (num * 534924131u ^ 1301694869u);
                            continue;
                        }

                        case 13u:
                        {
                            byte[] array2;
                            array2[20] = 0;
                            byte[] array3 = AuthenticationHandler.smethod_10(port);
                            array2[21] = array3[0];
                            arg_4A2_0  = (num * 1558897694u ^ 577623817u);
                            continue;
                        }

                        case 14u:
                        {
                            byte[] array2;
                            array2[6] = 0;
                            arg_4A2_0 = (num * 1594444616u ^ 3121916550u);
                            continue;
                        }

                        case 15u:
                        {
                            byte[] array2;
                            AuthenticationHandler.smethod_13(new byte[0].GenerateRandomKey(20), 0, array2, 234, 20);
                            arg_4A2_0 = (num * 1673846917u ^ 3902196868u);
                            continue;
                        }

                        case 16u:
                        {
                            byte[] expr_2B6 = new byte[32];
                            AuthenticationHandler.smethod_8(expr_2B6, fieldof(< PrivateImplementationDetails >.struct8_0).FieldHandle);
                            byte[] array2;
                            AuthenticationHandler.smethod_13(expr_2B6, 0, array2, 93, 32);
                            AuthenticationHandler.smethod_13(new byte[108], 0, array2, 125, 108);
                            arg_4A2_0 = (num * 3680003173u ^ 2041052791u);
                            continue;
                        }

                        case 17u:
                        {
                            byte[] array2;
                            Array  arg_297_0 = rsaCrypt.Encrypt <byte[]>(array2, false);
                            byte[] array4    = new byte[256];
                            AuthenticationHandler.smethod_14(arg_297_0, array4, 256);
                            arg_4A2_0 = (num * 2289352343u ^ 161977499u);
                            continue;
                        }

                        case 18u:
                        {
                            int num2;
                            num2++;
                            arg_4A2_0 = 1213188245u;
                            continue;
                        }

                        case 19u:
                        {
                            rsaCrypt.InitializeDecryption <byte[]>(RsaStore.Exponent, RsaStore.Modulus, false);
                            byte[] array = new byte[AuthenticationHandler.payloadOrder.Length];
                            arg_4A2_0 = (num * 163108824u ^ 2004099280u);
                            continue;
                        }

                        case 20u:
                        {
                            byte[] array2;
                            array2[7] = 0;
                            arg_4A2_0 = (num * 669897089u ^ 3823184314u);
                            continue;
                        }

                        case 21u:
                        {
                            int num2 = 0;
                            arg_4A2_0 = (num * 1178352322u ^ 2056709069u);
                            continue;
                        }

                        case 22u:
                        {
                            string string_ = Module.smethod_35 <string>(848950031u);
                            arg_4A2_0 = (num * 560797187u ^ 1592203457u);
                            continue;
                        }

                        case 23u:
                            packetWriter.WriteUInt8(conn);
                            arg_4A2_0 = (num * 264353632u ^ 1806577887u);
                            continue;

                        case 24u:
                        {
                            int num2;
                            arg_4A2_0 = ((AuthenticationHandler.payloadOrder[num2] <= 16) ? 423310451u : 557178527u);
                            continue;
                        }

                        case 25u:
                        {
                            byte[] array2;
                            array2[3] = 34;
                            array2[4] = 1;
                            arg_4A2_0 = (num * 4152105185u ^ 2192753377u);
                            continue;
                        }

                        case 26u:
                        {
                            byte[] array;
                            int    num2;
                            array[num2] = (byte)(AuthenticationHandler.payloadOrder[num2] - 3);
                            arg_4A2_0   = (num * 3507665298u ^ 2968893570u);
                            continue;
                        }

                        case 27u:
                        {
                            byte[] array2;
                            array2[12] = 0;
                            arg_4A2_0  = (num * 618037152u ^ 1046649983u);
                            continue;
                        }

                        case 28u:
                        {
                            byte[] array2;
                            array2[19] = 0;
                            arg_4A2_0  = (num * 1680293565u ^ 2487070996u);
                            continue;
                        }

                        case 29u:
                        {
                            int num2;
                            arg_4A2_0 = ((num2 >= AuthenticationHandler.payloadOrder.Length) ? 858439922u : 70439534u);
                            continue;
                        }

                        case 30u:
                        {
                            byte[] array4;
                            AuthenticationHandler.smethod_0(packetWriter, array4);
                            arg_4A2_0 = (num * 216092153u ^ 2688375690u);
                            continue;
                        }

                        case 31u:
                        {
                            byte[] array2;
                            array2[8] = 1;
                            array2[9] = 0;
                            arg_4A2_0 = (num * 3445269463u ^ 748842564u);
                            continue;
                        }

                        case 33u:
                        {
                            byte[] array2;
                            array2[17] = 0;
                            arg_4A2_0  = (num * 40612712u ^ 3030126910u);
                            continue;
                        }

                        case 34u:
                        {
                            byte[] array2;
                            string string_;
                            AuthenticationHandler.smethod_13(AuthenticationHandler.smethod_12(AuthenticationHandler.smethod_11(), string_), 0, array2, 23, 71);
                            arg_4A2_0 = (num * 376848159u ^ 536405427u);
                            continue;
                        }
                        }
                        goto Block_7;
                    }
                }
                Block_7 :;
            }
            finally
            {
                if (rsaCrypt != null)
                {
                    while (true)
                    {
                        IL_57F :
                        uint arg_566_0 = 461746135u;
                        while (true)
                        {
                            uint num;
                            switch ((num = (arg_566_0 ^ 117810876u)) % 3u)
                            {
                            case 0u:
                                goto IL_57F;

                            case 2u:
                                AuthenticationHandler.smethod_15(rsaCrypt);
                                arg_566_0 = (num * 3554924306u ^ 496472224u);
                                continue;
                            }
                            goto Block_10;
                        }
                    }
                    Block_10 :;
                }
            }
            if (session2 == null)
            {
                goto IL_5B1;
            }
IL_58A:
            int arg_594_0 = 202372283;

IL_58F:
            switch ((arg_594_0 ^ 117810876) % 4)
            {
            case 0:
IL_5B1:
                session.Send(ref packetWriter);
                arg_594_0 = 910700601;
                goto IL_58F;

            case 2:
                goto IL_58A;

            case 3:
                session2.Send(ref packetWriter);
                return;
            }
        }
        public static void HandleAuthContinuedSession(ref PacketReader packet, WorldClass2 session)
        {
            AuthenticationHandler.session2 = session;
            Manager.WorldMgr.Sessions.SingleOrDefault <KeyValuePair <ulong, WorldClass> >();
            while (true)
            {
IL_1B7:
                uint arg_17D_0 = 2389353796u;
                while (true)
                {
                    uint num;
                    switch ((num = (arg_17D_0 ^ 2381408322u)) % 11u)
                    {
                    case 0u:
                        goto IL_1B7;

                    case 1u:
                    {
                        SHA1Managed expr_127 = AuthenticationHandler.smethod_18();
                        byte[]      array;
                        AuthenticationHandler.smethod_3(expr_127, array, 0, array.Length, array, 0);
                        byte[] array2;
                        AuthenticationHandler.smethod_3(expr_127, array2, 0, 40, array2, 0);
                        byte[] byte_;
                        AuthenticationHandler.smethod_4(expr_127, byte_, 0, 4);
                        AuthenticationHandler.smethod_5(expr_127);
                        new PacketWriter(ServerMessage.EnableCrypt, false);
                        PacketWriter packetWriter = new PacketWriter(ServerMessage.ResumeComms, true);
                        arg_17D_0 = (num * 3949002163u ^ 3941582883u);
                        continue;
                    }

                    case 2u:
                    {
                        PacketWriter packetWriter;
                        AuthenticationHandler.session2.Send(ref packetWriter);
                        arg_17D_0 = (num * 3904375768u ^ 568160447u);
                        continue;
                    }

                    case 3u:
                        packet.Read <ulong>();
                        packet.ReadBytes(20u);
                        arg_17D_0 = (((AuthenticationHandler.session2 != null) ? 2852424687u : 3500428177u) ^ num * 109821150u);
                        continue;

                    case 4u:
                    {
                        byte[] array2 = AuthenticationHandler.sessionKey;
                        arg_17D_0 = (num * 2163954332u ^ 1605872583u);
                        continue;
                    }

                    case 5u:
                        return;

                    case 6u:
                    {
                        byte[] byte_ = AuthenticationHandler.smethod_17(2549515048u);
                        arg_17D_0 = (num * 4131246918u ^ 2980239949u);
                        continue;
                    }

                    case 7u:
                        packet.Read <ulong>();
                        arg_17D_0 = (num * 3561050817u ^ 404291365u);
                        continue;

                    case 8u:
                        arg_17D_0 = ((Manager.WorldMgr.AddSession2(0uL, ref AuthenticationHandler.session2) ? 213636815u : 1576825925u) ^ num * 3435104658u);
                        continue;

                    case 9u:
                    {
                        byte[] array = AuthenticationHandler.smethod_12(AuthenticationHandler.smethod_16(), Module.smethod_34 <string>(1006528553u));
                        arg_17D_0 = 2341857576u;
                        continue;
                    }
                    }
                    goto Block_3;
                }
            }
            Block_3 :;
        }