예제 #1
0
        private static void LoadBucketList()
        {
            File gomFile = Assets.FindFile("/resources/systemgenerated/buckets.info");

            using (var fs = gomFile.Open())
                using (var br = new GomBinaryReader(fs, Encoding.UTF8))
                {
                    br.ReadBytes(8); // Skip 8 header bytes

                    var c9 = br.ReadByte();
                    if (c9 != 0xC9)
                    {
                        throw new InvalidOperationException(String.Format("Unexpected character in buckets.info @ offset 0x8 - expected 0xC9 found {0:X2}", c9));
                    }

                    short numEntries = br.ReadInt16(Endianness.BigEndian);

                    for (var i = 0; i < numEntries; i++)
                    {
                        string fileName = br.ReadLengthPrefixString();
                        BucketFiles.Add(fileName);
                    }
                }
        }