Raised This Month: $ Target: $400
 0% 

[L4D2] Airstuck teleportation patch


Post New Thread Reply   
 
Thread Tools Display Modes
Krevik
Junior Member
Join Date: Mar 2021
Old 03-26-2021 , 15:55   Re: [L4D2] Airstuck teleportation patch
Reply With Quote #41

It may be better to check three things at once (WHEN TELEPORTING):
-is outside world
-is distance made lastly big (ONLY XY coords, to avoid fake reports while jumping with survivor from height especially near 0,0,0 position)
-is close to 0,0,0 when the distance is big

And when checking if should save position should check if:
-isn't outside the world
-isn't distance made lastly big (also XY only coords)
-isn't too close to 0,0,0.

Something like here, however I am not familiar with sourcepawn code so I may have made some mistakes here. I am testing this on my server right now, will see.

Code:
public int GetXZDistance(float[3] vec1, float[3] vec2){
	return SquareRoot(FloatAbs(((vec2[0]-vec1[0])*(vec2[0]-vec1[0]))+((vec2[1]-vec1[1])*(vec2[1]-vec1[1]))));
}

public Action SaveVictimPosition_Timer(Handle timer, any victim)
{
	static float prevVictimPos[3];
	static bool isOutsideWorld;

	if (IsClientInGame(victim) && GetClientTeam(victim) == 2 && IsPlayerAlive(victim))
	{
		GetClientAbsOrigin(victim, prevVictimPos);
		isOutsideWorld = TR_PointOutsideWorld(prevVictimPos);
		float zeroVector[] = {0.0,0.0,0.0};
                float distance = GetXZDistance(prevVictimPos, g_fVictimPrevPos);
		float distanceToZero = GetXZDistance(prevVictimPos, zeroVector);

		if ( !isOutsideWorld && distance < 700 && distanceToZero > 300)
		{
			g_fVictimPrevPos = prevVictimPos;

			#if debug
				CPrintToChatAll("{blue}[Jockey UnTeleport]{default} victim position saved.");
			#endif
		}
	}
	return Plugin_Continue;
}

public Action JockeyRideCheck_Timer(Handle timer, any victim)
{
	static float newVictimPos[3];
	static bool isOutsideWorld;

	if (IsClientInGame(victim) && GetClientTeam(victim) == 2 && IsPlayerAlive(victim))
	{
		GetClientAbsOrigin(victim, newVictimPos);
		isOutsideWorld = TR_PointOutsideWorld(newVictimPos);
		float zeroVector[] = {0.0,0.0,0.0};
                float distance = GetXZDistance(newVictimPos, g_fVictimPrevPos);
		float distanceToZero = GetXZDistance(newVictimPos, zeroVector);
		if ( isOutsideWorld  || ( distance > 700 && distanceToZero < 300 ) )
		{
			CPrintToChatAll("[{green}!{default}] {olive}Jockey {default}teleported {green}survivor{default}. Moving {green}survivor {default}back to previous position.");
			TeleportToPrevPos(victim);
		}
	}
	return Plugin_Continue;
}

Last edited by Krevik; 03-27-2021 at 11:13. Reason: improved logic
Krevik is offline
larrybrains
Senior Member
Join Date: May 2017
Old 03-26-2021 , 18:57   Re: [L4D2] Airstuck teleportation patch
Reply With Quote #42

Quote:
Originally Posted by Krevik View Post
It may be better to check three things at once:
-is outside world
-is distance made lastly big (ONLY XY coords, to avoid fake reports while jumping with survivor from height especially near 0,0,0 position)
-is close to 0,0,0 when the distance is big
I've been testing a new version of the plugin for a few weeks on my server that basically does what you mentioned. It seems to work about 90% of the time, and the other 10% are situations such as on Parish Map 1 where the 0,0,0 origin is inside the map but above the ground, so the player drops instantly and the plugin may not have time to catch it.

New plugin is attached.

You can exclude maps where you don't want the plugin to run such as c7m3_port by adding a cvar to your server.cfg:

