Example #1
0
 private static void \uE01A(object \uE049, ref \uE017 \uE04A, Stream \uE04B)
 {
     if (CpInazumaMsgPack.\uE005 == CpCustomDataPackMode.Array)
     {
         CpInazumaMsgPack.\uE00B(\uE04A.\uE001.Count, CpInazumaMsgPack.\uE007(\uE04A.\uE001.Count), \uE04B);
     }
     if (CpInazumaMsgPack.\uE005 == CpCustomDataPackMode.Raw || CpInazumaMsgPack.\uE005 == CpCustomDataPackMode.Array)
     {
         for (int i = 0; i < \uE04A.\uE001.Count; i++)
         {
             \uE016 uE = \uE04A.\uE001[i];
             CpInazumaMsgPack.Pack(uE.\uE002.GetValue(\uE049), \uE04B);
         }
         return;
     }
     if (CpInazumaMsgPack.\uE005 == CpCustomDataPackMode.Map || CpInazumaMsgPack.\uE005 == CpCustomDataPackMode.Older)
     {
         CpInazumaMsgPack.\uE00B(\uE04A.\uE001.Count, CpInazumaMsgPack.\uE006(\uE04A.\uE001.Count), \uE04B);
         for (int j = 0; j < \uE04A.\uE001.Count; j++)
         {
             \uE016 uE2 = \uE04A.\uE001[j];
             CpInazumaMsgPack.\uE018(uE2.\uE001, \uE04B);
             CpInazumaMsgPack.Pack(uE2.\uE002.GetValue(\uE049), \uE04B);
         }
     }
 }
Example #2
0
 private static int \uE006(\uE019.\uE01B \uE000, \uE017 \uE001)
 {
     while (\uE001 != null && !\uE001.\uE000)
     {
         \uE001 = ((\uE000.\uE000(1) > 0) ? \uE001.\uE003 : \uE001.\uE002);
     }
     return((int)\uE001.\uE001);
 }
Example #3
0
        private static int \uE008(\uE019.\uE01B \uE000, \uE017 \uE001)
        {
            int num = \uE019.\uE01A.\uE006(\uE000, \uE001);
            int num3;
            int num4;

            for (;;)
            {
                int num2 = \uE011.\uE006(92);
                for (;;)
                {
                    switch (num2)
                    {
                    case 0:
                        num3 = \uE012.\uE006[num];
                        num2 = 3;
                        continue;

                    case 1:
                    {
                        int num5;
                        num4 = \uE000.\uE000(num5);
                        num2 = 4;
                        continue;
                    }

                    case 2:
                    {
                        int num5;
                        if (num5 > 0)
                        {
                            num2 = \uE011.\uE006(90);
                            continue;
                        }
                        return(num3);
                    }

                    case 3:
                    {
                        int num5 = \uE012.\uE007[num];
                        num2 = 2;
                        continue;
                    }

                    case 4:
                        goto IL_75;
                    }
                    break;
                }
            }
            return(num3);

IL_75:
            return(num3 + num4);
        }
