mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:57:59 +02:00
add canKick to USI, revert constants to production
This commit is contained in:
parent
39e6ac0974
commit
4cdc98287b
4 changed files with 26 additions and 0 deletions
|
@ -151,6 +151,10 @@ void LimitedNodeList::setPermissions(const NodePermissions& newPermissions) {
|
||||||
newPermissions.can(NodePermissions::Permission::canWriteToAssetServer)) {
|
newPermissions.can(NodePermissions::Permission::canWriteToAssetServer)) {
|
||||||
emit canWriteAssetsChanged(_permissions.can(NodePermissions::Permission::canWriteToAssetServer));
|
emit canWriteAssetsChanged(_permissions.can(NodePermissions::Permission::canWriteToAssetServer));
|
||||||
}
|
}
|
||||||
|
if (originalPermissions.can(NodePermissions::Permission::canKick) !=
|
||||||
|
newPermissions.can(NodePermissions::Permission::canKick)) {
|
||||||
|
emit canKickChanged(_permissions.can(NodePermissions::Permission::canKick));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QUdpSocket& LimitedNodeList::getDTLSSocket() {
|
QUdpSocket& LimitedNodeList::getDTLSSocket() {
|
||||||
|
|
|
@ -259,6 +259,7 @@ signals:
|
||||||
void canRezChanged(bool canRez);
|
void canRezChanged(bool canRez);
|
||||||
void canRezTmpChanged(bool canRezTmp);
|
void canRezTmpChanged(bool canRezTmp);
|
||||||
void canWriteAssetsChanged(bool canWriteAssets);
|
void canWriteAssetsChanged(bool canWriteAssets);
|
||||||
|
void canKickChanged(bool canKick);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void connectedForLocalSocketTest();
|
void connectedForLocalSocketTest();
|
||||||
|
|
|
@ -13,6 +13,12 @@
|
||||||
|
|
||||||
#include <NodeList.h>
|
#include <NodeList.h>
|
||||||
|
|
||||||
|
UsersScriptingInterface::UsersScriptingInterface() {
|
||||||
|
// emit a signal when kick permissions have changed
|
||||||
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
connect(nodeList.data(), &LimitedNodeList::canKickChanged, this, &UsersScriptingInterface::canKickChanged);
|
||||||
|
}
|
||||||
|
|
||||||
void UsersScriptingInterface::ignore(const QUuid& nodeID) {
|
void UsersScriptingInterface::ignore(const QUuid& nodeID) {
|
||||||
// ask the NodeList to ignore this user (based on the session ID of their node)
|
// ask the NodeList to ignore this user (based on the session ID of their node)
|
||||||
DependencyManager::get<NodeList>()->ignoreNodeBySessionID(nodeID);
|
DependencyManager::get<NodeList>()->ignoreNodeBySessionID(nodeID);
|
||||||
|
@ -22,3 +28,8 @@ void UsersScriptingInterface::kick(const QUuid& nodeID) {
|
||||||
// ask the NodeList to kick the user with the given session ID
|
// ask the NodeList to kick the user with the given session ID
|
||||||
DependencyManager::get<NodeList>()->kickNodeBySessionID(nodeID);
|
DependencyManager::get<NodeList>()->kickNodeBySessionID(nodeID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool UsersScriptingInterface::getCanKick() {
|
||||||
|
// ask the NodeList to return our ability to kick
|
||||||
|
return DependencyManager::get<NodeList>()->getThisNodeCanKick();
|
||||||
|
}
|
||||||
|
|
|
@ -20,9 +20,19 @@ class UsersScriptingInterface : public QObject, public Dependency {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
SINGLETON_DEPENDENCY
|
SINGLETON_DEPENDENCY
|
||||||
|
|
||||||
|
Q_PROPERTY(bool canKick READ getCanKick)
|
||||||
|
|
||||||
|
public:
|
||||||
|
UsersScriptingInterface();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void ignore(const QUuid& nodeID);
|
void ignore(const QUuid& nodeID);
|
||||||
void kick(const QUuid& nodeID);
|
void kick(const QUuid& nodeID);
|
||||||
|
|
||||||
|
bool getCanKick();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void canKickChanged(bool canKick);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue