aboutsummaryrefslogtreecommitdiff
path: root/src/usermanager.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2019-07-27 19:12:29 +0100
committerGravatar Sadie Powell2019-07-27 19:12:29 +0100
commitada6646b6546e936f5f9d91f63f9f9fc6f651ef5 (patch)
tree817e2f69b601d4bbf0ef720a69240050c915560d /src/usermanager.cpp
parentRemove code relating to v3 API changes and v2 module compatibility. (diff)
parentImprove the "max connections exceeded" oper snotice. (diff)
Merge branch 'insp3' into master.
Diffstat (limited to 'src/usermanager.cpp')
-rw-r--r--src/usermanager.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/usermanager.cpp b/src/usermanager.cpp
index 9911e5b36..a9ea519c2 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);