mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-23 07:28:24 -08:00
Fix #2270 Check userinfo first before trying to use it.
This commit is contained in:
@@ -387,7 +387,7 @@ void Server_ProtocolHandler::pingClockTimeout()
|
|||||||
if (timeRunning - lastDataReceived > server->getMaxPlayerInactivityTime())
|
if (timeRunning - lastDataReceived > server->getMaxPlayerInactivityTime())
|
||||||
prepareDestroy();
|
prepareDestroy();
|
||||||
|
|
||||||
if (QString::fromStdString(userInfo->privlevel()).toLower() == "none") {
|
if (!userInfo || QString::fromStdString(userInfo->privlevel()).toLower() == "none") {
|
||||||
if ((server->getIdleClientTimeout() > 0) && (idleClientWarningSent)) {
|
if ((server->getIdleClientTimeout() > 0) && (idleClientWarningSent)) {
|
||||||
if (timeRunning - lastActionReceived > server->getIdleClientTimeout()) {
|
if (timeRunning - lastActionReceived > server->getIdleClientTimeout()) {
|
||||||
prepareDestroy();
|
prepareDestroy();
|
||||||
@@ -472,7 +472,7 @@ Response::ResponseCode Server_ProtocolHandler::cmdLogin(const Command_Login &cmd
|
|||||||
}
|
}
|
||||||
|
|
||||||
// limit the number of non-privileged users that can connect to the server based on configuration settings
|
// limit the number of non-privileged users that can connect to the server based on configuration settings
|
||||||
if (QString::fromStdString(userInfo->privlevel()).toLower() == "none") {
|
if (!userInfo || QString::fromStdString(userInfo->privlevel()).toLower() == "none") {
|
||||||
if (server->getMaxUserLimitEnabled()) {
|
if (server->getMaxUserLimitEnabled()) {
|
||||||
if (server->getUsersCount() > server->getMaxUserTotal()) {
|
if (server->getUsersCount() > server->getMaxUserTotal()) {
|
||||||
qDebug() << "Max Users Total Limit Reached, please increase the max_users_total setting.";
|
qDebug() << "Max Users Total Limit Reached, please increase the max_users_total setting.";
|
||||||
|
|||||||
Reference in New Issue
Block a user