mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-06 13:05:47 +00:00
Original Xbox games sold for PC through the Xbox store (Xbox360BackwardCompatibil.* packages: Fuzion Frenzy, BLiNX, Conker, Crimson Skies, Grabbed by the Ghoulies, Morrowind, Red Faction II, ...) now start and play on DroidDeck-Bionic. - droiddeck-xbox: keep the GameInput redistributable, remove its service class; run install actions with FEX's safe settings; find MicrosoftGame.config in any case and skip one that does not parse. - droiddeck-game-env: fix rule for these games turns on the emulator fixes in the Wine, FEX and VKD3D-Proton builds made for them. - Components: each installed game gets the Xbox FEX, VKD3D-Proton and DXVK builds, never over a player's choice (also not one made during the download). - Xbox store: these games show the size of their console package. - DroidDeck-Bionic launch.sh keeps the Wine and VKD3D-Proton switches; bionic pack uses the v18 layer with the fixes (released as DroidDeck-Bionic 14.1 r104). - Xbox backend: purchases that name a legacy marketplace offer reach the library.
46 lines
2.5 KiB
Diff
46 lines
2.5 KiB
Diff
diff --git a/crates/xodus-cli/src/commands/library.rs b/crates/xodus-cli/src/commands/library.rs
|
|
index 36191bf..43bf718 100644
|
|
--- a/crates/xodus-cli/src/commands/library.rs
|
|
+++ b/crates/xodus-cli/src/commands/library.rs
|
|
@@ -11,6 +11,10 @@ fn product_id(id: &str) -> bool {
|
|
.all(|b| b.is_ascii_uppercase() || b.is_ascii_digit())
|
|
}
|
|
|
|
+fn legacy_offer(id: &str) -> bool {
|
|
+ id.len() == 36 && uuid::Uuid::try_parse(id).is_ok()
|
|
+}
|
|
+
|
|
fn entry(id: &str, item: &Value) -> Result<Value, &'static str> {
|
|
if !product_id(id) || !item.is_object() { return Err("entitlement-product"); }
|
|
let status = item["status"].as_str().filter(|s|s.len()<40).ok_or("entitlement-status")?;
|
|
@@ -21,6 +25,9 @@ fn entry(id: &str, item: &Value) -> Result<Value, &'static str> {
|
|
let parent = match item.get("satisfiedByProductId") {
|
|
None | Some(Value::Null) => None,
|
|
Some(Value::String(id)) if product_id(id) => Some(id.as_str()),
|
|
+ // An original Xbox or Xbox 360 purchase names its marketplace offer, a GUID: not a Store product, so not a
|
|
+ // subscription plan either. The row stands on its own status, trial, sharing and expiry checks.
|
|
+ Some(Value::String(id)) if legacy_offer(id) => None,
|
|
_ => return Err("entitlement-parent"),
|
|
};
|
|
// Preserve typed Positron provenance for conditional library access.
|
|
@@ -271,6 +278,19 @@ mod tests {
|
|
json!({"status":"Active","isTrial":false,"sharingSource":"None","endDate":"2099-01-01T00:00:00Z"})
|
|
}
|
|
|
|
+ #[test]
|
|
+ fn a_purchase_naming_its_legacy_marketplace_offer_is_owned_on_its_own_checks() {
|
|
+ let mut raw = valid(); raw["satisfiedByProductId"] = json!("66acd000-77fe-1000-9115-d80258410896");
|
|
+ assert!(entry(A, &raw).unwrap()["satisfiedByProductId"].is_null());
|
|
+ raw["isTrial"] = json!(true);
|
|
+ assert_eq!(entry(A, &raw).unwrap()["isTrial"], json!(true));
|
|
+ for parent in ["{66acd000-77fe-1000-9115-d80258410896}", "66acd00077fe10009115d80258410896",
|
|
+ "urn:uuid:66acd000-77fe-1000-9115-d80258410896", "9aaaaaaaaaaa", ""] {
|
|
+ let mut raw = valid(); raw["satisfiedByProductId"] = json!(parent);
|
|
+ assert_eq!(entry(A, &raw), Err("entitlement-parent"), "{parent}");
|
|
+ }
|
|
+ }
|
|
+
|
|
#[test]
|
|
fn positron_provenance_is_explicit_boolean_and_never_copied_from_untrusted_fields() {
|
|
for flag in [None, Some(json!(false)), Some(json!(true)), Some(Value::Null),
|