1
0
Fork 0
forked from External/ergo

Stats for LUSERS logic now seperated, fixed params in LUSERS

This commit is contained in:
moocow 2018-04-20 22:48:15 +02:00
parent 19bb6d5a46
commit 744ad2ce0b
5 changed files with 94 additions and 14 deletions

View file

@ -131,6 +131,7 @@ type Server struct {
stsEnabled bool
webirc []webircConfig
whoWas *WhoWasList
stats *Stats
}
var (
@ -164,6 +165,7 @@ func NewServer(config *Config, logger *logger.Manager) (*Server, error) {
signals: make(chan os.Signal, len(ServerExitSignals)),
snomasks: NewSnoManager(),
whoWas: NewWhoWasList(config.Limits.WhowasEntries),
stats: NewStats(),
}
if err := server.applyConfig(config, true); err != nil {
@ -472,6 +474,9 @@ func (server *Server) tryRegister(c *Client) {
return
}
// count new user in statistics
server.stats.ChangeTotal(1)
// continue registration
server.logger.Debug("localconnect", fmt.Sprintf("Client registered [%s] [u:%s] [r:%s]", c.nick, c.username, c.realname))
server.snomasks.Send(sno.LocalConnects, fmt.Sprintf(ircfmt.Unescape("Client registered $c[grey][$r%s$c[grey]] [u:$r%s$c[grey]] [h:$r%s$c[grey]] [r:$r%s$c[grey]]"), c.nick, c.username, c.rawHostname, c.realname))