Example #4
0
        private static object \uE020(Stream \uE05D, ref \uE017 \uE05E)
        {
            sbyte  b   = 0;
            \uE015 uE  = CpInazumaMsgPack.\uE00A(\uE05D, out b);
            object obj = Activator.CreateInstance(\uE05E.\uE000);

            if (CpInazumaMsgPack.\uE010(uE))
            {
                int num = CpInazumaMsgPack.\uE005(\uE05D, uE, b);
                for (int i = 0; i < num; i++)
                {
                    CpInazumaMsgPack.\uE001 uE2 = new CpInazumaMsgPack.\uE001();
                    uE         = CpInazumaMsgPack.\uE00A(\uE05D, out b);
                    uE2.\uE000 = CpInazumaMsgPack.\uE01E(\uE05D, uE, b);
                    \uE016 uE3 = \uE05E.\uE001.Find(new Predicate <\uE016>(uE2.\uE000));
                    if (uE3 == null)
                    {
                        CpInazumaMsgPack.Unpack(\uE05D, typeof(object));
                    }
                    else
                    {
                        TypeCode typeCode = Type.GetTypeCode(uE3.\uE002.FieldType);
                        object   value    = CpInazumaMsgPack.\uE014(CpInazumaMsgPack.Unpack(\uE05D, uE3.\uE002.FieldType), typeCode);
                        uE3.\uE002.SetValue(obj, value);
                    }
                }
                return(obj);
            }
            if (CpInazumaMsgPack.\uE00F(uE))
            {
                \uE05D.Seek((long)CpInazumaMsgPack.\uE004(uE, b), SeekOrigin.Current);
                return(CpInazumaMsgPack.\uE020(\uE05D, ref \uE05E));
            }
            \uE05D.Seek(-1L, SeekOrigin.Current);
            if (uE == global::\uE015.\uE00A)
            {
                return(null);
            }
            for (int j = 0; j < \uE05E.\uE001.Count; j++)
            {
                FieldInfo uE4  = \uE05E.\uE001[j].\uE002;
                object    obj2 = CpInazumaMsgPack.Unpack(\uE05D, uE4.FieldType);
                if (obj2 != null)
                {
                    uE4.SetValue(obj, Convert.ChangeType(obj2, uE4.FieldType));
                }
            }
            return(obj);
        }
Example #5
0
 public static object Unpack(Stream stream, Type type)
 {
     if (stream != null && stream.CanRead)
     {
         if (stream.CanSeek)
         {
             \uE017 uE = default(\uE017);
             if (CpInazumaMsgPack.\uE022(type, ref uE))
             {
                 return(CpInazumaMsgPack.\uE020(stream, ref uE));
             }
             sbyte  b   = 0;
             \uE015 uE2 = CpInazumaMsgPack.\uE00A(stream, out b);
             if (uE2 == global::\uE015.\uE00B)
             {
                 stream.Seek(-1L, SeekOrigin.Current);
                 return(null);
             }
             if (uE2 == global::\uE015.\uE00A)
             {
                 return(null);
             }
             if (CpInazumaMsgPack.\uE00E(uE2))
             {
                 return(CpInazumaMsgPack.\uE01B(stream, uE2, b));
             }
             if (CpInazumaMsgPack.\uE00F(uE2))
             {
                 return(CpInazumaMsgPack.\uE01C(stream, uE2, b, type));
             }
             if (CpInazumaMsgPack.\uE010(uE2))
             {
                 return(CpInazumaMsgPack.\uE01D(stream, uE2, b, type));
             }
             if (CpInazumaMsgPack.\uE011(uE2))
             {
                 return(CpInazumaMsgPack.\uE01E(stream, uE2, b));
             }
             if (CpInazumaMsgPack.\uE012(uE2))
             {
                 return(CpInazumaMsgPack.\uE01F(stream, uE2, b));
             }
             stream.Seek(-1L, SeekOrigin.Current);
             return(null);
         }
     }
     throw new IOException(global::\uE019.\uE000(11502));
 }
Example #6
0
 public static void Pack(object data, Stream stream)
 {
     if (stream != null)
     {
         if (stream.CanWrite)
         {
             if (data == null)
             {
                 CpInazumaMsgPack.\uE00B(null, global::\uE015.\uE00A, stream);
                 return;
             }
             if (data.GetType().IsPrimitive)
             {
                 CpInazumaMsgPack.\uE015(data, stream);
                 return;
             }
             if (data is string)
             {
                 CpInazumaMsgPack.\uE018((string)data, stream);
                 return;
             }
             if (data is byte[])
             {
                 CpInazumaMsgPack.\uE019((byte[])data, stream);
                 return;
             }
             if (data is IList)
             {
                 CpInazumaMsgPack.\uE016((IList)data, stream);
                 return;
             }
             if (data is IDictionary)
             {
                 CpInazumaMsgPack.\uE017((IDictionary)data, stream);
                 return;
             }
             \uE017 uE = default(\uE017);
             if (CpInazumaMsgPack.\uE022(data.GetType(), ref uE))
             {
                 CpInazumaMsgPack.\uE01A(data, ref uE, stream);
             }
             return;
         }
     }
     throw new IOException(global::\uE019.\uE000(11502));
 }
