mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Cleanup max user check at login
This change accomplishes two goals. The first is it moves the checking for if the servers set user limit is reached out of the socket interface and into the protocol handler portion of the code (were it should live). It also eleminates the need for a DB query at login to check the user count. The user account is actually already maintained by the server and a function already existed to get the user count total.
This commit is contained in:
parent
f20e2ce2bd
commit
10b677acdf
7 changed files with 23 additions and 25 deletions
|
|
@ -393,6 +393,10 @@ void MainWindow::loginError(Response::ResponseCode r, QString reasonStr, quint32
|
|||
client->disconnectFromServer();
|
||||
break;
|
||||
}
|
||||
case Response::RespServerFull: {
|
||||
QMessageBox::critical(this, tr("Server Full"), tr("The server has reached its maximum user capacity, please check back later."));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
QMessageBox::critical(this, tr("Error"), tr("Unknown login error: %1").arg(static_cast<int>(r)) + tr("\nThis usually means that your client version is out of date, and the server sent a reply your client doesn't understand."));
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue