X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fusermanager.cpp;h=fafeffb42bce7e55355ea2d59f1b7d0914c43561;hb=87b1461e2a4710a38b32186c2582da9fe9bb3804;hp=4ab13fc95b677f3fc592e8bd7eca85573e7876f8;hpb=f5b2265c2e6868431abbaa301aa1d64e8d49d8b0;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 4ab13fc95..fafeffb42 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -52,13 +52,13 @@ namespace void CheckPingTimeout(LocalUser* user) { // Check if it is time to ping the user yet. - if (ServerInstance->Time() < user->nping) + if (ServerInstance->Time() < user->nextping) return; // This user didn't answer the last ping, remove them. if (!user->lastping) { - time_t secs = ServerInstance->Time() - (user->nping - user->MyClass->GetPingTime()); + 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); return; @@ -68,7 +68,7 @@ namespace ClientProtocol::Messages::Ping ping; user->Send(ServerInstance->GetRFCEvents().ping, ping); user->lastping = 0; - user->nping = ServerInstance->Time() + user->MyClass->GetPingTime(); + user->nextping = ServerInstance->Time() + user->MyClass->GetPingTime(); } void CheckRegistrationTimeout(LocalUser* user) @@ -210,8 +210,8 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs New->WriteNotice("*** Raw I/O logging is enabled on this server. All messages, passwords, and commands are being recorded."); FOREACH_MOD(OnSetUserIP, (New)); - if (New->quitting) - return; + if (!New->quitting) + FOREACH_MOD(OnUserPostInit, (New)); } void UserManager::QuitUser(User* user, const std::string& quitreason, const std::string* operreason)