fCraft  0.638
Custom Minecraft Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events
fCraft.RankManager Class Reference

Manages all the ranks on a server. Controlls what ranks are avaliable and in what order they exist in. More...

Static Public Member Functions

static void AddRank ([NotNull] Rank rank)
 Adds a new rank to the list. Checks for duplicates.
 
static Rank FindRank (string name)
 Parses rank name (without the ID) using autocompletion.
 
static Rank FindRank (int index)
 Finds rank by index. Rank at index 0 is the highest.
 
static int GetIndex (Rank rank)
 
static bool DeleteRank ([NotNull] Rank deletedRank,[NotNull] Rank replacementRank)
 Removes the specified rank from the list of available ranks
 
static bool CanRenameRank ([NotNull] Rank rank,[NotNull] string newName)
 
static void RenameRank ([NotNull] Rank rank,[NotNull] string newName)
 
static bool RaiseRank ([NotNull] Rank rank)
 Raises the index value of the specified Rank, and then lowers the rank that was previously in that position.
 
static bool LowerRank ([NotNull] Rank rank)
 Lowers the index value of the specified Rank, and then raises the rank that was previously in that position.
 
static string GenerateID ()
 Creates a 16 character unique rank ID, via Server.GetRandomString().
 
static Rank GetMinRankWithAllPermissions ([NotNull] params Permission[] permissions)
 Finds the lowest rank that has all the required permissions.
 
static Rank GetMinRankWithAnyPermission ([NotNull] params Permission[] permissions)
 Finds the lowest rank that has all the required permissions.
 

Properties

static Dictionary< string, RankRanksByName [get, set]
 List of Ranks, indexed by their name.
 
static Dictionary< string, RankRanksByFullName [get, set]
 List of Ranks, indexed by their fully qualified name.
 
static Dictionary< string, RankRanksByID [get, set]
 List of Ranks, indexed by their ID.
 
static List< RankRanks [get, set]
 List of all Ranks, in no particular order.
 
static Rank DefaultRank [get, set]
 Default Rank of a new user.
 
static Rank LowestRank [get, set]
 Lowest Rank available in the server.
 
static Rank HighestRank [get, set]
 Highest Rank available in the server.
 
static Rank PatrolledRank [get, set]
 Highest Rank that Patrol will consider when selecting canditates.
 
static Rank DefaultBuildRank [get, set]
 The default minimum Rank required to build in newly created worlds.
 
static Rank BlockDBAutoEnableRank [get, set]
 Rank used by BlockDB to determine whether it should be auto-enabled on a world or not. Worlds where BuildSecurity.MinRank is equal or lower than this rank WILL have BlockDB auto-enabled.
 

Detailed Description

Manages all the ranks on a server. Controlls what ranks are avaliable and in what order they exist in.

Member Function Documentation

static void fCraft.RankManager.AddRank ( [NotNull] Rank  rank)
static

Adds a new rank to the list. Checks for duplicates.

static bool fCraft.RankManager.CanRenameRank ( [NotNull] Rank  rank,
[NotNull] string  newName 
)
static
static bool fCraft.RankManager.DeleteRank ( [NotNull] Rank  deletedRank,
[NotNull] Rank  replacementRank 
)
static

Removes the specified rank from the list of available ranks

Parameters
deletedRankRank to be deleted.
replacementRankRank that will replace the deleted rank.
Returns
Whether or not the rank was succesfully deleted/replaced.
Exceptions
ArgumentNullExceptiondeletedRank or replacementRank is null.
InvalidOperationExceptionPlayerDB is already loaded.
static Rank fCraft.RankManager.FindRank ( string  name)
static

Parses rank name (without the ID) using autocompletion.

Parameters
nameFull or partial rank name. May be null.
Returns
If name could be parsed, returns the corresponding Rank object. Otherwise returns null. If null was given instead of rank name, returns null.
static Rank fCraft.RankManager.FindRank ( int  index)
static

Finds rank by index. Rank at index 0 is the highest.

Returns
If name could be parsed, returns the corresponding Rank object. Otherwise returns null.
static string fCraft.RankManager.GenerateID ( )
static

Creates a 16 character unique rank ID, via Server.GetRandomString().

Returns
16 character unique rank ID.
static int fCraft.RankManager.GetIndex ( Rank  rank)
static
static Rank fCraft.RankManager.GetMinRankWithAllPermissions ( [NotNull] params Permission[]  permissions)
static

Finds the lowest rank that has all the required permissions.

Parameters
permissionsOne or more permissions to check for.
Returns
A relevant Rank object, or null of none were found.
static Rank fCraft.RankManager.GetMinRankWithAnyPermission ( [NotNull] params Permission[]  permissions)
static

Finds the lowest rank that has all the required permissions.

Parameters
permissionsOne or more permissions to check for.
Returns
A relevant Rank object, or null of none were found.
static bool fCraft.RankManager.LowerRank ( [NotNull] Rank  rank)
static

Lowers the index value of the specified Rank, and then raises the rank that was previously in that position.

Parameters
rankRank to lower.
Returns
True if the Rank index was lowered; false if it is already the lowest rank.
Exceptions
ArgumentNullExceptionrank is null.
InvalidOperationExceptionPlayerDB is already loaded.
static bool fCraft.RankManager.RaiseRank ( [NotNull] Rank  rank)
static

Raises the index value of the specified Rank, and then lowers the rank that was previously in that position.

Parameters
rankRank to raise.
Returns
True if the Rank index was raised; false if it is already the highest rank.
Exceptions
ArgumentNullExceptionrank is null.
InvalidOperationExceptionPlayerDB is already loaded.
static void fCraft.RankManager.RenameRank ( [NotNull] Rank  rank,
[NotNull] string  newName 
)
static

Property Documentation

Rank fCraft.RankManager.BlockDBAutoEnableRank
staticgetset

Rank used by BlockDB to determine whether it should be auto-enabled on a world or not. Worlds where BuildSecurity.MinRank is equal or lower than this rank WILL have BlockDB auto-enabled.

Rank fCraft.RankManager.DefaultBuildRank
staticgetset

The default minimum Rank required to build in newly created worlds.

Rank fCraft.RankManager.DefaultRank
staticgetset

Default Rank of a new user.

Rank fCraft.RankManager.HighestRank
staticgetset

Highest Rank available in the server.

Rank fCraft.RankManager.LowestRank
staticgetset

Lowest Rank available in the server.

Rank fCraft.RankManager.PatrolledRank
staticgetset

Highest Rank that Patrol will consider when selecting canditates.

List<Rank> fCraft.RankManager.Ranks
staticgetset

List of all Ranks, in no particular order.

Dictionary<string, Rank> fCraft.RankManager.RanksByFullName
staticgetset

List of Ranks, indexed by their fully qualified name.

Dictionary<string, Rank> fCraft.RankManager.RanksByID
staticgetset

List of Ranks, indexed by their ID.

Dictionary<string, Rank> fCraft.RankManager.RanksByName
staticgetset

List of Ranks, indexed by their name.


The documentation for this class was generated from the following file: