From b594c9566c5c25baec32d352ad16e5f4137b615b Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Thu, 2 Apr 2020 19:18:58 +0200 Subject: [PATCH] Added some debug info --- server/src/client/ConnectedClientTextCommandHandler.cpp | 5 +++-- server/src/client/SpeakingClient.cpp | 1 - server/src/client/voice/VoiceClientConnection.h | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/server/src/client/ConnectedClientTextCommandHandler.cpp b/server/src/client/ConnectedClientTextCommandHandler.cpp index 2760304..3847f58 100644 --- a/server/src/client/ConnectedClientTextCommandHandler.cpp +++ b/server/src/client/ConnectedClientTextCommandHandler.cpp @@ -641,9 +641,10 @@ bool ConnectedClient::handle_text_command( auto id = vc->getConnection()->getPacketIdManager().currentPacketId(type); auto gen = vc->getConnection()->getPacketIdManager().generationId(type); + auto genestis = vc->getConnection()->get_incoming_generation_estimators(); + send_message(_this.lock(), " OUT " + type.name() + " => generation: " + to_string(gen) + " id: " + to_string(id)); - //auto& buffer = vc->getConnection()->packet_buffers()[type.type()]; - //send_message(_this.lock(), " IN " + type.name() + " => generation: " + to_string(buffer.generation(0)) + " id: " + to_string(buffer.current_index())); + send_message(_this.lock(), " IN " + type.name() + " => generation: " + to_string(genestis[type.type()].generation()) + " id: " + to_string(genestis[type.type()].current_packet_id())); } return true; } else if(TARG(0, "disconnect")) { diff --git a/server/src/client/SpeakingClient.cpp b/server/src/client/SpeakingClient.cpp index 58041a1..9bc0e53 100644 --- a/server/src/client/SpeakingClient.cpp +++ b/server/src/client/SpeakingClient.cpp @@ -65,7 +65,6 @@ void SpeakingClient::handlePacketVoice(const pipes::buffer_view& data, bool head if(!speaking_client) return true; return !speaking_client->shouldReceiveVoice(self); - }), target_clients.end()); if(target_clients.empty()) { return; diff --git a/server/src/client/voice/VoiceClientConnection.h b/server/src/client/voice/VoiceClientConnection.h index 0e8861e..d7560f0 100644 --- a/server/src/client/voice/VoiceClientConnection.h +++ b/server/src/client/voice/VoiceClientConnection.h @@ -82,6 +82,7 @@ namespace ts { bool wait_empty_write_and_prepare_queue(std::chrono::time_point until = std::chrono::time_point()); protocol::PacketIdManager& getPacketIdManager() { return this->packet_id_manager; } + inline auto get_incoming_generation_estimators() { return this->incoming_generation_estimators; } void reset(); void force_insert_command(const pipes::buffer_view& /* payload */);