PHP Code:
// Maps where the unteleport jockey plugin is disabled because the (0,0,0) origin is inside the map
jockey_unteleport_disabled c6m3_port //Passing finale
jockey_unteleport_disabled c7m3_port //Sacrifice finale 
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_unteleport_jockey.sp - 81 views - 7.2 KB)
File Type: smx l4d2_unteleport_jockey.smx (8.5 KB, 53 views)
larrybrains is offline
Krevik
Junior Member
Join Date: Mar 2021
Old 04-13-2021 , 16:59   Re: [L4D2] Airstuck teleportation patch
Reply With Quote #43

Quote:
Originally Posted by Krevik View Post
It may be better to check three things at once (WHEN TELEPORTING):
-is outside world
-is distance made lastly big (ONLY XY coords, to avoid fake reports while jumping with survivor from height especially near 0,0,0 position)
-is close to 0,0,0 when the distance is big

And when checking if should save position should check if:
-isn't outside the world
-isn't distance made lastly big (also XY only coords)
-isn't too close to 0,0,0.

Something like here, however I am not familiar with sourcepawn code so I may have made some mistakes here. I am testing this on my server right now, will see.

Code:
public int GetXZDistance(float[3] vec1, float[3] vec2){
	return SquareRoot(FloatAbs(((vec2[0]-vec1[0])*(vec2[0]-vec1[0]))+((vec2[1]-vec1[1])*(vec2[1]-vec1[1]))));
}

public Action SaveVictimPosition_Timer(Handle timer, any victim)
{
	static float prevVictimPos[3];
	static bool isOutsideWorld;

	if (IsClientInGame(victim) && GetClientTeam(victim) == 2 && IsPlayerAlive(victim))
	{
		GetClientAbsOrigin(victim, prevVictimPos);
		isOutsideWorld = TR_PointOutsideWorld(prevVictimPos);
		float zeroVector[] = {0.0,0.0,0.0};
                float distance = GetXZDistance(prevVictimPos, g_fVictimPrevPos);
		float distanceToZero = GetXZDistance(prevVictimPos, zeroVector);

		if ( !isOutsideWorld && distance < 700 && distanceToZero > 300)
		{
			g_fVictimPrevPos = prevVictimPos;

			#if debug
				CPrintToChatAll("{blue}[Jockey UnTeleport]{default} victim position saved.");
			#endif
		}
	}
	return Plugin_Continue;
}

public Action JockeyRideCheck_Timer(Handle timer, any victim)
{
	static float newVictimPos[3];
	static bool isOutsideWorld;

	if (IsClientInGame(victim) && GetClientTeam(victim) == 2 && IsPlayerAlive(victim))
	{
		GetClientAbsOrigin(victim, newVictimPos);
		isOutsideWorld = TR_PointOutsideWorld(newVictimPos);
		float zeroVector[] = {0.0,0.0,0.0};
                float distance = GetXZDistance(newVictimPos, g_fVictimPrevPos);
		float distanceToZero = GetXZDistance(newVictimPos, zeroVector);
		if ( isOutsideWorld  || ( distance > 700 && distanceToZero < 300 ) )
		{
			CPrintToChatAll("[{green}!{default}] {olive}Jockey {default}teleported {green}survivor{default}. Moving {green}survivor {default}back to previous position.");
			TeleportToPrevPos(victim);
		}
	}
	return Plugin_Continue;
}
This version doesn't work, don't try to use it. Furthermore jockey teleport bug happend to me few more times and it turns out that jockey teleport destination coordinates are not always 0,0,0. In my case, today it was 14063, 8089, -212 at c8m3_sewers. Gonna test more code to find a 99% working solution.
Krevik is offline
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 07-21-2021 , 06:43   Re: [L4D2] Airstuck teleportation patch
Reply With Quote #44

Is it fixed with Valve update ? If it is it was not in the changelog.

Last edited by JLmelenchon; 07-21-2021 at 10:02.
JLmelenchon is offline
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 07-22-2021 , 13:17   Re: [L4D2] Airstuck teleportation patch
Reply With Quote #45

Ok it is officialy not fixed just happened in my game.
JLmelenchon is offline
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 07-26-2021 , 15:35   Re: [L4D2] Airstuck teleportation patch
Reply With Quote #46

By the way there are important bugs with this plugin, not sure if it is map related (was on the sacrifice map 1 & 2) but a player was teleported to another one without even being jockeyed "insideworld" as the plugin says. I recommend to disable completely the sacrifice campaign with the cvar.

