mirror of
https://github.com/ergochat/ergo.git
synced 2026-01-10 04:12:06 -08:00
xline: Add ANDKILL param to kill all matching clients
This commit is contained in:
parent
3101f16478
commit
ebb9d629d7
5 changed files with 88 additions and 10 deletions
|
|
@ -137,6 +137,11 @@ func NewClient(server *Server, conn net.Conn, isTLS bool) *Client {
|
|||
return client
|
||||
}
|
||||
|
||||
// IP returns the IP address of this client.
|
||||
func (client *Client) IP() net.IP {
|
||||
return net.ParseIP(IPString(client.socket.conn.RemoteAddr()))
|
||||
}
|
||||
|
||||
//
|
||||
// command goroutine
|
||||
//
|
||||
|
|
@ -475,7 +480,7 @@ func (client *Client) destroy() {
|
|||
friends.Remove(client)
|
||||
|
||||
// remove from connection limits
|
||||
ipaddr := net.ParseIP(IPString(client.socket.conn.RemoteAddr()))
|
||||
ipaddr := client.IP()
|
||||
// this check shouldn't be required but eh
|
||||
if ipaddr != nil {
|
||||
client.server.connectionLimitsMutex.Lock()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue