示例#1
0
        protected override void WriteObjectData(AwesomeWriter aw)
        {
            aw.Write((int)Version);
            aw.WriteNullString(PackageName, 256);
            aw.Write((int)Entries.Count);
            aw.Write((int)4);

            foreach (string entry in Entries)
            {
                aw.WriteNullString(entry, 256);
            }
        }
示例#2
0
        protected override void WriteObjectData(AwesomeWriter aw)
        {
            aw.Write((int)Version);
            aw.Write((int)Entries.Count);
            aw.Write((int)4); // Should always be 4

            long nextPackageOffset = aw.BaseStream.Position + (Entries.Count * 24);

            // Writes index2 entries
            foreach (Index2Entry entry in Entries)
            {
                aw.Write((long)entry.FilePath.Key);
                aw.Write((long)entry.Type.Key);
                aw.Write((int)entry.PackageEntries.Count);
                aw.Write((int)(nextPackageOffset - aw.BaseStream.Position));

                nextPackageOffset += entry.PackageEntries.Count * 248;
            }

            // Writes package entries
            foreach (var entry in Entries.SelectMany(x => x.PackageEntries))
            {
                aw.Write((ulong)entry.Package);
                aw.WriteNullString(entry.ExternalFilePath, 240);
            }
        }