Proper client timeout detection

Port From (https://github.com/TrinityCore/TrinityCore/commit/2c3fc47a96baa8a47130befda647bf29d8eacce1)
This commit is contained in:
hondacrx
2020-07-24 17:48:02 -04:00
parent 5cc8c0dadf
commit 7bb86f94c5
6 changed files with 31 additions and 10 deletions
+6 -3
View File
@@ -237,6 +237,10 @@ namespace Game.Networking
authContinuedSession.Read();
HandleAuthContinuedSession(authContinuedSession);
break;
case ClientOpcodes.KeepAlive:
if (_worldSession != null)
_worldSession.ResetTimeOutTime(true);
break;
case ClientOpcodes.LogDisconnect:
break;
case ClientOpcodes.EnableNagle:
@@ -264,9 +268,8 @@ namespace Game.Networking
break;
}
// Our Idle timer will reset on any non PING opcodes.
// Catches people idling on the login screen and any lingering ingame connections.
_worldSession.ResetTimeOutTime();
// Our Idle timer will reset on any non PING opcodes on login screen, allowing us to catch people idling.
_worldSession.ResetTimeOutTime(false);
_worldSession.QueuePacket(packet);
break;
}