diff options
author | madmaxoft <github@xoft.cz> | 2014-08-13 09:53:33 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-08-13 09:53:33 +0200 |
commit | e110f7226895b1629f72a52c7953d8f00a1f63c6 (patch) | |
tree | 820d8f50c261d69e7a808bfff4386b37bbfd342a /src/RankManager.h | |
parent | Merge remote-tracking branch 'origin/master' into Ranks (diff) | |
download | cuberite-e110f7226895b1629f72a52c7953d8f00a1f63c6.tar cuberite-e110f7226895b1629f72a52c7953d8f00a1f63c6.tar.gz cuberite-e110f7226895b1629f72a52c7953d8f00a1f63c6.tar.bz2 cuberite-e110f7226895b1629f72a52c7953d8f00a1f63c6.tar.lz cuberite-e110f7226895b1629f72a52c7953d8f00a1f63c6.tar.xz cuberite-e110f7226895b1629f72a52c7953d8f00a1f63c6.tar.zst cuberite-e110f7226895b1629f72a52c7953d8f00a1f63c6.zip |
Diffstat (limited to 'src/RankManager.h')
-rw-r--r-- | src/RankManager.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/RankManager.h b/src/RankManager.h index 0a43bfe5d..ffe7638e1 100644 --- a/src/RankManager.h +++ b/src/RankManager.h @@ -14,11 +14,22 @@ +class cMojangAPI; + + + + + class cRankManager { public: + /** Creates the rank manager. Needs to be initialized before other use. */ cRankManager(void); + /** Initializes the rank manager. Performs migration and default-setting if no data is found in the DB. + The a_MojangAPI param is used when migrating from old ini files, to look up player UUIDs. */ + void Initialize(cMojangAPI & a_MojangAPI); + /** Returns the name of the rank that the specified player has assigned to them. */ AString GetPlayerRankName(const AString & a_PlayerUUID); @@ -79,6 +90,11 @@ public: Returns true if successful, false on error. */ bool AddPermissionToGroup(const AString & a_Permission, const AString & a_GroupName); + /** Adds the specified permissions to the specified permission group. + Fails if the permission group name is not found. + Returns true if successful, false on error. */ + bool AddPermissionsToGroup(const AStringVector & a_Permissions, const AString & a_GroupName); + /** Removes the specified rank. All players assigned to that rank will be re-assigned to a_ReplacementRankName. If a_ReplacementRankName is empty or not a valid rank, the player will be removed from the DB, @@ -147,7 +163,19 @@ public: protected: + /** The database storage for all the data. */ SQLite::Database m_DB; + + /** Set to true once the manager is initialized. */ + bool m_IsInitialized; + + + /** Returns true if all the DB tables are empty, indicating a fresh new install. */ + bool AreDBTablesEmpty(void); + + /** Returns true iff the specified DB table is empty. + If there's an error while querying, returns false. */ + bool IsDBTableEmpty(const AString & a_TableName); } ; |