mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 00:02:20 +02:00
inform gatekeeper immediately when kicking someone
This commit is contained in:
parent
d24ed62116
commit
3b344ca01a
2 changed files with 14 additions and 4 deletions
|
@ -20,7 +20,7 @@ endif ()
|
|||
symlink_or_copy_directory_beside_target(${_SHOULD_SYMLINK_RESOURCES} "${CMAKE_CURRENT_SOURCE_DIR}/resources" "resources")
|
||||
|
||||
# link the shared hifi libraries
|
||||
link_hifi_libraries(embedded-webserver networking shared)
|
||||
link_hifi_libraries(embedded-webserver networking shared avatars)
|
||||
|
||||
# find OpenSSL
|
||||
find_package(OpenSSL REQUIRED)
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include <NLPacketList.h>
|
||||
#include <NumericalConstants.h>
|
||||
#include <SettingHandle.h>
|
||||
|
||||
#include <AvatarData.h> //for KillAvatarReason
|
||||
#include "DomainServerNodeData.h"
|
||||
|
||||
const QString SETTINGS_DESCRIPTION_RELATIVE_PATH = "/resources/describe-settings.json";
|
||||
|
@ -711,6 +711,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) {
|
||||
qDebug() << "Removing connect permission for node" << uuidStringWithoutCurlyBraces(matchingNode->getUUID())
|
||||
|
@ -718,9 +725,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
|
||||
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 {
|
||||
qWarning() << "Node kick request received for unknown node. Refusing to process.";
|
||||
|
|
Loading…
Reference in a new issue