@@ -216,6 +216,36 @@ private UrlData ResolveOptimizedAssetsUrl(string dedicatedHostUrl)
216216 return new UrlData ( CacheBehaviour . FeatureFlagsDependent , $ "https://abcdn.decentraland.{ ENV } ") ;
217217 }
218218
219+ /// <summary>
220+ /// Asset-bundle registry / CDN base resolution. When the abgen parallel-pipeline flag is on,
221+ /// routes to the `-abgen` sibling host (own registry + ab-cdn-abgen CDN), taking precedence over
222+ /// OPTIMIZED_ASSETS so the whole AB surface (registry + CDN) moves together. The CLI
223+ /// "--optimized-assets-url" override still wins. LODs are intentionally NOT routed here (abgen's
224+ /// LOD lane is unimplemented) — LodGeneratorCDN keeps calling ResolveOptimizedAssetsUrl directly.
225+ /// </summary>
226+ private UrlData ResolveAssetBundleUrl ( string dedicatedHostUrl )
227+ {
228+ if ( optimizedAssetsBaseOverride is { Length : > 0 } )
229+ return new UrlData ( CacheBehaviour . FeatureFlagsDependent , optimizedAssetsBaseOverride ) ;
230+
231+ FeatureFlagsConfiguration featureFlags = FeatureFlagsConfiguration . Instance ;
232+
233+ // FeatureFlagsDependent so the abgen host is re-resolved (not cached) until flags load — the
234+ // {ENV} token is substituted in Url() once the environment domain is applied.
235+ if ( ! featureFlags . IsEmpty && featureFlags . IsEnabled ( FeatureFlagsStrings . ABGEN_REGISTRY ) )
236+ return new UrlData ( CacheBehaviour . FeatureFlagsDependent , InsertAbgenSubdomain ( dedicatedHostUrl ) ) ;
237+
238+ return ResolveOptimizedAssetsUrl ( dedicatedHostUrl ) ;
239+ }
240+
241+ /// <summary>
242+ /// Inserts the `-abgen` label into the leading subdomain of an AB host, leaving the {ENV} token
243+ /// intact: `https://ab-cdn.decentraland.{ENV}` → `https://ab-cdn-abgen.decentraland.{ENV}`,
244+ /// `https://asset-bundle-registry.decentraland.{ENV}` → `https://asset-bundle-registry-abgen.decentraland.{ENV}`.
245+ /// </summary>
246+ private static string InsertAbgenSubdomain ( string hostUrl ) =>
247+ hostUrl . Replace ( ".decentraland." , "-abgen.decentraland." ) ;
248+
219249 /// <summary>Registry-composed endpoints inherit the registry base's caching so a flag-driven base is not cached early.</summary>
220250 private UrlData ComposeRegistryUrl ( string path ) =>
221251 new ( RawUrl ( DecentralandUrl . AssetBundleRegistry ) . Caching , $ "{ Url ( DecentralandUrl . AssetBundleRegistry ) } { path } ") ;
@@ -273,7 +303,7 @@ protected virtual UrlData RawUrl(DecentralandUrl decentralandUrl) =>
273303 DecentralandUrl . Account => $ "https://decentraland.{ ENV } /account/",
274304 DecentralandUrl . MinimumSpecs => $ "https://docs.decentraland.{ ENV } /player/FAQs/decentraland-101/#what-hardware-do-i-need-to-run-decentraland",
275305 DecentralandUrl . Market => $ "https://market.decentraland.{ ENV } ",
276- DecentralandUrl . AssetBundlesCDN => ResolveOptimizedAssetsUrl ( $ "https://ab-cdn.decentraland.{ ENV } ") ,
306+ DecentralandUrl . AssetBundlesCDN => ResolveAssetBundleUrl ( $ "https://ab-cdn.decentraland.{ ENV } ") ,
277307 DecentralandUrl . LodGeneratorCDN => ResolveOptimizedAssetsUrl ( $ "https://lod-generator-unity-cdn.decentraland.{ ENV } ") ,
278308 DecentralandUrl . ArchipelagoStatus => $ "https://archipelago-ea-stats.decentraland.{ ENV } /status",
279309 DecentralandUrl . ArchipelagoHotScenes => $ "https://archipelago-ea-stats.decentraland.{ ENV } /hot-scenes",
@@ -286,7 +316,7 @@ protected virtual UrlData RawUrl(DecentralandUrl decentralandUrl) =>
286316 DecentralandUrl . CameraReelLink => $ "https://reels.decentraland.{ ENV } ",
287317 DecentralandUrl . Blocklist => $ "https://config.decentraland.{ ENV } /denylist.json",
288318 DecentralandUrl . ApiFriends => $ "wss://rpc-social-service-ea.decentraland.{ ENV } ",
289- DecentralandUrl . AssetBundleRegistry => ResolveOptimizedAssetsUrl ( $ "https://asset-bundle-registry.decentraland.{ ENV } ") ,
319+ DecentralandUrl . AssetBundleRegistry => ResolveAssetBundleUrl ( $ "https://asset-bundle-registry.decentraland.{ ENV } ") ,
290320
291321 DecentralandUrl . AssetBundleRegistryVersion => ComposeRegistryUrl ( "/entities/versions" ) ,
292322 DecentralandUrl . MarketplaceClaimName => $ "https://decentraland.{ ENV } /marketplace/names/claim",
0 commit comments