From 3323226c38c959392e61f406ec62f9d5f24fce15 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Fri, 20 Jun 2014 16:04:21 +0200 Subject: [PATCH] Increment serverstats::Collisions when a collision is handled, not when a module denies a nick change --- src/modules/m_spanningtree/nickcollide.cpp | 3 +++ src/users.cpp | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/m_spanningtree/nickcollide.cpp b/src/modules/m_spanningtree/nickcollide.cpp index 62e43a0b1..30be98fb5 100644 --- a/src/modules/m_spanningtree/nickcollide.cpp +++ b/src/modules/m_spanningtree/nickcollide.cpp @@ -33,6 +33,9 @@ */ int SpanningTreeUtilities::DoCollision(User* u, TreeServer* server, time_t remotets, const std::string& remoteident, const std::string& remoteip, const std::string& remoteuid) { + // At this point we're sure that a collision happened, increment the counter regardless of who wins + ServerInstance->stats.Collisions++; + /* * Under old protocol rules, we would have had to kill both clients. * Really, this sucks. diff --git a/src/users.cpp b/src/users.cpp index 4988590d9..1290b92be 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -625,10 +625,7 @@ bool User::ChangeNick(const std::string& newnick, bool force, time_t newts) FIRST_MOD_RESULT(OnUserPreNick, MOD_RESULT, (this, newnick)); if (MOD_RESULT == MOD_RES_DENY) - { - ServerInstance->stats.Collisions++; return false; - } } if (assign(newnick) == assign(nick)) -- 2.39.2