Minor bug fixes
This commit is contained in:
@@ -203,14 +203,14 @@ command_result ConnectedClient::handleCommandClientMove(Command &cmd) {
|
||||
}
|
||||
}
|
||||
clients.emplace_back(std::move(target_client));
|
||||
result.emplace_result(permission::ok);
|
||||
result.emplace_result(error::ok);
|
||||
}
|
||||
|
||||
if (!channel->properties()[property::CHANNEL_FLAG_MAXCLIENTS_UNLIMITED].as<bool>() || !channel->properties()[property::CHANNEL_FLAG_MAXFAMILYCLIENTS_UNLIMITED].as<bool>()) {
|
||||
if(!permission::v2::permission_granted(1, this->calculate_permission(permission::b_channel_join_ignore_maxclients, channel->channelId()))) {
|
||||
if(!channel->properties()[property::CHANNEL_FLAG_MAXCLIENTS_UNLIMITED].as<bool>()) {
|
||||
auto maxClients = channel->properties()[property::CHANNEL_MAXCLIENTS].as<int32_t>();
|
||||
if (maxClients >= 0 && maxClients <= this->server->getClientsByChannel(channel).size() + clients.size())
|
||||
if (maxClients >= 0 && maxClients < this->server->getClientsByChannel(channel).size() + clients.size())
|
||||
return command_result{error::channel_maxclients_reached};
|
||||
}
|
||||
if(!channel->properties()[property::CHANNEL_FLAG_MAXFAMILYCLIENTS_UNLIMITED].as<bool>()) {
|
||||
@@ -227,7 +227,7 @@ command_result ConnectedClient::handleCommandClientMove(Command &cmd) {
|
||||
for(const auto& entry : this->server->getClientsByChannelRoot(channel, false))
|
||||
if(entry.get() != this) client_count++; //Dont count the client itself
|
||||
|
||||
if (maxClients >= 0 && maxClients <= client_count + clients.size())
|
||||
if (maxClients >= 0 && maxClients < client_count + clients.size())
|
||||
return command_result{error::channel_maxfamily_reached};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -754,6 +754,9 @@ command_result ConnectedClient::handleCommandServerGroupDelClient(Command &cmd)
|
||||
|
||||
for(const auto& _server : target_server ? std::deque<shared_ptr<VirtualServer>>{target_server} : serverInstance->getVoiceServerManager()->serverInstances()) {
|
||||
for (const auto &targetClient : _server->findClientsByCldbId(target_cldbid)) {
|
||||
ConnectedLockedClient clock{targetClient};
|
||||
if(!clock) continue;
|
||||
|
||||
if (_server->notifyClientPropertyUpdates(targetClient, _server->groups->update_server_group_property(targetClient, true, targetClient->getChannel()))) {
|
||||
for (const auto &client : _server->getClients()) {
|
||||
if(client->isClientVisible(targetClient, true) || client == targetClient)
|
||||
|
||||
Reference in New Issue
Block a user