From 619e5601522fa0db0480049a717f0b8bf859b3f8 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Tue, 28 Jan 2020 21:01:02 +0100 Subject: [PATCH] Fixedi nvalid channel order --- server/src/client/ConnectedClient.cpp | 10 +++++++--- server/src/client/SpeakingClient.cpp | 2 +- server/src/client/voice/VoiceClientConnection.cpp | 2 +- shared | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/server/src/client/ConnectedClient.cpp b/server/src/client/ConnectedClient.cpp index 4300517..9d117da 100644 --- a/server/src/client/ConnectedClient.cpp +++ b/server/src/client/ConnectedClient.cpp @@ -620,7 +620,10 @@ inline void send_channels(ConnectedClient* client, ChannelIT begin, const Channe while(begin != end) { auto channel = (*begin)->channel(); - if(!channel) continue; + if(!channel) { + begin++; + continue; + } for (const auto &elm : channel->properties().list_properties(property::FLAG_CHANNEL_VIEW, client->getType() == CLIENT_TEAMSPEAK ? property::FLAG_NEW : (uint16_t) 0)) { if(elm.type() == property::CHANNEL_ORDER) @@ -630,9 +633,10 @@ inline void send_channels(ConnectedClient* client, ChannelIT begin, const Channe } begin++; - if(++index > 6) + if(++index > 3) break; } + if(dynamic_cast(client)) { auto vc = dynamic_cast(client); vc->sendCommand0(builder.build(), false, true); /* we need to process this command directly so it will be processed before the channellistfinished stuff */ @@ -691,7 +695,7 @@ void ConnectedClient::sendChannelList(bool lock_channel_tree) { if(entry_channels.empty()) logCritical(this->getServerId(), "ConnectedClient::sendChannelList => invalid (empty) own channel path!"); - send_channels(this, entry_channels.begin(), entry_channels.end(), true); + send_channels(this, entry_channels.begin(), entry_channels.end(), false); this->notifyClientEnterView(_this.lock(), nullptr, "", this->currentChannel, ViewReasonId::VREASON_SYSTEM, nullptr, false); //Notify self after path is send send_channels(this, channels.begin(), channels.end(), false); //this->notifyClientEnterView(_this.lock(), nullptr, "", this->currentChannel, ViewReasonId::VREASON_SYSTEM, nullptr, false); //Notify self after path is send diff --git a/server/src/client/SpeakingClient.cpp b/server/src/client/SpeakingClient.cpp index 55b15fb..3a50d90 100644 --- a/server/src/client/SpeakingClient.cpp +++ b/server/src/client/SpeakingClient.cpp @@ -490,7 +490,7 @@ command_result SpeakingClient::handleCommandClientInit(Command& cmd) { clones_uid++; if(client->getPeerIp() == this->getPeerIp()) clones_ip++; - if(client->getHardwareId() == _own_hwid) + if(!_own_hwid.empty() && client->getHardwareId() == _own_hwid) clones_hwid++; }); diff --git a/server/src/client/voice/VoiceClientConnection.cpp b/server/src/client/voice/VoiceClientConnection.cpp index 7ab8adc..9f0d205 100644 --- a/server/src/client/voice/VoiceClientConnection.cpp +++ b/server/src/client/voice/VoiceClientConnection.cpp @@ -420,7 +420,7 @@ bool VoiceClientConnection::prepare_packet_for_write(vector &resu string error = "success"; - if(packet->type().compressable() && !packet->memory_state.fragment_entry) { + if(packet->type().compressable() && !packet->memory_state.fragment_entry && false) { packet->enable_flag(PacketFlag::Compressed); if(!this->compress_handler.progressPacketOut(packet.get(), error)) { logError(this->getClient()->getServerId(), "{} Could not compress outgoing packet.\nThis could cause fatal failed for the client.\nError: {}", error); diff --git a/shared b/shared index d13c1e6..4aec154 160000 --- a/shared +++ b/shared @@ -1 +1 @@ -Subproject commit d13c1e6d6812aa568b6cc7215100828016b92582 +Subproject commit 4aec154ff161bedaa4080387ad3cf0450f1db1d3