Fixed some bugs

This commit is contained in:
WolverinDEV
2019-10-20 12:09:28 +02:00
parent 0c6fd1f864
commit 0bedf6c42a
21 changed files with 147 additions and 86 deletions
+8 -4
View File
@@ -54,14 +54,18 @@ void VoiceClient::sendCommand0(const ts::Command &command, bool low, bool direct
return;
}
auto command_str = command.build();
auto packet = make_shared<protocol::ServerPacket>(low ? protocol::PacketTypeInfo::CommandLow : protocol::PacketTypeInfo::Command, pipes::buffer_view{(void*) command_str.data(), command_str.length()});
if(low) packet->enable_flag(protocol::PacketFlag::NewProtocol);
auto packet = make_shared<protocol::ServerPacket>(
low ? protocol::PacketTypeInfo::CommandLow : protocol::PacketTypeInfo::Command,
pipes::buffer_view{(void*) cmd.data(), cmd.length()}
);
if(low) {
packet->enable_flag(protocol::PacketFlag::NewProtocol);
}
packet->setListener(std::move(listener));
this->connection->sendPacket(packet, false, direct);
#ifdef PKT_LOG_CMD
logTrace(this->getServerId(), "{}[Command][Server -> Client] Sending command {}. Command low: {}. Full command: {}", CLIENT_STR_LOG_PREFIX, command.command(), low, command_str);
logTrace(this->getServerId(), "{}[Command][Server -> Client] Sending command {}. Command low: {}. Full command: {}", CLIENT_STR_LOG_PREFIX, command.command(), low, cmd);
#endif
}
void VoiceClient::sendAcknowledge(uint16_t packetId, bool low) {