コード例 #1
0
 // Token: 0x06002462 RID: 9314 RVA: 0x0007B548 File Offset: 0x00079748
 public void method_16(IEnumerable <Class338> data)
 {
     this.method_7();
     if (data == null)
     {
         throw new ArgumentNullException("data");
     }
     if (!this.bool_2)
     {
         throw new InvalidOperationException("The index has not been loaded.");
     }
     foreach (Class338 @class in data)
     {
         Class136.Class339 class2 = @class as Class136.Class339;
         if (class2 == null)
         {
             throw new ArgumentException("Item is not MultiFileDataDetails.");
         }
         if (!this.dictionary_0.ContainsValue(class2))
         {
             throw new ArgumentException("The item was not loaded from the MultiFile.");
         }
         Class136.smethod_11(this.stream_0, this.binaryReader_0, class2);
     }
 }
コード例 #2
0
        // Token: 0x06002463 RID: 9315 RVA: 0x0007B5F4 File Offset: 0x000797F4
        public void method_17(Stream str, BinaryWriter writer)
        {
            if (!this.bool_2)
            {
                throw new InvalidOperationException("The index has not been loaded.");
            }
            if (writer.BaseStream != str)
            {
                throw new ArgumentException("The BinaryWriter has an incorrect base stream.");
            }
            IEnumerable <KeyValuePair <string, Class338> > source = this.dictionary_0;

            if (Class136.func_1 == null)
            {
                Class136.func_1 = new Func <KeyValuePair <string, Class338>, KeyValuePair <string, Class136.Class339> >(Class136.smethod_19);
            }
            List <KeyValuePair <string, Class136.Class339> > list  = source.Select(Class136.func_1).ToList <KeyValuePair <string, Class136.Class339> >();
            List <KeyValuePair <string, Class136.Class339> > list2 = list;

            if (Class136.comparison_0 == null)
            {
                Class136.comparison_0 = new Comparison <KeyValuePair <string, Class136.Class339> >(Class136.smethod_20);
            }
            list2.Sort(Class136.comparison_0);
            Class136.smethod_13(str, writer, this.short_0, this.short_1, this.uint_0, this.uint_1, list);
        }
コード例 #3
0
 // Token: 0x06002466 RID: 9318 RVA: 0x0007B83C File Offset: 0x00079A3C
 private static void smethod_10(Stream str, BinaryReader reader, Dictionary <string, Class338> data)
 {
     Class338[] array = data.Values.ToArray <Class338>();
     for (int i = 0; i < array.Length; i++)
     {
         Class136.smethod_11(str, reader, array[i] as Class136.Class339);
     }
 }
コード例 #4
0
 // Token: 0x0600245B RID: 9307 RVA: 0x0007B398 File Offset: 0x00079598
 private void method_9(ref List <KeyValuePair <string, Class136.Class339> > sortedCollection, out long endOfIndex)
 {
     this.method_7();
     if (this.binaryReader_0 == null)
     {
         this.binaryReader_0 = new BinaryReader(this.stream_0);
     }
     Class136.smethod_9(this.stream_0, this.binaryReader_0, out this.short_0, out this.short_1, out this.uint_0, out this.uint_1, ref this.dictionary_0, ref sortedCollection);
     endOfIndex  = this.stream_0.Position;
     this.bool_2 = true;
 }
コード例 #5
0
        // Token: 0x06002469 RID: 9321 RVA: 0x0007B8D8 File Offset: 0x00079AD8
        private static void smethod_13(Stream str, BinaryWriter writer, short majorVersion, short minorVersion, uint scale, uint timeStamp, List <KeyValuePair <string, Class136.Class339> > data)
        {
            foreach (KeyValuePair <string, Class136.Class339> keyValuePair in data)
            {
                if (!keyValuePair.Value.Populated)
                {
                    throw new NotSupportedException(string.Format("Item: '{0}' is not populated.", keyValuePair.Key));
                }
            }
            writer.Write(Class136.byte_0);
            writer.Write(majorVersion);
            writer.Write(minorVersion);
            writer.Write(scale);
            writer.Write(timeStamp);
            Class136.smethod_16(str, scale);
            foreach (KeyValuePair <string, Class136.Class339> keyValuePair2 in data)
            {
                keyValuePair2.Value.uint_3 = (uint)str.Position;
                writer.Write(0);
                writer.Write(0);
                writer.Write(keyValuePair2.Value.DataLength);
                writer.Write(keyValuePair2.Value.Flags);
                if (keyValuePair2.Value.Compressed)
                {
                    writer.Write(keyValuePair2.Value.DecompressedLength);
                }
                writer.Write(keyValuePair2.Value.TimeStamp);
                writer.Write((ushort)keyValuePair2.Key.Length);
                writer.Write(Class136.smethod_14(keyValuePair2.Key));
                Class136.smethod_16(str, scale);
            }
            int num = (int)str.Position;

            writer.Write(0);
            Class136.smethod_16(str, scale);
            for (int i = 0; i < data.Count; i++)
            {
                data[i].Value.uint_4 = (uint)str.Position / scale;
                writer.Write(data[i].Value.Data, 0, (int)data[i].Value.DataLength);
                Class136.smethod_16(str, scale);
            }
            long position = str.Position;

            for (int j = 0; j < data.Count; j++)
            {
                str.Position         = (long)((ulong)(data[j].Value.uint_3 / scale));
                data[j].Value.uint_5 = (uint)((long)((j < data.Count - 1) ? data[j + 1].Value.uint_3 : ((uint)num)) / (long)((ulong)scale));
                writer.Write(data[j].Value.uint_5);
                writer.Write(data[j].Value.uint_4);
            }
            str.Position = position;
        }
