SRCDS Steam group


Player rate tracking system using Linux's firewall (iptables)
#46
Nevermind, found it. Still would like to note the first link does not work.
Reply
#47
Thanks. The link is fixed now.

I'd be interested to see the stats from your server. Could you post the link here or PM me?
Reply
#48
Nice work css. I tried to use it. It worked. But it´s not neccesary atm because of the game mod im serving. The playerbase is to small. If il build an css server il realy will install this.
Reply
#49
Run it in monitor mode or set the ratelimit high enough so it's not kicking anyone. I'd like to see what kind of rates others have on their servers. On my server the rates are not so good. Players talk about 100 tick servers and 1000 FPS stuff, but the reality seems to be that only fraction of players even have solid 100 or 66 updates per second.
Reply
#50
Is the script compatible with Left4Dead2 ? Because I get no players result.

Code:
[Mon Dec 28 03:21:46 2009]:                          
[Mon Dec 28 03:21:46 2009]:         === Ratetables ===
[Mon Dec 28 03:21:46 2009]:                          
[Mon Dec 28 03:21:46 2009]: Author:  Ghost
[Mon Dec 28 03:21:46 2009]: Website: http://css.setti.info/
[Mon Dec 28 03:21:46 2009]:
[Mon Dec 28 03:21:46 2009]: Ratetables started
[Mon Dec 28 03:21:47 2009]: Flushing "csstracking" firewall chain for "[FR] L4D2 Fugitif server"
[Mon Dec 28 03:21:48 2009]: Connection succeeded to "[FR] L4D2 Fugitif server".
[Mon Dec 28 03:21:58 2009]: Server "[FR] L4D2 Fugitif server" sample #1 taken (players: 0)
[Mon Dec 28 03:22:09 2009]: Server "[FR] L4D2 Fugitif server" sample #2 taken (players: 0)

It detects the current map
Code:
[Mon Dec 28 03:10:11 2009] Server map changed from "unknown" to "c1m4_atrium"
Sorry for my English, I'm French
Reply
#51
The problem is solved

The rcon status of L4D2 is :

Code:
# userid name uniqueid connected ping loss state rate adr
# 311 3 "The name" STEAM_1:1:xxxxxxxx 34:55 215 1 active 20000 21x.2x.xx.xx:27005

And css is different (no clientid and client rate)

Code:
# userid name uniqueid connected ping loss state adr
# 1705 "oldsmobil" STEAM_ID_LAN 14:49 71 0 active 62.69.198.19:43621


