mirror of
https://github.com/redstrate/Astra.git
synced 2025-05-13 21:07:46 +00:00
Initialize free trial Steam app id when using a free trial account
This commit is contained in:
parent
ddbd9bb814
commit
a1494dd00d
3 changed files with 7 additions and 3 deletions
|
@ -14,7 +14,7 @@ class SteamAPI : public QObject
|
||||||
public:
|
public:
|
||||||
explicit SteamAPI(QObject *parent = nullptr);
|
explicit SteamAPI(QObject *parent = nullptr);
|
||||||
|
|
||||||
QCoro::Task<> initialize();
|
QCoro::Task<> initialize(bool freeTrial);
|
||||||
QCoro::Task<> shutdown();
|
QCoro::Task<> shutdown();
|
||||||
QCoro::Task<std::pair<QString, int>> getTicket();
|
QCoro::Task<std::pair<QString, int>> getTicket();
|
||||||
|
|
||||||
|
|
|
@ -234,7 +234,7 @@ QCoro::Task<std::optional<SquareEnixLogin::StoredInfo>> SquareEnixLogin::getStor
|
||||||
query.addQueryItem(QStringLiteral("issteam"), QString::number(1));
|
query.addQueryItem(QStringLiteral("issteam"), QString::number(1));
|
||||||
|
|
||||||
// initialize the steam api
|
// initialize the steam api
|
||||||
co_await m_launcher.steamApi()->initialize();
|
co_await m_launcher.steamApi()->initialize(m_info->profile->account()->config()->isFreeTrial());
|
||||||
|
|
||||||
// grab an auth ticket
|
// grab an auth ticket
|
||||||
auto [ticket, ticketSize] = co_await m_launcher.steamApi()->getTicket();
|
auto [ticket, ticketSize] = co_await m_launcher.steamApi()->getTicket();
|
||||||
|
|
|
@ -12,13 +12,17 @@ SteamAPI::SteamAPI(QObject *parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QCoro::Task<> SteamAPI::initialize()
|
QCoro::Task<> SteamAPI::initialize(const bool freeTrial)
|
||||||
{
|
{
|
||||||
|
QUrlQuery query;
|
||||||
|
query.addQueryItem(QStringLiteral("ft"), QString::number(freeTrial ? 1 : 0));
|
||||||
|
|
||||||
QUrl url;
|
QUrl url;
|
||||||
url.setScheme(QStringLiteral("http"));
|
url.setScheme(QStringLiteral("http"));
|
||||||
url.setHost(QStringLiteral("127.0.0.1"));
|
url.setHost(QStringLiteral("127.0.0.1"));
|
||||||
url.setPort(50481);
|
url.setPort(50481);
|
||||||
url.setPath(QStringLiteral("/init"));
|
url.setPath(QStringLiteral("/init"));
|
||||||
|
url.setQuery(query);
|
||||||
|
|
||||||
Q_UNUSED(co_await m_qnam.post(QNetworkRequest(url), QByteArray{}))
|
Q_UNUSED(co_await m_qnam.post(QNetworkRequest(url), QByteArray{}))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue