mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 08:10:15 +02:00
Merge pull request #14624 from davidkelly/dk/17207
ACs don't need to call into flagtimeForConnecitonStep
This commit is contained in:
commit
4838a9107a
3 changed files with 16 additions and 7 deletions
|
@ -1078,6 +1078,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
nodeList->startThread();
|
nodeList->startThread();
|
||||||
|
nodeList->setFlagTimeForConnectionStep(true);
|
||||||
|
|
||||||
// move the AddressManager to the NodeList thread so that domain resets due to domain changes always occur
|
// move the AddressManager to the NodeList thread so that domain resets due to domain changes always occur
|
||||||
// before we tell MyAvatar to go to a new location in the new domain
|
// before we tell MyAvatar to go to a new location in the new domain
|
||||||
|
|
|
@ -300,10 +300,10 @@ bool LimitedNodeList::packetSourceAndHashMatchAndTrackBandwidth(const udt::Packe
|
||||||
} else {
|
} else {
|
||||||
HIFI_FCDEBUG(networking(), "Replicated packet of type" << headerType
|
HIFI_FCDEBUG(networking(), "Replicated packet of type" << headerType
|
||||||
<< "received from unknown upstream" << packet.getSenderSockAddr());
|
<< "received from unknown upstream" << packet.getSenderSockAddr());
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
emit dataReceived(NodeType::Unassigned, packet.getPayloadSize());
|
emit dataReceived(NodeType::Unassigned, packet.getPayloadSize());
|
||||||
return true;
|
return true;
|
||||||
|
@ -319,7 +319,7 @@ bool LimitedNodeList::packetSourceAndHashMatchAndTrackBandwidth(const udt::Packe
|
||||||
SharedNodePointer matchingNode = nodeWithLocalID(sourceLocalID);
|
SharedNodePointer matchingNode = nodeWithLocalID(sourceLocalID);
|
||||||
sourceNode = matchingNode.data();
|
sourceNode = matchingNode.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
QUuid sourceID = sourceNode ? sourceNode->getUUID() : QUuid();
|
QUuid sourceID = sourceNode ? sourceNode->getUUID() : QUuid();
|
||||||
|
|
||||||
if (!sourceNode &&
|
if (!sourceNode &&
|
||||||
|
@ -1261,6 +1261,10 @@ void LimitedNodeList::flagTimeForConnectionStep(ConnectionStep connectionStep) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LimitedNodeList::flagTimeForConnectionStep(ConnectionStep connectionStep, quint64 timestamp) {
|
void LimitedNodeList::flagTimeForConnectionStep(ConnectionStep connectionStep, quint64 timestamp) {
|
||||||
|
if (!_flagTimeForConnectionStep) {
|
||||||
|
// this is only true in interface
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (connectionStep == ConnectionStep::LookupAddress) {
|
if (connectionStep == ConnectionStep::LookupAddress) {
|
||||||
QWriteLocker writeLock(&_connectionTimeLock);
|
QWriteLocker writeLock(&_connectionTimeLock);
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ public:
|
||||||
bool getThisNodeCanWriteAssets() const { return _permissions.can(NodePermissions::Permission::canWriteToAssetServer); }
|
bool getThisNodeCanWriteAssets() const { return _permissions.can(NodePermissions::Permission::canWriteToAssetServer); }
|
||||||
bool getThisNodeCanKick() const { return _permissions.can(NodePermissions::Permission::canKick); }
|
bool getThisNodeCanKick() const { return _permissions.can(NodePermissions::Permission::canKick); }
|
||||||
bool getThisNodeCanReplaceContent() const { return _permissions.can(NodePermissions::Permission::canReplaceDomainContent); }
|
bool getThisNodeCanReplaceContent() const { return _permissions.can(NodePermissions::Permission::canReplaceDomainContent); }
|
||||||
|
|
||||||
quint16 getSocketLocalPort() const { return _nodeSocket.localPort(); }
|
quint16 getSocketLocalPort() const { return _nodeSocket.localPort(); }
|
||||||
Q_INVOKABLE void setSocketLocalPort(quint16 socketLocalPort);
|
Q_INVOKABLE void setSocketLocalPort(quint16 socketLocalPort);
|
||||||
|
|
||||||
|
@ -204,9 +204,9 @@ public:
|
||||||
// This allows multiple threads (i.e. a thread pool) to share a lock
|
// This allows multiple threads (i.e. a thread pool) to share a lock
|
||||||
// without deadlocking when a dying node attempts to acquire a write lock
|
// without deadlocking when a dying node attempts to acquire a write lock
|
||||||
template<typename NestedNodeLambda>
|
template<typename NestedNodeLambda>
|
||||||
void nestedEach(NestedNodeLambda functor,
|
void nestedEach(NestedNodeLambda functor,
|
||||||
int* lockWaitOut = nullptr,
|
int* lockWaitOut = nullptr,
|
||||||
int* nodeTransformOut = nullptr,
|
int* nodeTransformOut = nullptr,
|
||||||
int* functorOut = nullptr) {
|
int* functorOut = nullptr) {
|
||||||
auto start = usecTimestampNow();
|
auto start = usecTimestampNow();
|
||||||
{
|
{
|
||||||
|
@ -310,6 +310,9 @@ public:
|
||||||
void setAuthenticatePackets(bool useAuthentication) { _useAuthentication = useAuthentication; }
|
void setAuthenticatePackets(bool useAuthentication) { _useAuthentication = useAuthentication; }
|
||||||
bool getAuthenticatePackets() const { return _useAuthentication; }
|
bool getAuthenticatePackets() const { return _useAuthentication; }
|
||||||
|
|
||||||
|
void setFlagTimeForConnectionStep(bool flag) { _flagTimeForConnectionStep = flag; }
|
||||||
|
bool isFlagTimeForConnectionStep() { return _flagTimeForConnectionStep; }
|
||||||
|
|
||||||
static void makeSTUNRequestPacket(char* stunRequestPacket);
|
static void makeSTUNRequestPacket(char* stunRequestPacket);
|
||||||
|
|
||||||
#if (PR_BUILD || DEV_BUILD)
|
#if (PR_BUILD || DEV_BUILD)
|
||||||
|
@ -440,6 +443,7 @@ private:
|
||||||
using LocalIDMapping = tbb::concurrent_unordered_map<Node::LocalID, SharedNodePointer>;
|
using LocalIDMapping = tbb::concurrent_unordered_map<Node::LocalID, SharedNodePointer>;
|
||||||
LocalIDMapping _localIDMap;
|
LocalIDMapping _localIDMap;
|
||||||
Node::LocalID _sessionLocalID { 0 };
|
Node::LocalID _sessionLocalID { 0 };
|
||||||
|
bool _flagTimeForConnectionStep { false }; // only keep track in interface
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_LimitedNodeList_h
|
#endif // hifi_LimitedNodeList_h
|
||||||
|
|
Loading…
Reference in a new issue