mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-27 17:13:54 -07:00
fix client crash when server goes down during registration (#5787)
This commit is contained in:
parent
aa3c8c0625
commit
feb8191904
2 changed files with 8 additions and 0 deletions
|
|
@ -574,6 +574,9 @@ void MainWindow::registerError(Response::ResponseCode r, QString reasonStr, quin
|
||||||
case Response::RespRegistrationFailed:
|
case Response::RespRegistrationFailed:
|
||||||
QMessageBox::critical(this, tr("Error"), tr("Registration failed for a technical problem on the server."));
|
QMessageBox::critical(this, tr("Error"), tr("Registration failed for a technical problem on the server."));
|
||||||
break;
|
break;
|
||||||
|
case Response::RespNotConnected:
|
||||||
|
QMessageBox::critical(this, tr("Error"), tr("The connection to the server has been lost."));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
QMessageBox::critical(this, tr("Error"),
|
QMessageBox::critical(this, tr("Error"),
|
||||||
tr("Unknown registration error: %1").arg(static_cast<int>(r)) +
|
tr("Unknown registration error: %1").arg(static_cast<int>(r)) +
|
||||||
|
|
|
||||||
|
|
@ -339,6 +339,11 @@ void RemoteClient::registerResponse(const Response &response)
|
||||||
emit registerAcceptedNeedsActivate();
|
emit registerAcceptedNeedsActivate();
|
||||||
doLogin();
|
doLogin();
|
||||||
break;
|
break;
|
||||||
|
case Response::RespNotConnected:
|
||||||
|
// this response is created by the client from doDisconnectFromServer, do not call it again!
|
||||||
|
emit registerError(response.response_code(), QString::fromStdString(resp.denied_reason_str()),
|
||||||
|
static_cast<quint32>(resp.denied_end_time()));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
emit registerError(response.response_code(), QString::fromStdString(resp.denied_reason_str()),
|
emit registerError(response.response_code(), QString::fromStdString(resp.denied_reason_str()),
|
||||||
static_cast<quint32>(resp.denied_end_time()));
|
static_cast<quint32>(resp.denied_end_time()));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue