Raised This Month: $51 Target: $400
 12% 

Detecting laggy players (Not ping lag)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pelipoika
Veteran Member
Join Date: May 2012
Location: Inside
Old 05-22-2017 , 11:44   Detecting laggy players (Not ping lag)
Reply With Quote #1

Like this duder



With timestamp:

https://youtu.be/x-Oj52C8jmc?t=30
__________________

Last edited by Pelipoika; 05-22-2017 at 11:44.
Pelipoika is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 05-23-2017 , 14:23   Re: Detecting laggy players (Not ping lag)
Reply With Quote #2

Use frequency analysis. Trajectory of a player without lags is smooth. Trajectories of lagging players contain irregularities and jumps.This leads to high frequencies in the spectrum:


https://en.wikipedia.org/wiki/Discre...rier_transform
https://en.wikipedia.org/wiki/Fast_Fourier_transform

You don't have to implement it on your own, there are a lot of examples on the internet for C++. In relation to your problem you can google "walk spectrum analysis"

Last edited by kadet.89; 05-23-2017 at 14:33.
kadet.89 is offline
Send a message via Skype™ to kadet.89
404UserNotFound
BANNED
Join Date: Dec 2011
Old 05-23-2017 , 17:49   Re: Detecting laggy players (Not ping lag)
Reply With Quote #3

I literally just now discovered the existence of the listed functions below whilst browsing a thread about fake clients taking up player slots. Someone's snippet contained IsClientTimingOut which I thought was a very neat function. I checked it out on the API and I happened to notice all these functions.How long have these been in SourceMod?! Could any of these work for what you need Peli?

Last edited by 404UserNotFound; 05-23-2017 at 17:50.
404UserNotFound is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 05-23-2017 , 18:08   Re: Detecting laggy players (Not ping lag)
Reply With Quote #4

Without going too far off topic, I wonder if some of those functions could be used to combat Fake Lag cheats.
__________________
sneaK is offline
blaacky
Senior Member
Join Date: Oct 2012
Old 05-27-2017 , 07:33   Re: Detecting laggy players (Not ping lag)
Reply With Quote #5

I use this method to catch a lot of laggers. It just freezes them for the time being until they stop lagging.

PHP Code:
int g_iRunCmdsPerSecond[MAXPLAYERS 1];
int g_iBadSeconds[MAXPLAYERS 1];
float g_fLastCheckTime[MAXPLAYERS 1];
MoveType g_mLastMoveType[MAXPLAYERS 1];

public 
Action OnPlayerRunCmd(int clientint &buttonsint &impulsefloat vel[3], float angles[3], int &weaponint &subtypeint &cmdnumint &tickcountint &seedint mouse[2])
{
    
float tickRate 1.0 GetTickInterval();
    
g_iRunCmdsPerSecond[client]++;
    if(
GetEngineTime() - g_fLastCheckTime[client] >= 1.0)
    {
        if(
float(g_iRunCmdsPerSecond[client]) / tickRate <= 0.95)
        {
            if(++
g_iBadSeconds[client] >= 3)
            {
                
SetEntityMoveType(clientMOVETYPE_NONE);
            }
        }
        else
        {
            if(
GetEntityMoveType(client) == MOVETYPE_NONE)
            {
                
SetEntityMoveType(clientg_mLastMoveType[client]);
            }
            
g_iBadSeconds[client] = 0;
        }
        
        
g_fLastCheckTime[client] = GetEngineTime();
        
g_iRunCmdsPerSecond[client] = 0;
    }

It could be improved by doing the lag check in a timer instead of OnPlayerRunCmd

Last edited by blaacky; 05-27-2017 at 07:34.
blaacky is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 05-27-2017 , 08:29   Re: Detecting laggy players (Not ping lag)
Reply With Quote #6

Whats g_mLastMoveType used for and where is it set?
hmmmmm is offline
blaacky
Senior Member
Join Date: Oct 2012
Old 05-27-2017 , 08:39   Re: Detecting laggy players (Not ping lag)
Reply With Quote #7

Forgot that, right before that code I do

PHP Code:
if(GetEntityMoveType(client) != MOVETYPE_NONE)
            {
                
g_mLastMoveType[client] = GetEntityMoveType(client);
            } 
Used to unfreeze the players by setting their movetype to their last used movetype, which is almost always MOVETYPE_WALK but can be others like MOVETYPE_LADDER, or MOVETYPE_FLY, or w/e else

Last edited by blaacky; 05-27-2017 at 08:40.
blaacky is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:58.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode