26 lines
829 B
C++
26 lines
829 B
C++
#include <tommath.h>
|
|
#include <misc/endianness.h>
|
|
#include <Definitions.h>
|
|
#include <log/LogUtils.h>
|
|
#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<ServerPacket>(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
|
|
} |