#include #include #include #include #include "../../InstanceHandler.h" #include "VoiceClient.h" using namespace std; using namespace ts::server; using namespace ts::protocol; extern InstanceHandler* serverInstance; void VoiceClient::sendPingRequest() { this->lastPingRequest = std::chrono::system_clock::now(); auto packet = make_shared(PacketTypeInfo::Ping, pipes::buffer_view{}); packet->enable_flag(PacketFlag::Unencrypted); this->connection->sendPacket(packet, false, true); /* prepare directly so the packet gets a packet id */ this->lastPingId = packet->packetId(); #ifdef PKT_LOG_PING logMessage(this->getServerId(), "{}[Ping] Sending a ping request with it {}", CLIENT_STR_LOG_PREFIX, this->lastPingId); #endif }