Skip to content

Xbox Cloud Gaming app for PS5 Homebrew

C

Your games: owned games that are also in Game Pass (#10)

Rafael Abud Ferreira1d3e22b5c10a
diff --git a/src/app/library.cpp b/src/app/library.cpp
index 4baf77b..ace6cc0 100644
--- a/src/app/library.cpp
+++ b/src/app/library.cpp
@@ -395,7 +395,9 @@ void Library::loadOwned(xcloud::GssvClient gssv, const Changed& changed, const s
ownedTitles.insert(t.titleId);
if (t.productId.empty()) continue;
ownedProducts.insert(t.productId);
- if (!gamePass_.count(t.productId)) mine.emplace_back(t.productId, t.titleId);
+ // Game Pass games the account owns itself (free-to-play ones
+ // like Fortnite, without the subscription) are its games too.
+ if (!gamePass_.count(t.productId) || !t.viaSubscription) mine.emplace_back(t.productId, t.titleId);
} else if (!t.productId.empty() && !gamePass_.count(t.productId)) {
toBuy[t.productId] = t.titleId;
}
diff --git a/src/xcloud/gssv.cpp b/src/xcloud/gssv.cpp
index ff82dde..5f317ae 100644
--- a/src/xcloud/gssv.cpp
+++ b/src/xcloud/gssv.cpp
@@ -284,6 +284,10 @@ bool GssvClient::listTitles(std::vector<Title>& out, std::string& err, bool rece
title.hasEntitlement = t["details"]["hasEntitlement"].asBool();
title.xboxTitleId = t["details"]["xboxTitleId"].str();
title.isFreeInStore = t["details"]["isFreeInStore"].asBool();
+ // What lets this account play it: a subscription's program
+ // (CALLISTO for Game Pass in the cloud) or F2P; none when bought.
+ for (const auto& program : t["details"]["userPrograms"].items())
+ if (program.str() != "F2P") title.viaSubscription = true;
if (!title.titleId.empty()) out.push_back(std::move(title));
}
continuation = recentOnly ? std::string() : (*j)["continuationToken"].str();
diff --git a/src/xcloud/gssv.h b/src/xcloud/gssv.h
index 12854b2..057582a 100644
--- a/src/xcloud/gssv.h
+++ b/src/xcloud/gssv.h
@@ -38,6 +38,10 @@ struct Title {
bool hasEntitlement = false;
std::string xboxTitleId; // Xbox Live title id (titlehub)
bool isFreeInStore = false;
+ // Playable through a subscription (the title's userPrograms has one
+ // besides F2P, such as CALLISTO for Game Pass). Entitled but not this:
+ // the account's own game, bought or free-to-play.
+ bool viaSubscription = false;
};
enum class SessionState { Unknown, Provisioning, WaitingForResources, ReadyToConnect, Provisioned, Failed };