Example #7
0
        private static bool \uE022(Type \uE060, ref \uE017 \uE061)
        {
            if (CpInazumaMsgPack.\uE007.TryGetValue(\uE060, out \uE061))
            {
                return(true);
            }
            if (\uE060.IsPrimitive || typeof(IList).IsAssignableFrom(\uE060) || typeof(IDictionary).IsAssignableFrom(\uE060) || \uE060 == typeof(object) || typeof(string) == \uE060)
            {
                return(false);
            }
            BindingFlags bindingAttr = BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;

            FieldInfo[]   fields = \uE060.GetFields(bindingAttr);
            List <\uE016> list   = new List <\uE016>(fields.Length);
            bool          flag   = false;

            foreach (FieldInfo fieldInfo in fields)
            {
                if (!fieldInfo.IsDefined(typeof(NonSerializedAttribute), false))
                {
                    \uE016 uE = new \uE016();
                    uE.\uE001 = fieldInfo.Name;
                    uE.\uE000 = int.MaxValue;
                    uE.\uE002 = fieldInfo;
                    object[] customAttributes = fieldInfo.GetCustomAttributes(typeof(CpSerializeFieldAttribute), false);
                    if (customAttributes.Length > 0 && customAttributes[0] is CpSerializeFieldAttribute)
                    {
                        flag = true;
                        CpSerializeFieldAttribute cpSerializeFieldAttribute = customAttributes[0] as CpSerializeFieldAttribute;
                        uE.\uE001 = (cpSerializeFieldAttribute.Name ?? fieldInfo.Name);
                        uE.\uE000 = cpSerializeFieldAttribute.Order;
                    }
                    list.Add(uE);
                }
            }
            if (flag)
            {
                List <\uE016> list2 = list;
                if (CpInazumaMsgPack.\uE00B == null)
                {
                    CpInazumaMsgPack.\uE00B = new Comparison <\uE016>(CpInazumaMsgPack.\uE024);
                }
                list2.Sort(CpInazumaMsgPack.\uE00B);
            }
            else
            {
                List <\uE016> list3 = list;
                if (CpInazumaMsgPack.\uE00C == null)
                {
                    CpInazumaMsgPack.\uE00C = new Comparison <\uE016>(CpInazumaMsgPack.\uE025);
                }
                list3.Sort(CpInazumaMsgPack.\uE00C);
            }
            \uE017 uE2 = default(\uE017);

            uE2.\uE000 = \uE060;
            uE2.\uE001 = list;
            CpInazumaMsgPack.\uE007[\uE060] = uE2;
            \uE017 uE3 = default(\uE017);

            for (int j = 0; j < list.Count; j++)
            {
                CpInazumaMsgPack.\uE022(list[j].\uE002.FieldType, ref uE3);
            }
            \uE061 = uE2;
            return(true);
        }
Example #8
0
 private static bool \uE021 <\uE000>(ref \uE017 \uE05F)
 {
     return(CpInazumaMsgPack.\uE022(typeof(\uE000), ref \uE05F));
 }
Example #9
0
        public static bool Analyze <T>()
        {
            \uE017 uE = default(\uE017);

            return(CpInazumaMsgPack.\uE021 <T>(ref uE));
        }
