C# Class fCraft.IPBanList

Afficher le fichier Open project: GlennMR/800craft Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
Get ( [ address ) : IPBanInfo
Load ( ) : void
ParseHeader ( [ header ) : int
RaiseAddedIPBanEvent ( [ info ) : void
RaiseAddingIPBanEvent ( [ info ) : bool
RaiseRemovedIPBanEvent ( [ info ) : void
RaiseRemovingIPBanEvent ( [ info ) : bool
Save ( ) : void

Method Details

Add() public static méthode

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.
Résultat bool

BanAll() public static méthode

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.
Résultat void

BanIP() public static méthode

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.
Résultat void

Contains() public static méthode

Checks whether the given address is banned.
public static Contains ( [ address ) : bool
address [ Address to look for.
Résultat bool

Remove() public static méthode

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.
Résultat bool

UnbanAll() public static méthode

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.
Résultat void

UnbanIP() public static méthode

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.
Résultat void