C# Class TShockAPI.DB.BanManager

Class that manages bans.
Afficher le fichier Open project: NyxStudios/TShock

Méthodes publiques

Méthode Description
AddBan ( string ip, string name = "", string uuid = "", string reason = "", bool exceptions = false, string banner = "", string expiration = "" ) : bool

Adds a ban.

BanManager ( IDbConnection db ) : System

Initializes a new instance of the TShockAPI.DB.BanManager class.

ClearBans ( ) : bool

Clears bans.

GetBanByIp ( string ip ) : Ban

Gets a ban by IP.

GetBanByName ( string name, bool casesensitive = true ) : Ban

Gets a ban by name.

GetBanByUUID ( string uuid ) : Ban

Gets a ban by UUID.

GetBans ( ) : List

Gets a list of bans.

RemoveBan ( string match, bool byName = false, bool casesensitive = true, bool exceptions = false ) : bool

Removes a ban.

Method Details

AddBan() public méthode

Adds a ban.
public AddBan ( string ip, string name = "", string uuid = "", string reason = "", bool exceptions = false, string banner = "", string expiration = "" ) : bool
ip string Ip.
name string Name.
uuid string UUID.
reason string Reason.
exceptions bool If set to true enable throwing exceptions.
banner string Banner.
expiration string Expiration date.
Résultat bool

BanManager() public méthode

Initializes a new instance of the TShockAPI.DB.BanManager class.
public BanManager ( IDbConnection db ) : System
db IDbConnection A valid connection to the TShock database
Résultat System

ClearBans() public méthode

Clears bans.
public ClearBans ( ) : bool
Résultat bool

GetBanByIp() public méthode

Gets a ban by IP.
public GetBanByIp ( string ip ) : Ban
ip string The IP.
Résultat Ban

GetBanByName() public méthode

Gets a ban by name.
public GetBanByName ( string name, bool casesensitive = true ) : Ban
name string The name.
casesensitive bool Whether to check with case sensitivity.
Résultat Ban

GetBanByUUID() public méthode

Gets a ban by UUID.
public GetBanByUUID ( string uuid ) : Ban
uuid string The UUID.
Résultat Ban

GetBans() public méthode

Gets a list of bans.
public GetBans ( ) : List
Résultat List

RemoveBan() public méthode

Removes a ban.
public RemoveBan ( string match, bool byName = false, bool casesensitive = true, bool exceptions = false ) : bool
match string Match.
byName bool If set to true by name.
casesensitive bool If set to true casesensitive.
exceptions bool If set to true exceptions.
Résultat bool