C# Класс fCraft.IPBanList

Показать файл Открыть проект Примеры использования класса

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

Метод Описание
Add ( [ ban, bool raiseEvent ) : bool

Adds a new IP Ban.

BanAll ( [ targetAddress, [ player, [ reason, bool announce, bool raiseEvents ) : void

Bans given IP address and all accounts on that IP. All players from IP are kicked. Throws PlayerOpException on problems.

BanIP ( [ targetAddress, [ player, [ reason, bool announce, bool raiseEvents ) : void

Bans given IP address. All players from IP are kicked. If an associated PlayerInfo is known, use a different overload of this method instead. Throws PlayerOpException on problems.

Contains ( [ address ) : bool

Checks whether the given address is banned.

Remove ( [ address, bool raiseEvents ) : bool

Removes a given IP address from the ban list (if present).

UnbanAll ( [ targetAddress, [ player, [ reason, bool announce, bool raiseEvents ) : void

Unbans given IP address and all accounts on that IP. Throws PlayerOpException on problems.

UnbanIP ( [ targetAddress, [ player, [ reason, bool announce, bool raiseEvents ) : void

Unbans an IP address. If an associated PlayerInfo is known, use a different overload of this method instead. Throws PlayerOpException on problems.

Приватные методы

Метод Описание
Get ( [ address ) : IPBanInfo
Load ( ) : void
ParseHeader ( [ header ) : int
RaiseAddedIPBanEvent ( [ info ) : void
RaiseAddingIPBanEvent ( [ info ) : bool
RaiseRemovedIPBanEvent ( [ info ) : void
RaiseRemovingIPBanEvent ( [ info ) : bool
Save ( ) : void

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

Add() публичный статический Метод

Adds a new IP Ban.
public static Add ( [ ban, bool raiseEvent ) : bool
ban [ Ban information
raiseEvent bool Whether AddingIPBan and AddedIPBan events should be raised.
Результат bool

BanAll() публичный статический Метод

Bans given IP address and all accounts on that IP. All players from IP are kicked. Throws PlayerOpException on problems.
public static BanAll ( [ targetAddress, [ player, [ reason, bool announce, bool raiseEvents ) : void
targetAddress [ IP address that is being banned.
player [ Player who is banning.
reason [ Reason for ban. May be empty, if permitted by server configuration.
announce bool Whether ban should be publicly announced on the server.
raiseEvents bool Whether AddingIPBan, AddedIPBan, BanChanging, and BanChanged events should be raised.
Результат void

BanIP() публичный статический Метод

Bans given IP address. All players from IP are kicked. If an associated PlayerInfo is known, use a different overload of this method instead. Throws PlayerOpException on problems.
public static BanIP ( [ targetAddress, [ player, [ reason, bool announce, bool raiseEvents ) : void
targetAddress [ IP address that is being banned.
player [ Player who is banning.
reason [ Reason for ban. May be empty, if permitted by server configuration.
announce bool Whether ban should be publicly announced on the server.
raiseEvents bool Whether AddingIPBan and AddedIPBan events should be raised.
Результат void

Contains() публичный статический Метод

Checks whether the given address is banned.
public static Contains ( [ address ) : bool
address [ Address to look for.
Результат bool

Remove() публичный статический Метод

Removes a given IP address from the ban list (if present).
public static Remove ( [ address, bool raiseEvents ) : bool
address [ Address to unban.
raiseEvents bool Whether to raise RemovingIPBan and RemovedIPBan events.
Результат bool

UnbanAll() публичный статический Метод

Unbans given IP address and all accounts on that IP. Throws PlayerOpException on problems.
public static UnbanAll ( [ targetAddress, [ player, [ reason, bool announce, bool raiseEvents ) : void
targetAddress [ IP address that is being unbanned.
player [ Player who is unbanning.
reason [ Reason for unban. May be null or empty, if permitted by server configuration.
announce bool Whether unban should be publicly announced on the server.
raiseEvents bool Whether RemovingIPBan, RemovedIPBan, BanChanging, and BanChanged events should be raised.
Результат void

UnbanIP() публичный статический Метод

Unbans an IP address. If an associated PlayerInfo is known, use a different overload of this method instead. Throws PlayerOpException on problems.
public static UnbanIP ( [ targetAddress, [ player, [ reason, bool announce, bool raiseEvents ) : void
targetAddress [ IP address that is being unbanned.
player [ Player who is unbanning.
reason [ Reason for unban. May be empty, if permitted by server configuration.
announce bool Whether unban should be publicly announced on the server.
raiseEvents bool Whether RemovingIPBan and RemovedIPBan events should be raised.
Результат void