fCraft  0.638
Custom Minecraft Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events
fCraft.IPBanList Class Reference

Handles the addition, lookup, and removal of IP bans. More...

Static Public Member Functions

static bool Add ([NotNull] IPBanInfo ban, bool raiseEvent)
 Adds a new IP Ban.
 
static IPBanInfo Get ([NotNull] IPAddress address)
 Retrieves ban information for a given IP address.
 
static bool Contains ([NotNull] IPAddress address)
 Checks whether the given address is banned.
 
static bool Remove ([NotNull] IPAddress address, bool raiseEvents)
 Removes a given IP address from the ban list (if present).
 
static void BanIP ([NotNull] this IPAddress targetAddress,[NotNull] Player player,[CanBeNull] string reason, bool announce, bool raiseEvents)
 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.
 
static void UnbanIP ([NotNull] this IPAddress targetAddress,[NotNull] Player player,[CanBeNull] string reason, bool announce, bool raiseEvents)
 Unbans an IP address. If an associated PlayerInfo is known, use a different overload of this method instead. Throws PlayerOpException on problems.
 
static void BanAll ([NotNull] this IPAddress targetAddress,[NotNull] Player player,[CanBeNull] string reason, bool announce, bool raiseEvents)
 Bans given IP address and all accounts on that IP. All players from IP are kicked. Throws PlayerOpException on problems.
 
static void UnbanAll ([NotNull] this IPAddress targetAddress,[NotNull] Player player,[CanBeNull] string reason, bool announce, bool raiseEvents)
 Unbans given IP address and all accounts on that IP.
 

Properties

static bool IsLoaded [get, set]
 
static int Count [get]
 Number of active IP bans on record.
 

Events

static EventHandler
< IPBanCancelableEventArgs
AddingIPBan
 Occurs when a new IP ban is about to be added (cancelable).
 
static EventHandler
< IPBanEventArgs
AddedIPBan
 Occurs when a new IP ban has been added.
 
static EventHandler
< IPBanCancelableEventArgs
RemovingIPBan
 Occurs when an existing IP ban is about to be removed (cancelable).
 
static EventHandler
< IPBanEventArgs
RemovedIPBan
 Occurs after an existing IP ban has been removed.
 

Detailed Description

Handles the addition, lookup, and removal of IP bans.

Member Function Documentation

static bool fCraft.IPBanList.Add ( [NotNull] IPBanInfo  ban,
bool  raiseEvent 
)
static

Adds a new IP Ban.

Parameters
banBan information
raiseEventWhether AddingIPBan and AddedIPBan events should be raised.
Returns
True if ban was added, false if it was already on the list
static void fCraft.IPBanList.BanAll ( [NotNull] this IPAddress  targetAddress,
[NotNull] Player  player,
[CanBeNull] string  reason,
bool  announce,
bool  raiseEvents 
)
static

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

Parameters
targetAddressIP address that is being banned.
playerPlayer who is banning.
reasonReason for ban. May be empty, if permitted by server configuration.
announceWhether ban should be publicly announced on the server.
raiseEventsWhether AddingIPBan, AddedIPBan, BanChanging, and BanChanged events should be raised.
Exceptions
ArgumentNullExceptiontargetAddress or player is null.
PlayerOpExceptionPermission or configuration issues arise, or if everyone has already been banned.
static void fCraft.IPBanList.BanIP ( [NotNull] this IPAddress  targetAddress,
[NotNull] Player  player,
[CanBeNull] string  reason,
bool  announce,
bool  raiseEvents 
)
static

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.

Parameters
targetAddressIP address that is being banned.
playerPlayer who is banning.
reasonReason for ban. May be empty, if permitted by server configuration.
announceWhether ban should be publicly announced on the server.
raiseEventsWhether AddingIPBan and AddedIPBan events should be raised.
Exceptions
ArgumentNullExceptiontargetAddress or player is null.
PlayerOpExceptionPermission or configuration issues arise, or if IP is already banned.
static bool fCraft.IPBanList.Contains ( [NotNull] IPAddress  address)
static

Checks whether the given address is banned.

Parameters
addressAddress to look for.
static IPBanInfo fCraft.IPBanList.Get ( [NotNull] IPAddress  address)
static

Retrieves ban information for a given IP address.

Parameters
addressIP address to check.
Returns
IPBanInfo object if found, otherwise null.
static bool fCraft.IPBanList.Remove ( [NotNull] IPAddress  address,
bool  raiseEvents 
)
static

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

Parameters
addressAddress to unban.
raiseEventsWhether to raise RemovingIPBan and RemovedIPBan events.
Returns
True if IP was unbanned. False if it was not banned in the first place, or if it was cancelled by an event.
static void fCraft.IPBanList.UnbanAll ( [NotNull] this IPAddress  targetAddress,
[NotNull] Player  player,
[CanBeNull] string  reason,
bool  announce,
bool  raiseEvents 
)
static

Unbans given IP address and all accounts on that IP.

Parameters
targetAddressIP address that is being unbanned.
playerPlayer who is unbanning.
reasonReason for unban. May be null or empty, if permitted by server configuration.
announceWhether unban should be publicly announced on the server.
raiseEventsWhether RemovingIPBan, RemovedIPBan, BanChanging, and BanChanged events should be raised.
Exceptions
ArgumentNullExceptiontargetAddress or player is null.
PlayerOpExceptionPermission or configuration issues arise, or if everyone has already been unbanned.
static void fCraft.IPBanList.UnbanIP ( [NotNull] this IPAddress  targetAddress,
[NotNull] Player  player,
[CanBeNull] string  reason,
bool  announce,
bool  raiseEvents 
)
static

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

Parameters
targetAddressIP address that is being unbanned.
playerPlayer who is unbanning.
reasonReason for unban. May be empty, if permitted by server configuration.
announceWhether unban should be publicly announced on the server.
raiseEventsWhether RemovingIPBan and RemovedIPBan events should be raised.
Exceptions
ArgumentNullExceptiontargetAddress or player is null.
PlayerOpExceptionPermission or configuration issues arise, or if IP is already unbanned.

Property Documentation

int fCraft.IPBanList.Count
staticget

Number of active IP bans on record.

bool fCraft.IPBanList.IsLoaded
staticgetset

Event Documentation

EventHandler<IPBanEventArgs> fCraft.IPBanList.AddedIPBan
static

Occurs when a new IP ban has been added.

EventHandler<IPBanCancelableEventArgs> fCraft.IPBanList.AddingIPBan
static

Occurs when a new IP ban is about to be added (cancelable).

EventHandler<IPBanEventArgs> fCraft.IPBanList.RemovedIPBan
static

Occurs after an existing IP ban has been removed.

EventHandler<IPBanCancelableEventArgs> fCraft.IPBanList.RemovingIPBan
static

Occurs when an existing IP ban is about to be removed (cancelable).


The documentation for this class was generated from the following file: