mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-20 11:47:46 +00:00
Remove "Unknown error" from login gate message
The network error should only be printed in the case where there's a real error, otherwise it adds nothing but confusion.
This commit is contained in:
parent
1eb1251418
commit
d9b44e230c
1 changed files with 10 additions and 4 deletions
|
@ -80,16 +80,22 @@ QCoro::Task<bool> SquareEnixLogin::checkGateStatus()
|
||||||
co_await reply;
|
co_await reply;
|
||||||
|
|
||||||
const QJsonDocument document = QJsonDocument::fromJson(reply->readAll());
|
const QJsonDocument document = QJsonDocument::fromJson(reply->readAll());
|
||||||
|
if (document.isEmpty()) {
|
||||||
|
Q_EMIT m_launcher.loginError(i18n("An error occured when checking login gate status:\n\n%1", reply->errorString()));
|
||||||
|
co_return false;
|
||||||
|
}
|
||||||
|
|
||||||
const bool isGateOpen = !document.isEmpty() && document.object()["status"_L1].toInt() != 0;
|
const bool isGateOpen = !document.isEmpty() && document.object()["status"_L1].toInt() != 0;
|
||||||
|
|
||||||
if (isGateOpen) {
|
if (isGateOpen) {
|
||||||
qInfo(ASTRA_LOG) << "Gate is open!";
|
qInfo(ASTRA_LOG) << "Gate is open!";
|
||||||
co_return true;
|
co_return true;
|
||||||
} else {
|
|
||||||
qInfo(ASTRA_LOG) << "Gate is closed!";
|
|
||||||
Q_EMIT m_launcher.loginError(i18n("The login gate is closed, the game may be under maintenance.\n\n%1", reply->errorString()));
|
|
||||||
co_return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qInfo(ASTRA_LOG) << "Gate is closed!";
|
||||||
|
Q_EMIT m_launcher.loginError(i18n("The login gate is closed, the game may be under maintenance."));
|
||||||
|
|
||||||
|
co_return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QCoro::Task<bool> SquareEnixLogin::checkLoginStatus()
|
QCoro::Task<bool> SquareEnixLogin::checkLoginStatus()
|
||||||
|
|
Loading…
Add table
Reference in a new issue