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

Rank of a player. Ranks are arranged in a linear hierarchy. One instance of a Rank object should be shared by players of the same rank. Rank objects are comparable - you can use comparison operators or CompareTo. More...

+ Inheritance diagram for fCraft.Rank:
+ Collaboration diagram for fCraft.Rank:

Public Member Functions

 Rank ([NotNull] string name,[NotNull] string id)
 Sets the name and ID of this Rank.
 
 Rank ([NotNull] XElement el)
 
XElement Serialize ()
 
int CompareTo ([NotNull] Rank other)
 
bool Can (Permission permission)
 Checks whether this rank is granted the given permission.
 
bool Can (Permission permission,[NotNull] Rank other)
 Checks whether this rank is granted the given permission, and whether the limit is high
 
bool CanSee ([NotNull] Rank other)
 Whether players of this rank are allowed to see hidden players of the given rank.
 
Rank GetLimit (Permission permission)
 Returns the highest rank that is allowed to be affected by this rank, in the conext of the given permission. If no limit was explicitly specified, returns this/own rank.
 
bool HasLimitSet (Permission permission)
 Checks whether this rank has a rank limit explicitly set for the given permission.
 
void SetLimit (Permission permission,[CanBeNull] Rank limit)
 Sets the rank limit for the given permission.
 
void ResetLimit (Permission permission)
 Resets the rank limit for the given permission to default ("own rank").
 
override string ToString ()
 

Static Public Member Functions

static bool operator> (Rank a, Rank b)
 
static bool operator< (Rank a, Rank b)
 
static bool operator>= (Rank a, Rank b)
 
static bool operator<= (Rank a, Rank b)
 
static bool IsValidRankName ([NotNull] string rankName)
 
static bool IsValidID ([NotNull] string id)
 
static bool IsValidPrefix ([NotNull] string prefix)
 
static Rank Parse (string name)
 Parses serialized rank. Accepts either the "name" or "name#ID" format. Uses legacy rank mapping table for unrecognized ranks. Does not autocomple. Name part is case-insensitive. ID part is case-sensitive.
 

Public Attributes

bool AllowSecurityCircumvention
 Whether players of this rank are allowed to remove restrictions that affect themselves. Affects /WMain, /WAccess, /WBuild, /ZAdd, /ZEdit, and /ZRemove.
 
int CopySlots = 2
 Maximum number of buffered copies this rank is allowed to have.
 
int FillLimit = 32
 Maximum number of blocks away the origin that a fill is allowed to travel. Applies to /Fill2D command. For example, a limit of 32, means that the maximum fill dimensions are (32 * 2 + 1), which is 65 x 65
 
int DrawLimit
 Maximum number of blocks that player is allowed to draw at a time using draw commands.
 
int IdleKickTimer
 Time until the idle kicker will kick this Rank from the server.
 
int AntiGriefBlocks
 Number of blocks that need to be modified in AntiGriefSeconds for the AntiGrief to kick in for this Rank.
 
int AntiGriefSeconds
 The interval in seconds for which to count number of blocks broken for use in AntiGrief for this Rank.
 
