Heavily improving the clients join and leave performance
This commit is contained in:
@@ -90,12 +90,14 @@ bool VirtualServer::registerClient(shared_ptr<ConnectedClient> client) {
|
||||
}
|
||||
|
||||
bool VirtualServer::unregisterClient(shared_ptr<ConnectedClient> cl, std::string reason, std::unique_lock<std::shared_mutex>& chan_tree_lock) {
|
||||
if(cl->getType() == ClientType::CLIENT_TEAMSPEAK && cl->getType() == ClientType::CLIENT_WEB) {
|
||||
if(cl->getType() == ClientType::CLIENT_TEAMSPEAK || cl->getType() == ClientType::CLIENT_TEASPEAK || cl->getType() == ClientType::CLIENT_WEB) {
|
||||
sassert(cl->state == ConnectionState::DISCONNECTED);
|
||||
}
|
||||
|
||||
auto client_id = cl->getClientId();
|
||||
if(client_id == 0) return false; /* not registered */
|
||||
if(client_id == 0) {
|
||||
return false; /* not registered */
|
||||
}
|
||||
{
|
||||
|
||||
lock_guard lock(this->clients.lock);
|
||||
@@ -252,6 +254,10 @@ bool VirtualServer::assignDefaultChannel(const shared_ptr<ConnectedClient>& clie
|
||||
skip_permissions:;
|
||||
}
|
||||
|
||||
/* Clear these parameters. We don't need them any more after we initially payed attention. */
|
||||
client->properties()[property::CLIENT_DEFAULT_CHANNEL] = "";
|
||||
client->properties()[property::CLIENT_DEFAULT_CHANNEL_PASSWORD] = "";
|
||||
|
||||
if(!channel) {
|
||||
/* Client did not propose a channel or the proposed channel got rejected */
|
||||
channel = this->channelTree->getDefaultChannel();
|
||||
|
||||
Reference in New Issue
Block a user