C# Class fCraft.RankManager

Manages all the ranks on a server. Controls what ranks are available and in what order they exist in.
Afficher le fichier Open project: fragmer/fCraft Class Usage Examples

Méthodes publiques

Свойство Type Description
DefaultRank Rank

Private Properties

Свойство Type Description
CheckIfPlayerDBLoaded void
DefineDefaultRanks XElement
FindRank Rank
FindRank Rank
FindRank Rank
GenerateId string
GetMinRankWithAllPermissions Rank
GetMinRankWithAnyPermission Rank
ParsePermissionLimits void
RankManager System
RebuildIndex void
Reset void
SortRanksByLegacyNumericRank void

Méthodes publiques

Méthode Description
AddRank ( Rank rank ) : void

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

AddRank ( [ rank ) : void

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

AddRank ( [ newRank, int desiredIndex ) : void

Adds a new rank to the list at the desired position in the hierarchy. Checks for duplicates.

CanRenameRank ( Rank rank, string newName ) : bool
CanRenameRank ( [ rank, [ newName ) : bool
DeleteRank ( Rank deletedRank, Rank replacementRank ) : bool
DeleteRank ( [ deletedRank, [ replacementRank ) : bool
GenerateID ( ) : string
GetIndex ( Rank rank ) : int
GetMinRankWithPermission ( ) : Rank

Finds the lowest rank that has all the required permissions.

LowerRank ( Rank rank ) : bool
LowerRank ( [ rank ) : bool
ParseRank ( string name ) : Rank

Parses serialized rank. Accepts either the "name" or "name#ID" format. Uses legacy rank mapping table for unrecognized ranks. Does not autocomple.

RaiseRank ( Rank rank ) : bool
RaiseRank ( [ rank ) : bool
RenameRank ( Rank rank, string newName ) : void
RenameRank ( [ rank, [ newName ) : void
ResetToDefaults ( ) : void

Resets the list of ranks to defaults (guest/builder/op/owner). Warning: This method is not thread-safe, and should never be used on a live server.

Private Methods

Méthode Description
CheckIfPlayerDBLoaded ( ) : void
DefineDefaultRanks ( ) : XElement
FindRank ( [ name ) : Rank
FindRank ( int index ) : Rank
FindRank ( string name ) : Rank
GenerateId ( ) : string
GetMinRankWithAllPermissions ( ) : Rank
GetMinRankWithAnyPermission ( ) : Rank
ParsePermissionLimits ( ) : void
RankManager ( ) : System
RebuildIndex ( ) : void
Reset ( ) : void

Clears the list of ranks.

SortRanksByLegacyNumericRank ( ) : void

Method Details

AddRank() public static méthode

Adds a new rank to the list. Checks for duplicates.
public static AddRank ( Rank rank ) : void
rank Rank
Résultat void

AddRank() public static méthode

Adds a new rank to the list. Checks for duplicates.
public static AddRank ( [ rank ) : void
rank [
Résultat void

AddRank() public static méthode

Adds a new rank to the list at the desired position in the hierarchy. Checks for duplicates.
If rank is null. If PlayerDB is already loaded. If a rank with this name or ID is already defined.
public static AddRank ( [ newRank, int desiredIndex ) : void
newRank [ Rank to add to the list.
desiredIndex int Desired rank index (zero-based).
Résultat void

CanRenameRank() public static méthode

public static CanRenameRank ( Rank rank, string newName ) : bool
rank Rank
newName string
Résultat bool

CanRenameRank() public static méthode

public static CanRenameRank ( [ rank, [ newName ) : bool
rank [
newName [
Résultat bool

DeleteRank() public static méthode

public static DeleteRank ( Rank deletedRank, Rank replacementRank ) : bool
deletedRank Rank
replacementRank Rank
Résultat bool

DeleteRank() public static méthode

public static DeleteRank ( [ deletedRank, [ replacementRank ) : bool
deletedRank [
replacementRank [
Résultat bool

GenerateID() public static méthode

public static GenerateID ( ) : string
Résultat string

GetIndex() public static méthode

public static GetIndex ( Rank rank ) : int
rank Rank
Résultat int

GetMinRankWithPermission() public static méthode

Finds the lowest rank that has all the required permissions.
public static GetMinRankWithPermission ( ) : Rank
Résultat Rank

LowerRank() public static méthode

public static LowerRank ( Rank rank ) : bool
rank Rank
Résultat bool

LowerRank() public static méthode

public static LowerRank ( [ rank ) : bool
rank [
Résultat bool

ParseRank() public static méthode

Parses serialized rank. Accepts either the "name" or "name#ID" format. Uses legacy rank mapping table for unrecognized ranks. Does not autocomple.
public static ParseRank ( string name ) : Rank
name string Full rank name
Résultat Rank

RaiseRank() public static méthode

public static RaiseRank ( Rank rank ) : bool
rank Rank
Résultat bool

RaiseRank() public static méthode

public static RaiseRank ( [ rank ) : bool
rank [
Résultat bool

RenameRank() public static méthode

public static RenameRank ( Rank rank, string newName ) : void
rank Rank
newName string
Résultat void

RenameRank() public static méthode

public static RenameRank ( [ rank, [ newName ) : void
rank [
newName [
Résultat void

ResetToDefaults() public static méthode

Resets the list of ranks to defaults (guest/builder/op/owner). Warning: This method is not thread-safe, and should never be used on a live server.
public static ResetToDefaults ( ) : void
Résultat void

Property Details

DefaultRank public_oe static_oe property

public static Rank DefaultRank
Résultat Rank