Skip to content

Xbox Cloud Gaming app for PS5 Homebrew

C

feat: implement game achievements and store wishlist (items 6 & 7)

Rafael Abud Ferreira8e42154e88a5
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d4490d8..96e5fb4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,6 +43,7 @@ add_library(xcloud_core STATIC
src/input/keyboard_nav.cpp
src/input/sdl_mapping.cpp
src/xcloud/social.cpp
+ src/xcloud/achievements.cpp
src/platform/posix_common.cpp
src/platform/toasts.cpp
src/input/gyro.cpp
diff --git a/src/app/app_core.cpp b/src/app/app_core.cpp
index 0bfdbff..cc88886 100644
--- a/src/app/app_core.cpp
+++ b/src/app/app_core.cpp
@@ -292,7 +292,7 @@ bool coreStartup() {
g_ui->setPrefs(g_settings.hidden, g_settings.librarySort == "az" ? ui::LibrarySort::AZ
: g_settings.librarySort == "console" ? ui::LibrarySort::Console
: ui::LibrarySort::Recent,
- g_settings.favorites);
+ g_settings.favorites, g_settings.wishlist);
}
g_ui->setCaps(uiCaps());
g_core->canvas.emplace(display::kWidth, display::kHeight);
@@ -642,12 +642,15 @@ bool Core::frame() {
std::lock_guard<std::mutex> lock(g_settingsMutex);
g_settings.hidden = ev.hidden;
g_settings.favorites = ev.favorites;
+ g_settings.wishlist = ev.wishlist;
g_settings.librarySort = ev.librarySort == ui::LibrarySort::AZ ? "az"
: ev.librarySort == ui::LibrarySort::Console ? "console"
: "recent";
g_settings.save(settingsPath()); // warns itself
- XC_LOGI("prefs saved: %zu hidden, %zu favorites, sort %s", g_settings.hidden.size(), g_settings.favorites.size(), g_settings.librarySort.c_str());
+ XC_LOGI("prefs saved: %zu hidden, %zu favorites, %zu wishlist, sort %s", g_settings.hidden.size(),
+ g_settings.favorites.size(), g_settings.wishlist.size(), g_settings.librarySort.c_str());
updateLibraryFavorites(g_settings.favorites);
+ updateLibraryWishlist(g_settings.wishlist);
break;
}
case ui::Action::GameSettingsChanged: {
diff --git a/src/app/app_state.h b/src/app/app_state.h
index d70d0a1..fe5af10 100644
--- a/src/app/app_state.h
+++ b/src/app/app_state.h
@@ -49,6 +49,8 @@ void startWorker();
void skipOfferedUpdate();
// Updates the running library's favorites list and refreshes UI rows.
void updateLibraryFavorites(const std::vector<std::string>& favorites);
+// Updates the running library's wishlist and refreshes UI rows.
+void updateLibraryWishlist(const std::vector<std::string>& wishlist);
// The running stream, for the input thread.
extern std::mutex g_playerMutex;
@@ -82,6 +84,8 @@ void startPriceLoop();
// `ms`, else it is left to the process's exit.
bool stopPriceLoop(uint32_t ms);
void setPriceMarket(const std::string& market, const std::string& language);
+// Auth tokens for title achievements and store features.
+void setPriceAuth(const std::string& xblAuth, const std::string& xuid);
// The signed-in xCloud client (a copy), for the open game page's queue
// estimate; nullptr after signing out.
void setQueueClient(const xcloud::GssvClient* gssv);
diff --git a/src/app/library.cpp b/src/app/library.cpp
index d766786..d9127da 100644
--- a/src/app/library.cpp
+++ b/src/app/library.cpp
@@ -180,6 +180,7 @@ ui::GameTile Library::tile(const std::string& productId, const std::string& titl
}
auto x = xboxTitleOf_.find(productId);
std::string xbox = x != xboxTitleOf_.end() ? x->second : p.xboxTitleId;
+ t.xboxTitleId = xbox;
auto pl = platform_.find(xbox);
if (pl != platform_.end()) t.platform = pl->second;
// Cross-gen pairs ("Call of Duty: Vanguard" and "... - Xbox Series X|S")
@@ -267,6 +268,25 @@ std::vector<ui::GameRow> Library::rows() const {
}
}
+ // Insert "Wishlist" row right after Favorites (or at top) if any are marked
+ if (!wishlist_.empty()) {
+ ui::GameRow wishRow;
+ wishRow.title = ui::tr(ui::Str::Wishlist);
+ wishRow.gamePassBadges = false;
+ wishRow.isGrid = false;
+ for (const auto& pid : wishlist_) {
+ ui::GameTile t = tile(pid);
+ if (!t.productId.empty()) {
+ wishRow.tiles.push_back(std::move(t));
+ }
+ }
+ if (!wishRow.tiles.empty()) {
+ size_t insertIdx = !favorites_.empty() ? 1 : 0;
+ if (insertIdx <= rows.size()) rows.insert(rows.begin() + static_cast<long>(insertIdx), std::move(wishRow));
+ else rows.push_back(std::move(wishRow));
+ }
+ }
+
return rows;
}
diff --git a/src/app/library.h b/src/app/library.h
index d935527..d969e22 100644
--- a/src/app/library.h
+++ b/src/app/library.h
@@ -47,6 +47,8 @@ public:
void setSubscription(std::string sub) { subscription_ = std::move(sub); }
// Games marked as favourite (product IDs)
void setFavorites(std::vector<std::string> favs) { favorites_ = std::move(favs); }
+ // Games marked on the wishlist (product IDs)
+ void setWishlist(std::vector<std::string> wish) { wishlist_ = std::move(wish); }
// Calls `changed` after each row arrives; false only when nothing loaded.
bool load(xcloud::GssvClient& gssv, const std::string& language, const Changed& changed, std::string& err);
@@ -146,6 +148,7 @@ private:
mutable size_t siblingsFor_ = 0;
std::vector<ui::GameTile> friendsTiles_;
std::vector<std::string> favorites_;
+ std::vector<std::string> wishlist_;
};
} // namespace xc::app
diff --git a/src/app/price_loop.cpp b/src/app/price_loop.cpp
index 9360cf7..ef5618d 100644
--- a/src/app/price_loop.cpp
+++ b/src/app/price_loop.cpp
@@ -4,10 +4,12 @@
// <dataDir>/prices.json; the same thread fetches the description of an
// opened game that has none yet.
#include "app/app_state.h"
-#include "platform/platform.h"
+#include "app/settings.h"
+#include "platform/toasts.h"
#include "ui/strings.h"
#include "util/json.h"
#include "util/log.h"
+#include "xcloud/achievements.h"
#include "xcloud/catalog.h"
#include "xcloud/prices.h"
@@ -15,12 +17,15 @@
#include <ctime>
#include <map>
#include <memory>
+#include <set>
namespace xc::app {
namespace {
std::mutex g_priceMutex;
std::string g_priceMarket, g_priceLanguage; // set by setPriceMarket() (empty: not yet)
+std::string g_priceXblAuth, g_priceXuid; // g_priceMutex
+std::set<std::string> g_notifiedSale;
std::unique_ptr<xcloud::GssvClient> g_queueClient; // g_priceMutex
platform::Thread g_priceThread;
std::atomic<bool> g_stopPrices{false};
@@ -65,6 +70,12 @@ void setPriceMarket(const std::string& market, const std::string& language) {
g_priceLanguage = language;
}
+void setPriceAuth(const std::string& xblAuth, const std::string& xuid) {
+ std::lock_guard<std::mutex> lock(g_priceMutex);
+ g_priceXblAuth = xblAuth;
+ g_priceXuid = xuid;
+}
+
void setQueueClient(const xcloud::GssvClient* gssv) {
std::lock_guard<std::mutex> lock(g_priceMutex);
g_queueClient = gssv ? std::make_unique<xcloud::GssvClient>(*gssv) : nullptr;
@@ -123,6 +134,27 @@ void priceLoop() {
XC_LOGI("queue estimate for %s: %d s", title.c_str(), seconds);
g_ui->setQueueTime(title, seconds);
}
+ // The open page's achievements (if it has an xboxTitleId).
+ if (std::string achTitle = g_ui->achievementsWanted(platform::nowMs()); !achTitle.empty()) {
+ std::string xblAuth, xuid, lang;
+ {
+ std::lock_guard<std::mutex> lock(g_priceMutex);
+ xblAuth = g_priceXblAuth;
+ xuid = g_priceXuid;
+ lang = g_priceLanguage;
+ }
+ if (!xblAuth.empty()) {
+ xcloud::TitleAchievements ach;
+ std::string err;
+ if (xcloud::fetchTitleAchievements(xblAuth, xuid, achTitle, ach, err, lang)) {
+ g_ui->setTitleAchievements(achTitle, ach);
+ XC_LOGI("achievements for %s: %d/%d (%d/%d G)", achTitle.c_str(), ach.unlockedCount,
+ ach.totalCount, ach.unlockedGamerscore, ach.totalGamerscore);
+ } else {
+ XC_LOGW("achievements for %s: %s", achTitle.c_str(), err.c_str());
+ }
+ }
+ }
std::vector<std::string> ids = market.empty() ? std::vector<std::string>() : g_ui->pricesWanted(20, true);
if (ids.empty()) {
platform::sleepMs(300);
@@ -152,6 +184,20 @@ void priceLoop() {
v.set("cur", p.currency);
v.set("t", now);
cache.set(id, v);
+ if (p.msrp > p.list + 0.005) {
+ bool isWish = false;
+ {
+ std::lock_guard<std::mutex> lock(g_settingsMutex);
+ isWish = std::find(g_settings.wishlist.begin(), g_settings.wishlist.end(), id) != g_settings.wishlist.end();
+ }
+ if (isWish && !g_notifiedSale.count(id)) {
+ g_notifiedSale.insert(id);
+ std::string name = g_ui->tileName(id);
+ if (!name.empty()) {
+ platform::notify(ui::trf(ui::Str::WishlistOnSale, name));
+ }
+ }
+ }
}
if (!texts.empty()) {
g_ui->setPrices(texts);
diff --git a/src/app/settings.cpp b/src/app/settings.cpp
index 1d6bdb8..2022207 100644
--- a/src/app/settings.cpp
+++ b/src/app/settings.cpp
@@ -59,6 +59,9 @@ bool Settings::load(const std::string& path) {
favorites.clear();
for (const auto& id : (*j)["favorites"].items())
if (!id.str().empty()) favorites.push_back(id.str());
+ wishlist.clear();
+ for (const auto& id : (*j)["wishlist"].items())
+ if (!id.str().empty()) wishlist.push_back(id.str());
librarySort = (*j)["librarySort"].str(librarySort);
streamStats = (*j)["streamStats"].asBool(streamStats);
statsMask = static_cast<uint32_t>((*j)["statsMask"].asInt(static_cast<int64_t>(statsMask)));
@@ -212,6 +215,9 @@ bool Settings::save(const std::string& path) const {
json::Value favIds = json::Value::array();
for (const auto& id : favorites) favIds.push(id);
v.set("favorites", favIds);
+ json::Value wishIds = json::Value::array();
+ for (const auto& id : wishlist) wishIds.push(id);
+ v.set("wishlist", wishIds);
v.set("librarySort", librarySort);
v.set("streamStats", streamStats);
v.set("statsMask", static_cast<int64_t>(statsMask));
diff --git a/src/app/settings.h b/src/app/settings.h
index 1850647..3996274 100644
--- a/src/app/settings.h
+++ b/src/app/settings.h
@@ -59,6 +59,7 @@ struct Settings {
// ("recent", "az", "console").
std::vector<std::string> hidden;
std::vector<std::string> favorites; // Games marked as favourite (product ids)
+ std::vector<std::string> wishlist; // Games marked on the wishlist (product ids)
std::string librarySort = "recent";
// The statistics line over the game (in-game menu).
bool streamStats = false;
diff --git a/src/app/worker.cpp b/src/app/worker.cpp
index 5876317..93a312b 100644
--- a/src/app/worker.cpp
+++ b/src/app/worker.cpp
@@ -140,6 +140,18 @@ void updateLibraryFavorites(const std::vector<std::string>& favorites) {
}
}
+void updateLibraryWishlist(const std::vector<std::string>& wishlist) {
+ std::shared_ptr<app::Library> lib;
+ {
+ std::lock_guard<std::mutex> lock(s_libraryMutex);
+ lib = s_library;
+ }
+ if (lib) {
+ lib->setWishlist(wishlist);
+ g_ui->setRows(lib->rows());
+ }
+}
+
namespace {
// Streams until the player ends or the user leaves; returns a status line.
@@ -395,6 +407,7 @@ std::string stream(xcloud::GssvClient& gssv) {
// `regionName` overrides the settings' region (empty: as set).
// Profile token for titlehub (memory only).
std::string g_xblAuth;
+std::string g_xuid;
// The sign-in renewed when it is about to expire (AuthManager::ensureFresh;
// `force`: a request was refused), before the xCloud calls. What other
@@ -407,7 +420,9 @@ bool keepSignedIn(auth::AuthManager& am, xcloud::GssvClient& gssv, std::string&
{
std::lock_guard<std::mutex> lock(g_argMutex);
g_xblAuth = am.profile().xblAuthorization;
+ g_xuid = am.profile().xuid;
}
+ setPriceAuth(g_xblAuth, g_xuid);
if (!gssv.isHome()) setQueueClient(&gssv);
}
return true;
@@ -724,6 +739,7 @@ void tryInstantCachedBoot(auth::AuthManager& am) {
{
std::lock_guard<std::mutex> lock(g_settingsMutex);
library->setFavorites(g_settings.favorites);
+ library->setWishlist(g_settings.wishlist);
}
if (library->loadCache(true) && !library->rows().empty()) {
{
@@ -855,7 +871,9 @@ void signInAndLoad(auth::AuthManager& am, xcloud::GssvClient& gssv) {
{
std::lock_guard<std::mutex> lock(g_argMutex);
g_xblAuth = am.profile().xblAuthorization;
+ g_xuid = am.profile().xuid;
}
+ setPriceAuth(g_xblAuth, g_xuid);
platform::notify(ui::trf(ui::Str::SignedInAs, am.profile().gamertag), "signed in (notification)");
static bool updateChecked = false;
if (!updateChecked && (g_autoplay.title.empty() || !g_autoplay.updateFeed.empty())) {
@@ -890,6 +908,7 @@ void loadLibrary(auth::AuthManager& am, xcloud::GssvClient& gssv) {
{
std::lock_guard<std::mutex> lock(g_settingsMutex);
library->setFavorites(g_settings.favorites);
+ library->setWishlist(g_settings.wishlist);
}
setPriceMarket(gssv.session().market.empty() ? "US" : gssv.session().market, ui::catalogLanguage());
setQueueClient(&gssv);
@@ -923,6 +942,22 @@ void loadLibrary(auth::AuthManager& am, xcloud::GssvClient& gssv) {
return;
}
std::vector<ui::GameRow> rows = library->rows();
+ {
+ std::set<std::string> wishSet;
+ {
+ std::lock_guard<std::mutex> lock(g_settingsMutex);
+ wishSet.insert(g_settings.wishlist.begin(), g_settings.wishlist.end());
+ }
+ if (!wishSet.empty()) {
+ static std::set<std::string> notifiedGp;
+ for (const auto& tile : library->gamePassSearchPool()) {
+ if (wishSet.count(tile.productId) && !notifiedGp.count(tile.productId)) {
+ notifiedGp.insert(tile.productId);
+ platform::notify(ui::trf(ui::Str::WishlistInGamePass, tile.name));
+ }
+ }
+ }
+ }
// The account's own games, the catalog names for the search, then hero
// art and descriptions keep arriving while the user browses/plays. The
// thread gets its own GssvClient copy.
@@ -1248,7 +1283,9 @@ void worker() {
{
std::lock_guard<std::mutex> lock(g_argMutex);
g_xblAuth.clear();
+ g_xuid.clear();
}
+ setPriceAuth({}, {});
g_ui->setProfile({}, {});
g_ui->setConsoles({}, false);
g_ui->setRows({});
diff --git a/src/ui/app_ui.cpp b/src/ui/app_ui.cpp
index e379160..704923f 100644
--- a/src/ui/app_ui.cpp
+++ b/src/ui/app_ui.cpp
@@ -598,10 +598,11 @@ void AppUi::drawLoadingBar(Canvas& c, int x, int y, int w, uint64_t nowMs) {
animating_ = true;
}
-void AppUi::setPrefs(const std::vector<std::string>& hidden, LibrarySort sort, const std::vector<std::string>& favorites) {
+void AppUi::setPrefs(const std::vector<std::string>& hidden, LibrarySort sort, const std::vector<std::string>& favorites, const std::vector<std::string>& wishlist) {
std::lock_guard<std::mutex> lock(mutex_);
hidden_ = std::set<std::string>(hidden.begin(), hidden.end());
favorites_ = std::set<std::string>(favorites.begin(), favorites.end());
+ wishlist_ = std::set<std::string>(wishlist.begin(), wishlist.end());
librarySort_ = sort;
rebuild();
}
@@ -618,6 +619,7 @@ void AppUi::prefsEvent(UiEvent& ev) const {
ev.action = Action::PrefsChanged;
ev.hidden.assign(hidden_.begin(), hidden_.end());
ev.favorites.assign(favorites_.begin(), favorites_.end());
+ ev.wishlist.assign(wishlist_.begin(), wishlist_.end());
ev.librarySort = librarySort_;
}
@@ -645,6 +647,18 @@ void AppUi::toggleFavorite(const GameTile& tile, UiEvent& ev) {
dirty_ = true;
}
+void AppUi::toggleWishlist(const GameTile& tile, UiEvent& ev) {
+ // Caller holds mutex_.
+ if (tile.productId.empty()) return;
+ bool wish = !wishlist_.count(tile.productId);
+ if (wish) wishlist_.insert(tile.productId);
+ else wishlist_.erase(tile.productId);
+ toast_ = tr(wish ? Str::AddedToWishlist : Str::RemovedFromWishlist);
+ toastUntil_ = 0;
+ prefsEvent(ev);
+ dirty_ = true;
+}
+
void AppUi::setSearchPools(std::vector<GameTile> gamePass, std::vector<GameTile> library) {
std::lock_guard<std::mutex> lock(mutex_);
gamePassPool_ = std::move(gamePass);
@@ -729,6 +743,43 @@ void AppUi::setQueueTime(const std::string& titleId, int seconds) {
if (detail_.titleId == titleId) dirty_ = true;
}
+std::string AppUi::achievementsWanted(uint64_t nowMs) {
+ std::lock_guard<std::mutex> lock(mutex_);
+ if (screen_ != Screen::Details || detail_.xboxTitleId.empty()) return {};
+ if (detail_.xboxTitleId == achievementsAskedFor_ && nowMs - achievementsAskedAt_ < 60000) return {};
+ achievementsAskedFor_ = detail_.xboxTitleId;
+ achievementsAskedAt_ = nowMs;
+ return detail_.xboxTitleId;
+}
+
+void AppUi::setTitleAchievements(const std::string& xboxTitleId, const xcloud::TitleAchievements& ach) {
+ std::lock_guard<std::mutex> lock(mutex_);
+ achievements_[xboxTitleId] = ach;
+ if (detail_.xboxTitleId == xboxTitleId) dirty_ = true;
+}
+
+void AppUi::openAchievements() {
+ std::lock_guard<std::mutex> lock(mutex_);
+ achievementsOpen_ = true;
+ achScroll_ = 0;
+ dirty_ = true;
+}
+
+std::string AppUi::tileName(const std::string& productId) const {
+ std::lock_guard<std::mutex> lock(mutex_);
+ for (const auto& row : rows_) {
+ for (const auto& t : row.tiles) {
+ if (t.productId == productId) return t.name;
+ }
+ }
+ for (const auto* list : {&owned_, &purchasable_, &gamePassPool_, &libraryPool_}) {
+ for (const auto& t : *list) {
+ if (t.productId == productId) return t.name;
+ }
+ }
+ return {};
+}
+
void AppUi::setDetailInfo(const std::string& productId, const std::string& description, const std::string& publisher,
const std::vector<std::string>& categories, const std::string& heroUrl) {
std::lock_guard<std::mutex> lock(mutex_);
@@ -2700,6 +2751,25 @@ UiEvent AppUi::handle(const NavInput& in) {
}
break;
case Screen::Details:
+ if (achievementsOpen_) {
+ if (in.up && achScroll_ > 0) {
+ achScroll_--;
+ dirty_ = true;
+ }
+ int maxScroll = 0;
+ if (auto it = achievements_.find(detail_.xboxTitleId); it != achievements_.end()) {
+ maxScroll = std::max(0, static_cast<int>(it->second.items.size()) - 5);
+ }
+ if (in.down && achScroll_ < maxScroll) {
+ achScroll_++;
+ dirty_ = true;
+ }
+ if (in.back || in.l3) {
+ achievementsOpen_ = false;
+ dirty_ = true;
+ }
+ break;
+ }
if (gameSettingsOpen_) {
handleGameSettings(in, ev);
break;
@@ -2721,6 +2791,8 @@ UiEvent AppUi::handle(const NavInput& in) {
}
if (in.square) toggleHidden(detail_, ev); // the page stays open
if (in.triangle) toggleFavorite(detail_, ev);
+ if (in.r3) toggleWishlist(detail_, ev);
+ if (in.l3 && !detail_.xboxTitleId.empty()) openAchievements();
if (in.back) {
screen_ = Screen::Home;
dirty_ = true;
@@ -3853,17 +3925,15 @@ void AppUi::drawDetails(Canvas& c, uint64_t nowMs) {
fonts_.semibold.draw(c, scan, box.x + (box.w - w) / 2, box.y + box.h + 22, 26, kWhite);
}
}
- if (g->freeInStore)
- drawHints(c, {{kIconCross, tr(Str::ClaimFree)},
- {kIconOptions, tr(Str::GameSettings)},
- {kIconTriangle, tr(favorites_.count(g->productId) ? Str::RemoveFavorite : Str::AddFavorite)},
- {kIconSquare, tr(hidden_.count(g->productId) ? Str::Unhide : Str::Hide)},
- {kIconCircle, tr(Str::Back)}});
- else
- drawHints(c, {{kIconOptions, tr(Str::GameSettings)},
- {kIconTriangle, tr(favorites_.count(g->productId) ? Str::RemoveFavorite : Str::AddFavorite)},
- {kIconSquare, tr(hidden_.count(g->productId) ? Str::Unhide : Str::Hide)},
- {kIconCircle, tr(Str::Back)}});
+ std::vector<Hint> hints;
+ if (g->freeInStore) hints.push_back({kIconCross, tr(Str::ClaimFree)});
+ hints.push_back({kIconOptions, tr(Str::GameSettings)});
+ hints.push_back({kIconTriangle, tr(favorites_.count(g->productId) ? Str::RemoveFavorite : Str::AddFavorite)});
+ hints.push_back({kIconSquare, tr(hidden_.count(g->productId) ? Str::Unhide : Str::Hide)});
+ hints.push_back({kIconR3, tr(wishlist_.count(g->productId) ? Str::RemoveWishlist : Str::AddWishlist)});
+ if (!g->xboxTitleId.empty()) hints.push_back({kIconL3, tr(Str::Achievements)});
+ hints.push_back({kIconCircle, tr(Str::Back)});
+ drawHints(c, hints);
drawToast(c, nowMs);
return;
}
@@ -3875,10 +3945,15 @@ void AppUi::drawDetails(Canvas& c, uint64_t nowMs) {
c.fillRect(note, rgba(255, 255, 255, 40), 38);
drawLock(c, note.x + 52, note.y + note.h / 2);
fonts_.semibold.draw(c, msg, note.x + 90, note.y + 22, 28, kGray);
- drawHints(c, {{kIconOptions, tr(Str::GameSettings)},
- {kIconTriangle, tr(favorites_.count(g->productId) ? Str::RemoveFavorite : Str::AddFavorite)},
- {kIconSquare, tr(hidden_.count(g->productId) ? Str::Unhide : Str::Hide)},
- {kIconCircle, tr(Str::Back)}});
+ std::vector<Hint> hints = {
+ {kIconOptions, tr(Str::GameSettings)},
+ {kIconTriangle, tr(favorites_.count(g->productId) ? Str::RemoveFavorite : Str::AddFavorite)},
+ {kIconSquare, tr(hidden_.count(g->productId) ? Str::Unhide : Str::Hide)},
+ {kIconR3, tr(wishlist_.count(g->productId) ? Str::RemoveWishlist : Str::AddWishlist)}
+ };
+ if (!g->xboxTitleId.empty()) hints.push_back({kIconL3, tr(Str::Achievements)});
+ hints.push_back({kIconCircle, tr(Str::Back)});
+ drawHints(c, hints);
drawToast(c, nowMs);
return;
}
@@ -3917,12 +3992,31 @@ void AppUi::drawDetails(Canvas& c, uint64_t nowMs) {
Rect pill{nextBadgeX, play.y + 14, w + 44, 48};
c.fillRect(pill, rgba(0, 0, 0, 150), 24);
fonts_.semibold.draw(c, playedText, pill.x + 22, pill.y + 12, 24, kWhite);
+ nextBadgeX += pill.w + 16;
}
- drawHints(c, {{kIconCross, tr(Str::Play)},
- {kIconOptions, tr(Str::GameSettings)},
- {kIconTriangle, tr(favorites_.count(g->productId) ? Str::RemoveFavorite : Str::AddFavorite)},
- {kIconSquare, tr(hidden_.count(g->productId) ? Str::Unhide : Str::Hide)},
- {kIconCircle, tr(Str::Back)}});
+ if (!g->xboxTitleId.empty()) {
+ auto it = achievements_.find(g->xboxTitleId);
+ if (it != achievements_.end() && it->second.totalCount > 0) {
+ const auto& ach = it->second;
+ std::string achText = "🏆 " + std::to_string(ach.unlockedCount) + "/" + std::to_string(ach.totalCount) +
+ " (" + std::to_string(ach.unlockedGamerscore) + "/" + std::to_string(ach.totalGamerscore) + " G)";
+ int w = fonts_.semibold.measure(achText, 24);
+ Rect pill{nextBadgeX, play.y + 14, w + 44, 48};
+ c.fillRect(pill, rgba(0, 0, 0, 150), 24);
+ fonts_.semibold.draw(c, achText, pill.x + 22, pill.y + 12, 24, kWhite);
+ nextBadgeX += pill.w + 16;
+ }
+ }
+ std::vector<Hint> hints = {
+ {kIconCross, tr(Str::Play)},
+ {kIconOptions, tr(Str::GameSettings)},
+ {kIconTriangle, tr(favorites_.count(g->productId) ? Str::RemoveFavorite : Str::AddFavorite)},
+ {kIconSquare, tr(hidden_.count(g->productId) ? Str::Unhide : Str::Hide)},
+ {kIconR3, tr(wishlist_.count(g->productId) ? Str::RemoveWishlist : Str::AddWishlist)}
+ };
+ if (!g->xboxTitleId.empty()) hints.push_back({kIconL3, tr(Str::Achievements)});
+ hints.push_back({kIconCircle, tr(Str::Back)});
+ drawHints(c, hints);
drawToast(c, nowMs);
}
@@ -4488,6 +4582,105 @@ void AppUi::drawNetworkTest(Canvas& c, uint64_t nowMs) {
drawHints(c, {{kIconCross, tr(Str::TryAgain)}, {kIconCircle, tr(Str::Back)}});
}
+void AppUi::drawAchievementsModal(Canvas& c, uint64_t nowMs) {
+ Rect panel = drawModal(c, 1180, 720, tr(Str::Achievements));
+
+ auto it = achievements_.find(detail_.xboxTitleId);
+ if (it == achievements_.end()) {
+ drawSpinner(c, static_cast<float>(panel.x + panel.w / 2), static_cast<float>(panel.y + panel.h / 2), 24.0f, nowMs);
+ animating_ = true;
+ c.fillRect({0, kH - 80, kW, 80}, kBg);
+ drawHints(c, {{kIconCircle, tr(Str::Back)}});
+ return;
+ }
+
+ const auto& ach = it->second;
+ if (ach.totalCount == 0) {
+ std::string emptyStr = tr(Str::NoAchievements);
+ int tw = fonts_.regular.measure(emptyStr, 28);
+ fonts_.regular.draw(c, emptyStr, panel.x + (panel.w - tw) / 2, panel.y + panel.h / 2, 28, kDim);
+ c.fillRect({0, kH - 80, kW, 80}, kBg);
+ drawHints(c, {{kIconCircle, tr(Str::Back)}});
+ return;
+ }
+
+ std::string summary = std::to_string(ach.unlockedCount) + " / " + std::to_string(ach.totalCount) +
+ " (" + std::to_string(ach.unlockedGamerscore) + " / " + std::to_string(ach.totalGamerscore) + " G)";
+ int sw = fonts_.semibold.measure(summary, 24);
+ fonts_.semibold.draw(c, summary, panel.x + panel.w - 56 - sw, panel.y + 56, 24, kWhite);
+
+ int barX = panel.x + 56;
+ int barY = panel.y + 104;
+ int barW = panel.w - 112;
+ int barH = 10;
+ c.fillRect({barX, barY, barW, barH}, rgba(255, 255, 255, 30), 5);
+ if (ach.totalCount > 0 && ach.unlockedCount > 0) {
+ int fillW = std::clamp(static_cast<int>(barW * static_cast<float>(ach.unlockedCount) / ach.totalCount), 10, barW);
+ c.fillRect({barX, barY, fillW, barH}, kGreen, 5);
+ }
+
+ constexpr int kRowH = 80;
+ constexpr int kGap = 8;
+ constexpr int kVisibleCount = 5;
+ int y = barY + 22;
+
+ int total = static_cast<int>(ach.items.size());
+ int startIdx = std::clamp(achScroll_, 0, std::max(0, total - kVisibleCount));
+
+ for (int i = startIdx; i < total && i < startIdx + kVisibleCount; ++i) {
+ const auto& item = ach.items[i];
+ Rect r{panel.x + 56, y, panel.w - 112, kRowH};
+ c.fillRect(r, rgba(255, 255, 255, 14), 14);
+
+ float cx = static_cast<float>(r.x + 36), cy = static_cast<float>(r.y + r.h / 2);
+ if (item.unlocked) {
+ c.fillCircle(cx, cy, 18.0f, kGreen);
+ c.line(cx - 7, cy, cx - 2, cy + 6, 3.0f, kWhite);
+ c.line(cx - 2, cy + 6, cx + 9, cy - 6, 3.0f, kWhite);
+ } else {
+ c.fillCircle(cx, cy, 18.0f, rgba(255, 255, 255, 20));
+ c.strokeCircle(cx, cy - 3.0f, 4.0f, 2.0f, kDim);
+ c.fillRect({static_cast<int>(cx) - 6, static_cast<int>(cy) - 2, 12, 10}, kDim, 2);
+ }
+
+ int textX = r.x + 72;
+ int maxTextW = r.w - 200;
+ if (item.unlocked) {
+ fonts_.semibold.draw(c, item.name, textX, r.y + 14, 24, kWhite);
+ std::string desc = fonts_.regular.fit(item.description, 20, maxTextW);
+ fonts_.regular.draw(c, desc, textX, r.y + 44, 20, kGray);
+ } else if (item.isSecret) {
+ fonts_.semibold.draw(c, tr(Str::SecretAchievement), textX, r.y + 14, 24, kDim);
+ fonts_.regular.draw(c, tr(Str::AchievementLocked), textX, r.y + 44, 20, rgba(255, 255, 255, 90));
+ } else {
+ fonts_.semibold.draw(c, item.name, textX, r.y + 14, 24, rgba(230, 230, 230));
+ std::string desc = item.lockedDescription.empty() ? item.description : item.lockedDescription;
+ desc = fonts_.regular.fit(desc, 20, maxTextW);
+ fonts_.regular.draw(c, desc, textX, r.y + 44, 20, kDim);
+ }
+
+ std::string score = std::to_string(item.gamerscore) + " G";
+ int scw = fonts_.semibold.measure(score, 22);
+ Color scCol = item.unlocked ? rgba(110, 225, 120) : kDim;
+ fonts_.semibold.draw(c, score, r.x + r.w - 28 - scw, fonts_.semibold.centeredY(r.y, r.h, 22), 22, scCol);
+
+ y += kRowH + kGap;
+ }
+
+ if (total > kVisibleCount) {
+ int trackH = kVisibleCount * (kRowH + kGap) - kGap;
+ int trackY = barY + 22;
+ int trackX = panel.x + panel.w - 40;
+ c.fillRect({trackX, trackY, 4, trackH}, rgba(255, 255, 255, 20), 2);
+ int thumbH = std::max(20, trackH * kVisibleCount / total);
+ int thumbY = trackY + (trackH - thumbH) * startIdx / (total - kVisibleCount);
+ c.fillRect({trackX, thumbY, 4, thumbH}, rgba(255, 255, 255, 120), 2);
+ }
+
+ c.fillRect({0, kH - 80, kW, 80}, kBg);
+ drawHints(c, {{kIconCircle, tr(Str::Back)}});
+}
+
void AppUi::drawKeysTester(Canvas& c) {
Rect panel = drawModal(c, 1500, 860, tr(Str::KeyboardKeys));
// Each input: its name (the PlayStation button, the Xbox one beside),
@@ -4865,6 +5058,7 @@ void AppUi::render(Canvas& c, uint64_t nowMs) {
case Screen::Details:
drawDetails(c, nowMs);
if (gameSettingsOpen_) drawGameSettings(c);
+ if (achievementsOpen_) drawAchievementsModal(c, nowMs);
break;
case Screen::Launching: drawLaunching(c, nowMs); break;
case Screen::Error: drawError(c); break;
diff --git a/src/ui/app_ui.h b/src/ui/app_ui.h
index 3e95966..3aee4b7 100644
--- a/src/ui/app_ui.h
+++ b/src/ui/app_ui.h
@@ -13,6 +13,7 @@
#include "ui/font.h"
#include "ui/image_cache.h"
#include "ui/pad_icons.h"
+#include "xcloud/achievements.h"
#include <cstdint>
#include <map>
@@ -50,6 +51,7 @@ struct GameTile {
// Console it was made for: "360", "ONE", "XS" (xcloud/titlehub.h); empty
// while unknown.
std::string platform;
+ std::string xboxTitleId;
// Not a game: the user's own Xbox (Remote Play); titleId is its serverId.
bool homeConsole = false;
// Once the store's full details are in (`detailed`): how it can be
@@ -254,6 +256,7 @@ struct UiEvent {
// PrefsChanged: hidden games (product ids), favorites, and the "Your games" order.
std::vector<std::string> hidden;
std::vector<std::string> favorites;
+ std::vector<std::string> wishlist;
LibrarySort librarySort = LibrarySort::Recent;
std::string reportWhat; // Report: the error on screen (empty from Settings)
std::string url; // OpenUrl
@@ -308,8 +311,13 @@ public:
void setPlaytime(int64_t remainingSeconds, int64_t maxSeconds);
// Store prices, formatted: productId -> {now, regular (empty unless on sale)}.
void setPrices(const std::map<std::string, PriceInfo>& prices);
- // Saved preferences: hidden games, the "Your games" order, and favorites.
- void setPrefs(const std::vector<std::string>& hidden, LibrarySort sort, const std::vector<std::string>& favorites = {});
+ // Saved preferences: hidden games, the "Your games" order, favorites, and wishlist.
+ void setPrefs(const std::vector<std::string>& hidden, LibrarySort sort, const std::vector<std::string>& favorites = {}, const std::vector<std::string>& wishlist = {});
+ // Asks for achievements of the open details page game; empty if not wanted
+ std::string achievementsWanted(uint64_t nowMs);
+ void setTitleAchievements(const std::string& xboxTitleId, const xcloud::TitleAchievements& ach);
+ std::string tileName(const std::string& productId) const;
+ void toggleWishlist(const GameTile& tile, UiEvent& ev);
// Games to buy on screen (or about to be) whose price hasn't been asked
// for yet; with `background`, any other game to buy once those are done
// (never while streaming). Marks them asked.
@@ -456,7 +464,8 @@ private:
void drawTopBar(Canvas& c);
void drawLogo(Canvas& c, float cx, float cy, float r);
void drawGamerscoreBadge(Canvas& c, float cx, float cy, float r);
- void drawHints(Canvas& c, const std::vector<std::pair<int, const char*>>& hints);
+ using Hint = std::pair<int, const char*>;
+ void drawHints(Canvas& c, const std::vector<Hint>& hints);
void drawSpinner(Canvas& c, float cx, float cy, float r, uint64_t nowMs);
void drawToast(Canvas& c, uint64_t nowMs);
void drawPads(Canvas& c);
@@ -543,6 +552,8 @@ private:
void drawPadTester(Canvas& c);
void drawSignInCheck(Canvas& c, uint64_t nowMs);
void drawNetworkTest(Canvas& c, uint64_t nowMs);
+ void openAchievements();
+ void drawAchievementsModal(Canvas& c, uint64_t nowMs);
// A modal panel over Settings with its title; returns its rectangle.
Rect drawModal(Canvas& c, int w, int h, const std::string& title);
void drawUpdating(Canvas& c, uint64_t nowMs);
@@ -698,6 +709,12 @@ private:
bool activeGameHasCustom_ = false;
void handleGameSettings(const NavInput& in, UiEvent& ev);
void drawGameSettings(Canvas& c);
+ std::set<std::string> wishlist_;
+ std::map<std::string, xcloud::TitleAchievements> achievements_;
+ std::string achievementsAskedFor_;
+ uint64_t achievementsAskedAt_ = 0;
+ bool achievementsOpen_ = false;
+ int achScroll_ = 0;
};
} // namespace xc::ui
diff --git a/src/ui/strings.cpp b/src/ui/strings.cpp
index fcd772b..7619237 100644
--- a/src/ui/strings.cpp
+++ b/src/ui/strings.cpp
@@ -355,6 +355,17 @@ constexpr Column kEnglish = {
"Run check", // RunCheck
"Network test", // NetworkTest
"Run test", // RunTest
+ "Achievements", // Achievements
+ "No achievements", // NoAchievements
+ "Locked", // AchievementLocked
+ "Secret achievement", // SecretAchievement
+ "Wishlist", // Wishlist
+ "Add to wishlist", // AddWishlist
+ "Remove from wishlist", // RemoveWishlist
+ "Added to wishlist", // AddedToWishlist
+ "Removed from wishlist", // RemovedFromWishlist
+ "%s is on sale!", // WishlistOnSale
+ "%s joined Game Pass!", // WishlistInGamePass
};
constexpr Column kPortugueseBR = {
@@ -680,6 +691,17 @@ constexpr Column kPortugueseBR = {
"Verificar", // RunCheck
"Teste de rede", // NetworkTest
"Testar", // RunTest
+ "Conquistas", // Achievements
+ "Nenhuma conquista", // NoAchievements
+ "Bloqueada", // AchievementLocked
+ "Conquista secreta", // SecretAchievement
+ "Lista de desejos", // Wishlist
+ "Adicionar à lista de desejos", // AddWishlist
+ "Remover da lista de desejos", // RemoveWishlist
+ "Adicionado à lista de desejos", // AddedToWishlist
+ "Removido da lista de desejos", // RemovedFromWishlist
+ "%s está em promoção!", // WishlistOnSale
+ "%s entrou no Game Pass!", // WishlistInGamePass
};
constexpr Column kSpanish = {
@@ -1005,6 +1027,17 @@ constexpr Column kSpanish = {
"Comprobar", // RunCheck
"Prueba de red", // NetworkTest
"Probar", // RunTest
+ "Logros", // Achievements
+ "Sin logros", // NoAchievements
+ "Bloqueado", // AchievementLocked
+ "Logro secreto", // SecretAchievement
+ "Lista de deseos", // Wishlist
+ "Añadir a lista de deseos", // AddWishlist
+ "Quitar de lista de deseos", // RemoveWishlist
+ "Añadido a lista de deseos", // AddedToWishlist
+ "Quitado de lista de deseos", // RemovedFromWishlist
+ "¡%s está en oferta!", // WishlistOnSale
+ "¡%s llegó a Game Pass!", // WishlistInGamePass
};
constexpr Column kFrench = {
@@ -1330,6 +1363,17 @@ constexpr Column kFrench = {
"Vérifier", // RunCheck
"Test réseau", // NetworkTest
"Tester", // RunTest
+ "Succès", // Achievements
+ "Aucun succès", // NoAchievements
+ "Verrouillé", // AchievementLocked
+ "Succès secret", // SecretAchievement
+ "Liste d'envies", // Wishlist
+ "Ajouter aux envies", // AddWishlist
+ "Retirer des envies", // RemoveWishlist
+ "Ajouté aux envies", // AddedToWishlist
+ "Retiré des envies", // RemovedFromWishlist
+ "%s est en promotion !", // WishlistOnSale
+ "%s a rejoint le Game Pass !", // WishlistInGamePass
};
constexpr Column kGerman = {
@@ -1655,6 +1699,17 @@ constexpr Column kGerman = {
"Prüfen", // RunCheck
"Netzwerktest", // NetworkTest
"Testen", // RunTest
+ "Erfolge", // Achievements
+ "Keine Erfolge", // NoAchievements
+ "Gesperrt", // AchievementLocked
+ "Geheimer Erfolg", // SecretAchievement
+ "Wunschliste", // Wishlist
+ "Zur Wunschliste hinzufügen", // AddWishlist
+ "Von Wunschliste entfernen", // RemoveWishlist
+ "Zur Wunschliste hinzugefügt", // AddedToWishlist
+ "Von Wunschliste entfernt", // RemovedFromWishlist
+ "%s ist im Angebot!", // WishlistOnSale
+ "%s ist jetzt im Game Pass!", // WishlistInGamePass
};
constexpr Column kItalian = {
@@ -1980,6 +2035,17 @@ constexpr Column kItalian = {
"Verifica", // RunCheck
"Test di rete", // NetworkTest
"Testa", // RunTest
+ "Obiettivi", // Achievements
+ "Nessun obiettivo", // NoAchievements
+ "Bloccato", // AchievementLocked
+ "Obiettivo segreto", // SecretAchievement
+ "Lista dei desideri", // Wishlist
+ "Aggiungi ai desideri", // AddWishlist
+ "Rimuovi dai desideri", // RemoveWishlist
+ "Aggiunto ai desideri", // AddedToWishlist
+ "Rimosso dai desideri", // RemovedFromWishlist
+ "%s è in saldo!", // WishlistOnSale
+ "%s è arrivato su Game Pass!", // WishlistInGamePass
};
constexpr std::array<const Column*, kLangs> kTable = {&kEnglish, &kPortugueseBR, &kSpanish,
diff --git a/src/ui/strings.h b/src/ui/strings.h
index 7eda8cc..a1f691a 100644
--- a/src/ui/strings.h
+++ b/src/ui/strings.h
@@ -332,6 +332,17 @@ enum class Str {
RunCheck, // settings option: "Run check"
NetworkTest, // settings: "Network test"
RunTest, // settings option: "Run test"
+ Achievements, // "Achievements"
+ NoAchievements, // "No achievements"
+ AchievementLocked, // "Locked"
+ SecretAchievement, // "Secret achievement"
+ Wishlist, // "Wishlist"
+ AddWishlist, // "Add to wishlist"
+ RemoveWishlist, // "Remove from wishlist"
+ AddedToWishlist, // "Added to wishlist"
+ RemovedFromWishlist,// "Removed from wishlist"
+ WishlistOnSale, // "%s is on sale!"
+ WishlistInGamePass, // "%s joined Game Pass!"
Count
};
diff --git a/src/xcloud/achievements.cpp b/src/xcloud/achievements.cpp
new file mode 100644
index 0000000..0301861
--- /dev/null
+++ b/src/xcloud/achievements.cpp
@@ -0,0 +1,89 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+// Copyright (C) 2026 RafaelNGP
+#include "xcloud/achievements.h"
+
+#include "net/http.h"
+#include "util/json.h"
+#include "util/log.h"
+
+namespace xc::xcloud {
+
+bool fetchTitleAchievements(const std::string& xblAuth, const std::string& xuid,
+ const std::string& xboxTitleId, TitleAchievements& out,
+ std::string& err, const std::string& language) {
+ if (xblAuth.empty()) {
+ err = "xblAuth empty";
+ return false;
+ }
+ if (xboxTitleId.empty()) {
+ err = "xboxTitleId empty";
+ return false;
+ }
+
+ net::Request req;
+ req.method = "GET";
+ if (!xuid.empty()) {
+ req.url = "https://achievements.xboxlive.com/users/xuid(" + xuid + ")/achievements?titleId=" + xboxTitleId + "&maxItems=100";
+ } else {
+ req.url = "https://achievements.xboxlive.com/users/me/achievements?titleId=" + xboxTitleId + "&maxItems=100";
+ }
+ req.headers = {
+ {"Authorization", xblAuth},
+ {"x-xbl-contract-version", "2"},
+ {"Accept-Language", language.empty() ? "en-US" : language}
+ };
+
+ auto r = net::perform(req);
+ auto j = json::parse(r.body);
+ if (!r.ok() || !j) {
+ err = "achievements: " + (r.status ? "HTTP " + std::to_string(r.status) : r.error);
+ XC_LOGW("%s", err.c_str());
+ return false;
+ }
+
+ out = TitleAchievements{};
+ for (const auto& a : (*j)["achievements"].items()) {
+ Achievement ach;
+ ach.id = a["id"].str();
+ ach.name = a["name"].str();
+ ach.description = a["description"].str();
+ ach.lockedDescription = a["lockedDescription"].str();
+ ach.isSecret = a["isSecret"].asBool();
+
+ std::string progressState = a["progressState"].str();
+ ach.unlocked = (progressState == "Achieved");
+
+ auto prog = a["progression"];
+ if (prog.isObject()) {
+ ach.timeUnlocked = prog["timeUnlocked"].str();
+ }
+
+ for (const auto& rw : a["rewards"].items()) {
+ std::string type = rw["type"].str();
+ std::string name = rw["name"].str();
+ if (type == "Gamerscore" || name == "Gamerscore") {
+ if (rw["value"].isNumber()) {
+ ach.gamerscore = rw["value"].asInt();
+ } else if (rw["value"].isString()) {
+ try {
+ ach.gamerscore = std::stoi(rw["value"].str());
+ } catch (...) {
+ ach.gamerscore = 0;
+ }
+ }
+ }
+ }
+
+ out.totalCount++;
+ out.totalGamerscore += ach.gamerscore;
+ if (ach.unlocked) {
+ out.unlockedCount++;
+ out.unlockedGamerscore += ach.gamerscore;
+ }
+ out.items.push_back(std::move(ach));
+ }
+
+ return true;
+}
+
+} // namespace xc::xcloud
diff --git a/src/xcloud/achievements.h b/src/xcloud/achievements.h
new file mode 100644
index 0000000..e8378bb
--- /dev/null
+++ b/src/xcloud/achievements.h
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+// Copyright (C) 2026 RafaelNGP
+// Xbox Live Achievements service.
+#pragma once
+
+#include <string>
+#include <vector>
+
+namespace xc::xcloud {
+
+struct Achievement {
+ std::string id;
+ std::string name;
+ std::string description;
+ std::string lockedDescription;
+ int gamerscore = 0;
+ bool unlocked = false;
+ bool isSecret = false;
+ std::string timeUnlocked;
+};
+
+struct TitleAchievements {
+ int unlockedCount = 0;
+ int totalCount = 0;
+ int unlockedGamerscore = 0;
+ int totalGamerscore = 0;
+ std::vector<Achievement> items;
+};
+
+// Fetches achievements for a title from achievements.xboxlive.com.
+// `xblAuth`: "XBL3.0 x=...;token" for http://xboxlive.com.
+// `xuid`: user's XUID.
+// `xboxTitleId`: decimal string Xbox Title ID.
+// `language`: language tag (e.g. "pt-BR", "en-US").
+bool fetchTitleAchievements(const std::string& xblAuth, const std::string& xuid,
+ const std::string& xboxTitleId, TitleAchievements& out,
+ std::string& err, const std::string& language = "en-US");
+
+} // namespace xc::xcloud
diff --git a/tests/test_main.cpp b/tests/test_main.cpp
index e48403e..0fd327d 100644
--- a/tests/test_main.cpp
+++ b/tests/test_main.cpp
@@ -46,6 +46,7 @@
#include "xcloud/prices.h"
#include "xcloud/purchase.h"
#include "xcloud/regions.h"
+#include "xcloud/achievements.h"
#include <algorithm>
#include <atomic>
@@ -2544,7 +2545,41 @@ static void testPurchase() {
net::setTestTransport({});
}
+static void testWishlist() {
+ using namespace xc::app;
+ std::string tmp = "/tmp/xcloud-tests-wishlist.json";
+ Settings s;
+ s.wishlist = {"PROD_A", "PROD_B"};
+ CHECK(s.save(tmp));
+
+ Settings loaded;
+ CHECK(loaded.load(tmp));
+ CHECK(loaded.wishlist.size() == 2);
+ if (loaded.wishlist.size() == 2) {
+ CHECK(loaded.wishlist[0] == "PROD_A");
+ CHECK(loaded.wishlist[1] == "PROD_B");
+ }
+ ::unlink(tmp.c_str());
+
+ Library lib;
+ lib.setWishlist({"PROD_WISH"});
+ auto rows = lib.rows();
+ (void)rows;
+}
+
+static void testAchievements() {
+ using namespace xc::xcloud;
+ TitleAchievements ach;
+ std::string err;
+ CHECK(!fetchTitleAchievements("", "123", "TITLE1", ach, err));
+ CHECK(err == "xblAuth empty");
+ CHECK(!fetchTitleAchievements("XBL3.0 x=1;tok", "123", "", ach, err));
+ CHECK(err == "xboxTitleId empty");
+}
+
int main() {
+ testWishlist();
+ testAchievements();
testPurchase();
testNullBackends();
testPadGlyphs();