mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 05:46:03 +00:00
fix(epic): start parent-checking Epic titles under an EpicGamesLauncher.exe stand-in and stage their Rockstar SDK (#2932)
* fix(epic): start Epic titles that check their parent under an EpicGamesLauncher.exe stand-in Rockstar's launcher only accepts an Epic copy of GTA V when a process named EpicGamesLauncher.exe started it. DroidDeck's Epic client is a Linux program, so the launcher logged "Epic Games Launcher not detected as parent process", failed to relaunch through Epic and showed the game as unowned. - tools/epic-launcher: a small Windows EpicGamesLauncher.exe that starts the game with the rest of its own command line, unchanged, waits for it and returns its exit code. It ships as the epic add-on pack. - The Epic .droiddeck-launch.bat runs the game through it for Epic titles known to need it (GTA V, GTA V Enhanced, RDR2, RDR, GTA SA DE, Returnal, Phantom Blade: Executioners), or for any Epic game whose per-game environment sets DD_EPIC_PARENT=1; DD_EPIC_PARENT=0 turns it off. Those titles also start without Steam's SteamAppId. Without the staged stand-in the game starts directly, as before. - Steam launch options now reach Epic games (%*). - The launch hook fetches the pack when such a title finds it missing. - Rockstar's launcher found no Social Club SDK in the prefix and ran Social-Club-Setup.exe /silent, which never exits under Wine. For Epic titles that carry a Rockstar SDK installer, the hook now extracts the SDK from the launcher's own Redistributables copy (the version the launcher compares against) or, before the launcher is installed, from the game's copy, and registers it. It re-extracts when that installer changes and leaves the Rockstar Games Launcher key alone, so PlayGTAV still installs the launcher on first start. * fix(epic): fetch the parent stand-in exactly when the game will use it; keep Cargo output out of source digests The launch hook runs before droiddeck-game-env applies per-game variables, so it now resolves DD_EPIC_PARENT through droiddeck-game-env's own apply_config and game_id: an unlisted title with DD_EPIC_PARENT=1 fetches the pack, a listed title with DD_EPIC_PARENT=0 no longer waits for it. runtime_inputs no longer hashes the target directory beside a Cargo.toml under its source paths, so a local cargo build of a Windows helper does not fail verify(). tools/epic-launcher gets the same .gitignore as the other helpers. * fix(epic): a DD_EPIC_PARENT in the game's sidecar env decides the stand-in fetch too The .bat sets the sidecar's env before it reads DD_EPIC_PARENT, so that value overrides the game environment there; the launch hook now gives it the same precedence when deciding whether to fetch the pack. * test(epic): keep an inherited DD_EPIC_PARENT out of the launch hook tests --------- Co-authored-by: MaxsTechReview <maxjividen@gmail.com>
This commit is contained in:
1 parent
9925873764
commit
367151be2c
22 files changed
+543
-29
No files matched your search
+2
-2
@@ -93,7 +93,7 @@ def trackingPack = rootProject.file('tools/packs/tracking/release.env').readLine
|
||||
def prootPackPin = rootProject.file('tools/packs/proot/release.env').readLines()
|
||||
.findAll { it.contains('=') && !it.startsWith('#') }
|
||||
.collectEntries { def kv = it.split('=', 2); [(kv[0].trim()): kv[1].trim()] }
|
||||
def addonPacks = ['proot', 'directaudio', 'tracking', 'xbox', 'comet', 'butler', 'powervr', 'ubisoft', 'rockstar', 'dirt'].collectEntries { name ->
|
||||
def addonPacks = ['proot', 'directaudio', 'tracking', 'xbox', 'comet', 'butler', 'powervr', 'ubisoft', 'rockstar', 'dirt', 'epic'].collectEntries { name ->
|
||||
def pack = file("build/packs/${name}.tar.zst")
|
||||
if (!pack.isFile()) {
|
||||
if (ciBuild) throw new GradleException("Add-on pack ${pack} is missing: run tools/packs/build.sh app/build/packs")
|
||||
@@ -202,7 +202,7 @@ android {
|
||||
}
|
||||
|
||||
androidResources {
|
||||
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~:<dir>droiddeck-xbox:<dir>droiddeck-comet:<dir>droiddeck-ubisoft:<dir>droiddeck-rockstar:<dir>droiddeck-dirt:<dir>directaudio:<dir>hybris'
|
||||
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~:<dir>droiddeck-xbox:<dir>droiddeck-comet:<dir>droiddeck-ubisoft:<dir>droiddeck-rockstar:<dir>droiddeck-dirt:<dir>droiddeck-epic:<dir>directaudio:<dir>hybris'
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
|
||||
@@ -96,6 +96,8 @@ class App : Application() {
|
||||
com.droiddeck.launcher.session.SessionFiles.ensureUbisoftService(app)
|
||||
if (com.droiddeck.launcher.stores.StoreAccounts.signedInAs(app, com.droiddeck.launcher.stores.Store.ROCKSTAR) != null)
|
||||
com.droiddeck.launcher.session.SessionFiles.ensureRockstarService(app)
|
||||
if (com.droiddeck.launcher.stores.StoreAccounts.signedInAs(app, com.droiddeck.launcher.stores.Store.EPIC) != null)
|
||||
com.droiddeck.launcher.session.SessionFiles.ensureEpicParent(app)
|
||||
com.droiddeck.launcher.handtracking.HandTracking.load(app)
|
||||
}.onFailure { android.util.Log.w("App", "add-on pack prefetch failed", it) }
|
||||
}, "addon-packs").start()
|
||||
|
||||
@@ -175,5 +175,6 @@ internal class AddonPack(
|
||||
val ROCKSTAR = AddonPack("rockstar", BuildConfig.PACK_ROCKSTAR_SHA256, BuildConfig.PACK_ROCKSTAR_SIZE,
|
||||
listOf("Launcher32.exe", "Launcher64.exe"))
|
||||
val DIRT = AddonPack("dirt", BuildConfig.PACK_DIRT_SHA256, BuildConfig.PACK_DIRT_SIZE, listOf("ws2_32.dll"))
|
||||
val EPIC = AddonPack("epic", BuildConfig.PACK_EPIC_SHA256, BuildConfig.PACK_EPIC_SIZE, listOf("EpicGamesLauncher.exe"))
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,7 @@ object SessionFiles {
|
||||
private val SERVICE_PACKS = mapOf(
|
||||
AddonPack.UBISOFT to "usr/local/lib/droiddeck-ubisoft",
|
||||
AddonPack.ROCKSTAR to "usr/local/lib/droiddeck-rockstar",
|
||||
AddonPack.EPIC to "usr/local/lib/droiddeck-epic",
|
||||
AddonPack.DIRT to "usr/local/lib/droiddeck-dirt",
|
||||
)
|
||||
|
||||
@@ -47,6 +48,8 @@ object SessionFiles {
|
||||
|
||||
fun ensureRockstarService(context: Context) = ensureStoreService(context, AddonPack.ROCKSTAR)
|
||||
|
||||
fun ensureEpicParent(context: Context) = ensureStoreService(context, AddonPack.EPIC)
|
||||
|
||||
/** The DiRT 3 / DiRT Showdown ws2_32 stand-in; droiddeck-game-env applies it only when it is staged. */
|
||||
fun ensureDirtStandIn(context: Context) = ensureStoreService(context, AddonPack.DIRT)
|
||||
|
||||
|
||||
@@ -13,6 +13,15 @@ object StoreLaunch {
|
||||
const val EPIC_ARGS = ".droiddeck-epic-args"
|
||||
const val UBISOFT_LAUNCH = ".droiddeck-ubisoft.json"
|
||||
private const val UBISOFT_SERVICE = "Z:\\usr\\local\\lib\\droiddeck-ubisoft\\droiddeck-upc.exe"
|
||||
const val EPIC_PARENT = "Z:\\usr\\local\\lib\\droiddeck-epic\\EpicGamesLauncher.exe"
|
||||
/** Per-game environment switch: 1 starts any Epic game under [EPIC_PARENT], 0 never does. */
|
||||
const val EPIC_PARENT_SWITCH = "DD_EPIC_PARENT"
|
||||
/** Epic app names whose launchers treat the game as unowned unless a process named EpicGamesLauncher.exe started it. */
|
||||
val EPIC_PARENT_TITLES = setOf(
|
||||
"9d2d0eb64d5c44529cece33fe2a46482", "8769e24080ea413b8ebca3f1b8c50951", "Heather",
|
||||
"c180bd9859624278aa20f1333918498a", "0828ecd4297c4f89bfcc45420e695b67",
|
||||
"e5f031908d2e460b8757387d1a136e48", "afd9f29c1af44610b9e0f9b69742e257",
|
||||
)
|
||||
const val EA_ENV = ".droiddeck-ea-env"
|
||||
/** A sleeping stand-in that the launch hook installs; older EA SDKs require a running Origin process. */
|
||||
const val EA_ORIGIN = "C:\\Program Files (x86)\\Origin\\Origin.exe"
|
||||
@@ -39,22 +48,29 @@ object StoreLaunch {
|
||||
val args = sidecar.args.joinToString(" ") { if (sidecar.store == Store.ROCKSTAR) batchArg(it) else quoteArg(it) }
|
||||
val run = "\"%~dp0$exe\"" + (if (args.isNotEmpty()) " $args" else "")
|
||||
if (sidecar.store == Store.EPIC) {
|
||||
lines += "set \"$PARENT_VAR=${if (sidecar.id in EPIC_PARENT_TITLES) "1" else ""}\""
|
||||
lines += "if \"%$EPIC_PARENT_SWITCH%\"==\"1\" set \"$PARENT_VAR=1\""
|
||||
lines += "if \"%$EPIC_PARENT_SWITCH%\"==\"0\" set \"$PARENT_VAR=\""
|
||||
lines += "if defined $PARENT_VAR set \"SteamAppId=\""
|
||||
lines += "if defined $PARENT_VAR if not exist \"$EPIC_PARENT\" set \"$PARENT_VAR=\""
|
||||
lines += "if defined $PARENT_VAR set $PARENT_VAR=\"$EPIC_PARENT\""
|
||||
val game = "%$PARENT_VAR% $run"
|
||||
lines += "if exist \"%~dp0$EPIC_ARGS\" goto client"
|
||||
lines += "set \"$CODE_VAR=\""
|
||||
lines += "if exist \"%~dp0$EPIC_CODE\" set /p $CODE_VAR=<\"%~dp0$EPIC_CODE\""
|
||||
lines += "if exist \"%~dp0$EPIC_CODE\" del \"%~dp0$EPIC_CODE\""
|
||||
lines += "if defined $CODE_VAR goto signed"
|
||||
lines += run
|
||||
lines += "$game %*"
|
||||
lines += "goto :eof"
|
||||
lines += ":signed"
|
||||
lines += "set \"$CODE_VAR=\" & $run -AUTH_LOGIN=unused -AUTH_PASSWORD=%$CODE_VAR% -AUTH_TYPE=exchangecode"
|
||||
lines += "set \"$CODE_VAR=\" & $game -AUTH_LOGIN=unused -AUTH_PASSWORD=%$CODE_VAR% -AUTH_TYPE=exchangecode %*"
|
||||
lines += "goto :eof"
|
||||
lines += ":client"
|
||||
lines += "set \"$CLIENT_VAR=\""
|
||||
lines += "set /p $CLIENT_VAR=<\"%~dp0$EPIC_ARGS\""
|
||||
lines += "del \"%~dp0$EPIC_ARGS\""
|
||||
lines += "if exist \"%~dp0$EPIC_CODE\" del \"%~dp0$EPIC_CODE\""
|
||||
lines += "set \"$CLIENT_VAR=\" & \"%~dp0$exe\" %$CLIENT_VAR%"
|
||||
lines += "set \"$CLIENT_VAR=\" & %$PARENT_VAR% \"%~dp0$exe\" %$CLIENT_VAR% %*"
|
||||
} else if (sidecar.store == Store.ROCKSTAR) {
|
||||
lines += "if not exist \"C:\\Program Files\\Rockstar Games\\Launcher\\launch.json\" goto direct"
|
||||
lines += "\"C:\\Program Files\\Rockstar Games\\Launcher\\Launcher.exe\""
|
||||
@@ -107,6 +123,7 @@ object StoreLaunch {
|
||||
|
||||
private const val CODE_VAR = "DD_X"
|
||||
private const val CLIENT_VAR = "DD_A"
|
||||
private const val PARENT_VAR = "DD_P"
|
||||
|
||||
fun installedGame(context: Context, store: Store, id: String): Library.SteamGame? {
|
||||
val folder = StoreInstallRoot.gameFolders(context).firstOrNull { folder ->
|
||||
|
||||
@@ -117,9 +117,9 @@ class StoreGameSidecarTest {
|
||||
val text = StoreLaunch.launcherText(sample.copy(exe = "Binaries/Win64/Celeste.exe"))
|
||||
assertTrue(text.contains("cd /d \"%~dp0Binaries\\Win64\"\r\n"))
|
||||
assertTrue(text.contains("set \"FOO=bar\"\r\n"))
|
||||
assertTrue(text.contains("\r\n\"%~dp0Binaries\\Win64\\Celeste.exe\" -EpicPortal -epicusername=\"Some One\"\r\n"))
|
||||
assertTrue(text.contains("\r\n%DD_P% \"%~dp0Binaries\\Win64\\Celeste.exe\" -EpicPortal -epicusername=\"Some One\" %*\r\n"))
|
||||
assertTrue(text.contains("set /p DD_X=<\"%~dp0.droiddeck-epic-code\""))
|
||||
assertTrue(text.contains("set \"DD_X=\" & \"%~dp0Binaries\\Win64\\Celeste.exe\" -EpicPortal -epicusername=\"Some One\" -AUTH_LOGIN=unused -AUTH_PASSWORD=%DD_X% -AUTH_TYPE=exchangecode\r\n"))
|
||||
assertTrue(text.contains("set \"DD_X=\" & %DD_P% \"%~dp0Binaries\\Win64\\Celeste.exe\" -EpicPortal -epicusername=\"Some One\" -AUTH_LOGIN=unused -AUTH_PASSWORD=%DD_X% -AUTH_TYPE=exchangecode %*\r\n"))
|
||||
assertFalse(text.contains("AUTH="))
|
||||
assertFalse(text.contains("DD_AUTH"))
|
||||
}
|
||||
@@ -157,11 +157,38 @@ class StoreGameSidecarTest {
|
||||
"set /p DD_A=<\"%~dp0.droiddeck-epic-args\"",
|
||||
"del \"%~dp0.droiddeck-epic-args\"",
|
||||
"if exist \"%~dp0.droiddeck-epic-code\" del \"%~dp0.droiddeck-epic-code\"",
|
||||
"set \"DD_A=\" & \"%~dp0Binaries\\Win64\\Celeste.exe\" %DD_A%",
|
||||
"set \"DD_A=\" & %DD_P% \"%~dp0Binaries\\Win64\\Celeste.exe\" %DD_A% %*",
|
||||
),
|
||||
lines.subList(client + 1, client + 6),
|
||||
)
|
||||
assertTrue(text.endsWith("%DD_A%\r\n"))
|
||||
assertTrue(text.endsWith("%DD_A% %*\r\n"))
|
||||
}
|
||||
|
||||
private val parentLines = listOf(
|
||||
"if \"%DD_EPIC_PARENT%\"==\"1\" set \"DD_P=1\"",
|
||||
"if \"%DD_EPIC_PARENT%\"==\"0\" set \"DD_P=\"",
|
||||
"if defined DD_P set \"SteamAppId=\"",
|
||||
"if defined DD_P if not exist \"Z:\\usr\\local\\lib\\droiddeck-epic\\EpicGamesLauncher.exe\" set \"DD_P=\"",
|
||||
"if defined DD_P set DD_P=\"Z:\\usr\\local\\lib\\droiddeck-epic\\EpicGamesLauncher.exe\"",
|
||||
)
|
||||
|
||||
@Test fun epicTitlesThatCheckTheirParentStartUnderTheStandIn() {
|
||||
for (id in listOf("9d2d0eb64d5c44529cece33fe2a46482", "8769e24080ea413b8ebca3f1b8c50951", "Heather")) {
|
||||
val lines = StoreLaunch.launcherText(StoreGameSidecar(Store.EPIC, id, "Rockstar title", "PlayGTAV.exe")).split("\r\n")
|
||||
val on = lines.indexOf("set \"DD_P=1\"")
|
||||
assertTrue(id, on > lines.indexOf("cd /d \"%~dp0\""))
|
||||
assertEquals(parentLines, lines.subList(on + 1, on + 6))
|
||||
assertEquals("if exist \"%~dp0.droiddeck-epic-args\" goto client", lines[on + 6])
|
||||
assertEquals(3, lines.count { it.contains("%DD_P% \"%~dp0PlayGTAV.exe\"") })
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun otherEpicGamesUseTheStandInOnlyWhenTheirEnvironmentAsksForIt() {
|
||||
val lines = StoreLaunch.launcherText(sample).split("\r\n")
|
||||
val off = lines.indexOf("set \"DD_P=\"")
|
||||
assertTrue(off > 0)
|
||||
assertFalse(lines.contains("set \"DD_P=1\""))
|
||||
assertEquals(parentLines, lines.subList(off + 1, off + 6))
|
||||
}
|
||||
|
||||
@Test fun gogLauncherHasNoEpicBlockAndIsOnlyWrittenWhenNeeded() {
|
||||
|
||||
Reference in new issue
Block a user