Sign in to follow this  
Followers 0
mouseboyx

info for event warp

A collection of tests that might help someone with event_warp in lua scripting.

 

Put 'antiwarp 3' without quotes into the sapp init.txt to enable the firing of the EVENT_WARP callback.

 

While continuously moving, on the 3rd time that a player warps, with 'antiwarp 3', event_warp is fired.  If the player stands still for a moment, there's a cooldown effect where they must move and warp 3 times again to trigger event_warp.

 

Adding 200-300ms of latency then restoring a normal connection every 0.5-1.0 seconds is enough to trigger a warp event, but somewhere in the 180-220ms range and below the player can still warp, but the warp is very subtle and doesn't always trigger event_warp.  Adding and subtracting a network delay above 300ms will surely trigger event_warp if it's applied continuously.

 

I was using this quick and dirty linux bash script to simulate warp through the localhost, there is a tool called clumsy for windows on github that can simulate delayed, dropped, etc, packets that can also be useful for testing.

for i in {0..10000}
do
sudo tc qdisc del dev lo root netem delay 150ms
sleep 0.5
sudo tc qdisc add dev lo root netem delay 150ms
sleep 0.5
done

Run:  sudo tc qdisc del dev lo root netem delay 150ms  after testing to restore normal latency.

 

 

Pushing a player with a vehicle can trigger EVENT_WARP even if both players have a perfect connection.  I included an lua script that attempts to find warping distance of players who aren't in vehicles.  It works ok, but doesn't take into account all the variables of what can happen in a game, like gravity, falling, player speed, being pushed by a vehicle, walking up an incline, or other things like that.

 

The main motivation for testing is, players who apply a warp cheat, then do flag runs, I was hoping there might be a way to auto-kick abusive players like that.  It may be possible, taking into account how many warp events happen in a time period, how far the player is warping each time, etc...  My main concern is that I wouldn't want a script solution to auto kick an innocent player.

 

event_warp.lua

Takka, AntiMomentum and Java like this

Share this post


Link to post
Share on other sites

Tiddy-bits:

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0
  • Recently Browsing   0 members

    No registered users viewing this page.