|
@@ -1293,21 +1293,13 @@ func listHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Resp
|
1293
|
1293
|
// LUSERS [<mask> [<server>]]
|
1294
|
1294
|
func lusersHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool {
|
1295
|
1295
|
//TODO(vegax87) Fix network statistics and additional parameters
|
1296
|
|
- var totalcount, invisiblecount, opercount int
|
|
1296
|
+ totalCount, invisibleCount, operCount := server.stats.GetStats()
|
|
1297
|
+
|
|
1298
|
+ rb.Add(nil, server.name, RPL_LUSERCLIENT, client.nick, fmt.Sprintf(client.t("There are %[1]d users and %[2]d invisible on %[3]d server(s)"), totalCount-invisibleCount, invisibleCount, 1))
|
|
1299
|
+ rb.Add(nil, server.name, RPL_LUSEROP, client.nick, strconv.Itoa(operCount), client.t("IRC Operators online"))
|
|
1300
|
+ rb.Add(nil, server.name, RPL_LUSERCHANNELS, client.nick, strconv.Itoa(server.channels.Len()), client.t("channels formed"))
|
|
1301
|
+ rb.Add(nil, server.name, RPL_LUSERME, client.nick, fmt.Sprintf(client.t("I have %[1]d clients and %[2]d servers"), totalCount, 1))
|
1297
|
1302
|
|
1298
|
|
- for _, onlineusers := range server.clients.AllClients() {
|
1299
|
|
- totalcount++
|
1300
|
|
- if onlineusers.flags[modes.Invisible] {
|
1301
|
|
- invisiblecount++
|
1302
|
|
- }
|
1303
|
|
- if onlineusers.flags[modes.Operator] {
|
1304
|
|
- opercount++
|
1305
|
|
- }
|
1306
|
|
- }
|
1307
|
|
- rb.Add(nil, server.name, RPL_LUSERCLIENT, client.nick, fmt.Sprintf(client.t("There are %[1]d users and %[2]d invisible on %[3]d server(s)"), totalcount - invisiblecount, invisiblecount, 1))
|
1308
|
|
- rb.Add(nil, server.name, RPL_LUSEROP, client.nick, fmt.Sprintf(client.t("%d IRC Operators online"), opercount))
|
1309
|
|
- rb.Add(nil, server.name, RPL_LUSERCHANNELS, client.nick, fmt.Sprintf(client.t("%d channels formed"), server.channels.Len()))
|
1310
|
|
- rb.Add(nil, server.name, RPL_LUSERME, client.nick, fmt.Sprintf(client.t("I have %[1]d clients and %[2]d servers"), totalcount, 1))
|
1311
|
1303
|
return false
|
1312
|
1304
|
}
|
1313
|
1305
|
|
|
@@ -1792,6 +1784,9 @@ func operHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Resp
|
1792
|
1784
|
|
1793
|
1785
|
server.snomasks.Send(sno.LocalOpers, fmt.Sprintf(ircfmt.Unescape("Client opered up $c[grey][$r%s$c[grey], $r%s$c[grey]]"), client.nickMaskString, client.operName))
|
1794
|
1786
|
|
|
1787
|
+ // increase oper count
|
|
1788
|
+ server.stats.ChangeOperators(1)
|
|
1789
|
+
|
1795
|
1790
|
// client may now be unthrottled by the fakelag system
|
1796
|
1791
|
client.resetFakelag()
|
1797
|
1792
|
|