Anti Bot Attack
#1

Hello, do you know any good method to prevent this shitty bots from connecting to the server?
Reply
#2

pawn Код:
// under onPlayerConnect
new num_players_on_ip = GetNumberOfPlayersOnThisIP(connecting_ip);
if(num_players_on_ip > MAX_CONNECTIONS_FROM_IP)
{
      // banning
}

stock GetNumberOfPlayersOnThisIP(test_ip[])
{
    new against_ip[32+1];
    new x = 0;
    new ip_count = 0;
    for(x=0; x<MAX_PLAYERS; x++) {
        if(IsPlayerConnected(x)) {
            GetPlayerIp(x,against_ip,32);
            if(!strcmp(against_ip,test_ip)) ip_count++;
        }
    }
    return ip_count;
}
Reply
#3

dominik's solution, although working, is not the best. And could end up with false positives of course.

I have another sort of check in place, which takes action if:
1. it has been less than 2 seconds from the last connection
2.1. the connecting player has the same name as the last connection OR
2.2. the connecting player has the same IP as the last connection

I haven't seen bots which would use the same name but a different IP when connecting so far, all I have encountered is bots using different names from the same IP real frequently. These sorts of attacks, though, can be made "invisible" to the other players in your server - detect them before sending any connection messages or spending ANY time on them (this would include calling queries, "registering" them with the streamer or sscanf, etc). This way you will encounter less lag, if any.

JernejL has released something a bit more complicated when it comes to detecting bots. I believe you'll find it if you search for it.
Reply
#4

http://ysi.wikia.com/wiki/Library:YSI%5Cy_flooding
Reply
#5

Quote:
Originally Posted by AndreT
Посмотреть сообщение
dominik's solution, although working, is not the best. And could end up with false positives of course.
How would that system end up with false positives?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)