@@ -56,9 +56,11 @@ public static async Task<StarRailPersistentRefResult> GetCacheReferenceAsync(
5656 AsbBlock = "" ,
5757 AsbBlockPersistent = "" ,
5858 Audio = "" ,
59+ AudioPersistent = "" ,
5960 DesignData = "" ,
6061 NativeData = "" ,
6162 Video = "" ,
63+ VideoPersistent = "" ,
6264 RawRes = "" ,
6365 CacheLua = mainUrlLua ,
6466 CacheIFix = mainUrlIFix
@@ -105,23 +107,16 @@ public static async Task<StarRailPersistentRefResult> GetCacheReferenceAsync(
105107 aDirIFix ,
106108 token ) ;
107109
108- // -- Save local index files
109- // Notes to Dev: HoYo no longer provides a proper raw bytes data anymore and the client creates it based
110- // on data provided by "handleArchive", so we need to emulate how the game generates these data.
111- await SaveLocalIndexFiles ( instance , handleLua , aDirLua , "LuaV" , token ) ;
112- await SaveLocalIndexFiles ( instance , handleIFix , aDirIFix , "IFixV" , token ) ;
113-
114110 // -- Load metadata files
115111 // -- LuaV
116- StarRailAssetSignaturelessMetadata ? metadataLuaV = new ( ".bytes" ) ;
117- metadataLuaV = await LoadMetadataFile ( instance ,
118- handleLua ,
119- client ,
120- baseUrls . CacheLua ,
121- "LuaV" ,
122- metadataLuaV ,
123- aDirLua ,
124- token ) ;
112+ StarRailAssetBytesSignaturelessMetadata ? metadataLuaV =
113+ await LoadMetadataFile < StarRailAssetBytesSignaturelessMetadata > ( instance ,
114+ handleLua ,
115+ client ,
116+ baseUrls . CacheLua ,
117+ "LuaV" ,
118+ aDirLua ,
119+ token ) ;
125120
126121 // -- IFixV
127122 StarRailAssetCsvMetadata ? metadataIFixV =
@@ -201,10 +196,12 @@ public static async Task<StarRailPersistentRefResult> GetRepairReferenceAsync(
201196 // We also made the second check for the actual block URLs below so HoYo wouldn't be able to fuck around with our code
202197 // anymore.
203198 string mainUrlAudio = mainUrlAsb . CombineURLFromString ( "AudioBlock" ) ;
199+ string mainUrlAudioAlt = mainUrlAsbAlt . CombineURLFromString ( "AudioBlock" ) ;
204200 string mainUrlAsbBlock = mainUrlAsb . CombineURLFromString ( "Block" ) ;
205201 string mainUrlAsbBlockAlt = mainUrlAsbAlt . CombineURLFromString ( "Block" ) ;
206202 string mainUrlNativeData = mainUrlDesignData . CombineURLFromString ( "NativeData" ) ;
207203 string mainUrlVideo = mainUrlAsb . CombineURLFromString ( "Video" ) ;
204+ string mainUrlVideoAlt = mainUrlAsbAlt . CombineURLFromString ( "Video" ) ;
208205 string mainUrlRawRes = mainUrlAsb . CombineURLFromString ( "RawRes" ) ;
209206
210207 AssetBaseUrls baseUrl = new ( )
@@ -213,10 +210,12 @@ public static async Task<StarRailPersistentRefResult> GetRepairReferenceAsync(
213210 DesignData = mainUrlDesignData ,
214211 Archive = mainUrlArchive ,
215212 Audio = mainUrlAudio ,
213+ AudioPersistent = mainUrlAudioAlt ,
216214 AsbBlock = mainUrlAsbBlock ,
217215 AsbBlockPersistent = mainUrlAsbBlockAlt ,
218216 NativeData = mainUrlNativeData ,
219217 Video = mainUrlVideo ,
218+ VideoPersistent = mainUrlVideoAlt ,
220219 RawRes = mainUrlRawRes
221220 } ;
222221
@@ -274,28 +273,16 @@ public static async Task<StarRailPersistentRefResult> GetRepairReferenceAsync(
274273 LogType . Debug ,
275274 true ) ;
276275
277- // -- Save local index files
278- // Notes to Dev: HoYo no longer provides a proper raw bytes data anymore and the client creates it based
279- // on data provided by "handleArchive", so we need to emulate how the game generates these data.
280- await SaveLocalIndexFiles ( instance , handleDesignArchive , aDirDesignData , "DesignV" , token ) ;
281- await SaveLocalIndexFiles ( instance , handleArchive , aDirAsbBlock , "AsbV" , token ) ;
282- await SaveLocalIndexFiles ( instance , handleArchive , aDirAsbBlock , "BlockV" , token ) ;
283- await SaveLocalIndexFiles ( instance , handleArchive , aDirAsbBlock , "Start_AsbV" , token ) ;
284- await SaveLocalIndexFiles ( instance , handleArchive , aDirAsbBlock , "Start_BlockV" , token ) ;
285- await SaveLocalIndexFiles ( instance , handleArchive , aDirAudio , "AudioV" , token ) ;
286- await SaveLocalIndexFiles ( instance , handleArchive , aDirVideo , "VideoV" , token ) ;
287- await SaveLocalIndexFiles ( instance , handleArchive , aDirRawRes , "RawResV" , token ) ;
288-
289276 // -- Load metadata files
290277 // -- DesignV
291- StarRailAssetSignaturelessMetadata ? metadataDesignV =
292- await LoadMetadataFile < StarRailAssetSignaturelessMetadata > ( instance ,
293- handleDesignArchive ,
294- client ,
295- baseUrl . DesignData ,
296- "DesignV" ,
297- aDirDesignData ,
298- token ) ;
278+ StarRailAssetBytesSignaturelessMetadata ? metadataDesignV =
279+ await LoadMetadataFile < StarRailAssetBytesSignaturelessMetadata > ( instance ,
280+ handleDesignArchive ,
281+ client ,
282+ baseUrl . DesignData ,
283+ "DesignV" ,
284+ aDirDesignData ,
285+ token ) ;
299286
300287 // -- NativeDataV
301288 StarRailAssetNativeDataMetadata ? metadataNativeDataV =
@@ -334,7 +321,7 @@ await LoadMetadataFile<StarRailAssetBundleMetadata>(instance,
334321 client ,
335322 baseUrl . AsbBlockPersistent ,
336323 "AsbV" ,
337- null ,
324+ aDirAsbBlock ,
338325 token ) ;
339326
340327 // -- BlockV
@@ -344,7 +331,7 @@ await LoadMetadataFile<StarRailAssetBlockMetadata>(instance,
344331 client ,
345332 baseUrl . AsbBlockPersistent ,
346333 "BlockV" ,
347- null ,
334+ aDirAsbBlock ,
348335 token ) ;
349336
350337 // -- AudioV
@@ -377,6 +364,19 @@ await LoadMetadataFile<StarRailAssetJsonMetadata>(instance,
377364 aDirRawRes ,
378365 token ) ;
379366
367+ // -- Save local index files
368+ // Notes to Dev: HoYo no longer provides a proper raw bytes data anymore and the client creates it based
369+ // on data provided by "handleArchive", so we need to emulate how the game generates these data.
370+ await SaveLocalIndexFiles ( instance , handleDesignArchive , aDirDesignData , "DesignV" , token ) ;
371+ await SaveLocalIndexFiles ( instance , handleDesignArchive , aDirNativeData , "NativeDataV" , token ) ;
372+ await SaveLocalIndexFiles ( instance , handleArchive , aDirAsbBlock , "AsbV" , token ) ;
373+ await SaveLocalIndexFiles ( instance , handleArchive , aDirAsbBlock , "BlockV" , token ) ;
374+ await SaveLocalIndexFiles ( instance , handleArchive , aDirAsbBlock , "Start_AsbV" , token ) ;
375+ await SaveLocalIndexFiles ( instance , handleArchive , aDirAsbBlock , "Start_BlockV" , token ) ;
376+ await SaveLocalIndexFiles ( instance , handleArchive , aDirAudio , "AudioV" , token ) ;
377+ await SaveLocalIndexFiles ( instance , handleArchive , aDirVideo , "VideoV" , token ) ;
378+ await SaveLocalIndexFiles ( instance , handleArchive , aDirRawRes , "RawResV" , token ) ;
379+
380380 // Perform URL test & swap for Audio and Video
381381 await baseUrl . TestAndSwapUrlAsync ( client ,
382382 mainUrlAsbAlt . CombineURLFromString ( "AudioBlock" ) ,
@@ -411,7 +411,7 @@ await baseUrl.TestAndSwapUrlAsync(client,
411411 }
412412
413413 private static async ValueTask SaveLocalIndexFiles (
414- StarRailRepairV2 instance ,
414+ StarRailRepairV2 instance ,
415415 Dictionary < string , StarRailRefMainInfo > handleArchiveSource ,
416416 string outputDir ,
417417 string indexKey ,
@@ -618,16 +618,20 @@ public class AssetBaseUrls
618618 public required string DesignData { get ; init ; }
619619 public required string Archive { get ; set ; }
620620 public required string Audio { get ; set ; }
621+ public required string AudioPersistent { get ; set ; }
621622 public required string AsbBlock { get ; set ; }
622623 public required string AsbBlockPersistent { get ; set ; }
623624 public required string NativeData { get ; init ; }
624625 public required string Video { get ; set ; }
626+ public required string VideoPersistent { get ; set ; }
625627 public required string RawRes { get ; init ; }
626628
627629 public string ? CacheLua { get ; init ; }
628630 public string ? CacheIFix { get ; init ; }
629631
630- public void SwapAsbPersistentUrl ( ) => ( AsbBlock , AsbBlockPersistent ) = ( AsbBlockPersistent , AsbBlock ) ;
632+ public void SwapAsbPersistentUrl ( ) =>
633+ ( AsbBlock , AsbBlockPersistent , Video , VideoPersistent , Audio , AudioPersistent ) =
634+ ( AsbBlockPersistent , AsbBlock , VideoPersistent , Video , AudioPersistent , Audio ) ;
631635
632636 public async Task TestAndSwapUrlAsync (
633637 HttpClient client ,
0 commit comments