diff options
Diffstat (limited to 'moderation.go')
-rw-r--r-- | moderation.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/moderation.go b/moderation.go index 2b21793..e0e3d1a 100644 --- a/moderation.go +++ b/moderation.go @@ -18,3 +18,16 @@ func (cc *ClientConn) Kick(reason string) { } }() } + +// Ban disconnects the ClientConn and prevents the underlying +// network address from connecting again. +func (cc *ClientConn) Ban() error { + cc.Kick("Banned by proxy.") + return authIface.Ban(cc.RemoteAddr().String(), cc.name) +} + +// Unban removes a player from the ban list. It accepts both +// network addresses and player names. +func Unban(id string) error { + return authIface.Unban(id) +} |