// Token: 0x06001E44 RID: 7748 RVA: 0x00062274 File Offset: 0x00060474
        public static void smethod_12(Class321 pd, Enum81 type, BinaryWriter write_stream, uint offset_orig, uint offset_new, Stream stream_orig, Stream stream_new)
        {
            switch (type)
            {
            case Enum81.const_1:
                if (!Class136.smethod_3(stream_orig, stream_new))
                {
                    type = Enum81.const_0;
                }
                break;

            case Enum81.const_2:
                if (!Class132.smethod_1(stream_orig, stream_new))
                {
                    type = Enum81.const_0;
                }
                break;
            }
            switch (type)
            {
            case Enum81.const_1:
                Class136.smethod_0(pd, write_stream, offset_orig, offset_new, stream_orig, stream_new);
                return;

            case Enum81.const_2:
                Class132.smethod_2(pd, write_stream, offset_orig, offset_new, stream_orig, stream_new);
                return;

            default:
                Class292.smethod_11(pd, write_stream, offset_orig, stream_orig, stream_new);
                return;
            }
        }
 // Token: 0x06002638 RID: 9784 RVA: 0x00086BC4 File Offset: 0x00084DC4
 public Class102(Class132 cp, Struct43 contentPackHash, string fileName)
 {
     this.dictionary_0       = new Dictionary <string, Class102.Class403>(StringComparer.OrdinalIgnoreCase);
     this.ID                 = cp.ID;
     this.FileName           = fileName;
     this.Name               = cp.Name;
     this.DateInstalled      = DateTime.Now;
     this.InstallState       = Enum76.const_0;
     this.UpdateUri          = cp.UpdateUri;
     this.DataHash           = contentPackHash;
     this.AutoUpdate         = (cp.UpdateUri != null);
     this.VersionType        = cp.Type;
     this.LoaderPack         = cp.LoaderPack;
     this.ContentPackVersion = cp.Version;
     foreach (KeyValuePair <string, Struct43> keyValuePair in cp.ItemIndex)
     {
         if (!this.dictionary_0.ContainsKey(keyValuePair.Key) && Class136.smethod_8(keyValuePair.Key))
         {
             if (this.method_4(keyValuePair.Key))
             {
                 this.dictionary_0.Add(keyValuePair.Key, new Class102.Class403(keyValuePair.Value, Enum76.const_0));
             }
             else
             {
                 this.dictionary_0.Add(keyValuePair.Key, new Class102.Class403(keyValuePair.Value, Enum76.const_3));
             }
         }
     }
 }
Пример #3
0
        public Class134(Class144 class144_0, Class140 class140_1, Class136 class136_0, int int_4, int int_5, int int_6) : base(class140_1, int_5)
        {
            this.int_3 = class136_0.vmethod_2();
            this.int_1 = int_6;
            for (int i = 0; i < int_6; i++)
            {
                this.int_2[i] = class144_0.vmethod_12(int_4);
            }
            int num  = class144_0.vmethod_10(2);
            int num2 = num;

            if (num2 == 0)
            {
                int      int_7  = class144_0.vmethod_10(4);
                Class138 @class = new Class138();
                this.class137_0   = @class;
                @class.int_0      = int_7;
                @class.class143_0 = class136_0.vmethod_1();
                @class.vmethod_0(class144_0, int_6, @class.int_0, class140_1, class136_0.vmethod_2());
                Buffer.BlockCopy(this.int_2, 0, class136_0.vmethod_0(), 0, int_6 << 2);
                BlackMagic.CopyArrayOffset(this.int_3, class140_1.int_0 - int_6, int_6, class136_0.vmethod_0(), int_6);
                return;
            }
            throw new IOException("STREAM_DECODER_UNPARSEABLE_STREAM");
        }
 // Token: 0x060020A6 RID: 8358 RVA: 0x0006DCD8 File Offset: 0x0006BED8
 public static void smethod_2(Class321 pd, BinaryWriter write_stream, uint offset_orig, uint offset_new, Stream stream_orig, Stream stream_new)
 {
     using (Stream3 stream = new Stream3(stream_orig))
     {
         using (Stream3 stream2 = new Stream3(stream_new))
         {
             uint num;
             uint num2;
             Class132.smethod_3(stream, out num, out num2);
             uint num3;
             uint num4;
             Class132.smethod_3(stream2, out num3, out num4);
             using (Stream3 stream3 = new Stream3(stream, 0L, (long)((ulong)num)))
             {
                 using (Stream3 stream4 = new Stream3(stream2, 0L, (long)((ulong)num3)))
                 {
                     Class292.smethod_12(pd, Enum81.const_0, write_stream, offset_orig, offset_new, stream3, stream4);
                 }
             }
             using (Stream3 stream5 = new Stream3(stream, (long)((ulong)num), (long)((ulong)(num + num2))))
             {
                 using (Stream3 stream6 = new Stream3(stream2, (long)((ulong)num3), (long)((ulong)(num3 + num4))))
                 {
                     Class136.smethod_0(pd, write_stream, offset_orig + num, offset_new + num3, stream5, stream6);
                 }
             }
         }
     }
 }
Пример #5
0
        public Class134(Class144 class1440, Class140 class1401, Class136 class1360, int int4, int int5,
                        int int6) : base(class1401, int5)
        {
            _int3 = class1360.vmethod_2();
            _int1 = int6;
            for (var i = 0; i < int6; i++)
            {
                _int2[i] = class1440.vmethod_12(int4);
            }
            var num  = class1440.vmethod_10(2);
            var num2 = num;

            if (num2 == 0)
            {
                var int7   = class1440.vmethod_10(4);
                var @class = new Class138();
                _class1370       = @class;
                @class.Int0      = int7;
                @class.Class1430 = class1360.vmethod_1();
                @class.vmethod_0(class1440, int6, @class.Int0, class1401, class1360.vmethod_2());
                Buffer.BlockCopy(_int2, 0, class1360.vmethod_0(), 0, int6 << 2);
                BlackMagic.CopyArrayOffset(_int3, class1401.Int0 - int6, int6, class1360.vmethod_0(), int6);
                return;
            }
            throw new IOException("STREAM_DECODER_UNPARSEABLE_STREAM");
        }
