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

Better error messages

Spent way too long thinking I had an incorrect game directory version
until I remembered a part in the wiki saying redhat systems needed to
update the crypto policies. Thought I'd add that into the main program
as a check as well as default the errors better.
This commit is contained in:
Toofy 2023-04-25 10:31:38 -04:00 committed by Joshua Goins
parent 04324554cd
commit c00f25029e

View file

@ -187,6 +187,7 @@ void SquareLauncher::registerSession(const LoginInformation& info) {
auto reply = window.mgr->post(request, report.toUtf8());
connect(reply, &QNetworkReply::finished, [=, &info] {
if (reply->error() == QNetworkReply::NoError) {
if (reply->rawHeaderList().contains("X-Patch-Unique-Id")) {
QString body = reply->readAll();
@ -204,10 +205,31 @@ void SquareLauncher::registerSession(const LoginInformation& info) {
auto messageBox = new QMessageBox(
QMessageBox::Icon::Critical,
"Failed to Login",
"Failed the anti-tamper check. Please restore your game to the original state or update the game.");
"Fatal error, request was successful but X-Patch-Unique-Id was not received");
messageBox->show();
}
} else {
if (reply->error() == QNetworkReply::SslHandshakeFailedError) {
auto messageBox = new QMessageBox(
QMessageBox::Icon::Critical,
"Failed to Login",
"SSL handshake error detected. If you are using OpenSUSE Tumbleweed or Fedora, this launcher will "
"only work if you run the following command `update-crypto-policies --set LEGACY`");
messageBox->show();
} else if (reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() == 405) {
auto messageBox = new QMessageBox(
QMessageBox::Icon::Critical,
"Failed to Login",
"Failed the anti-tamper check. Please restore your game to the original state or update the "
"game.");
messageBox->show();
} else {
int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
auto messageBox = new QMessageBox(
QMessageBox::Icon::Critical, "Failed to Login", &"Unknown error! Status code was "[statusCode]);
messageBox->show();
}
}
});
}