AFV initial commit

This commit is contained in:
Roland Rossgotterer
2019-09-14 21:18:26 +02:00
committed by Mat Sutcliffe
parent 7030302e73
commit b5a2f2ad13
100 changed files with 6821 additions and 25 deletions

View File

@@ -0,0 +1,28 @@
#include "clientconnectiondata.h"
#include <QDebug>
qint64 ClientConnectionData::secondsSinceAuthentication() const
{
return m_authenticatedDateTimeUtc.secsTo(QDateTime::currentDateTimeUtc());
}
bool ClientConnectionData::isVoiceServerAlive() const
{
return m_lastVoiceServerHeartbeatAckUtc.secsTo(QDateTime::currentDateTimeUtc()) > serverTimeout;
}
void ClientConnectionData::createCryptoChannels()
{
if (! m_tokens.isValid)
{
qWarning() << "Tokens not set";
}
voiceCryptoChannel.reset(new CryptoDtoChannel(m_tokens.VoiceServer.channelConfig));
// dataCryptoChannel.reset(new CryptoDtoChannel(m_tokens.DataServer.channelConfig));
}
bool ClientConnectionData::voiceServerAlive() const
{
return timeSinceAuthentication() < serverTimeout ||
m_lastVoiceServerHeartbeatAckUtc.secsTo(QDateTime::currentDateTimeUtc()) < serverTimeout;
}