The online racing simulator
Cheat protection
i made a plugin, which checks for speed hackers, then i remembered that every car has its own top speed, i will most likly make an array of top speeds for every car :P


<?php 
php
class Cheat extends Plugins {
    const 
URL 'http://lfsforum.net/forumdisplay.php?f=312';
    const 
NAME 'Cheat Protection';
    const 
AUTHOR 'T3charmy';
    const 
VERSION '0.1.0';
    const 
DESCRIPTION 'Does the dirty work for you!';

    public function 
__construct() {
        
$this->registerPacket('onMCI'ISP_MCI);
    }
    public function 
onMCI($Packet) {
        foreach (
$Packet->Info as $PacketInfo) {
            
$PacketData Plugins::getClientByPLID($PacketInfo->PLID);
            
$MPH number_format($CompCar->Speed 146.4860671);
            if(isset(
$PacketData)){
                if(
$MPH 200){
                    
$MST = new IS_MST;
                    
$MST->Msg("/ban {$PacketData->UName} 999")->Send();
                    
$MST->Msg("/msg ^1{$PacketData->UName} banned for Speed Hacking!")->Send();
                }
            }
        }    
    }
}

?>

did you just deside to post this after i sent you the link to that hacker on your server????????????????
Quote from tbofram :did you just deside to post this after i sent you the link to that hacker on your server????????????????

ye :P
Does it ban all people who drive more than 200 MPH? Doesn't BF1 drive more than that?
Quote from Flame CZE :Does it ban all people who drive more than 200 MPH? Doesn't BF1 drive more than that?

yes, exactly why i need to make an array of different car types
Its a start; I've seen a couple who use the hacks quite intelligently (IIRC most servers got Airio - and its got some sort of protection/speedcheck. Might be wrong though!).

Just checking the top speed of a specific car won't do the job 100%, you'd have to check acceleration (standard/with drafting). But then again when you consider the lag element...

And oh, you might get banned if you fly off a barrier (or a lag crash) faster than 200 mph.
easyest way is to take every car with default setup
+ any track
+ flip the car go to last gear and get the "maximum" theoretical speed from setup

then create
int UF1 = 165;
int XFG = 200;
int XRG = 210;

and so on
or if you check it per leaving pit


LeavePitpacked
{
LeftPit = true;
if (Car == UF1)
{
Maxspeed = 165;
}
if (Car == XF...)
{
}
}

on mci packed

MCI_Packed
{
if(LeftPit == true)
{
if (Currspeed < Maxspeed)
{
msg(/ban %username% "999")
}
}


Quote from Heiko1 :easyest way is to take every car with default setup
+ any track
+ flip the car go to last gear and get the "maximum" theoretical speed from setup

then create
int UF1 = 165;
int XFG = 200;
int XRG = 210;

and so on
or if you check it per leaving pit


LeavePitpacked
{
if (Car == UF1)
{
Maxspeed = 165;
}
if (Car == XF...)
}
}

on mci packed
MCI_Packed
{
if(LeftPit == true)
{
if (Currspeed < Maxspeed)
{
msg(/ban %username% "999")
}
}

if

yep thats what i was gonna do
Currspeed > Maxspeed
yea i still dont get it ^^

but yea its the easyest way to do it
Nice idea for a plugin, great work T3! I'll move this thread to accepted plugins once you have it working to the spec you've outlined.
I've made a similar program, the only problem was that if someone lagged into another person, one would go flying, tripping the program.
Quote from imthebestracerthereis :I've made a similar program, the only problem was that if someone lagged into another person, one would go flying, tripping the program.

+1

What happens when someone hits a red and white barrier? Does their speed trip the cheat protection?
Quote from imthebestracerthereis :I've made a similar program, the only problem was that if someone lagged into another person, one would go flying, tripping the program.

hmm is there a way to check if a user is lagging?
Quote from T3charmy :hmm is there a way to check if a user is lagging?

Yes, there's a lag notification built into the CompCar packet (check LFS/docs/InSim.txt). However, if hitting red/white barrier (or other object) would trip the cheat protection checking for lag is a moot point. What you could do is to check whether a user maintains a speed above the maximum for their car for a certain period of time (e.g. a few seconds). That would more reliably detect cheaters.
Quote from amp88 :Yes, there's a lag notification built into the CompCar packet (check LFS/docs/InSim.txt). However, if hitting red/white barrier (or other object) would trip the cheat protection checking for lag is a moot point. What you could do is to check whether a user maintains a speed above the maximum for their car for a certain period of time (e.g. a few seconds). That would more reliably detect cheaters.

ye that was the other idea i was thinking of take an average of about 5 seconds if they maintain it or go faster then it it will ban them
Like if the player goes above the known speed for that car, and then goes EVEN faster in the next packet they should be banned as that should not happen in the case of lagging or hitting an object. Also, have the server save the reply so that it can be inspected later.
Quote from Dygear :Like if the player goes above the known speed for that car, and then goes EVEN faster in the next packet they should be banned as that should not happen in the case of lagging or hitting an object. Also, have the server save the reply so that it can be inspected later.

Good idea but I would go with the delay also because if they are using the speedhack on a straight the. They wold be going super fast for a long time but if they hit a barrier and went flying then they would hit the ground and stop ( hopefully) and mybee a warning message saying your speeding if you get banned but only hit a barrier then do something
Quote from Dygear : Also, have the server save the reply so that it can be inspected later.

was the plan, but how do i do this?
Set autosave MPR to 1. It's an option in setup.cfg
Well your server is hosted by 500servers so it auto saves 200mb of replay data. You could just get your computer to auto download the replay every 24 hours or so and then you have a copy
i will go work on this a little... anyone wanna come to my server and help me get car top speeds?
How about in the .mpr below? Mind the black FXO at the start and again at 2.18 onwards. Obviously geared not to exceed a possible top speed... but the said sort of protection wouldn't detect it, would it?

The current (planned) plug-in would be better than no protection, I agree, on that. But please make provision to detect the sort of acceleration seen here...
Attached files
91502.zip - 1.8 MB - 226 views
Haha well if you mean that then to be honest I don't know how that would work. I'm sure you can get something sorted there might even be a magical packet that can do this for you
Make alone top speed and add 30kph to it. It's caused beacuse sometimes another car can go ahead and they together can rich bigger speed. Physics.
1

FGED GREDG RDFGDR GSFDG