mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 05:46:03 +00:00
fix: refresh repaired components and render Ubisoft Connect (#2090)
* fix: refresh repaired components and render Ubisoft Connect * fix: address component repair and Wine registry review * fix: repair manually enabled components and check registry writes * fix: serialize component repairs and use Proton runinprefix * fix: report queued component repair failures * fix: preserve newer component repair waits * Make component queue transitions atomic * Isolate component apply failures by game * Preserve pending repair when catalog is stale * Restore persisted component repair revisions * Update pending requirements atomically * Respect disabled pending components per game * Keep queue key state atomic while worker waits * Pass selected game to component repairs * Preserve pending repair when component is absent * Preserve pending revision on catalog failure * Test legacy pending repair revision recovery * Isolate fake worker Steam app info lookup * Merge queued Steam app info lookups * Persist launch component revisions before repair * Gate launch on component repair discovery * Expand and refresh launch repair discovery * Include new automatic picks in launch requirements * Log repair persistence failures and align repair keys * Use runtime key for Battle.net component repairs * Retain failed component reapplications for retry * Harden pending repairs and launch preparation * Isolate wait-cool sleep mocking * Allow launches without catalog when no repair is pending * Queue launch repairs even if persistence fails * Block launch when repair state cannot persist * Allow launch when no component repair is needed * Persist selected repairs when catalog is offline * Drain offline component repair in test
This commit is contained in:
1 parent
ab92033b90
commit
516e3862fa
14 files changed
+756
-83
No files matched your search
@@ -243,6 +243,20 @@ def ubisoft_overlay_off(env):
|
||||
print("droiddeck-game-env: Ubisoft Connect overlay left as is (%s)" % error, file=sys.stderr)
|
||||
|
||||
|
||||
def ubisoft_composition_off(proton, env):
|
||||
prefix = Path(env.get("STEAM_COMPAT_DATA_PATH", "/nonexistent")) / "pfx"
|
||||
if not (prefix / UBISOFT_LAUNCHER).is_dir() or not (prefix / "user.reg").is_file():
|
||||
return
|
||||
try:
|
||||
for program in ("upc.exe", "UplayWebCore.exe"):
|
||||
key = r"HKCU\Software\Wine\AppDefaults\%s\DllOverrides" % program
|
||||
subprocess.run([proton, "runinprefix", "reg.exe", "add", key,
|
||||
"/v", "dcomp", "/t", "REG_SZ", "/d", "", "/f"], env=env, check=True)
|
||||
print("droiddeck-game-env: Ubisoft Connect uses CEF without DirectComposition", file=sys.stderr)
|
||||
except (OSError, ValueError, subprocess.CalledProcessError) as error:
|
||||
print("droiddeck-game-env: Ubisoft Connect composition configuration failed (%s)" % error, file=sys.stderr)
|
||||
|
||||
|
||||
PZ_JVM_FLAGS = ("-XX:+UseG1GC", "-XX:TieredStopAtLevel=1")
|
||||
|
||||
|
||||
@@ -973,6 +987,8 @@ def wait_forwarding_signals(process):
|
||||
|
||||
|
||||
def start(launch, launch_env, digest, after=None):
|
||||
if len(launch) > 1 and launch[1] == "waitforexitandrun":
|
||||
ubisoft_composition_off(launch[0], launch_env)
|
||||
if after:
|
||||
process = subprocess.Popen(launch, env=launch_env)
|
||||
try:
|
||||
|
||||
@@ -476,15 +476,30 @@ def save_state(compat, state):
|
||||
def pending_for(app_id, pending=PENDING):
|
||||
try:
|
||||
with open(pending, encoding="utf-8") as source:
|
||||
ids = json.load(source).get("games", {}).get(str(app_id), [])
|
||||
config = json.load(source)
|
||||
ids = config.get("games", {}).get(str(app_id), [])
|
||||
revisions = config.get("revisions", {})
|
||||
except (OSError, ValueError, AttributeError):
|
||||
return []
|
||||
return [i for i in ids if valid_id(i)] if isinstance(ids, list) else []
|
||||
return {}
|
||||
revisions = revisions if isinstance(revisions, dict) else {}
|
||||
return {i: max(0, revisions[i]) if type(revisions.get(i)) is int else 0
|
||||
for i in ids if valid_id(i)} if isinstance(ids, list) else {}
|
||||
|
||||
|
||||
def wait_for_pending(app_id, pending=PENDING, store=STORE, timeout=PENDING_WAIT, sleep=time.sleep, clock=time.monotonic):
|
||||
def missing():
|
||||
return [cid for cid in pending_for(app_id, pending) if component(store, cid) is None]
|
||||
left = []
|
||||
for cid, revision in pending_for(app_id, pending).items():
|
||||
try:
|
||||
with open(Path(store) / cid / "component.json", encoding="utf-8") as source:
|
||||
meta = json.load(source)
|
||||
installed = meta.get("revision", 0)
|
||||
ready = type(installed) is int and installed >= revision
|
||||
except (OSError, ValueError, AttributeError):
|
||||
ready = False
|
||||
if not ready:
|
||||
left.append(cid)
|
||||
return left
|
||||
left = missing()
|
||||
if not left:
|
||||
return None
|
||||
|
||||
Reference in new issue
Block a user