@@ -9,8 +9,9 @@ public sealed class IndexInstance
99 private readonly long indexSize ;
1010 private IndexFooter footer ;
1111 private readonly short archiveIndex = - 1 ;
12- private readonly bool isFileIndex ;
13- private readonly bool isGroupArchive ;
12+ public readonly bool isFileIndex ;
13+ public readonly bool isCDNIndex ;
14+ public readonly bool isGroupIndex ;
1415
1516 private readonly MemoryMappedFile indexFile ;
1617 private readonly MemoryMappedViewAccessor accessor ;
@@ -37,7 +38,8 @@ public IndexInstance(string path, short archiveIndex = -1)
3738 accessor . Read ( 0 , out footer ) ;
3839
3940 isFileIndex = footer . offsetBytes == 0 ;
40- isGroupArchive = footer . offsetBytes == 6 ;
41+ isCDNIndex = footer . offsetBytes == 4 ;
42+ isGroupIndex = footer . offsetBytes == 6 ;
4143
4244 this . blockSizeBytes = footer . blockSizeKBytes << 10 ;
4345 this . entrySize = footer . keyBytes + footer . sizeBytes + footer . offsetBytes ;
@@ -98,7 +100,7 @@ public IndexInstance(string path, short archiveIndex = -1)
98100 var archiveIndex = this . archiveIndex ;
99101
100102 // TODO: Patch group archive?
101- if ( isGroupArchive )
103+ if ( isGroupIndex )
102104 {
103105 size = entry . Slice ( footer . keyBytes , footer . sizeBytes ) . ReadInt32BE ( ) ;
104106 archiveIndex = entry . Slice ( footer . keyBytes + footer . sizeBytes , 2 ) . ReadInt16BE ( ) ;
@@ -161,7 +163,7 @@ unsafe public (int offset, int size, int archiveIndex) GetIndexInfo(ReadOnlySpan
161163 return ( - 1 , - 1 , - 1 ) ;
162164
163165 // TODO: Patch group archive?
164- if ( isGroupArchive )
166+ if ( isGroupIndex )
165167 {
166168 var encodedSize = entry . Slice ( footer . keyBytes , footer . sizeBytes ) . ReadInt32BE ( ) ;
167169 var fileArchiveIndex = entry . Slice ( footer . keyBytes + footer . sizeBytes , 2 ) . ReadInt16BE ( ) ;
0 commit comments