コード例 #6
0
        // Token: 0x0600246C RID: 9324 RVA: 0x0007BC24 File Offset: 0x00079E24
        private static void smethod_16(Stream str, uint scale)
        {
            if (scale == 1U)
            {
                return;
            }
            uint num = Class136.smethod_17((uint)str.Position, scale);

            while (str.Position < (long)((ulong)num))
            {
                str.WriteByte(0);
            }
        }
コード例 #7
0
 // Token: 0x06002468 RID: 9320 RVA: 0x0007B874 File Offset: 0x00079A74
 private static void smethod_12(Stream str, BinaryReader reader, Dictionary <string, Class338> data, IEnumerable <string> names)
 {
     using (IEnumerator <string> enumerator = names.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             if (data.ContainsKey(enumerator.Current))
             {
                 Class136.smethod_11(str, reader, data[enumerator.Current] as Class136.Class339);
             }
         }
     }
 }
コード例 #8
0
 // Token: 0x0600245F RID: 9311 RVA: 0x0007B47C File Offset: 0x0007967C
 public void method_13(IEnumerable <string> names)
 {
     this.method_7();
     if (!this.bool_2)
     {
         throw new InvalidOperationException("The index has not been loaded.");
     }
     if (this.binaryReader_0 == null)
     {
         this.binaryReader_0 = new BinaryReader(this.stream_0);
     }
     Class136.smethod_12(this.stream_0, this.binaryReader_0, this.dictionary_0, names);
 }
コード例 #9
0
 // Token: 0x06002465 RID: 9317 RVA: 0x0007B718 File Offset: 0x00079918
 private static void smethod_9(Stream str, BinaryReader reader, out short majorVersion, out short minorVersion, out uint scale, out uint timeStamp, ref Dictionary <string, Class338> data, ref List <KeyValuePair <string, Class136.Class339> > orderedData)
 {
     byte[] array = reader.ReadBytes(Class136.byte_0.Length);
     if (!array.smethod_9(Class136.byte_0))
     {
         throw new InvalidFileType(Class136.byte_0, array);
     }
     majorVersion = reader.ReadInt16();
     minorVersion = reader.ReadInt16();
     scale        = reader.ReadUInt32();
     timeStamp    = reader.ReadUInt32();
     if (scale == 0U)
     {
         scale = 1U;
     }
     for (;;)
     {
         uint num = reader.ReadUInt32() * scale;
         if (num == 0U)
         {
             break;
         }
         Class136.Class339 @class = new Class136.Class339();
         @class.LoadedFromStream = true;
         @class.uint_5           = num;
         @class.uint_4           = reader.ReadUInt32() * scale;
         @class.DataLength       = reader.ReadUInt32();
         @class.Flags            = reader.ReadUInt16();
         if (@class.Compressed)
         {
             @class.DecompressedLength = reader.ReadUInt32();
         }
         else
         {
             @class.DecompressedLength = @class.DataLength;
         }
         @class.TimeStamp = reader.ReadUInt32();
         ushort count = reader.ReadUInt16();
         byte[] data2 = reader.ReadBytes((int)count);
         string key   = Class136.smethod_15(data2);
         data.Add(key, @class);
         if (orderedData != null)
         {
             orderedData.Add(new KeyValuePair <string, Class136.Class339>(key, @class));
         }
         str.Position = (long)((ulong)num);
     }
 }
