Some minor code refactors and fixed converter for 332bit builds
This commit is contained in:
@@ -100,18 +100,26 @@ command_result SpeakingClient::handleCommandClientInit(Command& cmd) {
|
||||
|
||||
{
|
||||
lock_guard<threads::Mutex> lock(this->server->join_attempts_lock);
|
||||
auto inetAddr = this->getPeerIp();
|
||||
if(config::voice::clientConnectLimit > 0 && this->server->join_attempts[inetAddr] + 1 > config::voice::clientConnectLimit)
|
||||
auto client_address = this->getPeerIp();
|
||||
auto& client_join_attempts = this->server->join_attempts[client_address];
|
||||
auto& general_join_attempts = this->server->join_attempts["_"];
|
||||
|
||||
if(config::voice::clientConnectLimit > 0 && client_join_attempts + 1 > config::voice::clientConnectLimit) {
|
||||
return command_result{error::client_join_rate_limit_reached};
|
||||
if(config::voice::connectLimit > 0 && this->server->join_attempts["_"] + 1 > config::voice::connectLimit)
|
||||
}
|
||||
|
||||
if(config::voice::connectLimit > 0 && general_join_attempts + 1 > config::voice::connectLimit) {
|
||||
return command_result{error::server_join_rate_limit_reached};
|
||||
this->server->join_attempts[inetAddr]++;
|
||||
this->server->join_attempts["_"]++;
|
||||
}
|
||||
|
||||
client_join_attempts++;
|
||||
general_join_attempts++;
|
||||
}
|
||||
TIMING_STEP(timings, "join atmp c");
|
||||
|
||||
if(!DatabaseHelper::assignDatabaseId(this->server->getSql(), this->server->getServerId(), _this.lock()))
|
||||
if(!DatabaseHelper::assignDatabaseId(this->server->getSql(), this->server->getServerId(), _this.lock())) {
|
||||
return command_result{error::vs_critical, "Could not assign database id!"};
|
||||
}
|
||||
|
||||
TIMING_STEP(timings, "db assign ");
|
||||
this->server->getGroupManager()->enableCache(this->getClientDatabaseId());
|
||||
|
||||
Reference in New Issue
Block a user