Merge branch 'master' of github.com:highfidelity/hifi into SUI/audioListFixes

This commit is contained in:
Zach Fox 2019-05-23 12:53:52 -07:00
commit ee226f7e44
20 changed files with 75 additions and 77 deletions

View file

@ -358,7 +358,7 @@ SharedNodePointer DomainGatekeeper::processAssignmentConnectRequest(const NodeCo
nodeData->setNodeVersion(it->second.getNodeVersion());
nodeData->setHardwareAddress(nodeConnection.hardwareAddress);
nodeData->setMachineFingerprint(nodeConnection.machineFingerprint);
nodeData->setLastDomainCheckinTimestamp(nodeConnection.lastPingTimestamp);
nodeData->setWasAssigned(true);
// cleanup the PendingAssignedNodeData for this assignment now that it's connecting
@ -499,9 +499,6 @@ SharedNodePointer DomainGatekeeper::processAgentConnectRequest(const NodeConnect
// set the machine fingerprint passed in the connect request
nodeData->setMachineFingerprint(nodeConnection.machineFingerprint);
// set the last ping timestamp passed in the connect request
nodeData->setLastDomainCheckinTimestamp(nodeConnection.lastPingTimestamp);
// also add an interpolation to DomainServerNodeData so that servers can get username in stats
nodeData->addOverrideForKey(USERNAME_UUID_REPLACEMENT_STATS_KEY,
uuidStringWithoutCurlyBraces(newNode->getUUID()), username);

View file

@ -1068,8 +1068,6 @@ void DomainServer::processListRequestPacket(QSharedPointer<ReceivedMessage> mess
// update the connecting hostname in case it has changed
nodeData->setPlaceName(nodeRequestData.placeName);
nodeData->setLastDomainCheckinTimestamp(nodeRequestData.lastPingTimestamp);
sendDomainListToNode(sendingNode, message->getSenderSockAddr());
}
@ -1176,10 +1174,6 @@ void DomainServer::sendDomainListToNode(const SharedNodePointer& node, const Hif
DomainServerNodeData* nodeData = static_cast<DomainServerNodeData*>(node->getLinkedData());
domainListStream << nodeData->getLastDomainCheckinTimestamp();
domainListStream << usecTimestampNow();
// store the nodeInterestSet on this DomainServerNodeData, in case it has changed
auto& nodeInterestSet = nodeData->getNodeInterestSet();

View file

@ -61,9 +61,6 @@ public:
void setMachineFingerprint(const QUuid& machineFingerprint) { _machineFingerprint = machineFingerprint; }
const QUuid& getMachineFingerprint() { return _machineFingerprint; }
void setLastDomainCheckinTimestamp(quint64 lastDomainCheckinTimestamp) { _lastDomainCheckinTimestamp = lastDomainCheckinTimestamp; }
quint64 getLastDomainCheckinTimestamp() { return _lastDomainCheckinTimestamp; }
void addOverrideForKey(const QString& key, const QString& value, const QString& overrideValue);
void removeOverrideForKey(const QString& key, const QString& value);
@ -96,7 +93,7 @@ private:
QString _nodeVersion;
QString _hardwareAddress;
QUuid _machineFingerprint;
quint64 _lastDomainCheckinTimestamp;
QString _placeName;
bool _wasAssigned { false };

View file

@ -36,8 +36,6 @@ NodeConnectionData NodeConnectionData::fromDataStream(QDataStream& dataStream, c
// now the machine fingerprint
dataStream >> newHeader.machineFingerprint;
}
dataStream >> newHeader.lastPingTimestamp;
dataStream >> newHeader.nodeType
>> newHeader.publicSockAddr >> newHeader.localSockAddr

View file

@ -22,7 +22,6 @@ public:
bool isConnectRequest = true);
QUuid connectUUID;
quint64 lastPingTimestamp{ 0 };
NodeType_t nodeType;
HifiSockAddr publicSockAddr;
HifiSockAddr localSockAddr;

View file

@ -412,8 +412,6 @@ void NodeList::sendDomainServerCheckIn() {
packetStream << FingerprintUtils::getMachineFingerprint();
}
packetStream << usecTimestampNow();
// pack our data to send to the domain-server including
// the hostname information (so the domain-server can see which place name we came in on)
packetStream << _ownerType.load() << publicSockAddr << localSockAddr << _nodeTypesOfInterest.toList();
@ -620,58 +618,12 @@ void NodeList::processDomainServerConnectionTokenPacket(QSharedPointer<ReceivedM
}
void NodeList::processDomainServerList(QSharedPointer<ReceivedMessage> message) {
// parse header information
QDataStream packetStream(message->getMessage());
// grab the domain's ID from the beginning of the packet
QUuid domainUUID;
packetStream >> domainUUID;
Node::LocalID domainLocalID;
packetStream >> domainLocalID;
// pull our owner (ie. session) UUID from the packet, it's always the first thing
// The short (16 bit) ID comes next.
QUuid newUUID;
Node::LocalID newLocalID;
packetStream >> newUUID;
packetStream >> newLocalID;
// pull the permissions/right/privileges for this node out of the stream
NodePermissions newPermissions;
packetStream >> newPermissions;
setPermissions(newPermissions);
// Is packet authentication enabled?
bool isAuthenticated;
packetStream >> isAuthenticated;
setAuthenticatePackets(isAuthenticated);
quint64 connectRequestTimestamp;
quint64 now = usecTimestampNow();
packetStream >> connectRequestTimestamp;
quint64 pingLagTime = (now - connectRequestTimestamp) / USECS_PER_MSEC;
quint64 domainServerPingReceiveTime;
packetStream >> domainServerPingReceiveTime;
quint64 domainServerRequestLag = (domainServerPingReceiveTime - connectRequestTimestamp) / USECS_PER_MSEC;
quint64 domainServerResponseLag = (now - domainServerPingReceiveTime) / USECS_PER_MSEC;
if (_domainHandler.getSockAddr().isNull()) {
qWarning(networking) << "IGNORING DomainList packet while not connected to a Domain Server: sent " << pingLagTime << " msec ago.";
qWarning(networking) << "DomainList request lag (with skew): " << domainServerRequestLag << "msec";
qWarning(networking) << "DomainList response lag (with skew): " << domainServerResponseLag << "msec";
qWarning() << "IGNORING DomainList packet while not connected to a Domain Server";
// refuse to process this packet if we aren't currently connected to the DS
return;
}
// warn if ping lag is getting long
if (pingLagTime > MSECS_PER_SECOND) {
qCDebug(networking) << "DomainList ping is lagging: " << pingLagTime << "msec";
qCDebug(networking) << "DomainList request lag (with skew): " << domainServerRequestLag << "msec";
qCDebug(networking) << "DomainList response lag (with skew): " << domainServerResponseLag << "msec";
}
// this is a packet from the domain server, reset the count of un-replied check-ins
_domainHandler.clearPendingCheckins();
@ -680,15 +632,28 @@ void NodeList::processDomainServerList(QSharedPointer<ReceivedMessage> message)
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::ReceiveDSList);
QDataStream packetStream(message->getMessage());
// grab the domain's ID from the beginning of the packet
QUuid domainUUID;
packetStream >> domainUUID;
if (_domainHandler.isConnected() && _domainHandler.getUUID() != domainUUID) {
// Recieved packet from different domain.
qWarning() << "IGNORING DomainList packet from" << domainUUID << "while connected to"
<< _domainHandler.getUUID() << ": sent " << pingLagTime << " msec ago.";
qWarning(networking) << "DomainList request lag (with skew): " << domainServerRequestLag << "msec";
qWarning(networking) << "DomainList response lag (with skew): " << domainServerResponseLag << "msec";
qWarning() << "IGNORING DomainList packet from" << domainUUID << "while connected to" << _domainHandler.getUUID();
return;
}
Node::LocalID domainLocalID;
packetStream >> domainLocalID;
// pull our owner (ie. session) UUID from the packet, it's always the first thing
// The short (16 bit) ID comes next.
QUuid newUUID;
Node::LocalID newLocalID;
packetStream >> newUUID;
packetStream >> newLocalID;
// when connected, if the session ID or local ID were not null and changed, we should reset
auto currentLocalID = getSessionLocalID();
auto currentSessionID = getSessionUUID();
@ -719,6 +684,15 @@ void NodeList::processDomainServerList(QSharedPointer<ReceivedMessage> message)
DependencyManager::get<AddressManager>()->lookupShareableNameForDomainID(domainUUID);
}
// pull the permissions/right/privileges for this node out of the stream
NodePermissions newPermissions;
packetStream >> newPermissions;
setPermissions(newPermissions);
// Is packet authentication enabled?
bool isAuthenticated;
packetStream >> isAuthenticated;
setAuthenticatePackets(isAuthenticated);
// pull each node in the packet
while (packetStream.device()->pos() < message->getSize()) {
parseNodeFromPacketStream(packetStream);

View file

@ -27,7 +27,7 @@ PacketVersion versionForPacketType(PacketType packetType) {
case PacketType::StunResponse:
return 17;
case PacketType::DomainList:
return static_cast<PacketVersion>(DomainListVersion::HasTimestamp);
return static_cast<PacketVersion>(DomainListVersion::AuthenticationOptional);
case PacketType::EntityAdd:
case PacketType::EntityClone:
case PacketType::EntityEdit:
@ -72,7 +72,7 @@ PacketVersion versionForPacketType(PacketType packetType) {
return static_cast<PacketVersion>(DomainConnectionDeniedVersion::IncludesExtraInfo);
case PacketType::DomainConnectRequest:
return static_cast<PacketVersion>(DomainConnectRequestVersion::HasTimestamp);
return static_cast<PacketVersion>(DomainConnectRequestVersion::AlwaysHasMachineFingerprint);
case PacketType::DomainServerAddedNode:
return static_cast<PacketVersion>(DomainServerAddedNodeVersion::PermissionsGrid);

View file

@ -344,8 +344,7 @@ enum class DomainConnectRequestVersion : PacketVersion {
HasProtocolVersions,
HasMACAddress,
HasMachineFingerprint,
AlwaysHasMachineFingerprint,
HasTimestamp
AlwaysHasMachineFingerprint
};
enum class DomainConnectionDeniedVersion : PacketVersion {
@ -364,8 +363,7 @@ enum class DomainListVersion : PacketVersion {
PermissionsGrid,
GetUsernameFromUUIDSupport,
GetMachineFingerprintFromUUIDSupport,
AuthenticationOptional,
HasTimestamp
AuthenticationOptional
};
enum class AudioVersion : PacketVersion {

View file

@ -0,0 +1,41 @@
"use strict";
/* jslint vars: true, plusplus: true */
//
// defaultScripts.js
//
// Authors: Zach Fox
// Created: 2019-05-23
// Copyright 2019 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
var DEFAULT_SCRIPTS_PATH_PREFIX = ScriptDiscoveryService.defaultScriptsPath + "/";
var DEFAULT_SCRIPTS_SEPARATE = [
DEFAULT_SCRIPTS_PATH_PREFIX + "system/controllers/controllerScripts.js",
Script.resolvePath("simplifiedUI.js")
];
function loadSeparateDefaults() {
for (var i in DEFAULT_SCRIPTS_SEPARATE) {
Script.load(DEFAULT_SCRIPTS_SEPARATE[i]);
}
}
var DEFAULT_SCRIPTS_COMBINED = [
DEFAULT_SCRIPTS_PATH_PREFIX + "system/request-service.js",
DEFAULT_SCRIPTS_PATH_PREFIX + "system/progress.js",
DEFAULT_SCRIPTS_PATH_PREFIX + "system/away.js"
];
function runDefaultsTogether() {
for (var i in DEFAULT_SCRIPTS_COMBINED) {
Script.include(DEFAULT_SCRIPTS_COMBINED[i]);
}
loadSeparateDefaults();
}
runDefaultsTogether();

View file

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View file

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -5,7 +5,7 @@
// simplifiedUI.js
//
// Authors: Wayne Chen & Zach Fox
// Created on: 5/1/2019
// Created: 2019-05-01
// Copyright 2019 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.