From 356822a0c51e5315f955c83d5ca43aa36dc4408c Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Wed, 31 Jul 2019 15:15:34 +0200 Subject: [PATCH 1/2] Fixed skip and negate flags --- .../client/ConnectedClientCommandHandler.cpp | 19 ++++++++++--------- .../client/voice/VoiceClientConnection.cpp | 2 +- shared | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/server/src/client/ConnectedClientCommandHandler.cpp b/server/src/client/ConnectedClientCommandHandler.cpp index 9eba1fd..526d7ca 100644 --- a/server/src/client/ConnectedClientCommandHandler.cpp +++ b/server/src/client/ConnectedClientCommandHandler.cpp @@ -1162,8 +1162,8 @@ CommandResult ConnectedClient::handleCommandChannelGroupAddPerm(Command &cmd) { permission::v2::PermissionUpdateType::set_value, permission::v2::PermissionUpdateType::do_nothing, - cmd[index]["permnegated"].as() ? 1 : 0, - cmd[index]["permskip"].as() ? 1 : 0 + cmd[index]["permskip"].as() ? 1 : 0, + cmd[index]["permnegated"].as() ? 1 : 0 ); updateList |= permission_is_group_property(permType); } @@ -2335,8 +2335,9 @@ CommandResult ConnectedClient::handleCommandChannelAddPerm(Command &cmd) { permission::v2::PermissionUpdateType::set_value, permission::v2::PermissionUpdateType::do_nothing, - cmd[index]["permnegated"].as() ? 1 : 0, - cmd[index]["permskip"].as() ? 1 : 0 + + cmd[index]["permskip"].as() ? 1 : 0, + cmd[index]["permnegated"].as() ? 1 : 0 ); updateClients |= permission_is_client_property(permType); update_view |= permType == permission::i_channel_needed_view_power; @@ -2820,8 +2821,8 @@ CommandResult ConnectedClient::handleCommandServerGroupAddPerm(Command &cmd) { permission::v2::PermissionUpdateType::set_value, permission::v2::PermissionUpdateType::do_nothing, - cmd[index]["permnegated"].as() ? 1 : 0, - cmd[index]["permskip"].as() ? 1 : 0 + cmd[index]["permskip"].as() ? 1 : 0, + cmd[index]["permnegated"].as() ? 1 : 0 ); sgroupUpdate |= permission_is_group_property(permType); checkTp |= permission_is_client_property(permType); @@ -2978,8 +2979,8 @@ CommandResult ConnectedClient::handleCommandServerGroupAutoAddPerm(ts::Command& permission::v2::PermissionUpdateType::set_value, permission::v2::PermissionUpdateType::do_nothing, - cmd[index]["permnegated"].as() ? 1 : 0, - cmd[index]["permskip"].as() ? 1 : 0 + cmd[index]["permskip"].as() ? 1 : 0, + cmd[index]["permnegated"].as() ? 1 : 0 ); } } @@ -6456,7 +6457,7 @@ CommandResult ConnectedClient::handleCommandPlaylistAddPerm(ts::Command &cmd) { playlist->permissions()->setPermissionGranted(permType, cmd[index]["permvalue"], nullptr); } else { - playlist->permissions()->setPermission(permType, cmd[index]["permvalue"], nullptr, cmd[index]["permnegated"], cmd[index]["permskip"]); + playlist->permissions()->setPermission(permType, cmd[index]["permvalue"], nullptr, cmd[index]["permskip"], cmd[index]["permnegated"]); } } diff --git a/server/src/client/voice/VoiceClientConnection.cpp b/server/src/client/voice/VoiceClientConnection.cpp index 987381f..7ff4322 100644 --- a/server/src/client/voice/VoiceClientConnection.cpp +++ b/server/src/client/voice/VoiceClientConnection.cpp @@ -228,7 +228,7 @@ void VoiceClientConnection::handleDatagramReceived(const pipes::buffer_view& buf } else { //TODO: Needs rethinking because read_queue.push_back increases the index, but this has not to be the packet id if(!read_queue.push_back(move(packet))) { - debugMessage(this->client->getServerId(), "{} Got unordered packet of type {} which is out of the buffer range of {}. Packet ID: {}. Dropping packet.", + debugMessage(this->client->getServerId(), "{} Got unordered packet of type {} which is out of the buffer capacity of {}. Packet ID: {}. Dropping packet.", CLIENT_STR_LOG_PREFIX_(this->client), packet_type.name(), read_queue.capacity(), diff --git a/shared b/shared index a0cca36..c8cae59 160000 --- a/shared +++ b/shared @@ -1 +1 @@ -Subproject commit a0cca36eca11da410626a340dbe4377067d59c1b +Subproject commit c8cae593a016b842031b5f73e103554a4f87cb66 From 54c9dbda99b1bb13f49cd00cae8758280e677fb9 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Wed, 31 Jul 2019 15:18:13 +0200 Subject: [PATCH 2/2] fixed granted permissions --- server/src/client/ConnectedClientCommandHandler.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/src/client/ConnectedClientCommandHandler.cpp b/server/src/client/ConnectedClientCommandHandler.cpp index 526d7ca..5b328ba 100644 --- a/server/src/client/ConnectedClientCommandHandler.cpp +++ b/server/src/client/ConnectedClientCommandHandler.cpp @@ -5653,7 +5653,7 @@ CommandResult ConnectedClient::handleCommandPermOverview(Command &cmd) { result[index]["s"] = permission.flags.skip; index++; } - if(permission.flags.skip) { + if(permission.flags.grant_set) { result[index]["t"] = 0; /* server group */ result[index]["id1"] = server_group->group->groupId(); result[index]["id2"] = 0; @@ -5681,7 +5681,7 @@ CommandResult ConnectedClient::handleCommandPermOverview(Command &cmd) { result[index]["s"] = permission.flags.skip; index++; } - if(permission.flags.skip) { + if(permission.flags.grant_set) { result[index]["t"] = 1; /* client */ result[index]["id1"] = client_dbid; result[index]["id2"] = 0; @@ -5710,7 +5710,7 @@ CommandResult ConnectedClient::handleCommandPermOverview(Command &cmd) { result[index]["s"] = permission.flags.skip; index++; } - if(permission.flags.skip) { + if(permission.flags.grant_set) { result[index]["t"] = 2; /* server channel */ result[index]["id1"] = channel->channelId(); result[index]["id2"] = 0; @@ -5739,7 +5739,7 @@ CommandResult ConnectedClient::handleCommandPermOverview(Command &cmd) { result[index]["s"] = permission.flags.skip; index++; } - if(permission.flags.skip) { + if(permission.flags.grant_set) { result[index]["t"] = 3; /* channel group */ result[index]["id1"] = channel_group->channelId; result[index]["id2"] = channel_group->group->groupId(); @@ -5767,7 +5767,7 @@ CommandResult ConnectedClient::handleCommandPermOverview(Command &cmd) { result[index]["s"] = permission.flags.skip; index++; } - if(permission.flags.skip) { + if(permission.flags.grant_set) { result[index]["t"] = 1; /* client */ result[index]["id1"] = std::get<1>(permission_data); result[index]["id2"] = client_dbid;