mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 07:46:01 +00:00
fix(battlenet): follow the selected FEX instead of pinning an old build (#2987)
* fix(battlenet): follow the selected FEX instead of pinning a d2rfix build The Battle.net prefix forced the newest FEXCore d2rfix package from the Nightlies listing, which stopped updating. Its fixes are in the bundled and nightly FEX, so the prefix now uses whatever FEX is selected. Existing d2rfix selections for the Battle.net profile are cleared once; any other choice is kept. The DXVK memory cap and Start without Steam defaults are now applied when a session starts. * fix(battlenet): import the legacy plugin state before unpinning the Battle.net FEX
This commit is contained in:
1 parent
31dd8f9987
commit
088c8ff1cf
9 files changed
+79
-232
No files matched your search
@@ -238,6 +238,20 @@ object ComponentsManager {
|
||||
saveState(context, state)
|
||||
}
|
||||
|
||||
private val UNPINNED_FEX = Regex("""(?i)FEXCore-\d+(?:\.\d+)*-d2rfix\d+-linux\.wcp""")
|
||||
|
||||
fun migrateBattleNetFex(context: Context) = synchronized(lock) {
|
||||
val marker = File(dataDir(context), ".battlenet-fex-unpinned")
|
||||
if (marker.isFile) return@synchronized
|
||||
migratePlugin(context)
|
||||
val scope = com.droiddeck.launcher.runtime.BattleNet.APP_ID.toString()
|
||||
if (gameComponents(context, scope)["fex"]?.let(UNPINNED_FEX::matches) == true) {
|
||||
setGameComponent(context, scope, "fex", null)
|
||||
Log.i(TAG, "Battle.net follows the selected FEX again")
|
||||
}
|
||||
marker.writeText("1\n")
|
||||
}
|
||||
|
||||
private fun migratePlugin(context: Context) {
|
||||
val marker = File(dataDir(context), ".plugin-imported")
|
||||
if (marker.isFile) return
|
||||
@@ -487,6 +501,7 @@ object ComponentsManager {
|
||||
|
||||
fun snapshotAll(context: Context) = synchronized(lock) {
|
||||
migratePlugin(context)
|
||||
runCatching { migrateBattleNetFex(context) }.onFailure { Log.w(TAG, "Battle.net FEX selection", it) }
|
||||
val state = loadState(context)
|
||||
for (p in protons(context)) for (comp in COMPONENTS) {
|
||||
runCatching { ensureOriginal(context, p, comp, state) }.onFailure { Log.w(TAG, "original $comp of ${p.name}", it) }
|
||||
@@ -497,6 +512,7 @@ object ComponentsManager {
|
||||
|
||||
fun snapshot(context: Context): Snapshot = synchronized(lock) {
|
||||
migratePlugin(context)
|
||||
runCatching { migrateBattleNetFex(context) }.onFailure { Log.w(TAG, "Battle.net FEX selection", it) }
|
||||
val state = loadState(context)
|
||||
val reapplied = HashMap<String, Long>()
|
||||
runCatching {
|
||||
|
||||
@@ -287,6 +287,7 @@ object SessionFiles {
|
||||
File(root, "usr/share/vulkan/implicit_layer.d/droiddeck_vram_cap.json").delete()
|
||||
LegacyNames.migrateRootfs(root)
|
||||
ComponentsManager.migrateLaunchDir(context)
|
||||
runCatching { ComponentsManager.migrateBattleNetFex(context) }.onFailure { Log.w(TAG, "Battle.net FEX selection", it) }
|
||||
EsyncPacks.stageBundled(context, root)
|
||||
val directAudio = arrayOf(
|
||||
"aarch64-unix/winedirectaudio.so",
|
||||
|
||||
@@ -589,7 +589,10 @@ class SessionService : Service() {
|
||||
|
||||
val sessionDir = openSessionFolder()
|
||||
try {
|
||||
SessionEvents.step("game-environment") { GameEnvironmentStore.publish(this) }
|
||||
SessionEvents.step("game-environment") {
|
||||
com.droiddeck.launcher.runtime.BattleNet.ensureDefaults(this, SessionState.program)
|
||||
GameEnvironmentStore.publish(this)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "could not publish the game environment", e)
|
||||
failSession(gen, "GAME_ENVIRONMENT_FAILED", getString(R.string.session_game_environment_failed), -1)
|
||||
@@ -1951,11 +1954,6 @@ class SessionService : Service() {
|
||||
}
|
||||
return
|
||||
}
|
||||
if (path == com.droiddeck.launcher.runtime.BattleNet.FEX_REQUEST) {
|
||||
File(dir, path).delete()
|
||||
com.droiddeck.launcher.runtime.BattleNet.answerFexRequest(this@SessionService, dir)
|
||||
return
|
||||
}
|
||||
if (path != null && path.startsWith("desktop-import-") && path.endsWith(".request")) {
|
||||
val request = File(dir, path)
|
||||
val text = runCatching { request.readText() }.getOrNull() ?: return
|
||||
|
||||
Reference in new issue
Block a user