Example #10
0
    private static \uE017 \uE006(\uE012.\uE014[] \uE000, int \uE001, int \uE002, int \uE003)
    {
        \uE012.\uE014[] array = new \uE012.\uE014[\uE001];
        int             num4;
        int             num3;
        \uE017          uE2;

        \uE012.\uE014[] array2;
        for (;;)
        {
            int num = \uE019.\uE001(101);
            for (;;)
            {
                int           num2;
                \uE012.\uE014 uE;
                switch (num)
                {
                case 0:
IL_1C:
                    uE  = \uE000[num2];
                    num = 4;
                    continue;

                case 1:
                    num3 = (num4 = 0);
                    num  = 10;
                    continue;

                case 2:
                    uE2.\uE000 = false;
                    num        = 1;
                    continue;

                case 3:
                    if (uE.\uE000.\uE000 == \uE002)
                    {
                        num = 5;
                        continue;
                    }
                    goto IL_D6;

                case 4:
                    if (uE.\uE000.\uE001 == \uE003)
                    {
                        num = 3;
                        continue;
                    }
                    goto IL_D6;

                case 5:
                    uE2.\uE000 = true;
                    num        = 9;
                    continue;

                case 6:
                    uE2 = new \uE017();
                    num = \uE011.\uE006(93);
                    continue;

                case 7:
                    if (num2 != 0)
                    {
                        num = 0;
                        continue;
                    }
                    goto IL_129;

                case 8:
                    array2 = new \uE012.\uE014[\uE001];
                    num    = 6;
                    continue;

                case 9:
                    uE2.\uE001 = uE.\uE001;
                    num        = 11;
                    continue;

                case 10:
                    num2 = 0;
                    num  = 7;
                    continue;

                case 11:
                    goto IL_123;
                }
                break;
IL_129:
                if (num2 >= \uE001)
                {
                    goto Block_6;
                }
                goto IL_1C;
IL_123:
                num2++;
                goto IL_129;
IL_D6:
                if ((uE.\uE000.\uE000 >> uE.\uE000.\uE001 - \uE003 - 1 & 1) != 0)
                {
                    array2[num4++] = uE;
                    goto IL_123;
                }
                array[num3++] = uE;
                goto IL_123;
            }
        }
Block_6:
        if (!uE2.\uE000)
        {
            if (num3 > 0)
            {
                uE2.\uE002 = \uE012.\uE006(array, num3, \uE002 << 1, \uE003 + 1);
            }
            if (num4 > 0)
            {
                uE2.\uE003 = \uE012.\uE006(array2, num4, \uE002 << 1 | 1, \uE003 + 1);
            }
        }
        return(uE2);
    }
Example #11
0
        private static int[] \uE00A(\uE019.\uE01B \uE000, \uE017 \uE001, int \uE002)
        {
            int[] array = new int[\uE002];
            int   num   = 0;

            if (num == 0)
            {
                goto IL_12E;
            }
IL_17:
            int num2 = \uE019.\uE01A.\uE006(\uE000, \uE001);

            for (;;)
            {
                int num3 = \uE011.\uE006(92);
                for (;;)
                {
                    switch (num3)
                    {
                    case 0:
                        if (num2 < 16)
                        {
                            num3 = 1;
                            continue;
                        }
                        goto IL_57;

                    case 1:
                        array[num] = num2;
                        num3       = 2;
                        continue;

                    case 2:
                        goto IL_52;
                    }
                    break;
                }
            }
IL_52:
            goto IL_122;
IL_57:
            if (num2 == 16)
            {
                int num4 = \uE000.\uE000(2) + 3;
                for (;;)
                {
                    int num5 = \uE011.\uE006(90);
                    for (;;)
                    {
                        int num6;
                        switch (num5)
                        {
                        case 0:
IL_8A:
                            array[num + num6] = array[num - 1];
                            num5 = 3;
                            continue;

                        case 1:
                            num6 = 0;
                            num5 = 2;
                            continue;

                        case 2:
                            if (num6 != 0)
                            {
                                num5 = 0;
                                continue;
                            }
                            goto IL_B1;

                        case 3:
                            num6++;
                            goto IL_B1;
                        }
                        break;
IL_B1:
                        if (num6 >= num4)
                        {
                            goto Block_4;
                        }
                        goto IL_8A;
                    }
                }
Block_4:
                num += num4 - 1;
            }
            else if (num2 == 17)
            {
                for (;;)
                {
                    int num7 = \uE011.\uE006(92);
                    for (;;)
                    {
                        switch (num7)
                        {
                        case 0:
                        {
                            int num8 = \uE000.\uE000(3) + 3;
                            num7 = 1;
                            continue;
                        }

                        case 1:
                        {
                            int num8;
                            num += num8 - 1;
                            num7 = 2;
                            continue;
                        }

                        case 2:
                            goto IL_FF;
                        }
                        break;
                    }
                }
IL_FF:          ;
            }
            else if (num2 == 18)
            {
                int num9 = \uE000.\uE000(7) + 11;
                num += num9 - 1;
            }
IL_122:
            num++;
IL_12E:
            if (num >= \uE002)
            {
                return(array);
            }
            goto IL_17;
        }
