X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fusermanager.cpp;h=4f65994aa29be6399964f51869c5b5546e30d627;hb=5a2af6ded883d71c6c4c9f1497cca1721f8b0742;hp=6acd25ac5200eeb2860abc4969a63e5522dcb09a;hpb=2ab383f707ec648ceeb29059ce4f54d4bbb056a4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 6acd25ac5..4f65994aa 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -58,6 +58,16 @@ namespace // This user didn't answer the last ping, remove them. if (!user->lastping) { + ModResult res; + FIRST_MOD_RESULT(OnConnectionFail, res, (user, I_ERR_TIMEOUT)); + if (res == MOD_RES_ALLOW) + { + // A module is preventing this user from being timed out. + user->lastping = 1; + user->nextping = ServerInstance->Time() + user->MyClass->GetPingTime(); + return; + } + time_t secs = ServerInstance->Time() - (user->nextping - user->MyClass->GetPingTime()); const std::string message = "Ping timeout: " + ConvToStr(secs) + (secs != 1 ? " seconds" : " second"); ServerInstance->Users.QuitUser(user, message);