internal static R_MythicPackageBlock Pack(List <R_MythicPackageIndex> indexes, int k, ref int i) { /* * [2] - Index Block Header (sizeof: 24bytes) * There can be multiple index blocks, they are splitted into chunks. * DWORD 0x28 -> Amount of contained files in this index, max 100/0x64 * QWORD 0x2c -> Offset to the next index block header OR Zero * When a index block doesn't contain 100 index definitions, it will be padded with nulls */ R_MythicPackageBlock final = new R_MythicPackageBlock(); for (int j = 0; j < 100; j++) //Should fill single block { if (k < indexes.Count) { final.Adds(indexes[k]); final.FileCount++; //Amount of contained files in this index, max 100/0x64 k++; i = k; } else { final.Adds(R_MythicPackageIndex.Empty()); } } final.NextBlock = 0; //Offset to the next index block header OR Zero return(final); }
internal static R_MythicPackageBlock Pack(List<R_MythicPackageIndex> indexes, int k, ref int i) { /* * [2] - Index Block Header (sizeof: 24bytes) * There can be multiple index blocks, they are splitted into chunks. * DWORD 0x28 -> Amount of contained files in this index, max 100/0x64 * QWORD 0x2c -> Offset to the next index block header OR Zero * When a index block doesn't contain 100 index definitions, it will be padded with nulls */ R_MythicPackageBlock final = new R_MythicPackageBlock(); for (int j = 0; j < 100; j++) //Should fill single block { if (k < indexes.Count) { final.Adds(indexes[k]); final.FileCount++; //Amount of contained files in this index, max 100/0x64 k++; i = k; } else final.Adds(R_MythicPackageIndex.Empty()); } final.NextBlock = 0; //Offset to the next index block header OR Zero return final; }