Fix windows compile error

This commit is contained in:
Atlante45 2019-02-28 13:10:10 -08:00 committed by Clement
parent 8032063512
commit 9fe7a3350c
3 changed files with 12 additions and 13 deletions

View file

@ -908,7 +908,7 @@ void AvatarMixer::parseDomainServerSettings(const QJsonObject& domainSettings) {
const QString CONNECTION_RATE = "connection_rate"; const QString CONNECTION_RATE = "connection_rate";
auto nodeList = DependencyManager::get<NodeList>(); auto nodeList = DependencyManager::get<NodeList>();
auto defaultConnectionRate = nodeList->getMaxConnectionRate(); auto defaultConnectionRate = nodeList->getMaxConnectionRate();
int connectionRate = avatarMixerGroupObject[CONNECTION_RATE].toInt(defaultConnectionRate); int connectionRate = avatarMixerGroupObject[CONNECTION_RATE].toInt((int)defaultConnectionRate);
nodeList->setMaxConnectionRate(connectionRate); nodeList->setMaxConnectionRate(connectionRate);
} }

View file

@ -41,7 +41,7 @@
static Setting::Handle<quint16> LIMITED_NODELIST_LOCAL_PORT("LimitedNodeList.LocalPort", 0); static Setting::Handle<quint16> LIMITED_NODELIST_LOCAL_PORT("LimitedNodeList.LocalPort", 0);
using namespace std::chrono_literals; using namespace std::chrono_literals;
static const std::chrono::milliseconds CONNECTION_RATE_INTERVAL = 1s; static const std::chrono::milliseconds CONNECTION_RATE_INTERVAL_MS = 1s;
const std::set<NodeType_t> SOLO_NODE_TYPES = { const std::set<NodeType_t> SOLO_NODE_TYPES = {
NodeType::AvatarMixer, NodeType::AvatarMixer,
@ -94,7 +94,7 @@ LimitedNodeList::LimitedNodeList(int socketListenPort, int dtlsListenPort) :
// Flush delayed adds every second // Flush delayed adds every second
QTimer* delayedAddsFlushTimer = new QTimer(this); QTimer* delayedAddsFlushTimer = new QTimer(this);
connect(delayedAddsFlushTimer, &QTimer::timeout, this, &NodeList::processDelayedAdds); connect(delayedAddsFlushTimer, &QTimer::timeout, this, &NodeList::processDelayedAdds);
delayedAddsFlushTimer->start(CONNECTION_RATE_INTERVAL); delayedAddsFlushTimer->start(CONNECTION_RATE_INTERVAL_MS.count());
// check the local socket right now // check the local socket right now
updateLocalSocket(); updateLocalSocket();
@ -848,13 +848,13 @@ unsigned int LimitedNodeList::broadcastToNodes(std::unique_ptr<NLPacket> packet,
eachNode([&](const SharedNodePointer& node){ eachNode([&](const SharedNodePointer& node){
if (node && destinationNodeTypes.contains(node->getType())) { if (node && destinationNodeTypes.contains(node->getType())) {
if (packet->isReliable()) { if (packet->isReliable()) {
auto packetCopy = NLPacket::createCopy(*packet); auto packetCopy = NLPacket::createCopy(*packet);
sendPacket(std::move(packetCopy), *node); sendPacket(std::move(packetCopy), *node);
} else { } else {
sendUnreliablePacket(*packet, *node); sendUnreliablePacket(*packet, *node);
} }
++n; ++n;
} }
}); });

View file

@ -37,8 +37,7 @@
#include "SharedUtil.h" #include "SharedUtil.h"
#include <Trace.h> #include <Trace.h>
using namespace std::chrono_literals; const int KEEPALIVE_PING_INTERVAL_MS = 1000;
static const std::chrono::milliseconds KEEPALIVE_PING_INTERVAL = 1s;
NodeList::NodeList(char newOwnerType, int socketListenPort, int dtlsListenPort) : NodeList::NodeList(char newOwnerType, int socketListenPort, int dtlsListenPort) :
LimitedNodeList(socketListenPort, dtlsListenPort), LimitedNodeList(socketListenPort, dtlsListenPort),
@ -105,7 +104,7 @@ NodeList::NodeList(char newOwnerType, int socketListenPort, int dtlsListenPort)
connect(this, &LimitedNodeList::nodeActivated, this, &NodeList::maybeSendIgnoreSetToNode); connect(this, &LimitedNodeList::nodeActivated, this, &NodeList::maybeSendIgnoreSetToNode);
// setup our timer to send keepalive pings (it's started and stopped on domain connect/disconnect) // setup our timer to send keepalive pings (it's started and stopped on domain connect/disconnect)
_keepAlivePingTimer.setInterval(KEEPALIVE_PING_INTERVAL); // 1s, Qt::CoarseTimer acceptable _keepAlivePingTimer.setInterval(KEEPALIVE_PING_INTERVAL_MS); // 1s, Qt::CoarseTimer acceptable
connect(&_keepAlivePingTimer, &QTimer::timeout, this, &NodeList::sendKeepAlivePings); connect(&_keepAlivePingTimer, &QTimer::timeout, this, &NodeList::sendKeepAlivePings);
connect(&_domainHandler, SIGNAL(connectedToDomain(QUrl)), &_keepAlivePingTimer, SLOT(start())); connect(&_domainHandler, SIGNAL(connectedToDomain(QUrl)), &_keepAlivePingTimer, SLOT(start()));
connect(&_domainHandler, &DomainHandler::disconnectedFromDomain, &_keepAlivePingTimer, &QTimer::stop); connect(&_domainHandler, &DomainHandler::disconnectedFromDomain, &_keepAlivePingTimer, &QTimer::stop);