I change these lines
Code:
next unless ($line =~ m/^#\s+(\d+) "([^"]*)" ([^\s]+)\s*((\d+:)?\d+:\d+) (\d+) (\d+) (\w+) (.*)/);
To

Code:
next unless ($line =~ m/^#\s+(\d+) (\d+) "([^"]*)" ([^\s]+)\s*((\d+:)?\d+:\d+) (\d+) (\d+) (.*) (\w+) (.*)/);

And
Code:
my ($userid, $uniqueid, $steamid, $connected, undef, $ping, $loss, $state, $adr) =
        ($line =~ m/^#\s+(\d+) "([^"]*)" ([^ ]+)\s*((\d+:)?\d+:\d+) (\d+) (\d+) (\w+) (.*)/);

To
Code:
my ($userid, undef, $uniqueid, $steamid, $connected, undef, $ping, $loss, $state, undef, $adr) =
        ($line =~ m/^#\s+(\d+) (\d+) "([^"]*)" ([^ ]+)\s*((\d+:)?\d+:\d+) (\d+) (\d+) (.*) (\w+) (.*)/);

And it works
Quote:[Tue Dec 29 14:34:12 2009]: Server "L4D2 Fugitif server" sample #147 taken (players: 3)
[Tue Dec 29 14:34:22 2009]: Server "L4D2 Fugitif server" sample #148 taken (players: 3)
[Tue Dec 29 14:34:33 2009]: Added tracking for "BaudBish" (address: 78.105.xxx.xxx:56562) on L4D2 Fugitif server
[Tue Dec 29 14:34:33 2009]: Server "L4D2 Fugitif server" sample #149 taken (players: 4)

But I wonder if this is useful because the server sends only 30 fps maximum

Code:
stats
CPU   In    Out   Uptime  Users   FPS    Players
4.00 2872.74 5756.18      46     3   29.64       4
Thank you for the script. I also use the plugin Munin.
Reply
#52
Nice patching Smile

Indeed, it might be unnecessary to use ratetables for L4D2 server if it's limited to 30 updates per second. All players should be able to do that much.
Reply
#53
(12-30-2009, 07:53 AM)css Wrote:  Nice patching Smile

Indeed, it might be unnecessary to use ratetables for L4D2 server if it's limited to 30 updates per second. All players should be able to do that much.

Thank you, indeed I am no expert in python, but I often use php or bash.
For l4d2 I have users who are unable to an average of 20 fps per second.
An example today :

Code:
[Tue Dec 29 19:32:38 2009] Kicked player "Veloa" (userid: 356) (steamid: STEAM_1:1:x7x3xxxx) (rate min/avg/max: 10.6 / 13.8 / 17.6) (size min/avg/max: 994 / 91 / 1552 bytes/pkt) (ping: 104) (loss: 0) (state: active) (onlinetime: 226) (samples: 18)
[Tue Dec 29 19:53:31 2009] Kicked player "Loga" (userid: 368) (steamid: STEAM_1:1:1x36xxxx) (rate min/avg/max: 0.0 / 9.1 / 16.5) (size min/avg/max: 0 / 74 / 1252 bytes/pkt) (ping: 109) (loss: 0) (state: active) (onlinetime: 896) (samples: 81)
9.1 fps /s should be unplayable I think.
For now, I test the script on a single server about 6 that I create for l4d2.
Reply
#54
(12-30-2009, 09:09 AM)fugitif Wrote:  Thank you, indeed I am no expert in python, but I often use php or bash.

Hehe.. it's Perl Smile It pays off to know at least some scripting language. The rest are all the same.

(12-30-2009, 09:09 AM)fugitif Wrote:  For now, I test the script on a single server about 6 that I create for l4d2.

If you're creating the servers on a same computer, then you can use the "advanced" feature in the script. It's something that I don't know anyone has used yet. Just follow the instructions how to set it up for multiple servers.

Note also that at least in CSS players who are alt-tabbed to windows have rate reduced to about 17/s. It may be unpleasant surprise if the system has banned you while you were checking emails or something. If you see lots of players getting banned with 17-18/s rate, then try to increase the number of needed samples so players have enough time to check their mails or whatever every once in a while without getting kicked (or maybe they should be kicked if they do that..)
Reply
#55
I am trying to use the advanced options, but I can not find the correct syntax for multiple server.
I try this but it does not work

Code:
my %servers = (
           1 =>
           {
           name => "My CSS server1",
           ip => "1.2.3.4",
           port => 27015,
           rconpass => "mypassword",
           fwchain => "csstracking1",
           ratelimit => 25,
           onlinetimelimit => 30,
           samples => 18,
           loginterval => 1,
           players => {}
           }
           2 =>
           {
           name => "My CSS server1",
           ip => "1.2.3.4",
           port => 27016,
           rconpass => "mypassword",
           fwchain => "csstracking2",
           ratelimit => 25,
           onlinetimelimit => 30,
           samples => 18,
           loginterval => 1,
           players => {}
           }
           );
Reply
#56
Try this:

Code:
my %servers = (
           1 =>
           {
           name => "My CSS server1",
           ip => "1.2.3.4",
           port => 27015,
           rconpass => "mypassword",
           fwchain => "csstracking1",
           ratelimit => 25,
           onlinetimelimit => 30,
           samples => 18,
           loginterval => 1,
           players => {}
           },
           2 =>
           {
           name => "My CSS server1",
           ip => "1.2.3.4",
           port => 27016,
           rconpass => "mypassword",
           fwchain => "csstracking2",
           ratelimit => 25,
           onlinetimelimit => 30,
           samples => 18,
           loginterval => 1,
           players => {}
           }
           );

You have to have comma "," after each { ... } block. So that it's like 1 => { ... }, 2 => { ... }
Reply
#57
It works thank you Smile

Quote:[Thu Dec 31 14:50:02 2009]:
[Thu Dec 31 14:50:02 2009]: === Ratetables ===
[Thu Dec 31 14:50:02 2009]:
[Thu Dec 31 14:50:02 2009]: Author: Ghost
[Thu Dec 31 14:50:02 2009]: Website: http://css.setti.info/
[Thu Dec 31 14:50:02 2009]:
[Thu Dec 31 14:50:02 2009]: Ratetables started
[Thu Dec 31 14:50:03 2009]: Flushing "l4dtracking4" firewall chain for "L4D2 server4"
[Thu Dec 31 14:50:03 2009]: Flushing "l4dtracking1" firewall chain for "L4D2 server1"
[Thu Dec 31 14:50:03 2009]: Flushing "l4dtracking3" firewall chain for "L4D2 server3"
[Thu Dec 31 14:50:03 2009]: Flushing "l4dtracking2" firewall chain for "L4D2 server2"
[Thu Dec 31 14:50:03 2009]: Flushing "l4dtracking5" firewall chain for "L4D2 server5"
[Thu Dec 31 14:50:04 2009]: Connection succeeded to "L4D2 server4".
[Thu Dec 31 14:50:04 2009]: Connection succeeded to "L4D2 server1".
[Thu Dec 31 14:50:05 2009]: Connection succeeded to "L4D2 server3".
[Thu Dec 31 14:50:05 2009]: Connection succeeded to "L4D2 server2".
[Thu Dec 31 14:50:06 2009]: Connection succeeded to "L4D2 server5".

Just one problem, the file rates.html will update too fast. I just do not see the stats
Reply
#58
(12-31-2009, 11:53 PM)fugitif Wrote:  It works thank you Smile

Just one problem, the file rates.html will update too fast. I just do not see the stats

Great.

It seems I haven't thought through the web page rates creating. Now the "htmlfile" configuration option is in the general configuration section although it should be in the specific servers. That way each server would have their own rates file.

You seem to know quite enough to maybe fix the bug yourself. I'll take a look at the problem sometime soon, but if you manage to fix the problem with these instructions then maybe you'll provide another patch for the system.

The problem is on line 661 (you have it probably around 700 or so because you have more configuration lines for the servers):
Code:
open (OUT, ">$CONF{htmlfile}");
This should read
Code:
open (OUT, ">$server->{htmlfile}");

Then in the start %servers = ( 1 => ...., 2 => ....) you should add for each server:
Code:
...
htmlfile => "/home/user/public_html/...",
...

That way the html file is separate for each server.

The fix itself doesn't seem so difficult, but I haven't tested it so I'm not saying it'll work. It doesn't seem to break anything either, but I know these small fixes usually break at least something Smile

(Note: The "fix" above is completely untested, but I think if you implement it you'll be able to fix the possible syntax errors and such..)
Reply
#59
It works Smile Again thank you css for your help
I set the rate of 20 fps of 30 max for L4D2 and I have some kick with 20 samples.

Code:
[Sat Jan  2 10:35:54 2010] Kicked player "[HD] Просто Витя^^" (userid: 162) (steamid: STEAM_1:1:2xxxxx2) (rate min/avg/max: 11.3 / 14.4 / 18.5) (size min/avg/max: 961 / 91 / 1920 bytes/pkt) (ping: 116) (loss: 0) (state: active) (onlinetime: 672) (samples: 50)
[Sat Jan  2 10:47:54 2010] Kicked player "XxPeggyxX" (userid: 593) (steamid: STEAM_1:0:2xxxxx8) (rate min/avg/max: 0.0 / 0.0 / 0.0) (size min/avg/max: 0 / 0 / 0 bytes/pkt) (ping: 305) (loss: 62) (state: active) (onlinetime: 354) (samples: 20)
[Sat Jan  2 11:14:44 2010] Kicked player "<<<3d@g§nIgIIt§>>>" (userid: 163) (steamid: STEAM_1:0:xxxxx8) (rate min/avg/max: 5.4 / 14.8 / 19.2) (size min/avg/max: 413 / 75 / 1449 bytes/pkt) (ping: 142) (loss: 0) (state: active) (onlinetime: 3001) (samples: 230)
[Sat Jan  2 11:37:05 2010] Kicked player "Buffie" (userid: 4921) (steamid: STEAM_1:0:xxxxx1) (rate min/avg/max: 15.4 / 16.4 / 16.9) (size min/avg/max: 1115 / 72 / 1212 bytes/pkt) (ping: 76) (loss: 0) (state: active) (onlinetime: 289) (samples: 20)
[Sat Jan  2 11:43:13 2010] Kicked player "SZK GUONOO" (userid: 4938) (steamid: STEAM_1:1:xxxxx2) (rate min/avg/max: 7.3 / 16.7 / 19.5) (size min/avg/max: 629 / 90 / 1836 bytes/pkt) (ping: 96) (loss: 0) (state: active) (onlinetime: 303) (samples: 20)
[Sat Jan  2 11:51:14 2010] Kicked player "stask312" (userid: 4912) (steamid: STEAM_1:1:xxxxx7) (rate min/avg/max: 12.7 / 16.0 / 19.9) (size min/avg/max: 1201 / 94 / 1967 bytes/pkt) (ping: 164) (loss: 0) (state: active) (onlinetime: 1250) (samples: 92)
[Sat Jan  2 11:52:44 2010] Kicked player "dbekarovski" (userid: 4953) (steamid: STEAM_1:1:xxxxx3) (rate min/avg/max: 6.7 / 10.6 / 15.0) (size min/avg/max: 618 / 90 / 1337 bytes/pkt) (ping: 119) (loss: 0) (state: active) (onlinetime: 537) (samples: 36)
[Sat Jan  2 14:59:36 2010] Kicked player "Oelix" (userid: 5062) (steamid: STEAM_1:0:xxxxx0) (rate min/avg/max: 11.6 / 14.5 / 18.0) (size min/avg/max: 1214 / 101 / 1880 bytes/pkt) (ping: 118) (loss: 0) (state: active) (onlinetime: 1235) (samples: 20)
[Sat Jan  2 15:05:05 2010] Kicked player "Pogo(Fr)" (userid: 84) (steamid: STEAM_1:0:xxxxx7) (rate min/avg/max: 0.0 / 13.0 / 15.9) (size min/avg/max: 0 / 68 / 1085 bytes/pkt) (ping: 73) (loss: 0) (state: active) (onlinetime: 822) (samples: 45)

Do you think I should lower the minimum number of fps to 15 or 18 ?
The server is a good machine with 2x1Gb/s bandwidth, 8Gb RAM, Quad Core Xeon and 3x1 To RAID 5 disk.
The ping is good, but not in the world

Code:
$ ping -c 5 www.free.fr
PING www.free.fr (212.27.48.10) 56(84) bytes of data.
64 bytes from www.free.fr (212.27.48.10): icmp_seq=1 ttl=124 time=0.740 ms
64 bytes from www.free.fr (212.27.48.10): icmp_seq=2 ttl=124 time=0.730 ms
64 bytes from www.free.fr (212.27.48.10): icmp_seq=3 ttl=124 time=0.727 ms
64 bytes from www.free.fr (212.27.48.10): icmp_seq=4 ttl=124 time=0.742 ms
64 bytes from www.free.fr (212.27.48.10): icmp_seq=5 ttl=124 time=0.742 ms

--- www.free.fr ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4001ms
rtt min/avg/max/mdev = 0.727/0.736/0.742/0.018 ms


Code:
$ ping -c 5 srcds.com
PING srcds.com (208.122.61.16) 56(84) bytes of data.
64 bytes from 208.122.61.16: icmp_seq=1 ttl=55 time=82.6 ms
64 bytes from 208.122.61.16: icmp_seq=2 ttl=55 time=82.6 ms
64 bytes from 208.122.61.16: icmp_seq=3 ttl=55 time=82.7 ms
64 bytes from 208.122.61.16: icmp_seq=4 ttl=55 time=82.7 ms
64 bytes from 208.122.61.16: icmp_seq=5 ttl=55 time=82.7 ms

--- srcds.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4000ms
rtt min/avg/max/mdev = 82.612/82.717/82.795/0.323 ms


Code:
$ ping -c 5 css.setti.info
PING css.setti.info (188.40.40.201) 56(84) bytes of data.
64 bytes from css.setti.info (188.40.40.201): icmp_seq=1 ttl=56 time=15.7 ms
64 bytes from css.setti.info (188.40.40.201): icmp_seq=2 ttl=56 time=15.7 ms
64 bytes from css.setti.info (188.40.40.201): icmp_seq=3 ttl=56 time=16.0 ms
64 bytes from css.setti.info (188.40.40.201): icmp_seq=4 ttl=56 time=16.4 ms
64 bytes from css.setti.info (188.40.40.201): icmp_seq=5 ttl=56 time=16.0 ms

--- css.setti.info ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4004ms
rtt min/avg/max/mdev = 15.760/16.025/16.450/0.287 ms

I also note that the ping specified by the server, and ping player is different.
The server indicates 107 ms while the players were 30-40 ms
Reply
#60
(01-03-2010, 01:01 AM)fugitif Wrote:  Do you think I should lower the minimum number of fps to 15 or 18 ?
It depends how players act on the server. For example in CSS players quite often alt-tab to windows. The FPS drops while they are in Windows and they might get kicked then.

I recommend you look at the sort key in function "kick_low_raters".

Code:
if ($player->{rate_max} < $server->{ratelimit}) {

You can change the rate_max value to rate_avg or rate_min. Then adjust the ratelimit accordingly. The current implementation uses rate_max because rate_avg and rate_min are affected by alt-tabbing to windows. The min rate goes to something like 17.5/s (I'm not sure why, but everybody when in Windows have ~17/s rate) and at the same time also the average also decreases. In my newest unpublished version I also have rate_median, which is the median of all values. It's probably better than the average, but I'm not sure which would be good all-around solution.

I've been trying to think of settings which would allow normal alt-tabbing to windows without getting kicked, but which would identify low raters quite fast. In different games players behave differently. For example in TF2 players probably don't alt-tab to windows because there's no time! Smile

(01-03-2010, 01:01 AM)fugitif Wrote:  The server is a good machine with 2x1Gb/s bandwidth, 8Gb RAM, Quad Core Xeon and 3x1 To RAID 5 disk.

Where are you hosted?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)