bool HasReservedSlot
 Whether this rank has a reserved slot (is allowed to join the server even if it's full).
 
int Index
 Rank's relative index on the hierarchy. Index of the top rank is always 0. Subordinate ranks start at 1. Higher index = lower rank.
 

Properties

string Color [get, set]
 Rank color code. Should not be left blank.
 
string Prefix [get, set]
 String that prefixes the username of all members of this rank.
 
string Name [get, set]
 Rank's displayed name. Use rank.FullName instead for serializing (to improve backwards compatibility).
 
string ID [get, set]
 Unique rank ID. Generated by Rank.GenerateID. Assigned once at creation. Used to preserve compatibility in case a rank gets renamed.
 
bool[] Permissions [get, set]
 Set of permissions given to this rank. Use Rank.Can() to access.
 
Rank NextRankUp [get, set]
 The Rank immediately above this Rank. Null if there is no higher rank. Set by RankManager.
 
Rank NextRankDown [get, set]
 The Rank immediately below this Rank. Null if there is no lower rank. Set by RankManager.
 
World MainWorld [get, set]
 The main world for this Rank. Set and saved by WorldManager.
 
Rank[] PermissionLimits [get, set]
 
string FullName [get, set]
 Fully qualified name of the rank. Format: "Name#ID". Should be used whereever rank name needs to be serialized.
 
string ClassyName [get]
 Decorated name of the rank, including color and prefix (if enabled by the configuration).
 
IEnumerable< PlayerPlayers [get]
 Shortcut to the list of all online players of this rank.
 
int PlayerCount [get]
 Total number of players of this rank (online and offline).
 
- Properties inherited from fCraft.IClassy
string ClassyName [get]
 Name optionally formatted with minecraft color codes or other decorations.
 

Detailed Description

Rank of a player. Ranks are arranged in a linear hierarchy. One instance of a Rank object should be shared by players of the same rank. Rank objects are comparable - you can use comparison operators or CompareTo.

Constructor & Destructor Documentation

fCraft.Rank.Rank ( [NotNull] string  name,
[NotNull] string  id 
)

Sets the name and ID of this Rank.

Parameters
nameName to assign to this Rank.
idUnique ID to assing to this Rank. Use RankManager.GenerateID to generate.
Exceptions
ArgumentNullExceptionname or id is null.
fCraft.Rank.Rank ( [NotNull] XElement  el)

Member Function Documentation

bool fCraft.Rank.Can ( Permission  permission)

Checks whether this rank is granted the given permission.

bool fCraft.Rank.Can ( Permission  permission,
[NotNull] Rank  other 
)

Checks whether this rank is granted the given permission, and whether the limit is high

bool fCraft.Rank.CanSee ( [NotNull] Rank  other)

Whether players of this rank are allowed to see hidden players of the given rank.

int fCraft.Rank.CompareTo ( [NotNull] Rank  other)
Rank fCraft.Rank.GetLimit ( Permission  permission)

Returns the highest rank that is allowed to be affected by this rank, in the conext of the given permission. If no limit was explicitly specified, returns this/own rank.

bool fCraft.Rank.HasLimitSet ( Permission  permission)

Checks whether this rank has a rank limit explicitly set for the given permission.

static bool fCraft.Rank.IsValidID ( [NotNull] string  id)
static
static bool fCraft.Rank.IsValidPrefix ( [NotNull] string  prefix)
static
static bool fCraft.Rank.IsValidRankName ( [NotNull] string  rankName)
static
static bool fCraft.Rank.operator< ( Rank  a,
Rank  b 
)
static
static bool fCraft.Rank.operator<= ( Rank  a,
Rank  b 
)
static
static bool fCraft.Rank.operator> ( Rank  a,
Rank  b 
)
static
static bool fCraft.Rank.operator>= ( Rank  a,
Rank  b 
)
static
static Rank fCraft.Rank.Parse ( string  name)
static

Parses serialized rank. Accepts either the "name" or "name#ID" format. Uses legacy rank mapping table for unrecognized ranks. Does not autocomple. Name part is case-insensitive. ID part is case-sensitive.

Parameters
nameFull rank name, or name and ID.
Returns
If name could be parsed, returns the corresponding Rank object. Otherwise returns null.
void fCraft.Rank.ResetLimit ( Permission  permission)

Resets the rank limit for the given permission to default ("own rank").

XElement fCraft.Rank.Serialize ( )
void fCraft.Rank.SetLimit ( Permission  permission,
[CanBeNull] Rank  limit 
)

Sets the rank limit for the given permission.

override string fCraft.Rank.ToString ( )

Member Data Documentation

bool fCraft.Rank.AllowSecurityCircumvention

Whether players of this rank are allowed to remove restrictions that affect themselves. Affects /WMain, /WAccess, /WBuild, /ZAdd, /ZEdit, and /ZRemove.

int fCraft.Rank.AntiGriefBlocks

Number of blocks that need to be modified in AntiGriefSeconds for the AntiGrief to kick in for this Rank.

int fCraft.Rank.AntiGriefSeconds

The interval in seconds for which to count number of blocks broken for use in AntiGrief for this Rank.

int fCraft.Rank.CopySlots = 2

Maximum number of buffered copies this rank is allowed to have.

int fCraft.Rank.DrawLimit

Maximum number of blocks that player is allowed to draw at a time using draw commands.

int fCraft.Rank.FillLimit = 32

Maximum number of blocks away the origin that a fill is allowed to travel. Applies to /Fill2D command. For example, a limit of 32, means that the maximum fill dimensions are (32 * 2 + 1), which is 65 x 65

bool fCraft.Rank.HasReservedSlot

Whether this rank has a reserved slot (is allowed to join the server even if it's full).

int fCraft.Rank.IdleKickTimer

Time until the idle kicker will kick this Rank from the server.

int fCraft.Rank.Index

Rank's relative index on the hierarchy. Index of the top rank is always 0. Subordinate ranks start at 1. Higher index = lower rank.

Property Documentation

string fCraft.Rank.ClassyName
get

Decorated name of the rank, including color and prefix (if enabled by the configuration).

string fCraft.Rank.Color
getset

Rank color code. Should not be left blank.

string fCraft.Rank.FullName
getset

Fully qualified name of the rank. Format: "Name#ID". Should be used whereever rank name needs to be serialized.

string fCraft.Rank.ID
getset

Unique rank ID. Generated by Rank.GenerateID. Assigned once at creation. Used to preserve compatibility in case a rank gets renamed.

World fCraft.Rank.MainWorld
getset

The main world for this Rank. Set and saved by WorldManager.

string fCraft.Rank.Name
getset

Rank's displayed name. Use rank.FullName instead for serializing (to improve backwards compatibility).

Rank fCraft.Rank.NextRankDown
getset

The Rank immediately below this Rank. Null if there is no lower rank. Set by RankManager.

Rank fCraft.Rank.NextRankUp
getset

The Rank immediately above this Rank. Null if there is no higher rank. Set by RankManager.

Rank [] fCraft.Rank.PermissionLimits
getset
bool [] fCraft.Rank.Permissions
getset

Set of permissions given to this rank. Use Rank.Can() to access.

int fCraft.Rank.PlayerCount
get

Total number of players of this rank (online and offline).

IEnumerable<Player> fCraft.Rank.Players
get

Shortcut to the list of all online players of this rank.

string fCraft.Rank.Prefix
getset

String that prefixes the username of all members of this rank.


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