Jump to content

[Help] Autokick lagger user


Guest Darky88

Recommended Posts

If you're on Unix :

grep "latency" mangos/src

You'll find everything you want, especially this :

pPlayer->GetSession()->GetLatency();

So I suggest a simple timer in WorldSession::Update such as :

if (m_latencyCheckTimer < diff)
{
   if (GetLatency() > 500 /*replace it by whatever you want*/)
   {
       KickPlayer();
       m_latencyCheckTimer = 1 * MINUTE * IN_MILLISECONDS;
   }
} else m_latencyCheckTimer = 1 * MINUTE * IN_MILLISECONDS;

Very basic, but you can improve it if you want (take values from conf, write something about the kicked player in logs, etc) ;)

Edit : actually my code is really bad, since a player could have a huge lag for 2 or 3 secs and be kicked just because the check would occur during those 2 or 3 secs.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use