C# Class TShockAPI.DB.BanManager

Class that manages bans.
Datei anzeigen Open project: NyxStudios/TShock

Public Methods

Method 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 method

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.
return bool

BanManager() public method

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

ClearBans() public method

Clears bans.
public ClearBans ( ) : bool
return bool

GetBanByIp() public method

Gets a ban by IP.
public GetBanByIp ( string ip ) : Ban
ip string The IP.
return Ban

GetBanByName() public method

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.
return Ban

GetBanByUUID() public method

Gets a ban by UUID.
public GetBanByUUID ( string uuid ) : Ban
uuid string The UUID.
return Ban

GetBans() public method

Gets a list of bans.
public GetBans ( ) : List
return List

RemoveBan() public method

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.
return bool