[This is preliminary documentation and is subject to change.]
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.
Namespace: fCraftAssembly: fCraft (in fCraft.dll) Version: 0.6.3.0 (0.6.3.0)
Syntax
| C# |
Parameters
- targetAddress
- IPAddress
IP address that is being banned.
- player
- Player
Player who is banning.
- reason
- String
Reason for ban. May be empty, if permitted by server configuration.
- announce
- Boolean
Whether ban should be publicly announced on the server.
- raiseEvents
- Boolean
Whether AddingIPBan and AddedIPBan events should be raised.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IPAddress. When you use instance method syntax to call this method, omit the first parameter.
Exceptions
| Exception | Condition |
|---|---|
| System..::..ArgumentNullException | If targetAddress or player is null. |
| fCraft..::..PlayerOpException | If permission or configuration issues arise, or if IP is already banned. |