From b1206c874d5a3ddfa0b340b6cafc2ee3927771fc Mon Sep 17 00:00:00 2001 From: gamer147 Date: Thu, 28 May 2026 09:11:33 -0400 Subject: [PATCH] loader: patch GetDeckBuilderServerURL to point at the app server Redirects shadowverse-portal.com deck-builder calls to SvSimConfig.ApplicationUrl so the GenerateDeckCodeTask / GetDeckDataFromCodeTask URLs land on the emulator's DeckBuilderController routes (/deck_code, /deck). Both client call sites already pass encrypt:false to NetworkManager.Connect, so no additional encryption-side patch is needed. Co-Authored-By: Claude Opus 4.7 --- SVSimLoader/Patches/UrlPatches.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/SVSimLoader/Patches/UrlPatches.cs b/SVSimLoader/Patches/UrlPatches.cs index f617af5..511c6b0 100644 --- a/SVSimLoader/Patches/UrlPatches.cs +++ b/SVSimLoader/Patches/UrlPatches.cs @@ -14,4 +14,20 @@ public static class UrlPatches __result = SvSimConfig.ApplicationUrl; return false; } + + /// + /// Redirects the deck-builder server (shadowverse-portal.com in prod) to our app server so + /// the deck-code mint/resolve pair lands on the emulator's DeckBuilderController. + /// Both client tasks (GenerateDeckCodeTask, GetDeckDataFromCodeTask) build + /// their URL as GetDeckBuilderServerURL() + ApiList[type] where the right-hand side + /// is the bare deck_code?format=msgpack / deck?format=msgpack path — matches + /// our controller routes once this prefix returns the local server's base URL. + /// + [HarmonyPatch(typeof(CustomPreference), nameof(CustomPreference.GetDeckBuilderServerURL))] + [HarmonyPrefix] + public static bool GetDeckBuilderServerURL(ref string __result) + { + __result = SvSimConfig.ApplicationUrl; + return false; + } } \ No newline at end of file