mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Rework user limit and checks around join process
This commit is contained in:
@@ -3356,6 +3356,15 @@ bool Server::denyIfBanned(session_t peer_id)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Server::checkUserLimit(const std::string &player_name, const std::string &addr_s)
|
||||
{
|
||||
if (!m_clients.isUserLimitReached())
|
||||
return false;
|
||||
if (player_name == g_settings->get("name")) // admin can always join
|
||||
return false;
|
||||
return !m_script->can_bypass_userlimit(player_name, addr_s);
|
||||
}
|
||||
|
||||
void Server::notifyPlayer(const char *name, const std::wstring &msg)
|
||||
{
|
||||
// m_env will be NULL if the server is initializing
|
||||
@@ -3489,7 +3498,6 @@ void Server::hudSetHotbarSelectedImage(RemotePlayer *player, const std::string &
|
||||
|
||||
Address Server::getPeerAddress(session_t peer_id)
|
||||
{
|
||||
// Note that this is only set after Init was received in Server::handleCommand_Init
|
||||
return getClient(peer_id, CS_Invalid)->getAddress();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user