diff options
Diffstat (limited to 'src/clientiface.cpp')
-rw-r--r-- | src/clientiface.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/clientiface.cpp b/src/clientiface.cpp index 68bd4afe7..475397279 100644 --- a/src/clientiface.cpp +++ b/src/clientiface.cpp @@ -633,6 +633,16 @@ std::vector<u16> ClientInterface::getClientIDs(ClientState min_state) return reply; } +/** + * Verify if user limit was reached. + * User limit count all clients from HelloSent state (MT protocol user) to Active state + * @return true if user limit was reached + */ +bool ClientInterface::isUserLimitReached() +{ + return getClientIDs(CS_HelloSent).size() >= g_settings->getU16("max_users"); +} + void ClientInterface::step(float dtime) { m_print_info_timer += dtime; |