Adjusted some things to the new shared library

This commit is contained in:
WolverinDEV 2019-10-21 20:03:27 +02:00
parent 12df983367
commit 68d07cf7d3

View File

@ -76,7 +76,7 @@ void VoiceClientConnection::handleDatagramReceived(const pipes::buffer_view& buf
#endif #endif
#endif #endif
auto packet = std::make_unique<ClientPacket>(buffer); auto packet = ClientPacket::from_buffer(buffer);
//packet //packet
//packet->type().type() //packet->type().type()
@ -427,7 +427,7 @@ unique_ptr<protocol::ClientPacket> VoiceClientConnection::next_reassembled_packe
); );
} }
final_packet = make_unique<ClientPacket>(packet_buffer); final_packet = ClientPacket::from_buffer(packet_buffer);
final_packet->setCompressed(final_packet->has_flag(PacketFlag::Compressed)); final_packet->setCompressed(final_packet->has_flag(PacketFlag::Compressed));
} else { } else {
final_packet = buffer->pop_front(); final_packet = buffer->pop_front();
@ -455,7 +455,7 @@ void VoiceClientConnection::sendPacket(const shared_ptr<protocol::ServerPacket>&
shared_ptr<protocol::ServerPacket> packet; shared_ptr<protocol::ServerPacket> packet;
if(copy) { if(copy) {
packet.reset(new protocol::ServerPacket(original_packet->buffer().dup(buffer::allocate_buffer(original_packet->buffer().length())))); packet = protocol::ServerPacket::from_buffer(original_packet->buffer().dup(buffer::allocate_buffer(original_packet->buffer().length())));
if(original_packet->getListener()) if(original_packet->getListener())
packet->setListener(std::move(original_packet->getListener())); packet->setListener(std::move(original_packet->getListener()));
packet->memory_state.flags = original_packet->memory_state.flags; packet->memory_state.flags = original_packet->memory_state.flags;