From 69ea1ac7ab8037181844572802fe6faafed7eaae Mon Sep 17 00:00:00 2001 From: Graham Date: Fri, 5 May 2023 22:37:57 +0100 Subject: [PATCH] Add beta HTTP js5 endpoint Signed-off-by: Graham --- .../kotlin/org/openrs2/archive/cache/CacheDownloader.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheDownloader.kt b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheDownloader.kt index 6ccb63fb90..bf67f7d135 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheDownloader.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheDownloader.kt @@ -61,7 +61,11 @@ public class CacheDownloader @Inject constructor( val tokens = config.params.values.filter { TOKEN_REGEX.matches(it) } val token = tokens.singleOrNull() ?: throw Exception("Multiple candidate tokens: $tokens") - hostname = NXT_HOSTNAME + hostname = if (environment == "beta") { + NXT_BETA_HOSTNAME + } else { + NXT_LIVE_HOSTNAME + } val musicStreamClient = MusicStreamClient(client, byteBufBodyHandler, "http://$hostname") @@ -97,7 +101,8 @@ public class CacheDownloader @Inject constructor( private companion object { private const val CODEBASE = "codebase" - private const val NXT_HOSTNAME = "content.runescape.com" + private const val NXT_LIVE_HOSTNAME = "content.runescape.com" + private const val NXT_BETA_HOSTNAME = "content.beta.runescape.com" private const val PORT = 443 private val TOKEN_REGEX = Regex("[A-Za-z0-9*-]{32}") }