mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-20 19:57:45 +00:00
Correct placement of String in right method
This commit is contained in:
parent
5dba0afed2
commit
04324554cd
1 changed files with 3 additions and 6 deletions
|
@ -10,10 +10,7 @@ SapphireLauncher::SapphireLauncher(LauncherCore& window) : window(window), QObje
|
||||||
void SapphireLauncher::login(const QString& lobbyUrl, const LoginInformation& info) {
|
void SapphireLauncher::login(const QString& lobbyUrl, const LoginInformation& info) {
|
||||||
QJsonObject data{{"username", info.username}, {"pass", info.password}};
|
QJsonObject data{{"username", info.username}, {"pass", info.password}};
|
||||||
|
|
||||||
QUrl url;
|
QUrl url(lobbyUrl + "/sapphire-api/lobby/login");
|
||||||
url.setScheme("http");
|
|
||||||
url.setHost(lobbyUrl);
|
|
||||||
url.setPath("/sapphire-api/lobby/login");
|
|
||||||
|
|
||||||
QNetworkRequest request(url);
|
QNetworkRequest request(url);
|
||||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
|
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
|
||||||
|
@ -39,7 +36,7 @@ void SapphireLauncher::login(const QString& lobbyUrl, const LoginInformation& in
|
||||||
|
|
||||||
void SapphireLauncher::registerAccount(const QString& lobbyUrl, const LoginInformation& info) {
|
void SapphireLauncher::registerAccount(const QString& lobbyUrl, const LoginInformation& info) {
|
||||||
QJsonObject data{{"username", info.username}, {"pass", info.password}};
|
QJsonObject data{{"username", info.username}, {"pass", info.password}};
|
||||||
QUrl url(lobbyUrl + "/sapphire-api/lobby/login");
|
QUrl url(lobbyUrl + "/sapphire-api/lobby/createAccount");
|
||||||
|
|
||||||
QNetworkRequest request(url);
|
QNetworkRequest request(url);
|
||||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
|
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
|
||||||
|
@ -56,4 +53,4 @@ void SapphireLauncher::registerAccount(const QString& lobbyUrl, const LoginInfor
|
||||||
|
|
||||||
window.launchGame(*info.settings, auth);
|
window.launchGame(*info.settings, auth);
|
||||||
});
|
});
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue