1
0

RankMgr: GetAllPlayers() returns players sorted by name.

This commit is contained in:
madmaxoft 2014-09-29 22:00:14 +02:00
parent 7a8ca26052
commit 33dc66a4d2
3 changed files with 3 additions and 3 deletions

View File

@ -2037,7 +2037,7 @@ cPluginManager.AddHook(cPluginManager.HOOK_CHAT, OnChatMessage);
ClearPlayerRanks = { Params = "", Return = "", Notes = "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." },
GetAllGroups = { Params = "", Return = "array-table of groups' names", Notes = "Returns an array-table containing the names of all the groups that are known to the manager." },
GetAllPermissions = { Params = "", Return = "array-table of permissions", Notes = "Returns an array-table containing all the permissions that are known to the manager." },
GetAllPlayers = { Params = "", Return = "array-table of playernames", Notes = "Returns the short uuids of all defined players." },
GetAllPlayers = { Params = "", Return = "array-table of uuids", Notes = "Returns the short uuids of all defined players, sorted by the players' names (case insensitive)." },
GetAllRanks = { Params = "", Return = "array-table of ranks' names", Notes = "Returns an array-table containing the names of all the ranks that are known to the manager." },
GetDefaultRank = { Params = "", Return = "string", Notes = "Returns the name of the default rank. " },
GetGroupPermissions = { Params = "GroupName", Return = "array-table of permissions", Notes = "Returns an array-table containing the permissions that the specified group contains." },

View File

@ -671,7 +671,7 @@ AStringVector cRankManager::GetAllPlayerUUIDs(void)
AStringVector res;
try
{
SQLite::Statement stmt(m_DB, "SELECT PlayerUUID FROM PlayerRank");
SQLite::Statement stmt(m_DB, "SELECT PlayerUUID FROM PlayerRank ORDER BY PlayerName COLLATE NOCASE");
while (stmt.executeStep())
{
res.push_back(stmt.getColumn(0).getText());

View File

@ -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. */