mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 18:42:58 +02:00
Finish flag work on kick functionality.
This commit is contained in:
parent
0216b34681
commit
be0bd3940d
3 changed files with 14 additions and 10 deletions
|
@ -50,6 +50,7 @@
|
||||||
#include <shared/ConicalViewFrustum.h>
|
#include <shared/ConicalViewFrustum.h>
|
||||||
#include <shared/FileLogger.h>
|
#include <shared/FileLogger.h>
|
||||||
#include <RunningMarker.h>
|
#include <RunningMarker.h>
|
||||||
|
#include <ModerationFlags.h>
|
||||||
|
|
||||||
#include "avatar/MyAvatar.h"
|
#include "avatar/MyAvatar.h"
|
||||||
#include "FancyCamera.h"
|
#include "FancyCamera.h"
|
||||||
|
@ -608,7 +609,7 @@ private:
|
||||||
void toggleTabletUI(bool shouldOpen = false) const;
|
void toggleTabletUI(bool shouldOpen = false) const;
|
||||||
bool shouldCaptureMouse() const;
|
bool shouldCaptureMouse() const;
|
||||||
|
|
||||||
void userKickConfirmation(const QUuid& nodeID, int banFlags);
|
void userKickConfirmation(const QUuid& nodeID, int banFlags = ModerationFlags::getDefaultBanFlags());
|
||||||
|
|
||||||
MainWindow* _window;
|
MainWindow* _window;
|
||||||
QElapsedTimer& _sessionRunTimer;
|
QElapsedTimer& _sessionRunTimer;
|
||||||
|
|
|
@ -41,10 +41,10 @@ class UsersScriptingInterface : public QObject, public Dependency {
|
||||||
Q_PROPERTY(bool canKick READ getCanKick)
|
Q_PROPERTY(bool canKick READ getCanKick)
|
||||||
Q_PROPERTY(bool requestsDomainListData READ getRequestsDomainListData WRITE setRequestsDomainListData)
|
Q_PROPERTY(bool requestsDomainListData READ getRequestsDomainListData WRITE setRequestsDomainListData)
|
||||||
|
|
||||||
Q_PROPERTY(unsigned int NO_BAN READ ModerationFlags::BanFlags::NO_BAN CONSTANT)
|
Q_PROPERTY(unsigned int NO_BAN READ getNoBan CONSTANT)
|
||||||
Q_PROPERTY(unsigned int BAN_BY_USERNAME READ ModerationFlags::BanFlags::BAN_BY_USERNAME CONSTANT)
|
Q_PROPERTY(unsigned int BAN_BY_USERNAME READ getBanByUsername CONSTANT)
|
||||||
Q_PROPERTY(unsigned int BAN_BY_FINGERPRINT READ ModerationFlags::BanFlags::BAN_BY_FINGERPRINT CONSTANT)
|
Q_PROPERTY(unsigned int BAN_BY_FINGERPRINT READ getBanByFingerprint CONSTANT)
|
||||||
Q_PROPERTY(unsigned int BAN_BY_IP READ ModerationFlags::BanFlags::BAN_BY_IP CONSTANT)
|
Q_PROPERTY(unsigned int BAN_BY_IP READ getBanByIP CONSTANT)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UsersScriptingInterface();
|
UsersScriptingInterface();
|
||||||
|
@ -123,11 +123,9 @@ public slots:
|
||||||
* <p>This function only works if you're an administrator of the domain you're in.</p>
|
* <p>This function only works if you're an administrator of the domain you're in.</p>
|
||||||
* @function Users.kick
|
* @function Users.kick
|
||||||
* @param {Uuid} sessionID - The session ID of the user to kick and ban.
|
* @param {Uuid} sessionID - The session ID of the user to kick and ban.
|
||||||
* @param {boolean} [banByUsername=true] - Should ban the user's username.
|
* @param {number} - Preferred ban flags. <i>Bans a user by username (if available) and machine fingerprint by default.</i>
|
||||||
* @param {boolean} [banByFingerprint=true] - Should ban the user's machine fingerprint.
|
|
||||||
* @param {boolean} [banByIP=false] - Should ban the user's IP address.
|
|
||||||
*/
|
*/
|
||||||
void kick(const QUuid& nodeID, int banFlags = 0);
|
void kick(const QUuid& nodeID, int banFlags = ModerationFlags::getDefaultBanFlags());
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Mutes a user's microphone for everyone. The mute is not permanent: the user can unmute themselves.
|
* Mutes a user's microphone for everyone. The mute is not permanent: the user can unmute themselves.
|
||||||
|
@ -247,6 +245,11 @@ private:
|
||||||
bool getRequestsDomainListData();
|
bool getRequestsDomainListData();
|
||||||
void setRequestsDomainListData(bool requests);
|
void setRequestsDomainListData(bool requests);
|
||||||
|
|
||||||
|
static constexpr unsigned int getNoBan() { return ModerationFlags::BanFlags::NO_BAN; };
|
||||||
|
static constexpr unsigned int getBanByUsername() { return ModerationFlags::BanFlags::BAN_BY_USERNAME; };
|
||||||
|
static constexpr unsigned int getBanByFingerprint() { return ModerationFlags::BanFlags::BAN_BY_FINGERPRINT; };
|
||||||
|
static constexpr unsigned int getBanByIP() { return ModerationFlags::BanFlags::BAN_BY_IP; };
|
||||||
|
|
||||||
std::function<void(const QUuid& nodeID, int banFlags)> _kickConfirmationOperator;
|
std::function<void(const QUuid& nodeID, int banFlags)> _kickConfirmationOperator;
|
||||||
|
|
||||||
ReadWriteLockable _kickResponseLock;
|
ReadWriteLockable _kickResponseLock;
|
||||||
|
|
|
@ -22,7 +22,7 @@ public:
|
||||||
BAN_BY_IP = 4
|
BAN_BY_IP = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
int test(int lol) { return lol; };
|
static constexpr unsigned int getDefaultBanFlags() { return (BanFlags::BAN_BY_USERNAME | BanFlags::BAN_BY_FINGERPRINT); };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // vircadia_ModerationFlags_h
|
#endif // vircadia_ModerationFlags_h
|
Loading…
Reference in a new issue