ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.74k stars 630 forks source link

[HL1/CS] Add proper anti-speedhack code, or fix existing one #393

Open AnAkkk opened 11 years ago

AnAkkk commented 11 years ago

HL1/CS already has some sort of anti-speedhack code, but it doesn't work correctly. All it does is making the speedhacker lag once a while.

As you can see, this was added a very long time ago:

Half-Life Linux Primary Server 3.1.1.0.b Beta Update Changelog

* Added new cvar "clockwindow". This cvar is temporary.
It's designed to combat the speed cheats being used in-game.
The default value for this cvar is "0.5".
We're very interested in how low you can get this value and not have your players "feel" any
different while they're playing. Broadband clients shouldn't be affected by this cvar.
Adjusting "clockwindow" should have a greater affect on modem clients.
As you lower the value (0.3, 0.1, 0.01, etc.), modem clients' games should feel jittery.
Adjusting "clockwindow" does not affect the server.
Only clients will notice problems when the value starts to get too low.
Please play with this cvar and report your results directly to Eric Smith.

Maybe the default value could be changed to really block speedhacks, or a real speedhack block could be added. There are already some plugins that do it correctly. Speedhacking works by sending more command packets than necessary, so it just needs detecting how much packets/sec a client is sending, and blocking him if he sends too much.

Old: https://github.com/ValveSoftware/steam-for-linux/issues/1188

Rastid commented 11 years ago

I don't know if a cheat can be effectively blocked if you are attacking the cheat. Would some sort of NoTarget plugin or new server side cvar for dedicated servers help? If a cheat tracks hitboxes or uses bots aiming calculations, make the players in a dedicated server invisible to cheats, at least that is the theory, and leave that off in case that a server uses bots (for obvious reasons)

Freeman-AM commented 11 years ago

And what about compatibility with mods using speed ? :/

ghost commented 11 years ago

Keep using your plugin, ohh wait you can't since you want to block all commands ^^

To be serious, there are always hacks, they will find another way to do it. So keep it and ban hacker.

AnAkkk commented 11 years ago

Speedhack exists because the server code that makes the player move is just exploitable. Speedhack is a game exploit that can be easily fixed, it was fixed in various other non valve games. There are also many plugins that can block it. If there is a proper anti-speedhack code, there is NO way around it.

@luckynator : This is not going to change anything for mods that modify the players speed, they work differently than speedhacking.

ghost commented 11 years ago

So speedhacks only exists for HL1? I doub it.

AnAkkk commented 11 years ago

Where did I say that...seriously?

AnAkkk commented 11 years ago

CS GO now has an anti speedhack. See:

-Added a server convar "sv_maxusrcmdprocessticks" to limit maximum number of user commands backlog, defaulting at 3; observed player speed by others will now always be within max movement speed even when user is cheating, experiencing high packet loss or exteremely low fps.

Could a similar one be added to HL1?

AnAkkk commented 11 years ago

This has now been added to Orange Box engine as well.