Пример #6
0
    // Token: 0x06000091 RID: 145 RVA: 0x0000AB8C File Offset: 0x00008D8C
    private static Class47 smethod_6(out bool bool_0)
    {
        bool_0 = true;
        if (Class9.class47_0 != null)
        {
            return(Class9.class47_0);
        }
        if (Class9.class136_0 != null)
        {
            bool_0 = false;
            return(Class9.class136_0.method_8());
        }
        Class136 @class = Class9.smethod_8();
        Class47  class2 = @class.method_8();

        if (class2.vmethod_0())
        {
            Class9.class47_0 = class2;
            @class.Dispose();
        }
        else
        {
            Class9.class136_0 = @class;
            bool_0            = false;
        }
        return(class2);
    }
Пример #7
0
 public Class132(Class144 class144_0, Class140 class140_1, Class136 class136_0, int int_2, int int_3) : base(class140_1, int_3)
 {
     this.int_1 = class144_0.vmethod_12(int_2);
     for (int i = 0; i < class140_1.int_0; i++)
     {
         class136_0.vmethod_0()[i] = this.int_1;
     }
 }
Пример #8
0
 public Class133(Class144 class144_0, Class140 class140_1, Class136 class136_0, int int_2, int int_3) : base(class140_1, int_3)
 {
     this.int_1 = class136_0.vmethod_2();
     for (int i = 0; i < class140_1.int_0; i++)
     {
         this.int_1[i] = class144_0.vmethod_12(int_2);
     }
     Buffer.BlockCopy(this.int_1, 0, class136_0.vmethod_0(), 0, class140_1.int_0 << 2);
 }
