Tripperful / sf-servers-requests

Requests and issues for SF HL2DM Servers
1 stars 0 forks source link

Feature Request - Fake Lag Implementation #18

Open TehEdges opened 1 month ago

TehEdges commented 1 month ago

Looking to have a feature added that would allow the server to control fake lag via tc to balance pings.

Example commands to add fake latency by IP:

sudo tc qdisc add dev eth0 root handle 1: prio priomap 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 <--- sets up root traffic control and prio map sudo tc qdisc add dev eth0 parent 1:1 handle 10: netem delay 50ms <--- This creates 50ms on flow 1:1 which we will use for player 1 sudo tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst 8.8.8.8 flowid 1:1 <--- Applies traffic control qdisc for matching ip address and flow 1:1 sudo tc qdisc add dev eth0 parent 1:2 handle 20: netem delay 70ms <--- This creates 70ms on flow 1:2 which we will use for player 2 sudo tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst 1.1.1.1 flowid 1:2 <--- Applies traffic control qdisc for matching ipaddress and flow 1:2

Example command to remove fake latency:

sudo tc qdisc del dev eth0 root