Updated the config and fixed stuff

This commit is contained in:
WolverinDEV 2020-02-03 19:41:18 +01:00
parent 6297b4cba7
commit 76342bbb96
7 changed files with 40 additions and 14 deletions

View File

@ -318,7 +318,7 @@ void read_bindings(YAML::Node& root, const std::deque<std::shared_ptr<EntryBindi
inline string apply_comments(stringstream &in, map<string, deque<string>>& comments);
std::deque<std::shared_ptr<EntryBinding>> create_local_bindings(int& version, std::string& license);
#define CURRENT_CONFIG_VERSION 14
#define CURRENT_CONFIG_VERSION 15
static std::string _config_path;
vector<string> config::parseConfig(const std::string& path) {
_config_path = path;
@ -410,6 +410,29 @@ vector<string> config::parseConfig(const std::string& path) {
if(node_ft.IsDefined() && node_ft.as<string>() == "0.0.0.0")
node_ft = node_ft.as<string>() + ",[::]";
}
case 14:
{
{
auto nodes_key = resolveNode(config, "threads.voice.execute_limit").back();
if(nodes_key.IsDefined() && nodes_key.as<uint32_t>() == 10)
nodes_key = "5";
}
{
auto nodes_key = resolveNode(config, "threads.voice.io_limit").back();
if(nodes_key.IsDefined() && nodes_key.as<uint32_t>() == 10)
nodes_key = "5";
}
{
auto nodes_key = resolveNode(config, "threads.web.io_loops").back();
if(nodes_key.IsDefined() && nodes_key.as<uint32_t>() == 4)
nodes_key = "2";
}
{
auto nodes_key = resolveNode(config, "threads.music.execute_limit").back();
if(nodes_key.IsDefined() && nodes_key.as<uint32_t>() == 15)
nodes_key = "2";
}
}
default:
break;
}
@ -1566,7 +1589,7 @@ std::deque<std::shared_ptr<EntryBinding>> config::create_bindings() {
BIND_GROUP(music);
{
CREATE_BINDING("execute_limit", 0);
BIND_INTEGRAL(config::threads::music::execute_limit, 15, 1, 1024);
BIND_INTEGRAL(config::threads::music::execute_limit, 5, 1, 1024);
ADD_DESCRIPTION("Max number of threads for command handling on the instance");
ADD_SENSITIVE();
}
@ -1579,7 +1602,7 @@ std::deque<std::shared_ptr<EntryBinding>> config::create_bindings() {
}
{
CREATE_BINDING("web.io_loops", 0);
BIND_INTEGRAL(config::threads::web::io_loops, 4, 1, 128);
BIND_INTEGRAL(config::threads::web::io_loops, 2, 1, 128);
ADD_DESCRIPTION("Thread pool size for the ticking task of a VirtualServer");
ADD_SENSITIVE();
}
@ -1599,7 +1622,7 @@ std::deque<std::shared_ptr<EntryBinding>> config::create_bindings() {
}
{
CREATE_BINDING("execute_limit", 0);
BIND_INTEGRAL(config::threads::voice::execute_limit, 10, 1, 1024);
BIND_INTEGRAL(config::threads::voice::execute_limit, 5, 1, 1024);
ADD_DESCRIPTION("Max number of threads for command handling threads within the instance");
ADD_SENSITIVE();
}
@ -1617,7 +1640,7 @@ std::deque<std::shared_ptr<EntryBinding>> config::create_bindings() {
}
{
CREATE_BINDING("io_limit", 0);
BIND_INTEGRAL(config::threads::voice::io_limit, 10, 1, 1024);
BIND_INTEGRAL(config::threads::voice::io_limit, 5, 1, 1024);
ADD_DESCRIPTION("Max IO threads");
ADD_SENSITIVE();
}

View File

@ -425,7 +425,7 @@ command_result ConnectedClient::handleCommandChannelGroupAddPerm(Command &cmd) {
return command_result{permission::i_permission_modify_power};
}
if(!ignore_granted_values && !permission::v2::permission_granted(val, this->calculate_permission(permType, 0, true))) {
if(!ignore_granted_values && !permission::v2::permission_granted(1, this->calculate_permission(permType, 0, true))) {
if(conOnError) continue;
return command_result{permission::i_permission_modify_power};
}
@ -1487,7 +1487,7 @@ command_result ConnectedClient::handleCommandChannelAddPerm(Command &cmd) {
return command_result{permission::i_permission_modify_power};
}
if(!ignore_granted_values && !permission::v2::permission_granted(val, this->calculate_permission(permType, channel_id, true))) {
if(!ignore_granted_values && !permission::v2::permission_granted(1, this->calculate_permission(permType, channel_id, true))) {
if(conOnError) continue;
return command_result{permission::i_permission_modify_power};
}
@ -1806,7 +1806,7 @@ command_result ConnectedClient::handleCommandChannelClientAddPerm(Command &cmd)
return command_result{permission::i_permission_modify_power};
}
if(!ignore_granted_values && !permission::v2::permission_granted(val, this->calculate_permission(permType, channel_id, true))) {
if(!ignore_granted_values && !permission::v2::permission_granted(1, this->calculate_permission(permType, channel_id, true))) {
if(conOnError) continue;
return command_result{permission::i_permission_modify_power};
}

View File

@ -885,7 +885,7 @@ command_result ConnectedClient::handleCommandClientAddPerm(Command &cmd) {
return command_result{permission::i_permission_modify_power};
}
if(!ignore_granted_values && !permission::v2::permission_granted(val, this->calculate_permission(permType, 0, true))) {
if(!ignore_granted_values && !permission::v2::permission_granted(1, this->calculate_permission(permType, 0, true))) {
if(conOnError) continue;
return command_result{permission::i_permission_modify_power};
}

View File

@ -573,7 +573,7 @@ command_result ConnectedClient::handleCommandPlaylistAddPerm(ts::Command &cmd) {
return command_result{permission::i_permission_modify_power};
}
if(!ignore_granted_values && !permission::v2::permission_granted(val, this->calculate_permission(permType, 0, true))) {
if(!ignore_granted_values && !permission::v2::permission_granted(1, this->calculate_permission(permType, 0, true))) {
if(conOnError) continue;
return command_result{permission::i_permission_modify_power};
}
@ -713,7 +713,7 @@ command_result ConnectedClient::handleCommandPlaylistClientAddPerm(ts::Command &
return command_result{permission::i_permission_modify_power};
}
if(!ignore_granted_values && !permission::v2::permission_granted(val, this->calculate_permission(permType, 0, true))) {
if(!ignore_granted_values && !permission::v2::permission_granted(1, this->calculate_permission(permType, 0, true))) {
if(conOnError) continue;
return command_result{permission::i_permission_modify_power};
}

View File

@ -820,7 +820,7 @@ command_result ConnectedClient::handleCommandServerGroupAddPerm(Command &cmd) {
return command_result{permission::i_permission_modify_power};
}
if(!ignore_granted_values && !permission::v2::permission_granted(val, this->calculate_permission(permType, 0, true))) {
if(!ignore_granted_values && !permission::v2::permission_granted(1, this->calculate_permission(permType, 0, true))) {
if(conOnError) continue;
return command_result{permission::i_permission_modify_power};
}
@ -983,7 +983,7 @@ command_result ConnectedClient::handleCommandServerGroupAutoAddPerm(ts::Command&
return command_result{permission::i_permission_modify_power};
}
if(!ignore_granted_values && !permission::v2::permission_granted(val, this->calculate_permission(permType, 0, true))) {
if(!ignore_granted_values && !permission::v2::permission_granted(1, this->calculate_permission(permType, 0, true))) {
if(conOnError) continue;
return command_result{permission::i_permission_modify_power};
}

View File

@ -43,7 +43,10 @@ void VoiceClient::handlePacketCommand(const pipes::buffer_view& command_string)
}
void VoiceClient::handlePacketPing(const protocol::IncomingClientPacketParser& packet) {
(void) packet.payload().length();
if (packet.type() == protocol::PONG) {
if(packet.payload_length() < 2) return;
uint16_t id = be2le16((char*) packet.payload().data_ptr());
if (this->lastPingId == id) {
#ifdef PKT_LOG_PING

2
shared

@ -1 +1 @@
Subproject commit 8f7d980a6a8c841042e71dcb2a22098c84593859
Subproject commit dca5bf1ce814ecfb63ebef21e579b9dc2781cbbc