Пример #9
0
 public Class132(Class144 class1440, Class140 class1401, Class136 class1360, int int2,
                 int int3) : base(class1401, int3)
 {
     _int1 = class1440.vmethod_12(int2);
     for (var i = 0; i < class1401.Int0; i++)
     {
         class1360.vmethod_0()[i] = _int1;
     }
 }
        // Token: 0x06002641 RID: 9793 RVA: 0x0008825C File Offset: 0x0008645C
        private void method_7(out Dictionary <string, HashSet <string> > installingFiles, out Dictionary <string, HashSet <string> > uninstallingFiles)
        {
            installingFiles   = new Dictionary <string, HashSet <string> >(StringComparer.OrdinalIgnoreCase);
            uninstallingFiles = new Dictionary <string, HashSet <string> >(StringComparer.OrdinalIgnoreCase);
            if (this.InstallState != Enum76.const_0)
            {
                lock (((ICollection)this.dictionary_0).SyncRoot)
                {
                    foreach (KeyValuePair <string, Class102.Class403> keyValuePair in this.dictionary_0)
                    {
                        string key;
                        if (keyValuePair.Value.enum76_0 != Enum76.const_0 && Class136.smethod_5(keyValuePair.Key, out key))
                        {
                            Enum76 installState = this.InstallState;
                            if (installState == Enum76.const_2)
                            {
                                switch (keyValuePair.Value.enum76_0)
                                {
                                case Enum76.const_1:
                                case Enum76.const_2:
                                case Enum76.const_4:
                                    if (!uninstallingFiles.ContainsKey(key))
                                    {
                                        uninstallingFiles.Add(key, new HashSet <string>(StringComparer.OrdinalIgnoreCase));
                                    }
                                    uninstallingFiles[key].Add(keyValuePair.Key);
                                    break;
                                }
                            }
                            else
                            {
                                switch (keyValuePair.Value.enum76_0)
                                {
                                case Enum76.const_2:
                                case Enum76.const_4:
                                    if (!uninstallingFiles.ContainsKey(key))
                                    {
                                        uninstallingFiles.Add(key, new HashSet <string>(StringComparer.OrdinalIgnoreCase));
                                    }
                                    uninstallingFiles[key].Add(keyValuePair.Key);
                                    break;

                                case Enum76.const_3:
                                    if (!installingFiles.ContainsKey(key))
                                    {
                                        installingFiles.Add(key, new HashSet <string>(StringComparer.OrdinalIgnoreCase));
                                    }
                                    installingFiles[key].Add(keyValuePair.Key);
                                    break;
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #11
0
 public Class133(Class144 class1440, Class140 class1401, Class136 class1360, int int2,
                 int int3) : base(class1401, int3)
 {
     _int1 = class1360.vmethod_2();
     for (var i = 0; i < class1401.Int0; i++)
     {
         _int1[i] = class1440.vmethod_12(int2);
     }
     Buffer.BlockCopy(_int1, 0, class1360.vmethod_0(), 0, class1401.Int0 << 2);
 }
Пример #12
0
        public Class135(Class144 class1440, Class140 class1401, Class136 class1360, int int7, int int8,
                        int int9) : base(class1401, int8)
        {
            _int6 = class1360.vmethod_2();
            _int1 = int9;
            for (var i = 0; i < int9; i++)
            {
                _int5[i] = class1440.vmethod_12(int7);
            }
            var num = class1440.vmethod_10(4);

            if (num == 15)
            {
                throw new IOException("STREAM_DECODER_ERROR_STATUS_LOST_SYNC");
            }
            _int2 = num + 1;
            _int3 = class1440.vmethod_12(5);
            for (var j = 0; j < int9; j++)
            {
                _int4[j] = class1440.vmethod_12(_int2);
            }
            var num2 = class1440.vmethod_10(2);
            var num3 = num2;

            if (num3 != 0)
            {
                throw new IOException("STREAM_DECODER_UNPARSEABLE_STREAM");
            }
            _class1370 = new Class138();
            ((Class138)_class1370).Int0      = class1440.vmethod_10(4);
            ((Class138)_class1370).Class1430 = class1360.vmethod_1();
            if (_class1370 is Class138)
            {
                ((Class138)_class1370).vmethod_0(class1440, int9, ((Class138)_class1370).Int0, class1401,
                                                 class1360.vmethod_2());
            }
            Buffer.BlockCopy(_int5, 0, class1360.vmethod_0(), 0, int9 << 2);
            if (int7 + _int2 + Class141.smethod_0(int9) > 32)
            {
                Class130.smethod_1(class1360.vmethod_2(), class1401.Int0 - int9, _int4, int9, _int3,
                                   class1360.vmethod_0(), int9);
                return;
            }
            if (int7 <= 16 && _int2 <= 16)
            {
                Class130.smethod_0(class1360.vmethod_2(), class1401.Int0 - int9, _int4, int9, _int3,
                                   class1360.vmethod_0(), int9);
                return;
            }
            Class130.smethod_0(class1360.vmethod_2(), class1401.Int0 - int9, _int4, int9, _int3, class1360.vmethod_0(),
                               int9);
        }
Пример #13
0
        public Class135(Class144 class144_0, Class140 class140_1, Class136 class136_0, int int_7, int int_8, int int_9) : base(class140_1, int_8)
        {
            this.int_6 = class136_0.vmethod_2();
            this.int_1 = int_9;
            for (int i = 0; i < int_9; i++)
            {
                this.int_5[i] = class144_0.vmethod_12(int_7);
            }
            int num = class144_0.vmethod_10(4);

            if (num == 15)
            {
                throw new IOException("STREAM_DECODER_ERROR_STATUS_LOST_SYNC");
            }
            this.int_2 = num + 1;
            this.int_3 = class144_0.vmethod_12(5);
            for (int j = 0; j < int_9; j++)
            {
                this.int_4[j] = class144_0.vmethod_12(this.int_2);
            }
            int num2 = class144_0.vmethod_10(2);
            int num3 = num2;

            if (num3 != 0)
            {
                throw new IOException("STREAM_DECODER_UNPARSEABLE_STREAM");
            }
            this.class137_0 = new Class138();
            ((Class138)this.class137_0).int_0      = class144_0.vmethod_10(4);
            ((Class138)this.class137_0).class143_0 = class136_0.vmethod_1();
            if (this.class137_0 is Class138)
            {
                ((Class138)this.class137_0).vmethod_0(class144_0, int_9, ((Class138)this.class137_0).int_0, class140_1, class136_0.vmethod_2());
            }
            Buffer.BlockCopy(this.int_5, 0, class136_0.vmethod_0(), 0, int_9 << 2);
            if (int_7 + this.int_2 + Class141.smethod_0(int_9) > 32)
            {
                Class130.smethod_1(class136_0.vmethod_2(), class140_1.int_0 - int_9, this.int_4, int_9, this.int_3, class136_0.vmethod_0(), int_9);
                return;
            }
            if (int_7 <= 16 && this.int_2 <= 16)
            {
                Class130.smethod_0(class136_0.vmethod_2(), class140_1.int_0 - int_9, this.int_4, int_9, this.int_3, class136_0.vmethod_0(), int_9);
                return;
            }
            Class130.smethod_0(class136_0.vmethod_2(), class140_1.int_0 - int_9, this.int_4, int_9, this.int_3, class136_0.vmethod_0(), int_9);
        }
Пример #14
0
 private Class1108(Class764 A_0, SubDocumentType A_1)
 {
     this.class985_0        = new Class985();
     this.class132_0        = new Class132();
     this.class136_0        = new Class136();
     this.class135_0        = new Class135();
     this.class133_0        = new Class133();
     this.class131_0        = new Class131();
     this.class134_0        = new Class134();
     this.class130_0        = new Class130();
     this.class130_1        = new Class130();
     this.class129_0        = new Class129();
     this.stack_0           = new Stack();
     this.class764_0        = A_0;
     this.subDocumentType_0 = A_1;
     this.class263_0        = new Class263(this.class764_0.method_43());
 }
        // Token: 0x06001CAD RID: 7341 RVA: 0x0005C870 File Offset: 0x0005AA70
        private void method_1(object state)
        {
            string text = state as string;

            if (string.IsNullOrEmpty(text))
            {
                this.class374_0.method_4(new Action <object>(this.method_4));
                this.class374_0.method_4(new Action <object>(this.method_2));
                return;
            }
            byte[] array = null;
            if (this.class132_0.Data.MultiFileData.ContainsKey(text))
            {
                Class338 @class = this.class132_0.Data.MultiFileData[text];
                array = @class.Data;
            }
            switch (Class136.smethod_4(text))
            {
            case Enum68.const_0:
                break;

            case Enum68.const_1:
                this.class374_0.method_5(new Action <object>(this.method_2), Class429.smethod_0(array, null));
                this.class374_0.method_4(new Action <object>(this.method_4));
                return;

            case Enum68.const_2:
                using (MemoryStream memoryStream = new MemoryStream(array))
                {
                    this.class374_0.method_5(new Action <object>(this.method_2), new Class429(Class486.smethod_2(memoryStream), null));
                }
                this.class374_0.method_4(new Action <object>(this.method_4));
                return;

            case Enum68.const_3:
            case Enum68.const_4:
            case Enum68.const_5:
                this.class374_0.method_5(new Action <object>(this.method_4), new Class355(text, array, null));
                this.class374_0.method_4(new Action <object>(this.method_2));
                break;

            default:
                return;
            }
        }
Пример #16
0
 // Token: 0x06001BFD RID: 7165 RVA: 0x00057CF0 File Offset: 0x00055EF0
 private void btnExport_Click(object sender, EventArgs e)
 {
     if (this.lbFiles.SelectedItems.Count > 0)
     {
         ListViewItemState <string> listViewItemState = this.lbFiles.SelectedItems[0] as ListViewItemState <string>;
         Enum68 @enum = Class136.smethod_4(listViewItemState.State);
         if (@enum == Enum68.const_0)
         {
             return;
         }
         this.saveFileDialog_0.FileName = Path.GetFileName(listViewItemState.State);
         this.saveFileDialog_0.Filter   = @enum.smethod_0(false);
         if (this.saveFileDialog_0.ShowDialog() == DialogResult.OK)
         {
             Class338 mfd = this.dictionary_0[listViewItemState];
             mfd.smethod_0(this.saveFileDialog_0.FileName);
         }
     }
 }
Пример #17
0
        // Token: 0x06002B39 RID: 11065 RVA: 0x000A78D0 File Offset: 0x000A5AD0
        public static bool smethod_0(EventHandler <EventArgs9> progressChanged, string installPath)
        {
            string path  = Path.Combine(installPath, "phase_1.mf");
            string path2 = Path.Combine(installPath, "phase_2.mf");
            bool   result;

            try
            {
                using (Stream stream = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.None))
                {
                    using (Stream stream2 = File.Open(path2, FileMode.Open, FileAccess.Read, FileShare.None))
                    {
                        using (Class136 @class = new Class136(stream))
                        {
                            using (Class136 class2 = new Class136(stream2))
                            {
                                @class.method_10();
                                class2.method_10();
                                Class337 class3 = @class.method_8("phase_1_index.txt");
                                Class337 class4 = class2.method_8("phase_2_index.txt");
                                int      num    = class3.Files.Count + class4.Files.Count;
                                int      num2   = 0;
                                if (progressChanged != null)
                                {
                                    progressChanged(null, new EventArgs9((long)num2, (long)num));
                                }
                                Class481.smethod_1(progressChanged, installPath, @class, class3, num, ref num2);
                                Class481.smethod_1(progressChanged, installPath, class2, class4, num, ref num2);
                            }
                        }
                    }
                }
                result = true;
            }
            catch (Exception ex)
            {
                ex.smethod_0();
                result = false;
            }
            return(result);
        }
Пример #18
0
    // Token: 0x06000653 RID: 1619 RVA: 0x00035E5C File Offset: 0x0003405C
    private Class47 method_10(bool bool_2)
    {
        if (!this.bool_0)
        {
            bool flag = this.bool_1 || this.symmetricAlgorithm_0 == null;
            if (this.symmetricAlgorithm_0 == null)
            {
                this.symmetricAlgorithm_0 = Class136.smethod_0();
                if (this.symmetricAlgorithm_0 == null)
                {
                    this.bool_0 = true;
                }
            }
            if (this.symmetricAlgorithm_0 != null)
            {
                if (flag)
                {
                    this.symmetricAlgorithm_0.Key     = this.method_4();
                    this.symmetricAlgorithm_0.IV      = this.method_6();
                    this.symmetricAlgorithm_0.Mode    = Class136.smethod_1(this.method_0());
                    this.symmetricAlgorithm_0.Padding = Class136.smethod_2(this.method_2());
                }
                return(new Class48(bool_2 ? this.symmetricAlgorithm_0.CreateEncryptor() : this.symmetricAlgorithm_0.CreateDecryptor()));
            }
        }
        Class92 interface6_ = new Class92(new Class135());
        Class65 @class;

        if (this.method_2() != (Enum1)1)
        {
            @class = new Class66(interface6_, Class136.smethod_3(this.method_2()));
        }
        else
        {
            @class = new Class65(interface6_);
        }
        Class95 interface1_ = new Class95(new Class19(this.method_4()), this.method_6());

        @class.imethod_1(bool_2, interface1_);
        return(new Class49(@class));
    }
        // Token: 0x0600263E RID: 9790 RVA: 0x00087324 File Offset: 0x00085524
        public static void smethod_1(HashSet <string> modifiedFiles)
        {
            if (Class110.Instance.ConnectSettings.SpoofedToonTownEnabled)
            {
                lock (((ICollection)Class110.Instance.ConnectSettings.ContentPacks).SyncRoot)
                {
                    foreach (Class102 @class in Class110.Instance.ConnectSettings.ContentPacks)
                    {
                        lock (((ICollection)@class.dictionary_0).SyncRoot)
                        {
                            foreach (KeyValuePair <string, Class102.Class403> keyValuePair in @class.dictionary_0)
                            {
                                string item;
                                if (keyValuePair.Value.enum76_0 != Enum76.const_0 && Class136.smethod_5(keyValuePair.Key, out item))
                                {
                                    switch (keyValuePair.Value.enum76_0)
                                    {
                                    case Enum76.const_1:
                                        if (modifiedFiles.Contains(item))
                                        {
                                            @class.dictionary_0[keyValuePair.Key].enum76_0 = Enum76.const_3;
                                        }
                                        break;

                                    case Enum76.const_2:
                                        if (modifiedFiles.Contains(item))
                                        {
                                            @class.dictionary_0[keyValuePair.Key].enum76_0 = Enum76.const_0;
                                        }
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #20
0
        // Token: 0x06001EEA RID: 7914 RVA: 0x00065C98 File Offset: 0x00063E98
        public Dictionary <string, Class307> method_9(Class96 data, string installFolder, bool usingVirtualServer, bool canMoveOrInstallFiles, HashSet <string> changedFiles, out bool success)
        {
            Dictionary <string, Class307> dictionary = new Dictionary <string, Class307>();

            success = true;
            lock (((ICollection)this.FILES).SyncRoot)
            {
                lock (((ICollection)data.FILES).SyncRoot)
                {
                    foreach (KeyValuePair <string, Class186> keyValuePair in data.FILES)
                    {
                        Class96.Class308 @class;
                        bool             flag3;
                        if (usingVirtualServer && Class136.smethod_6(keyValuePair.Key))
                        {
                            @class = new Class96.Class308(keyValuePair.Key, keyValuePair.Key + ".orig", Path.Combine(installFolder, keyValuePair.Key + ".orig"), keyValuePair.Key, Path.Combine(installFolder, keyValuePair.Key), true);
                            flag3  = true;
                        }
                        else
                        {
                            @class = new Class96.Class308(keyValuePair.Key, keyValuePair.Key, Path.Combine(installFolder, keyValuePair.Key), keyValuePair.Key + ".orig", Path.Combine(installFolder, keyValuePair.Key + ".orig"), false);
                            flag3  = false;
                        }
                        bool     flag4;
                        Struct43 @struct;
                        Enum23   @enum;
                        if (flag4 = this.FILES.ContainsKey(keyValuePair.Key))
                        {
                            @enum = keyValuePair.Value.method_5(this.FILES[keyValuePair.Key], @class.FilePath, out @struct);
                        }
                        else
                        {
                            @enum = keyValuePair.Value.method_3(@class.FilePath, out @struct);
                        }
                        if (@enum != Enum23.const_2)
                        {
                            if (!canMoveOrInstallFiles)
                            {
                                success = false;
                                break;
                            }
                            if (@enum == Enum23.const_1 && keyValuePair.Value.method_2(@struct))
                            {
                                @class.FileDetails = keyValuePair.Value.method_1(@struct);
                                dictionary.Add(keyValuePair.Key, @class);
                            }
                            else if (flag3)
                            {
                                Struct43 struct2;
                                long     expectedSize;
                                switch (keyValuePair.Value.method_4(@class.AltFilePath, out struct2, out expectedSize))
                                {
                                case Enum23.const_0:
                                    @class.FileDetails = keyValuePair.Value.method_0();
                                    dictionary.Add(keyValuePair.Key, @class);
                                    break;

                                case Enum23.const_1:
                                    if (keyValuePair.Value.method_2(struct2))
                                    {
                                        Class234.smethod_14(@class.AltFilePath, @class.FilePath, true);
                                        @class.FileDetails = keyValuePair.Value.method_1(struct2);
                                        this.method_7(keyValuePair.Key, new Class186(expectedSize, struct2, string.Empty));
                                        dictionary.Add(keyValuePair.Key, @class);
                                        Class110.Instance.CreatedFileArchive.method_4(@class.FilePath);
                                        Class110.Instance.CreatedFileArchive.method_5(@class.AltFilePath);
                                    }
                                    else
                                    {
                                        @class.FileDetails = keyValuePair.Value.method_0();
                                        dictionary.Add(keyValuePair.Key, @class);
                                    }
                                    break;

                                case Enum23.const_2:
                                    File.Copy(@class.AltFilePath, @class.FilePath, true);
                                    this.method_6(keyValuePair.Key, keyValuePair.Value, null, null);
                                    Class110.Instance.CreatedFileArchive.method_4(@class.FilePath);
                                    break;
                                }
                            }
                            else
                            {
                                @class.FileDetails = keyValuePair.Value.method_0();
                                dictionary.Add(keyValuePair.Key, @class);
                            }
                            string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(keyValuePair.Key);
                            if (!changedFiles.Contains(fileNameWithoutExtension))
                            {
                                changedFiles.Add(fileNameWithoutExtension);
                            }
                        }
                        else if (!flag4)
                        {
                            this.method_6(keyValuePair.Key, keyValuePair.Value, null, null);
                        }
                        if (flag3 && !File.Exists(@class.AltFilePath) && File.Exists(@class.FilePath))
                        {
                            File.Copy(@class.FilePath, @class.AltFilePath, true);
                            string fileNameWithoutExtension2 = Path.GetFileNameWithoutExtension(keyValuePair.Key);
                            if (!changedFiles.Contains(fileNameWithoutExtension2))
                            {
                                changedFiles.Add(fileNameWithoutExtension2);
                            }
                            Class110.Instance.CreatedFileArchive.method_4(@class.AltFilePath);
                        }
                    }
                }
            }
            return(dictionary);
        }
Пример #21
0
 public Class112(Class136 serializerReader)
 {
     Class203.smethod_2(serializerReader, "serializerReader");
     this.class136_0       = serializerReader;
     this.jsonSerializer_0 = serializerReader.jsonSerializer_0;
 }
Пример #22
0
 // Token: 0x06002B3A RID: 11066 RVA: 0x000A7A20 File Offset: 0x000A5C20
 private static void smethod_1(EventHandler <EventArgs9> progressChanged, string installPath, Class136 mf, Class337 index, int total, ref int count)
 {
     foreach (KeyValuePair <string, Class337.Struct34> keyValuePair in index)
     {
         string text = Path.Combine(installPath, keyValuePair.Key);
         if (!File.Exists(text) || Class234.smethod_11(text) != keyValuePair.Value.ExpectedSize || Struct43.smethod_6(Class513.smethod_0(text), keyValuePair.Value.ExpectedHash))
         {
             if (mf.method_6(keyValuePair.Key))
             {
                 Class338 @class = mf[keyValuePair.Key];
                 mf.method_15(@class);
                 @class.smethod_0(text);
                 @class.Data = null;
                 Class110.Instance.CreatedFileArchive.method_4(text);
             }
             count++;
             if (progressChanged != null)
             {
                 progressChanged(null, new EventArgs9((long)count, (long)total));
             }
         }
     }
 }
        // Token: 0x0600263D RID: 9789 RVA: 0x00087018 File Offset: 0x00085218
        public void method_5()
        {
            this.DateInstalled = DateTime.Now;
            HashSet <string> hashSet = new HashSet <string>(StringComparer.OrdinalIgnoreCase);

            lock (((ICollection)this.dictionary_0).SyncRoot)
            {
                using (Class132 @class = new Class132(this.FileName, false, false))
                {
                    foreach (KeyValuePair <string, Struct43> keyValuePair in @class.ItemIndex)
                    {
                        if (this.dictionary_0.ContainsKey(keyValuePair.Key))
                        {
                            if (Struct43.smethod_6(keyValuePair.Value, this.dictionary_0[keyValuePair.Key].struct43_0))
                            {
                                if (this.dictionary_0[keyValuePair.Key].enum76_0 == Enum76.const_1)
                                {
                                    this.dictionary_0[keyValuePair.Key].enum76_0 = Enum76.const_3;
                                }
                                this.dictionary_0[keyValuePair.Key].struct43_0 = keyValuePair.Value;
                            }
                        }
                        else if (Class136.smethod_8(keyValuePair.Key))
                        {
                            if (this.method_4(keyValuePair.Key))
                            {
                                this.dictionary_0.Add(keyValuePair.Key, new Class102.Class403(keyValuePair.Value, Enum76.const_0));
                            }
                            else
                            {
                                this.dictionary_0.Add(keyValuePair.Key, new Class102.Class403(keyValuePair.Value, Enum76.const_3));
                                this.InstallState = Enum76.const_3;
                            }
                        }
                    }
                    foreach (KeyValuePair <string, Class102.Class403> keyValuePair2 in this.dictionary_0)
                    {
                        if ([email protected](keyValuePair2.Key))
                        {
                            Enum76 @enum = keyValuePair2.Value.enum76_0;
                            if (@enum == Enum76.const_1)
                            {
                                keyValuePair2.Value.enum76_0 = Enum76.const_4;
                            }
                            else
                            {
                                hashSet.Add(keyValuePair2.Key);
                            }
                        }
                    }
                    this.Name               = @class.Name;
                    this.UpdateUri          = @class.UpdateUri;
                    this.VersionType        = @class.Type;
                    this.ContentPackVersion = @class.Version;
                    this.LoaderPack         = @class.LoaderPack;
                    if (this.VersionType == Enum82.const_0)
                    {
                        this.DataHash = @class.DataHash;
                    }
                }
                if (this.VersionType != Enum82.const_0)
                {
                    using (Stream stream = File.Open(this.FileName, FileMode.Open, FileAccess.Read, FileShare.None))
                    {
                        this.DataHash = stream.smethod_2();
                    }
                }
                this.dictionary_0.smethod_8(hashSet);
            }
        }
 public abstract void Visit(Class136 c);
        // Token: 0x0600263F RID: 9791 RVA: 0x000874F8 File Offset: 0x000856F8
        public static void smethod_2(string installDirectory, out HashSet <string> changedMultiFiles)
        {
            changedMultiFiles = new HashSet <string>(StringComparer.OrdinalIgnoreCase);
            if (Class110.Instance.ConnectSettings.SpoofedToonTownEnabled)
            {
                Class102.Class404 @class = new Class102.Class404();
                Dictionary <Class102, Dictionary <string, HashSet <string> > > dictionary  = new Dictionary <Class102, Dictionary <string, HashSet <string> > >();
                Dictionary <string, Dictionary <Class102, HashSet <string> > > dictionary2 = new Dictionary <string, Dictionary <Class102, HashSet <string> > >(StringComparer.OrdinalIgnoreCase);
                @class.dictionary_0 = new Dictionary <string, HashSet <string> >(StringComparer.OrdinalIgnoreCase);
                lock (((ICollection)Class110.Instance.ConnectSettings.ContentPacks).SyncRoot)
                {
                    foreach (Class102 class2 in Class110.Instance.ConnectSettings.ContentPacks)
                    {
                        if (!class2.LoaderPack)
                        {
                            Dictionary <string, HashSet <string> > dictionary3;
                            Dictionary <string, HashSet <string> > dictionary4;
                            class2.method_7(out dictionary3, out dictionary4);
                            if (dictionary3.Count > 0)
                            {
                                dictionary.Add(class2, dictionary3);
                            }
                            foreach (KeyValuePair <string, HashSet <string> > keyValuePair in dictionary3)
                            {
                                if ([email protected]_0.ContainsKey(keyValuePair.Key))
                                {
                                    @class.dictionary_0.Add(keyValuePair.Key, new HashSet <string>(StringComparer.OrdinalIgnoreCase));
                                }
                                foreach (string item in keyValuePair.Value)
                                {
                                    if ([email protected]_0[keyValuePair.Key].Contains(item))
                                    {
                                        @class.dictionary_0[keyValuePair.Key].Add(item);
                                    }
                                }
                            }
                            foreach (KeyValuePair <string, HashSet <string> > keyValuePair2 in dictionary4)
                            {
                                Dictionary <Class102, HashSet <string> > dictionary5;
                                if (dictionary2.ContainsKey(keyValuePair2.Key))
                                {
                                    dictionary5 = dictionary2[keyValuePair2.Key];
                                }
                                else
                                {
                                    dictionary2.Add(keyValuePair2.Key, dictionary5 = new Dictionary <Class102, HashSet <string> >());
                                }
                                HashSet <string> hashSet;
                                if (dictionary5.ContainsKey(class2))
                                {
                                    hashSet = dictionary5[class2];
                                }
                                else
                                {
                                    dictionary5.Add(class2, hashSet = new HashSet <string>(StringComparer.OrdinalIgnoreCase));
                                }
                                foreach (string item2 in keyValuePair2.Value)
                                {
                                    if (!hashSet.Contains(item2))
                                    {
                                        hashSet.Add(item2);
                                    }
                                }
                            }
                        }
                    }
                }
                dictionary2.smethod_7(new Action <KeyValuePair <string, Dictionary <Class102, HashSet <string> > > >(@class.method_0));
                IEnumerable <KeyValuePair <string, Dictionary <Class102, HashSet <string> > > > source = dictionary2;
                if (Class102.func_0 == null)
                {
                    Class102.func_0 = new Func <KeyValuePair <string, Dictionary <Class102, HashSet <string> > >, bool>(Class102.smethod_3);
                }
                KeyValuePair <string, Dictionary <Class102, HashSet <string> > >[] array = source.Where(Class102.func_0).ToArray <KeyValuePair <string, Dictionary <Class102, HashSet <string> > > >();
                foreach (KeyValuePair <string, Dictionary <Class102, HashSet <string> > > keyValuePair3 in array)
                {
                    dictionary2.Remove(keyValuePair3.Key);
                }
                Dictionary <Class102, Class132> dictionary6 = new Dictionary <Class102, Class132>();
                try
                {
                    foreach (string text in @class.dictionary_0.Keys.Union(dictionary2.Keys, StringComparer.OrdinalIgnoreCase))
                    {
                        string path = Path.Combine(installDirectory, text + ".mf");
                        if (File.Exists(path))
                        {
                            using (Stream stream = File.Open(path, FileMode.Open, FileAccess.ReadWrite, FileShare.None))
                            {
                                using (Class136 class3 = new Class136(stream))
                                {
                                    if (!changedMultiFiles.Contains(text))
                                    {
                                        changedMultiFiles.Add(text);
                                    }
                                    class3.method_12();
                                    if (dictionary2.ContainsKey(text))
                                    {
                                        string path2 = Path.Combine(installDirectory, text + ".mf.orig");
                                        if (File.Exists(path2))
                                        {
                                            using (Stream stream2 = File.Open(path2, FileMode.Open, FileAccess.Read, FileShare.None))
                                            {
                                                using (Class136 class4 = new Class136(stream2))
                                                {
                                                    HashSet <string> hashSet2 = new HashSet <string>(StringComparer.OrdinalIgnoreCase);
                                                    foreach (KeyValuePair <Class102, HashSet <string> > keyValuePair4 in dictionary2[text])
                                                    {
                                                        foreach (string item3 in keyValuePair4.Value)
                                                        {
                                                            if (!hashSet2.Contains(item3))
                                                            {
                                                                hashSet2.Add(item3);
                                                            }
                                                        }
                                                    }
                                                    class4.method_14(hashSet2);
                                                    foreach (KeyValuePair <Class102, HashSet <string> > keyValuePair5 in dictionary2[text])
                                                    {
                                                        foreach (string name in keyValuePair5.Value)
                                                        {
                                                            if (class4.method_6(name) && class3.method_6(name))
                                                            {
                                                                class4[name].method_0(class3[name]);
                                                            }
                                                        }
                                                        Enum76 installState = keyValuePair5.Key.InstallState;
                                                        if (installState == Enum76.const_2)
                                                        {
                                                            using (HashSet <string> .Enumerator enumerator11 = keyValuePair5.Value.GetEnumerator())
                                                            {
                                                                while (enumerator11.MoveNext())
                                                                {
                                                                    string key = enumerator11.Current;
                                                                    switch (keyValuePair5.Key.dictionary_0[key].enum76_0)
                                                                    {
                                                                    case Enum76.const_2:
                                                                        keyValuePair5.Key.dictionary_0[key].enum76_0 = Enum76.const_0;
                                                                        continue;

                                                                    case Enum76.const_4:
                                                                        continue;
                                                                    }
                                                                    keyValuePair5.Key.dictionary_0[key].enum76_0 = Enum76.const_3;
                                                                }
                                                                continue;
                                                            }
                                                        }
                                                        foreach (string key2 in keyValuePair5.Value)
                                                        {
                                                            Enum76 @enum = keyValuePair5.Key.dictionary_0[key2].enum76_0;
                                                            if (@enum != Enum76.const_4)
                                                            {
                                                                keyValuePair5.Key.dictionary_0[key2].enum76_0 = Enum76.const_0;
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    foreach (KeyValuePair <Class102, Dictionary <string, HashSet <string> > > keyValuePair6 in dictionary)
                                    {
                                        if (keyValuePair6.Value.ContainsKey(text))
                                        {
                                            Class102 key3 = keyValuePair6.Key;
                                            if (!dictionary6.ContainsKey(keyValuePair6.Key))
                                            {
                                                dictionary6.Add(keyValuePair6.Key, new Class132(keyValuePair6.Key.FileName, false, true));
                                            }
                                            Class136 data = dictionary6[keyValuePair6.Key].Data;
                                            foreach (string text2 in keyValuePair6.Value[text])
                                            {
                                                if (data.method_6(text2) && class3.method_6(text2))
                                                {
                                                    Class338 class5 = data[text2];
                                                    class5.method_0(class3[text2]);
                                                    class5.Data = null;
                                                    key3.dictionary_0[text2].enum76_0 = Enum76.const_1;
                                                }
                                                else
                                                {
                                                    key3.dictionary_0[text2].enum76_0 = Enum76.const_0;
                                                }
                                            }
                                        }
                                    }
                                    class3.method_18();
                                }
                                continue;
                            }
                        }
                        if (dictionary2.ContainsKey(text))
                        {
                            foreach (KeyValuePair <Class102, HashSet <string> > keyValuePair7 in dictionary2[text])
                            {
                                Enum76 installState = keyValuePair7.Key.InstallState;
                                if (installState == Enum76.const_2)
                                {
                                    using (HashSet <string> .Enumerator enumerator3 = keyValuePair7.Value.GetEnumerator())
                                    {
                                        while (enumerator3.MoveNext())
                                        {
                                            string key4 = enumerator3.Current;
                                            switch (keyValuePair7.Key.dictionary_0[key4].enum76_0)
                                            {
                                            case Enum76.const_2:
                                                keyValuePair7.Key.dictionary_0[key4].enum76_0 = Enum76.const_0;
                                                continue;

                                            case Enum76.const_4:
                                                continue;
                                            }
                                            keyValuePair7.Key.dictionary_0[key4].enum76_0 = Enum76.const_3;
                                        }
                                        continue;
                                    }
                                }
                                foreach (string key5 in keyValuePair7.Value)
                                {
                                    installState = keyValuePair7.Key.dictionary_0[key5].enum76_0;
                                    if (installState != Enum76.const_4)
                                    {
                                        keyValuePair7.Key.dictionary_0[key5].enum76_0 = Enum76.const_0;
                                    }
                                }
                            }
                        }
                    }
                }
                finally
                {
                    foreach (KeyValuePair <Class102, Class132> keyValuePair8 in dictionary6)
                    {
                        keyValuePair8.Value.Dispose();
                    }
                }
                foreach (Class102 class6 in Class110.Instance.ConnectSettings.ContentPacks)
                {
                    class6.method_6();
                }
            }
        }
Пример #26
0
 public override IMessageHandler imethod_3 <TBody>(string string_0, int int_1, TBody body, string string_1, int int_2) where TBody : class
 {
     byte[] buffer = null;
     if (body != null)
     {
         BaseSerializeContract contract = body as BaseSerializeContract;
         if (contract != null)
         {
             buffer = contract.ToStream();
         }
         else
         {
             buffer = (this.method_1(typeof(TBody)) == SerializeStrategy.Property) ? CompactPropertySerializer.Default.Serialize <TBody>(body) : Class136.smethod_0().Serialize <TBody>(body);
         }
     }
     return(new MessageHandler(new Class41(string_0, int_1, (buffer == null) ? 0 : buffer.Length, string_1, int_2), buffer, 0, null));
 }
Пример #27
0
    public override TBody imethod_1 <TBody>(IMessageHandler interface37_0) where TBody : class//, new()
    {
        MessageHandler class2 = (MessageHandler)interface37_0;

        if (class2.method_0().imethod_5() == 0)
        {
            return(default(TBody));
        }
        Type type = typeof(TBody);

        if (type.IsSubclassOf(this.type_0))
        {
            return(BaseSerializeContract.smethod_0 <TBody>(class2));
        }
        return((this.method_1(type) == SerializeStrategy.Property) ? CompactPropertySerializer.Default.Deserialize <TBody>(class2.Body.Data, class2.Body.Offset) : Class136.smethod_0().Deserialize <TBody>(class2.Body.Data, class2.Body.Offset));
    }
        // Token: 0x060018F4 RID: 6388 RVA: 0x000446C4 File Offset: 0x000428C4
        public static HashSet <string> smethod_0(byte[] buffer)
        {
            HashSet <string> hashSet = null;
            string           @string = Encoding.ASCII.GetString(buffer);
            int i = 0;

            while (i < @string.Length && @string.smethod_10("phase_", ref i))
            {
                int num;
                i = (num = i - "phase_".Length);
                string text;
                if (@string.smethod_8('/', ref i, out text))
                {
                    string a;
                    if (!Class136.smethod_7(text))
                    {
                        i = num + "phase_".Length;
                    }
                    else if (@string.smethod_8('/', ref i, out text) && (a = text.ToLower()) != null)
                    {
                        string text2;
                        if (!(a == "audio"))
                        {
                            if (!(a == "maps"))
                            {
                                continue;
                            }
                            while (i <= @string.Length)
                            {
                                if (@string.smethod_9('.', ref i) && @string.smethod_4(ref i, 3, out text))
                                {
                                    string a2;
                                    if ((a2 = text.ToLower()) == null || (!(a2 == "jpg") && !(a2 == "rgb")))
                                    {
                                        if (!text.smethod_1())
                                        {
                                            break;
                                        }
                                    }
                                    else
                                    {
                                        text2 = @string.Substring(num, i - num);
                                        if (!text2.smethod_1())
                                        {
                                            break;
                                        }
                                        goto IL_1E7;
                                    }
                                }
                            }
                            continue;
                        }
                        else
                        {
                            string a3;
                            if ([email protected]_8('/', ref i, out text) || (a3 = text.ToLower()) == null)
                            {
                                continue;
                            }
                            if (!(a3 == "bgm") && !(a3 == "dial") && !(a3 == "sfx"))
                            {
                                continue;
                            }
                            while (i <= @string.Length)
                            {
                                if (@string.smethod_9('.', ref i) && @string.smethod_4(ref i, 3, out text))
                                {
                                    string a4;
                                    if ((a4 = text.ToLower()) == null || (!(a4 == "wav") && !(a4 == "mp3") && !(a4 == "mid")))
                                    {
                                        if (!text.smethod_1())
                                        {
                                            break;
                                        }
                                    }
                                    else
                                    {
                                        text2 = @string.Substring(num, i - num);
                                        if (text2.smethod_1())
                                        {
                                            goto IL_1E7;
                                        }
                                        break;
                                    }
                                }
                            }
                            continue;
                        }
IL_1E7:
                        if (hashSet == null)
                        {
                            hashSet = new HashSet <string>(StringComparer.OrdinalIgnoreCase);
                        }
                        if (!hashSet.Contains(text2))
                        {
                            hashSet.Add(text2);
                        }
                    }
                }
            }
            return(hashSet);
        }
Пример #29
0
 // Token: 0x06000009 RID: 9 RVA: 0x00002BCD File Offset: 0x00000DCD
 public void method_5(Class136 class136_1)
 {
     this.class136_0 = class136_1;
 }
 public override void Visit(Class136 c) { }