コード例 #10
0
        // Token: 0x06002443 RID: 9283 RVA: 0x0007AFEC File Offset: 0x000791EC
        public static bool smethod_5(string file, out string multifile_name)
        {
            multifile_name = null;
            int    num = 0;
            string text;

            if (!file.smethod_8('/', ref num, out text))
            {
                return(false);
            }
            if (!Class136.smethod_7(text))
            {
                return(false);
            }
            multifile_name = text;
            return(true);
        }
コード例 #11
0
 // Token: 0x0600243E RID: 9278 RVA: 0x0007AC18 File Offset: 0x00078E18
 public static void smethod_0(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))
         {
             using (Class136 @class = new Class136(stream))
             {
                 using (Class136 class2 = new Class136(stream2))
                 {
                     List <KeyValuePair <string, Class136.Class339> > list  = new List <KeyValuePair <string, Class136.Class339> >();
                     List <KeyValuePair <string, Class136.Class339> > list2 = null;
                     long endPosition;
                     class2.method_9(ref list, out endPosition);
                     long endPosition2;
                     @class.method_9(ref list2, out endPosition2);
                     using (Stream3 stream3 = new Stream3(stream, 0L, endPosition2))
                     {
                         using (Stream3 stream4 = new Stream3(stream2, 0L, endPosition))
                         {
                             Class292.smethod_12(pd, Enum81.const_0, write_stream, offset_orig, offset_new, stream3, stream4);
                         }
                     }
                     foreach (KeyValuePair <string, Class136.Class339> keyValuePair in list)
                     {
                         if (@class.method_6(keyValuePair.Key))
                         {
                             Class136.Class339 class3 = @class[keyValuePair.Key] as Class136.Class339;
                             Class136.smethod_1(pd, write_stream, offset_orig, offset_new, keyValuePair.Key, stream, class3.uint_4, class3.uint_4 + class3.DataLength, stream2, keyValuePair.Value.uint_4, keyValuePair.Value.uint_4 + keyValuePair.Value.DataLength);
                         }
                         else
                         {
                             class2.method_15(keyValuePair.Value);
                             Class292.smethod_4(pd, write_stream, keyValuePair.Value.DataLength, keyValuePair.Value.Data, 0U, 0U, 0U);
                         }
                     }
                 }
             }
         }
     }
 }
コード例 #12
0
 // Token: 0x06002461 RID: 9313 RVA: 0x0007B4D4 File Offset: 0x000796D4
 public void method_15(Class338 data)
 {
     this.method_7();
     if (data == null)
     {
         throw new ArgumentNullException("data");
     }
     if (!this.bool_2)
     {
         throw new InvalidOperationException("The index has not been loaded.");
     }
     Class136.Class339 @class = data as Class136.Class339;
     if (@class == null)
     {
         throw new ArgumentException("data is not MultiFileDataDetails.");
     }
     if (!this.dictionary_0.ContainsValue(@class))
     {
         throw new ArgumentException("The data was not loaded from the MultiFile.");
     }
     Class136.smethod_11(this.stream_0, this.binaryReader_0, @class);
 }
コード例 #13
0
        // Token: 0x06002446 RID: 9286 RVA: 0x0007B104 File Offset: 0x00079304
        public static bool smethod_8(string file)
        {
            if (string.IsNullOrEmpty(file))
            {
                return(false);
            }
            int    num = 0;
            string text;

            if (!file.smethod_8('/', ref num, out text))
            {
                return(false);
            }
            if (!Class136.smethod_7(text))
            {
                return(false);
            }
            if (!file.smethod_8('/', ref num, out text))
            {
                return(false);
            }
            string a;

            if ((a = text.ToLower()) != null)
            {
                if (a == "audio")
                {
                    string a2;
                    string a3;
                    return(file.smethod_8('/', ref num, out text) && ((a2 = text.ToLower()) != null && (a2 == "bgm" || a2 == "dial" || a2 == "sfx")) && file.smethod_14('.', ref num, out text) && ((a3 = text.ToLower()) != null && (a3 == "wav" || a3 == "mp3" || a3 == "mid")));
                }
                if (a == "maps")
                {
                    string a4;
                    return(file.smethod_14('.', ref num, out text) && ((a4 = text.ToLower()) != null && (a4 == "jpg" || a4 == "rgb")));
                }
            }
            return(false);
        }
コード例 #14
0
 // Token: 0x06002441 RID: 9281 RVA: 0x0007AF58 File Offset: 0x00079158
 public static bool smethod_3(Stream file_stream1, Stream file_stream2)
 {
     byte[] enumeration;
     byte[] enumeration2;
     return(Class136.smethod_2(file_stream1, out enumeration) && Class136.smethod_2(file_stream2, out enumeration2) && enumeration.smethod_9(enumeration2));
 }