1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-20 19:57:45 +00:00

Adding fix for connecting to a sapphire server

This commit is contained in:
Toofy 2023-01-14 20:08:40 +00:00 committed by Joshua Goins
parent 3e030587c7
commit 103cc34170

View file

@ -39,10 +39,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; QUrl url(lobbyUrl + "/sapphire-api/lobby/login");
url.setScheme("http");
url.setHost(lobbyUrl);
url.setPath("/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");
@ -59,4 +56,4 @@ void SapphireLauncher::registerAccount(const QString& lobbyUrl, const LoginInfor
window.launchGame(*info.settings, auth); window.launchGame(*info.settings, auth);
}); });
} }