From 2fb3eb3532c2c40e21def269cb9d5ca6eb11ef6d Mon Sep 17 00:00:00 2001 From: Howaner Date: Sun, 28 Sep 2014 02:17:32 +0200 Subject: cRankManager: Added GetAllPlayers() and GetPlayerName() --- src/RankManager.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/RankManager.h') diff --git a/src/RankManager.h b/src/RankManager.h index f364bba6a..ebdba17a0 100644 --- a/src/RankManager.h +++ b/src/RankManager.h @@ -60,6 +60,10 @@ public: If the player has no rank assigned, returns an empty string (NOT the default rank). */ AString GetPlayerRankName(const AString & a_PlayerUUID); + /** Returns the last name that the specified player has. + If the player isn't in the database, this returns an empty string. */ + AString GetPlayerName(const AString & a_PlayerUUID); + /** Returns the names of Groups that the specified player has assigned to them. */ AStringVector GetPlayerGroups(const AString & a_PlayerUUID); @@ -79,6 +83,9 @@ public: Returns an empty vector if the rank doesn't exist. Any non-existent groups are ignored. */ AStringVector GetRankPermissions(const AString & a_RankName); + /** Returns the short uuids of all defined players. */ + AStringVector GetAllPlayers(void); + /** Returns the names of all defined ranks. */ AStringVector GetAllRanks(void); @@ -210,6 +217,9 @@ public: /** Returns the name of the default rank. */ const AString & GetDefaultRank(void) const { return m_DefaultRank; } + + /** Updates the playername that is saved with this uuid. Returns false if a error occurred */ + bool UpdatePlayerName(const AString & a_PlayerUUID, const AString & a_NewPlayerName); protected: -- cgit v1.2.3 From 27331da017625c748a104c72d72c8958003e1e90 Mon Sep 17 00:00:00 2001 From: Howaner Date: Sun, 28 Sep 2014 11:17:36 +0200 Subject: Updated api documentation. --- src/RankManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/RankManager.h') diff --git a/src/RankManager.h b/src/RankManager.h index ebdba17a0..b577fad05 100644 --- a/src/RankManager.h +++ b/src/RankManager.h @@ -61,7 +61,7 @@ public: AString GetPlayerRankName(const AString & a_PlayerUUID); /** Returns the last name that the specified player has. - If the player isn't in the database, this returns an empty string. */ + An empty string is returned if the player isn't in the database. */ AString GetPlayerName(const AString & a_PlayerUUID); /** Returns the names of Groups that the specified player has assigned to them. */ -- cgit v1.2.3 From 63c53a8e23776cc3011fd0260857bd22274e2c62 Mon Sep 17 00:00:00 2001 From: Howaner Date: Sun, 28 Sep 2014 15:16:11 +0200 Subject: cRankManager: Added ClearPlayerRanks() --- src/RankManager.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/RankManager.h') diff --git a/src/RankManager.h b/src/RankManager.h index b577fad05..acfcdb01d 100644 --- a/src/RankManager.h +++ b/src/RankManager.h @@ -217,6 +217,10 @@ public: /** Returns the name of the default rank. */ const AString & GetDefaultRank(void) const { return m_DefaultRank; } + + /** Removes all player ranks from the database. Note that this doesn't change the cPlayer instances + for the already connected players, you need to update all the instances manually. */ + void ClearPlayerRanks(void); /** Updates the playername that is saved with this uuid. Returns false if a error occurred */ bool UpdatePlayerName(const AString & a_PlayerUUID, const AString & a_NewPlayerName); -- cgit v1.2.3 From ff3a3b801d5fa6edb855b13b73af497b29e8a42e Mon Sep 17 00:00:00 2001 From: Howaner Date: Mon, 29 Sep 2014 14:43:16 +0200 Subject: Renamed GetAllPlayers() to GetAllPlayerUUIDs() --- src/RankManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/RankManager.h') diff --git a/src/RankManager.h b/src/RankManager.h index acfcdb01d..3f5884f2e 100644 --- a/src/RankManager.h +++ b/src/RankManager.h @@ -84,7 +84,7 @@ public: AStringVector GetRankPermissions(const AString & a_RankName); /** Returns the short uuids of all defined players. */ - AStringVector GetAllPlayers(void); + AStringVector GetAllPlayerUUIDs(void); /** Returns the names of all defined ranks. */ AStringVector GetAllRanks(void); -- cgit v1.2.3 From 33dc66a4d23246b5794cf9ca5bd4287a72db4cec Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 29 Sep 2014 22:00:14 +0200 Subject: RankMgr: GetAllPlayers() returns players sorted by name. --- src/RankManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/RankManager.h') diff --git a/src/RankManager.h b/src/RankManager.h index 3f5884f2e..61c52fda6 100644 --- a/src/RankManager.h +++ b/src/RankManager.h @@ -83,7 +83,7 @@ public: Returns an empty vector if the rank doesn't exist. Any non-existent groups are ignored. */ AStringVector GetRankPermissions(const AString & a_RankName); - /** Returns the short uuids of all defined players. */ + /** Returns the short uuids of all defined players. The returned players are ordered by their name (NOT their UUIDs). */ AStringVector GetAllPlayerUUIDs(void); /** Returns the names of all defined ranks. */ -- cgit v1.2.3 From a26541a7c3ced0569098edd0aae61c097c2912f4 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 20 Oct 2014 21:55:07 +0100 Subject: En masse NULL -> nullptr replace --- src/RankManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/RankManager.h') diff --git a/src/RankManager.h b/src/RankManager.h index 61c52fda6..5dff634b5 100644 --- a/src/RankManager.h +++ b/src/RankManager.h @@ -240,7 +240,7 @@ protected: bool m_IsInitialized; /** The MojangAPI instance that is used for translating playernames to UUIDs. - Set in Initialize(), may be NULL. */ + Set in Initialize(), may be nullptr. */ cMojangAPI * m_MojangAPI; -- cgit v1.2.3