mirror of
https://github.com/lubosz/overte.git
synced 2025-04-13 11:52:09 +02:00
Fix windows compile error
This commit is contained in:
parent
8032063512
commit
9fe7a3350c
3 changed files with 12 additions and 13 deletions
|
@ -908,7 +908,7 @@ void AvatarMixer::parseDomainServerSettings(const QJsonObject& domainSettings) {
|
|||
const QString CONNECTION_RATE = "connection_rate";
|
||||
auto nodeList = DependencyManager::get<NodeList>();
|
||||
auto defaultConnectionRate = nodeList->getMaxConnectionRate();
|
||||
int connectionRate = avatarMixerGroupObject[CONNECTION_RATE].toInt(defaultConnectionRate);
|
||||
int connectionRate = avatarMixerGroupObject[CONNECTION_RATE].toInt((int)defaultConnectionRate);
|
||||
nodeList->setMaxConnectionRate(connectionRate);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
static Setting::Handle<quint16> 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<NodeType_t> 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<NLPacket> 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;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -37,8 +37,7 @@
|
|||
#include "SharedUtil.h"
|
||||
#include <Trace.h>
|
||||
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue