C# Класс TShockAPI.DB.BanManager

Class that manages bans.
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Описание методов

AddBan() публичный Метод

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.
Результат bool

BanManager() публичный Метод

Initializes a new instance of the TShockAPI.DB.BanManager class.
public BanManager ( IDbConnection db ) : System
db IDbConnection A valid connection to the TShock database
Результат System

ClearBans() публичный Метод

Clears bans.
public ClearBans ( ) : bool
Результат bool

GetBanByIp() публичный Метод

Gets a ban by IP.
public GetBanByIp ( string ip ) : Ban
ip string The IP.
Результат Ban

GetBanByName() публичный Метод

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.
Результат Ban

GetBanByUUID() публичный Метод

Gets a ban by UUID.
public GetBanByUUID ( string uuid ) : Ban
uuid string The UUID.
Результат Ban

GetBans() публичный Метод

Gets a list of bans.
public GetBans ( ) : List
Результат List

RemoveBan() публичный Метод

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.
Результат bool