A lot of changes to 1.4.17

This commit is contained in:
WolverinDEV 2020-07-28 18:36:32 +02:00
parent 071a6533e0
commit ad51f8118d
10 changed files with 23 additions and 12 deletions

@ -1 +1 @@
Subproject commit e371401bd35d10717c92e2e71d0b5d4d40577fa2
Subproject commit 5f0349e5f930b4f0275c43518d01b9e8c57aa73a

View File

@ -243,7 +243,7 @@ target_link_libraries(PermMapHelper
SET(CPACK_PACKAGE_VERSION_MAJOR "1")
SET(CPACK_PACKAGE_VERSION_MINOR "4")
SET(CPACK_PACKAGE_VERSION_PATCH "16")
SET(CPACK_PACKAGE_VERSION_PATCH "17")
if (BUILD_TYPE_NAME EQUAL OFF)
SET(CPACK_PACKAGE_VERSION_DATA "beta")
elseif (BUILD_TYPE_NAME STREQUAL "")

View File

@ -230,7 +230,6 @@ int main(int argc, char** argv) {
if(true) return 0;
*/
//debugMessage(LOG_GENERAL, "Sizeof ViewEntry {} Sizeof LinkedTreeEntry {} Sizeof shared_ptr<ViewEntry> {} Sizeof ClientChannelView {}", sizeof(ts::ViewEntry), sizeof(ts::TreeView::LinkedTreeEntry), sizeof(shared_ptr<ts::ViewEntry>), sizeof(ts::ClientChannelView));
{
//http://git.mcgalaxy.de/WolverinDEV/tomcrypt/blob/develop/src/misc/crypt/crypt_inits.c#L40-86
std::string descriptors = "LTGE";

View File

@ -1,5 +1,6 @@
#include <utility>
#include <log/LogUtils.h>
#include "Configuration.h"
#include "build.h"
#include "../../license/shared/include/license/license.h"
@ -566,6 +567,14 @@ std::vector<std::string> config::reload() {
auto bindings = create_bindings();
read_bindings(config, bindings, FLAG_RELOADABLE);
const auto& logConfig = logger::currentConfig();
if(logConfig) {
logConfig->logfileLevel = (spdlog::level::level_enum) ts::config::log::logfileLevel;
logConfig->terminalLevel = (spdlog::level::level_enum) ts::config::log::terminalLevel;
logger::updateLogLevels();
}
} catch(const YAML::Exception& ex) {
errors.emplace_back("Could not read config: " + ex.msg + " @" + to_string(ex.mark.line) + ":" + to_string(ex.mark.column));
return errors;
@ -1007,8 +1016,9 @@ std::deque<std::shared_ptr<EntryBinding>> config::create_bindings() {
{
BIND_GROUP(log)
{
CREATE_BINDING("level", 0);
CREATE_BINDING("level", FLAG_RELOADABLE);
BIND_INTEGRAL(config::log::logfileLevel, spdlog::level::debug, spdlog::level::trace, spdlog::level::off);
ADD_NOTE_RELOADABLE();
ADD_DESCRIPTION("The log level within the log files");
ADD_DESCRIPTION("Available types:");
ADD_DESCRIPTION(" 0: Trace");
@ -1020,8 +1030,9 @@ std::deque<std::shared_ptr<EntryBinding>> config::create_bindings() {
ADD_DESCRIPTION(" 6: Off");
}
{
CREATE_BINDING("terminal_level", 0);
CREATE_BINDING("terminal_level", FLAG_RELOADABLE);
BIND_INTEGRAL(config::log::terminalLevel, spdlog::level::info, spdlog::level::trace, spdlog::level::off);
ADD_NOTE_RELOADABLE();
ADD_DESCRIPTION("The log level within the TeaSpeak server terminal");
ADD_DESCRIPTION("Available types:");
ADD_DESCRIPTION(" 0: Trace");

View File

@ -168,7 +168,7 @@ void ConnectedClient::updateChannelClientProperties(bool lock_channel_tree, bool
block_flood = !permission::v2::permission_granted(1, permission_ignore_antiflood);
if(server_ref)
server_ref->notifyClientPropertyUpdates(_this.lock(), notifyList, notify_self);
this->updateTalkRights(permission_talk_power.has_value ? permission_talk_power.value : 0);
this->updateTalkRights(permission_talk_power);
if((this->channels_view_power != permission_channel_view_power || this->channels_ignore_view != permission_channel_ignore_view_power) && notify_self && this->currentChannel && server_ref) {
this->channels_view_power = permission_channel_view_power;
@ -197,11 +197,11 @@ void ConnectedClient::updateChannelClientProperties(bool lock_channel_tree, bool
}
}
void ConnectedClient::updateTalkRights(permission::PermissionValue talk_power) {
void ConnectedClient::updateTalkRights(permission::v2::PermissionFlaggedValue talk_power) {
bool flag = false;
flag |= this->properties()[property::CLIENT_IS_TALKER].as<bool>();
if(!flag && this->currentChannel) {
flag = this->currentChannel->talk_power_granted({talk_power, talk_power != permNotGranted});
flag = this->currentChannel->talk_power_granted(talk_power);
}
this->allowedToTalk = flag;
}

View File

@ -254,7 +254,7 @@ namespace ts {
std::shared_ptr<ConnectionInfoData> request_connection_info(const std::shared_ptr<ConnectedClient> & /* receiver */, bool& /* send temporary (no client response yet) */);
virtual void updateChannelClientProperties(bool /* lock channel tree */, bool /* notify our self */);
void updateTalkRights(permission::PermissionValue talk_power);
void updateTalkRights(permission::v2::PermissionFlaggedValue talk_power);
virtual std::shared_ptr<BanRecord> resolveActiveBan(const std::string& ip_address);

View File

@ -1072,6 +1072,8 @@ command_result ConnectedClient::handleCommandChannelEdit(Command &cmd) {
}
keys.push_back(&property);
}
if(keys.empty())
return command_result{error::ok};
unique_lock server_channel_w_lock(this->server ? this->server->channel_tree_lock : serverInstance->getChannelTreeLock(), defer_lock);
if(require_write_lock) {

View File

@ -731,7 +731,7 @@ command_result ConnectedClient::handleCommandClientEdit(Command &cmd, const std:
);
}
if(update_talk_rights)
client->updateTalkRights(client->properties()[property::CLIENT_TALK_POWER]);
client->updateTalkRights(client->calculate_permission(permission::i_client_talk_power, client->getChannelId()));
if(this->server)
this->server->notifyClientPropertyUpdates(client, updates);

View File

@ -56,7 +56,6 @@ std::string TypedActionLogger<>::generate_insert(const std::string &table_name,
result += ", " + TypedActionLogger::value_binding_name(index);
result += ");";
debugMessage(0, "Insert query: {}", result);
return result;
}

2
shared

@ -1 +1 @@
Subproject commit a4d7c90945525aad35c1280ebfd0d0d8cc7cd197
Subproject commit b1f5620760351535a825ec3e618150c001b85799