Example #12
0
        private void \uE009(\uE019.\uE01B \uE000, out \uE016[] \uE001, out \uE016[] \uE002)
        {
            int num = \uE000.\uE000(5) + 257;

            int[] array;
            int   num5;

            for (;;)
            {
                int num2 = \uE019.\uE001(87);
                for (;;)
                {
                    int num3;
                    int num4;
                    switch (num2)
                    {
                    case 0:
                        array = new int[19];
                        num2  = 2;
                        continue;

                    case 1:
                    {
IL_34:
                        int[] uE;
                        array[uE[num3]] = \uE000.\uE000(3);
                        num2            = 7;
                        continue;
                    }

                    case 2:
                        num3 = 0;
                        num2 = 4;
                        continue;

                    case 3:
                    {
                        int[] uE = \uE012.\uE003;
                        num2 = \uE011.\uE006(92);
                        continue;
                    }

                    case 4:
                        if (num3 != 0)
                        {
                            num2 = 1;
                            continue;
                        }
                        goto IL_91;

                    case 5:
                        num4 = \uE000.\uE000(4) + 4;
                        num2 = 3;
                        continue;

                    case 6:
                        num5 = \uE000.\uE000(5) + 1;
                        num2 = 5;
                        continue;

                    case 7:
                        num3++;
                        goto IL_91;
                    }
                    break;
IL_91:
                    if (num3 >= num4)
                    {
                        goto Block_2;
                    }
                    goto IL_34;
                }
            }
Block_2:
            \uE017 uE2 = \uE012.\uE005(\uE012.\uE002(array));

            int[] array2;
            for (;;)
            {
                int num6 = \uE011.\uE006(90);
                for (;;)
                {
                    int num7;
                    switch (num6)
                    {
                    case 0:
                        if (num7 != 0)
                        {
                            num6 = 2;
                            continue;
                        }
                        goto IL_124;

                    case 1:
                        array2 = \uE019.\uE01A.\uE00A(\uE000, uE2, num + num5);
                        num6   = 4;
                        continue;

                    case 2:
IL_EB:
                        \uE001[num7].\uE001 = array2[num7];
                        num6 = 5;
                        continue;

                    case 3:
                        num7 = 0;
                        num6 = \uE011.\uE006(92);
                        continue;

                    case 4:
                        \uE001 = new \uE016[num];
                        num6   = 3;
                        continue;

                    case 5:
                        num7++;
                        goto IL_124;
                    }
                    break;
IL_124:
                    if (num7 >= num)
                    {
                        goto Block_4;
                    }
                    goto IL_EB;
                }
            }
Block_4:
            \uE012.\uE003(\uE001);
            for (;;)
            {
                int num8 = \uE011.\uE006(90);
                for (;;)
                {
                    int num9;
                    switch (num8)
                    {
                    case 0:
IL_15C:
                        \uE002[num9].\uE001 = array2[num9 + num];
                        num8 = 2;
                        continue;

                    case 1:
                        \uE002 = new \uE016[num5];
                        num8   = 4;
                        continue;

                    case 2:
                        num9++;
                        num8 = \uE019.\uE001(99);
                        continue;

                    case 3:
                        if (num9 != 0)
                        {
                            num8 = 0;
                            continue;
                        }
                        goto IL_1B6;

                    case 4:
                        num9 = 0;
                        num8 = 3;
                        continue;

                    case 5:
                        goto IL_1B6;
                    }
                    break;
IL_1B6:
                    if (num9 >= num5)
                    {
                        goto Block_6;
                    }
                    goto IL_15C;
                }
            }
Block_6:
            \uE012.\uE003(\uE002);
        }