Then i will need to add a rate limiter for connect too.
Edit: it is harder to make than i thought. I expect that the current code will also block other players from joining as well.
Printable View
A lot of servers in COD2 1.0 are filled now... Some russian kid is doing this. Max 5 bots are added now, so its already a big improvement :)
I guess that there is no need for connect rate limiter.
This might limit the fake clients a little better. It will allow ~5 challenge packets per second.
The limiter stores the burst of the packets. The challenge limiter is also affected by other packets like getinfo, getstatus, rcon.PHP Code:
int hook_SV_GetChallenge(netadr_t from)
{
// Prevent using getchallenge as an amplifier
if ( SVC_RateLimitAddress( from, 5, 1000 ) ) {
For example, 2x getinfo, 2x getstatus, 1x rcon and 1x getchallenge in one second. With the above code the challenge will be dropped, because it is packet #6.
And how to use / add this? :P
Maybe for now it might be easier to tweak the fake bot kick script.
Now the server will wait 5 seconds for the first fake client. But after kicking this bot, the server will kick the clients from that IP after 1.5 seconds.
How to use:PHP Code:
kickFakeClients()
{
self endon("begin");
self endon("disconnect");
if(self getGuid() != 0)
return; // cd key can only be used once
wait 0.05;
if(self getClientState() >= 3) // CS_PRIMED (3) or CS_ACTIVE (4)
return; // a fake player's state is always CS_CONNECTED (2)
ip = self getIP();
if(isDefined(level.lastfakeplayerip) && level.lastfakeplayerip == ip)
wait 1.5;
else // more time when IP isn't the same as previous ip
wait 5;
if(self getClientState() == 2)
{
lastconnect = self getLastConnectTime();
lastmsg = self getLastMSG();
if(lastconnect == lastmsg)
{
level.lastfakeplayerip = ip; // store ip from fake client
self kickFakeClient(ip, lastconnect, lastmsg);
}
}
}
kickFakeClient(ip, lastconnect, lastmsg)
{
printfline("[" + ip + "][" + self getClientState() + "] connect: " + lastconnect + "/" + lastmsg + " (" + self.name + ")");
iprintln(self.name + "^7 connection timeout.");
kick(self getEntityNumber());
}
You can add it to CodeCallback_PlayerConnect() when you are use multiple gametypes.PHP Code:
Callback_PlayerConnect()
{
thread dummy();
self thread kickFakeClients();
self PlayerConnected();
But the bots connect every 0.05 seconds. Thats the smallest delay
Again a filler.
Mitch's script works perfectly!
IP of filler: http://www.ip-tracker.org/locator/ip...=80.25.150.100
New IP of the filler:
109.26.225.58