A lot of updates (Speed improvement)

This commit is contained in:
WolverinDEV
2020-04-24 22:04:07 +02:00
parent 0a2c1bf3d9
commit 3e787a1d9f
18 changed files with 458 additions and 495 deletions
+2 -2
View File
@@ -10,7 +10,6 @@
#include "SpeakingClient.h"
#include "src/InstanceHandler.h"
#include "StringVariable.h"
#include "src/music/MusicBotManager.h"
#include "misc/timer.h"
using namespace std::chrono;
@@ -99,9 +98,10 @@ void SpeakingClient::handlePacketVoice(const pipes::buffer_view& data, bool head
memcpy(&buffer[5], &data[3], data.length() - 3);
}
auto bview = pipes::buffer_view{buffer, data.length() + 2};
for (const auto& client : target_clients) {
auto speaking_client = static_pointer_cast<SpeakingClient>(client);
speaking_client->send_voice_packet(pipes::buffer_view{buffer, data.length() + 2}, flags);
speaking_client->send_voice_packet(bview, flags);
}
}