Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[L4D2] Detect lag cheats #128

Open
lunatixxx opened this issue Jul 24, 2022 · 6 comments
Open

[L4D2] Detect lag cheats #128

lunatixxx opened this issue Jul 24, 2022 · 6 comments
Labels
Request New feature or request

Comments

@lunatixxx
Copy link

lunatixxx commented Jul 24, 2022

Because of that cheaters can instantly heal with medkit, pick up teammates, reloading, never falling from cornice, no fall damage, being immune to smoker damage, infinite air jump with hunter, infinite charger and manipulate client side physics to turn in directions, break a final script so the rescue come instantly ect.

But the more important:
Various packet exploit that make the server hang out or crash it, jockey and charger being the most known.

@J-Tanzanite
Copy link
Owner

Sorry for being slow to reply, I am a little busy atm with some IRL stuff, but I'll add this to my todo list. :)

@J-Tanzanite J-Tanzanite added the Request New feature or request label Sep 5, 2022
@lunatixxx
Copy link
Author

lunatixxx commented Sep 10, 2022

Someone made a plugin to reset the tickbase of the players if it is more than 2 seconds in advance from the server, i don't know for sure that it prevents all of this for now. I augmented it to 4 seconds personally as some players even with good pings were stuttering in appearance.

I think it has the same effect than "sv_clockcorrection_msecs", except that the cvar can be manipulated i guess it's not protected. "sv", "launcher"

@lunatixxx
Copy link
Author

Will it work for blocking curving chargers on humans? As this code fix it for bots only, so again this is probably an engine bug originally.

/* -------------------CHANGELOG--------------------
 1.2
 - Implemented new method of blocking charger`s auto-aim, now it just continues charging instead of stopping the attack (thanks to dcx2)
 1.1
 - Fixed possible non-changer infected detecting as heatseeking charger
 
 1.0
 - Initial release
^^^^^^^^^^^^^^^^^^^^CHANGELOG^^^^^^^^^^^^^^^^^^^^ */

#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>

#define PL_VERSION "1.2.1"

bool
	IsInCharge[MAXPLAYERS + 1] = {false, ...};

public Plugin myinfo =
{
	name = "Blocks heatseeking chargers",
	description = "Blocks heatseeking chargers",
	author = "sheo",
	version = PL_VERSION,
	url = "https://github.com/SirPlease/L4D2-Competitive-Rework"
}

public void OnPluginStart()
{
	CreateConVar("l4d2_block_heatseeking_chargers_version", PL_VERSION, "Block heatseeking chargers fix version");
	
	HookEvent("player_bot_replace", BotReplacesPlayer);
	HookEvent("charger_charge_start", Event_ChargeStart);
	HookEvent("charger_charge_end", Event_ChargeEnd);
	HookEvent("player_spawn", Event_OnPlayerSpawn);
	HookEvent("player_death", Event_OnPlayerDeath);
	
	HookEvent("round_start", Event_Reset, EventHookMode_PostNoCopy);
	HookEvent("round_end", Event_Reset, EventHookMode_PostNoCopy);
}

void ResetArray()
{
	for (int i = 0; i <= MaxClients; i++) {
		IsInCharge[i] = false;
	}
}

public void Event_Reset(Event hEvent, const char[] sEntityName, bool bDontBroadcast)
{
	ResetArray();
}

public void Event_ChargeStart(Event hEvent, const char[] sEntityName, bool bDontBroadcast)
{
	IsInCharge[GetClientOfUserId(hEvent.GetInt("userid"))] = true;
}

public void Event_ChargeEnd(Event hEvent, const char[] sEntityName, bool bDontBroadcast)
{
	IsInCharge[GetClientOfUserId(hEvent.GetInt("userid"))] = false;
}

public void BotReplacesPlayer(Event hEvent, const char[] sEntityName, bool bDontBroadcast)
{
	int iClient = GetClientOfUserId(hEvent.GetInt("player"));
	if (iClient > 0 && IsInCharge[iClient]) {
		int iBot = GetClientOfUserId(hEvent.GetInt("bot"));
		
		SetEntityFlags(iBot, GetEntityFlags(iBot) | FL_FROZEN);
		IsInCharge[iClient] = false;
	}
}

public void Event_OnPlayerSpawn(Event hEvent, const char[] sEntityName, bool bDontBroadcast)
{
	IsInCharge[GetClientOfUserId(hEvent.GetInt("userid"))] = false;
}

public void Event_OnPlayerDeath(Event hEvent, const char[] sEntityName, bool bDontBroadcast)
{
	IsInCharge[GetClientOfUserId(hEvent.GetInt("userid"))] = false;
}

@J-Tanzanite
Copy link
Owner

Will it work for blocking curving chargers on humans? As this code fix it for bots only, so again this is probably an engine bug originally.

Why are you asking me? I didn't write the code, ask... SirPlease.

@lunatixxx
Copy link
Author

lunatixxx commented Oct 17, 2022

Will it work for blocking curving chargers on humans? As this code fix it for bots only, so again this is probably an engine bug originally.

Why are you asking me? I didn't write the code, ask... SirPlease.

Because he clearly said that his repository was not made for that the reason why i am asking here.

@J-Tanzanite
Copy link
Owner

Well I'm not familiar with the inner workings of L4D or what his intentions were, so I really can't tell you what this code is for or if it would solve your issue.

A L4D1&2 lilac update will come in due time, where I'll investigate these things and write detections and patches, but it'll be a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants