@@ -55,9 +55,11 @@ public static async Task<StarRailPersistentRefResult> GetCacheReferenceAsync(
5555 AsbBlock = "" ,
5656 AsbBlockPersistent = "" ,
5757 Audio = "" ,
58+ AudioPersistent = "" ,
5859 DesignData = "" ,
5960 NativeData = "" ,
6061 Video = "" ,
62+ VideoPersistent = "" ,
6163 RawRes = "" ,
6264 CacheLua = mainUrlLua ,
6365 CacheIFix = mainUrlIFix
@@ -104,23 +106,16 @@ public static async Task<StarRailPersistentRefResult> GetCacheReferenceAsync(
104106 aDirIFix ,
105107 token ) ;
106108
107- // -- Save local index files
108- // Notes to Dev: HoYo no longer provides a proper raw bytes data anymore and the client creates it based
109- // on data provided by "handleArchive", so we need to emulate how the game generates these data.
110- await SaveLocalIndexFiles ( instance , handleLua , aDirLua , "LuaV" , token ) ;
111- await SaveLocalIndexFiles ( instance , handleIFix , aDirIFix , "IFixV" , token ) ;
112-
113109 // -- Load metadata files
114110 // -- LuaV
115- StarRailAssetSignaturelessMetadata ? metadataLuaV = new ( ".bytes" ) ;
116- metadataLuaV = await LoadMetadataFile ( instance ,
117- handleLua ,
118- client ,
119- baseUrls . CacheLua ,
120- "LuaV" ,
121- metadataLuaV ,
122- aDirLua ,
123- token ) ;
111+ StarRailAssetBytesSignaturelessMetadata ? metadataLuaV =
112+ await LoadMetadataFile < StarRailAssetBytesSignaturelessMetadata > ( instance ,
113+ handleLua ,
114+ client ,
115+ baseUrls . CacheLua ,
116+ "LuaV" ,
117+ aDirLua ,
118+ token ) ;
124119
125120 // -- IFixV
126121 StarRailAssetCsvMetadata ? metadataIFixV =
@@ -200,10 +195,12 @@ public static async Task<StarRailPersistentRefResult> GetRepairReferenceAsync(
200195 // We also made the second check for the actual block URLs below so HoYo wouldn't be able to fuck around with our code
201196 // anymore.
202197 string mainUrlAudio = mainUrlAsb . CombineURLFromString ( "AudioBlock" ) ;
198+ string mainUrlAudioAlt = mainUrlAsbAlt . CombineURLFromString ( "AudioBlock" ) ;
203199 string mainUrlAsbBlock = mainUrlAsb . CombineURLFromString ( "Block" ) ;
204200 string mainUrlAsbBlockAlt = mainUrlAsbAlt . CombineURLFromString ( "Block" ) ;
205201 string mainUrlNativeData = mainUrlDesignData . CombineURLFromString ( "NativeData" ) ;
206202 string mainUrlVideo = mainUrlAsb . CombineURLFromString ( "Video" ) ;
203+ string mainUrlVideoAlt = mainUrlAsbAlt . CombineURLFromString ( "Video" ) ;
207204 string mainUrlRawRes = mainUrlAsb . CombineURLFromString ( "RawRes" ) ;
208205
209206 AssetBaseUrls baseUrl = new ( )
@@ -212,10 +209,12 @@ public static async Task<StarRailPersistentRefResult> GetRepairReferenceAsync(
212209 DesignData = mainUrlDesignData ,
213210 Archive = mainUrlArchive ,
214211 Audio = mainUrlAudio ,
212+ AudioPersistent = mainUrlAudioAlt ,
215213 AsbBlock = mainUrlAsbBlock ,
216214 AsbBlockPersistent = mainUrlAsbBlockAlt ,
217215 NativeData = mainUrlNativeData ,
218216 Video = mainUrlVideo ,
217+ VideoPersistent = mainUrlVideoAlt ,
219218 RawRes = mainUrlRawRes
220219 } ;
221220
@@ -273,28 +272,16 @@ public static async Task<StarRailPersistentRefResult> GetRepairReferenceAsync(
273272 LogType . Debug ,
274273 true ) ;
275274
276- // -- Save local index files
277- // Notes to Dev: HoYo no longer provides a proper raw bytes data anymore and the client creates it based
278- // on data provided by "handleArchive", so we need to emulate how the game generates these data.
279- await SaveLocalIndexFiles ( instance , handleDesignArchive , aDirDesignData , "DesignV" , token ) ;
280- await SaveLocalIndexFiles ( instance , handleArchive , aDirAsbBlock , "AsbV" , token ) ;
281- await SaveLocalIndexFiles ( instance , handleArchive , aDirAsbBlock , "BlockV" , token ) ;
282- await SaveLocalIndexFiles ( instance , handleArchive , aDirAsbBlock , "Start_AsbV" , token ) ;
283- await SaveLocalIndexFiles ( instance , handleArchive , aDirAsbBlock , "Start_BlockV" , token ) ;
284- await SaveLocalIndexFiles ( instance , handleArchive , aDirAudio , "AudioV" , token ) ;
285- await SaveLocalIndexFiles ( instance , handleArchive , aDirVideo , "VideoV" , token ) ;
286- await SaveLocalIndexFiles ( instance , handleArchive , aDirRawRes , "RawResV" , token ) ;
287-
288275 // -- Load metadata files
289276 // -- DesignV
290- StarRailAssetSignaturelessMetadata ? metadataDesignV =
291- await LoadMetadataFile < StarRailAssetSignaturelessMetadata > ( instance ,
292- handleDesignArchive ,
293- client ,
294- baseUrl . DesignData ,
295- "DesignV" ,
296- aDirDesignData ,
297- token ) ;
277+ StarRailAssetBytesSignaturelessMetadata ? metadataDesignV =
278+ await LoadMetadataFile < StarRailAssetBytesSignaturelessMetadata > ( instance ,
279+ handleDesignArchive ,
280+ client ,
281+ baseUrl . DesignData ,
282+ "DesignV" ,
283+ aDirDesignData ,
284+ token ) ;
298285
299286 // -- NativeDataV
300287 StarRailAssetNativeDataMetadata ? metadataNativeDataV =
@@ -333,7 +320,7 @@ await LoadMetadataFile<StarRailAssetBundleMetadata>(instance,
333320 client ,
334321 baseUrl . AsbBlockPersistent ,
335322 "AsbV" ,
336- null ,
323+ aDirAsbBlock ,
337324 token ) ;
338325
339326 // -- BlockV
@@ -343,7 +330,7 @@ await LoadMetadataFile<StarRailAssetBlockMetadata>(instance,
343330 client ,
344331 baseUrl . AsbBlockPersistent ,
345332 "BlockV" ,
346- null ,
333+ aDirAsbBlock ,
347334 token ) ;
348335
349336 // -- AudioV
@@ -376,6 +363,19 @@ await LoadMetadataFile<StarRailAssetJsonMetadata>(instance,
376363 aDirRawRes ,
377364 token ) ;
378365
366+ // -- Save local index files
367+ // Notes to Dev: HoYo no longer provides a proper raw bytes data anymore and the client creates it based
368+ // on data provided by "handleArchive", so we need to emulate how the game generates these data.
369+ await SaveLocalIndexFiles ( instance , handleDesignArchive , aDirDesignData , "DesignV" , token ) ;
370+ await SaveLocalIndexFiles ( instance , handleDesignArchive , aDirNativeData , "NativeDataV" , token ) ;
371+ await SaveLocalIndexFiles ( instance , handleArchive , aDirAsbBlock , "AsbV" , token ) ;
372+ await SaveLocalIndexFiles ( instance , handleArchive , aDirAsbBlock , "BlockV" , token ) ;
373+ await SaveLocalIndexFiles ( instance , handleArchive , aDirAsbBlock , "Start_AsbV" , token ) ;
374+ await SaveLocalIndexFiles ( instance , handleArchive , aDirAsbBlock , "Start_BlockV" , token ) ;
375+ await SaveLocalIndexFiles ( instance , handleArchive , aDirAudio , "AudioV" , token ) ;
376+ await SaveLocalIndexFiles ( instance , handleArchive , aDirVideo , "VideoV" , token ) ;
377+ await SaveLocalIndexFiles ( instance , handleArchive , aDirRawRes , "RawResV" , token ) ;
378+
379379 // Perform URL test & swap for Audio and Video
380380 await baseUrl . TestAndSwapUrlAsync ( client ,
381381 mainUrlAsbAlt . CombineURLFromString ( "AudioBlock" ) ,
@@ -410,7 +410,7 @@ await baseUrl.TestAndSwapUrlAsync(client,
410410 }
411411
412412 private static async ValueTask SaveLocalIndexFiles (
413- StarRailRepairV2 instance ,
413+ StarRailRepairV2 instance ,
414414 Dictionary < string , StarRailRefMainInfo > handleArchiveSource ,
415415 string outputDir ,
416416 string indexKey ,
@@ -617,16 +617,20 @@ public class AssetBaseUrls
617617 public required string DesignData { get ; init ; }
618618 public required string Archive { get ; set ; }
619619 public required string Audio { get ; set ; }
620+ public required string AudioPersistent { get ; set ; }
620621 public required string AsbBlock { get ; set ; }
621622 public required string AsbBlockPersistent { get ; set ; }
622623 public required string NativeData { get ; init ; }
623624 public required string Video { get ; set ; }
625+ public required string VideoPersistent { get ; set ; }
624626 public required string RawRes { get ; init ; }
625627
626628 public string ? CacheLua { get ; init ; }
627629 public string ? CacheIFix { get ; init ; }
628630
629- public void SwapAsbPersistentUrl ( ) => ( AsbBlock , AsbBlockPersistent ) = ( AsbBlockPersistent , AsbBlock ) ;
631+ public void SwapAsbPersistentUrl ( ) =>
632+ ( AsbBlock , AsbBlockPersistent , Video , VideoPersistent , Audio , AudioPersistent ) =
633+ ( AsbBlockPersistent , AsbBlock , VideoPersistent , Video , AudioPersistent , Audio ) ;
630634
631635 public async Task TestAndSwapUrlAsync (
632636 HttpClient client ,
0 commit comments