Merge remote-tracking branch 'origin' into parent-hotkey

This commit is contained in:
Menithal 2017-02-16 08:43:59 +02:00
commit 7afe0d7fc0
5 changed files with 20 additions and 10 deletions

View file

@ -548,9 +548,6 @@ AudioMixerClientData::IgnoreZone& AudioMixerClientData::IgnoreZoneMemo::get(unsi
_zone = box; _zone = box;
unsigned int oldFrame = _frame.exchange(frame, std::memory_order_release); unsigned int oldFrame = _frame.exchange(frame, std::memory_order_release);
Q_UNUSED(oldFrame); Q_UNUSED(oldFrame);
// check the precondition
assert(oldFrame == 0 || frame == (oldFrame + 1));
} }
} }

View file

@ -44,7 +44,7 @@ public:
AvatarAudioStream* getAvatarAudioStream(); AvatarAudioStream* getAvatarAudioStream();
// returns whether self (this data's node) should ignore node, memoized by frame // returns whether self (this data's node) should ignore node, memoized by frame
// precondition: frame is monotonically increasing after first call // precondition: frame is increasing after first call (including overflow wrap)
bool shouldIgnore(SharedNodePointer self, SharedNodePointer node, unsigned int frame); bool shouldIgnore(SharedNodePointer self, SharedNodePointer node, unsigned int frame);
// the following methods should be called from the AudioMixer assignment thread ONLY // the following methods should be called from the AudioMixer assignment thread ONLY
@ -131,7 +131,7 @@ private:
// returns an ignore zone, memoized by frame (lockless if the zone is already memoized) // returns an ignore zone, memoized by frame (lockless if the zone is already memoized)
// preconditions: // preconditions:
// - frame is monotonically increasing after first call // - frame is increasing after first call (including overflow wrap)
// - there are no references left from calls to getIgnoreZone(frame - 1) // - there are no references left from calls to getIgnoreZone(frame - 1)
IgnoreZone& get(unsigned int frame); IgnoreZone& get(unsigned int frame);

View file

@ -20,7 +20,7 @@ endif ()
symlink_or_copy_directory_beside_target(${_SHOULD_SYMLINK_RESOURCES} "${CMAKE_CURRENT_SOURCE_DIR}/resources" "resources") symlink_or_copy_directory_beside_target(${_SHOULD_SYMLINK_RESOURCES} "${CMAKE_CURRENT_SOURCE_DIR}/resources" "resources")
# link the shared hifi libraries # link the shared hifi libraries
link_hifi_libraries(embedded-webserver networking shared) link_hifi_libraries(embedded-webserver networking shared avatars)
# find OpenSSL # find OpenSSL
find_package(OpenSSL REQUIRED) find_package(OpenSSL REQUIRED)

View file

@ -29,7 +29,7 @@
#include <NLPacketList.h> #include <NLPacketList.h>
#include <NumericalConstants.h> #include <NumericalConstants.h>
#include <SettingHandle.h> #include <SettingHandle.h>
#include <AvatarData.h> //for KillAvatarReason
#include "DomainServerNodeData.h" #include "DomainServerNodeData.h"
const QString SETTINGS_DESCRIPTION_RELATIVE_PATH = "/resources/describe-settings.json"; const QString SETTINGS_DESCRIPTION_RELATIVE_PATH = "/resources/describe-settings.json";
@ -728,6 +728,13 @@ void DomainServerSettingsManager::processNodeKickRequestPacket(QSharedPointer<Re
} }
} }
} }
// if we are here, then we kicked them, so send the KillAvatar message to everyone
auto packet = NLPacket::create(PacketType::KillAvatar, NUM_BYTES_RFC4122_UUID + sizeof(KillAvatarReason), true);
packet->write(nodeUUID.toRfc4122());
packet->writePrimitive(KillAvatarReason::NoReason);
// send to avatar mixer, it sends the kill to everyone else
limitedNodeList->broadcastToNodes(std::move(packet), NodeSet() << NodeType::AvatarMixer);
if (newPermissions) { if (newPermissions) {
qDebug() << "Removing connect permission for node" << uuidStringWithoutCurlyBraces(matchingNode->getUUID()) qDebug() << "Removing connect permission for node" << uuidStringWithoutCurlyBraces(matchingNode->getUUID())
@ -735,9 +742,12 @@ void DomainServerSettingsManager::processNodeKickRequestPacket(QSharedPointer<Re
// we've changed permissions, time to store them to disk and emit our signal to say they have changed // we've changed permissions, time to store them to disk and emit our signal to say they have changed
packPermissions(); packPermissions();
} else {
emit updateNodePermissions();
} }
// we emit this no matter what -- though if this isn't a new permission probably 2 people are racing to kick and this
// person lost the race. No matter, just be sure this is called as otherwise it takes like 10s for the person being banned
// to go away
emit updateNodePermissions();
} else { } else {
qWarning() << "Node kick request received for unknown node. Refusing to process."; qWarning() << "Node kick request received for unknown node. Refusing to process.";

View file

@ -478,6 +478,9 @@ bool SendQueue::maybeResendPacket() {
Packet::ObfuscationLevel level = (Packet::ObfuscationLevel)(entry.first < 2 ? 0 : (entry.first - 2) % 4); Packet::ObfuscationLevel level = (Packet::ObfuscationLevel)(entry.first < 2 ? 0 : (entry.first - 2) % 4);
auto wireSize = resendPacket.getWireSize();
auto sequenceNumber = it->first;
if (level != Packet::NoObfuscation) { if (level != Packet::NoObfuscation) {
#ifdef UDT_CONNECTION_DEBUG #ifdef UDT_CONNECTION_DEBUG
QString debugString = "Obfuscating packet %1 with level %2"; QString debugString = "Obfuscating packet %1 with level %2";
@ -512,7 +515,7 @@ bool SendQueue::maybeResendPacket() {
sentLocker.unlock(); sentLocker.unlock();
} }
emit packetRetransmitted(resendPacket.getWireSize(), it->first, p_high_resolution_clock::now()); emit packetRetransmitted(wireSize, sequenceNumber, p_high_resolution_clock::now());
// Signal that we did resend a packet // Signal that we did resend a packet
return true; return true;