Code:
L 07/26/2021 - 21:03:21: Info (map "c7m1_docks") (file "/home/gameserver/servers/serveur9/srcds/left4dead2/addons/sourcemod/logs/errors_20210726.log")
L 07/26/2021 - 21:03:21: [SM] Exception reported: Client index -1 is invalid (arg 5)
L 07/26/2021 - 21:03:21: [SM] Blaming: l4d2_unteleport_jockey_fix.smx
L 07/26/2021 - 21:03:21: [SM] Call stack trace:
L 07/26/2021 - 21:03:21: [SM]   [0] LogAction
L 07/26/2021 - 21:03:21: [SM]   [1] Line 259, plugin.sp::JockeyRideCheck_Timer
L 07/26/2021 - 21:07:36: Error log file session closed.
L 07/26/2021 - 21:14:39: SourceMod error session started
L 07/26/2021 - 21:14:39: Info (map "c7m2_barge") (file "/home/gameserver/servers/serveur9/srcds/left4dead2/addons/sourcemod/logs/errors_20210726.log")
L 07/26/2021 - 21:14:39: [SM] Exception reported: Client index -1 is invalid (arg 5)
L 07/26/2021 - 21:14:39: [SM] Blaming: l4d2_unteleport_jockey_fix.smx
L 07/26/2021 - 21:14:39: [SM] Call stack trace:
L 07/26/2021 - 21:14:39: [SM]   [0] LogAction
L 07/26/2021 - 21:14:39: [SM]   [1] Line 259, plugin.sp::JockeyRideCheck_Timer
L 07/26/2021 - 21:16:31: [SM] Exception reported: Client index -1 is invalid (arg 5)
L 07/26/2021 - 21:16:31: [SM] Blaming: l4d2_unteleport_jockey_fix.smx
L 07/26/2021 - 21:16:31: [SM] Call stack trace:
L 07/26/2021 - 21:16:31: [SM]   [0] LogAction
L 07/26/2021 - 21:16:31: [SM]   [1] Line 259, plugin.sp::JockeyRideCheck_Timer
L 07/26/2021 - 21:18:31: Error log file session closed.
L 07/26/2021 - 21:10:53: [l4d2_unteleport_jockey_fix.smx] [Jockey UnTeleport] Player1 teleported by Jockey Player2, origin: 8061.8, 2438.3, 150.5 distance: 773.0 distance to center: 8423.8 worldInsideWorld)

L 07/26/2021 - 21:11:57: [l4d2_unteleport_jockey_fix.smx] [Jockey UnTeleport] Player1 teleported by Jockey player2, origin: 4664.9, 1902.1, 129.7 distance: 786.8 distance to center: 5039.5 worldInsideWorld)

L 07/26/2021 - 21:16:01: [l4d2_unteleport_jockey_fix.smx] [Jockey UnTeleport] Player1 teleported by Jockey Player2, origin: 10692.2, 2258.9, 176.0 distance: 963.6 distance to center: 10929.6 worldInsideWorld)

Last edited by JLmelenchon; 07-26-2021 at 15:36.
JLmelenchon is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 07-26-2021 , 15:39   Re: [L4D2] Airstuck teleportation patch
Reply With Quote #47

may be a bot teleporting because was stuck either
__________________
Marttt is offline
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 07-26-2021 , 15:50   Re: [L4D2] Airstuck teleportation patch
Reply With Quote #48

Was only real players. I am really wondering when Valve is going to fix this thing so we can remove this plugin, it just happen in versus.

Last edited by JLmelenchon; 07-26-2021 at 15:51.
JLmelenchon is offline
ProjectSky
AlliedModders Donor
Join Date: Aug 2020
Old 08-17-2021 , 22:56   Re: [L4D2] Airstuck teleportation patch
Reply With Quote #49

this exploit seems to only trigger on new linux systems, my server is running on ubuntu20.04
ProjectSky is offline
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 08-18-2021 , 18:52   Re: [L4D2] Airstuck teleportation patch
Reply With Quote #50

From what i understood sirplease server too are running on an older linux version and don't have this problem, so yes maybe a system problem.
JLmelenchon is offline
Reply


Thread Tools
Display Modes

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:29.


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