diff --git a/server/src/client/ConnectedClient.cpp b/server/src/client/ConnectedClient.cpp index 7b68913..81b1913 100644 --- a/server/src/client/ConnectedClient.cpp +++ b/server/src/client/ConnectedClient.cpp @@ -620,7 +620,12 @@ inline void send_channels(ConnectedClient* client, ChannelIT begin, const Channe if(++index > 6) break; } - client->sendCommand(channellist); + if(dynamic_cast(client)) { + auto vc = dynamic_cast(client); + vc->sendCommand0(channellist, false, true); /* we need to process this command directly so it will be processed before the channellistfinished stuff */ + } else { + client->sendCommand(channellist); + } if(begin != end) send_channels(client, begin, end, override_orderid); } diff --git a/server/src/client/ConnectedClient.h b/server/src/client/ConnectedClient.h index 010745f..7d5ad5f 100644 --- a/server/src/client/ConnectedClient.h +++ b/server/src/client/ConnectedClient.h @@ -121,6 +121,7 @@ namespace ts { bool isAddressV6() { return this->remote_address.ss_family == AF_INET6; } const sockaddr_in6* getAddressV6(){ return (sockaddr_in6*) &this->remote_address; } + /* Note: Order is not guaranteed here! */ virtual void sendCommand(const ts::Command& command, bool low = false) = 0; //General manager stuff diff --git a/server/src/client/ConnectedClientCommandHandler.cpp b/server/src/client/ConnectedClientCommandHandler.cpp index 2e5ebaf..ff237c8 100644 --- a/server/src/client/ConnectedClientCommandHandler.cpp +++ b/server/src/client/ConnectedClientCommandHandler.cpp @@ -3313,8 +3313,12 @@ CommandResult ConnectedClient::handleCommandFTGetFileList(Command &cmd) { } if (fileList[0].has("name")) { - this->sendCommand(fileList); - if (this->getExternalType() == CLIENT_TEAMSPEAK) this->sendCommand(fileListFinished); + if(dynamic_cast(this)) { + dynamic_cast(this)->sendCommand0(fileList, false, true); /* We need to process this directly else the order could get shuffeled up! */ + this->sendCommand(fileListFinished); + } else { + this->sendCommand(fileList); + } return CommandResult::Success; } else { return {findError("database_empty_result"), "empty"}; diff --git a/server/src/client/voice/VoiceClient.h b/server/src/client/voice/VoiceClient.h index 8173179..e5283f0 100644 --- a/server/src/client/voice/VoiceClient.h +++ b/server/src/client/voice/VoiceClient.h @@ -55,6 +55,7 @@ namespace ts { bool disconnect(ViewReasonId /* reason type */, const std::string& /* reason */, const std::shared_ptr& /* invoker */, bool /* notify viewer */); virtual void sendCommand(const ts::Command &command, bool low = false) { return this->sendCommand0(command, low); } + /* Note: Order is only guaranteed if progressDirectly is on! */ virtual void sendCommand0(const ts::Command &command, bool low = false, bool progressDirectly = false, std::unique_ptr> listener = nullptr); virtual void sendAcknowledge(uint16_t packetId, bool low = false); diff --git a/shared b/shared index 9833dab..a0cca36 160000 --- a/shared +++ b/shared @@ -1 +1 @@ -Subproject commit 9833dab6e4f96c045da632c208aa1bc977d45349 +Subproject commit a0cca36eca11da410626a340dbe4377067d59c1b