Updated the logging system
This commit is contained in:
@@ -183,14 +183,17 @@ bool TSServer::assignDefaultChannel(const shared_ptr<ConnectedClient>& client, b
|
||||
channel = this->channelTree->findChannelByPath(str);
|
||||
if (channel) {
|
||||
if(!channel->permission_granted(permission::i_channel_needed_join_power, client->calculate_permission_value(permission::i_channel_join_power, channel->channelId()), false)) {
|
||||
logMessage(this->serverId, "[{}] Client tried to connect to a channel which he hasn't permission for. Channel: {} ({})", CLIENT_STR_LOG_PREFIX_(client), channel->channelId(), channel->name());
|
||||
logMessage(this->serverId, "{} Client tried to connect to a channel which he hasn't permission for. Channel: {} ({})", CLIENT_STR_LOG_PREFIX_(client), channel->channelId(), channel->name());
|
||||
channel = nullptr;
|
||||
} else if (!channel->passwordMatch(client->properties()[property::CLIENT_DEFAULT_CHANNEL_PASSWORD], true) && client->permissionValue(permission::PERMTEST_ORDERED, permission::b_channel_join_ignore_password, channel) < 1) {
|
||||
logMessage(this->serverId, "[{}] Client tried to connect to a channel which is password protected and he hasn't the right password. Channel: {} ({})", CLIENT_STR_LOG_PREFIX_(client), channel->channelId(), channel->name());
|
||||
logMessage(this->serverId, "{} Client tried to connect to a channel which is password protected and he hasn't the right password. Channel: {} ({})", CLIENT_STR_LOG_PREFIX_(client), channel->channelId(), channel->name());
|
||||
channel = nullptr;
|
||||
}
|
||||
} else
|
||||
logMessage("Client " + client->getDisplayName() + "/" + client->getUid() + " tried to join on a not existing channel. Name: " + client->properties()[property::CLIENT_DEFAULT_CHANNEL].as<std::string>());
|
||||
logMessage(this->serverId, "{} Client {}/{} tried to join on a not existing channel. Name: {}",
|
||||
CLIENT_STR_LOG_PREFIX_(client),
|
||||
client->getDisplayName(), client->getUid(),
|
||||
client->properties()[property::CLIENT_DEFAULT_CHANNEL].as<std::string>());
|
||||
}
|
||||
if(!channel) channel = this->channelTree->getDefaultChannel();
|
||||
if(!channel) return false;
|
||||
|
||||
Reference in New Issue
Block a user