fixed connection issues

This commit is contained in:
WolverinDEV 2019-07-18 21:36:36 +02:00
parent 0a762eef76
commit dd0eaf33e5

View File

@ -228,25 +228,16 @@ void VoiceClientConnection::handleDatagramReceived(const pipes::buffer_view& buf
} else {
//TODO: Needs rethinking because read_queue.push_back increases the index, but this has not to be the packet id
if(!read_queue.push_back(move(packet))) {
debugMessage(this->client->getServerId(), "{} Got unordered packet of type {} which is out of the buffer range of {}. Packet ID: {}, Full index: {}. Dropping packet",
debugMessage(this->client->getServerId(), "{} Got unordered packet of type {} which is out of the buffer range of {}. Packet ID: {}. Dropping packet.",
CLIENT_STR_LOG_PREFIX_(this->client),
packet_type.name(),
read_queue.capacity(),
packet_id,
read_queue.full_index()
);
if(read_queue.current_index() < packet_id) {
logWarning(this->client->getServerId(), "{} Unordered packet queue index increased from {} to {} for type {}",
CLIENT_STR_LOG_PREFIX_(this->client),
read_queue.current_index(),
packet_id,
packet_type.name()
);
read_queue.set_full_index_to(packet_id);
}
/* return; dont stop here because we've to progress the packets */
} else {
//Allowing that the packet id pointer is lower then the actual packet ids.
}
{
//A max entropie of 16 packets should not happen. This indicates more that 16 or more packets got lost
auto current_index = read_queue.current_index();
if(current_index + 16 < packet_id)
read_queue.set_full_index_to(packet_id);