diff --git a/assignment-client/src/avatars/AvatarMixer.cpp b/assignment-client/src/avatars/AvatarMixer.cpp index 7c21daefc3..dc3570c7b3 100644 --- a/assignment-client/src/avatars/AvatarMixer.cpp +++ b/assignment-client/src/avatars/AvatarMixer.cpp @@ -908,7 +908,7 @@ void AvatarMixer::parseDomainServerSettings(const QJsonObject& domainSettings) { const QString CONNECTION_RATE = "connection_rate"; auto nodeList = DependencyManager::get(); auto defaultConnectionRate = nodeList->getMaxConnectionRate(); - int connectionRate = avatarMixerGroupObject[CONNECTION_RATE].toInt(defaultConnectionRate); + int connectionRate = avatarMixerGroupObject[CONNECTION_RATE].toInt((int)defaultConnectionRate); nodeList->setMaxConnectionRate(connectionRate); } diff --git a/libraries/networking/src/LimitedNodeList.cpp b/libraries/networking/src/LimitedNodeList.cpp index f00614141c..01c7a16166 100644 --- a/libraries/networking/src/LimitedNodeList.cpp +++ b/libraries/networking/src/LimitedNodeList.cpp @@ -41,7 +41,7 @@ static Setting::Handle LIMITED_NODELIST_LOCAL_PORT("LimitedNodeList.LocalPort", 0); 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 SOLO_NODE_TYPES = { NodeType::AvatarMixer, @@ -94,7 +94,7 @@ LimitedNodeList::LimitedNodeList(int socketListenPort, int dtlsListenPort) : // Flush delayed adds every second QTimer* delayedAddsFlushTimer = new QTimer(this); 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 updateLocalSocket(); @@ -848,13 +848,13 @@ unsigned int LimitedNodeList::broadcastToNodes(std::unique_ptr packet, eachNode([&](const SharedNodePointer& node){ if (node && destinationNodeTypes.contains(node->getType())) { - if (packet->isReliable()) { - auto packetCopy = NLPacket::createCopy(*packet); - sendPacket(std::move(packetCopy), *node); - } else { - sendUnreliablePacket(*packet, *node); - } - ++n; + if (packet->isReliable()) { + auto packetCopy = NLPacket::createCopy(*packet); + sendPacket(std::move(packetCopy), *node); + } else { + sendUnreliablePacket(*packet, *node); + } + ++n; } }); diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index 4097ddf1a3..d45e466291 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -37,8 +37,7 @@ #include "SharedUtil.h" #include -using namespace std::chrono_literals; -static const std::chrono::milliseconds KEEPALIVE_PING_INTERVAL = 1s; +const int KEEPALIVE_PING_INTERVAL_MS = 1000; NodeList::NodeList(char newOwnerType, int socketListenPort, int dtlsListenPort) : LimitedNodeList(socketListenPort, dtlsListenPort), @@ -105,7 +104,7 @@ NodeList::NodeList(char newOwnerType, int socketListenPort, int dtlsListenPort) connect(this, &LimitedNodeList::nodeActivated, this, &NodeList::maybeSendIgnoreSetToNode); // 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(&_domainHandler, SIGNAL(connectedToDomain(QUrl)), &_keepAlivePingTimer, SLOT(start())); connect(&_domainHandler, &DomainHandler::disconnectedFromDomain, &_keepAlivePingTimer, &QTimer::stop);