mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-08 03:35:35 +08:00
AFV initial commit
This commit is contained in:
committed by
Mat Sutcliffe
parent
7030302e73
commit
b5a2f2ad13
28
src/blackcore/afv/connection/clientconnectiondata.cpp
Normal file
28
src/blackcore/afv/connection/clientconnectiondata.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user