]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Increment serverstats::Collisions when a collision is handled, not when a module...
authorAttila Molnar <attilamolnar@hush.com>
Fri, 20 Jun 2014 14:04:21 +0000 (16:04 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Fri, 20 Jun 2014 14:04:21 +0000 (16:04 +0200)
src/modules/m_spanningtree/nickcollide.cpp
src/users.cpp

index 62e43a0b1d9e141e6b31899623365e746c086dcb..30be98fb5b89317448c856fae1a6f6a8201ae461 100644 (file)
@@ -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.
index 4988590d90059c0ae2fa0a3ffcc955477243e3a0..1290b92be1997935aed95266b495c97e22ac4332 100644 (file)
@@ -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))