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 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-05-28 09:11:33 -04:00
parent 76b7e59489
commit b1206c874d

View File

@@ -14,4 +14,20 @@ public static class UrlPatches
__result = SvSimConfig.ApplicationUrl; __result = SvSimConfig.ApplicationUrl;
return false; return false;
} }
/// <summary>
/// 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 <c>DeckBuilderController</c>.
/// Both client tasks (<c>GenerateDeckCodeTask</c>, <c>GetDeckDataFromCodeTask</c>) build
/// their URL as <c>GetDeckBuilderServerURL() + ApiList[type]</c> where the right-hand side
/// is the bare <c>deck_code?format=msgpack</c> / <c>deck?format=msgpack</c> path — matches
/// our controller routes once this prefix returns the local server's base URL.
/// </summary>
[HarmonyPatch(typeof(CustomPreference), nameof(CustomPreference.GetDeckBuilderServerURL))]
[HarmonyPrefix]
public static bool GetDeckBuilderServerURL(ref string __result)
{
__result = SvSimConfig.ApplicationUrl;
return false;
}
} }