Help me with anti bot-players
#1

Hi guys, plenty of bot-players have been imported to my server and I still haven't found a way to deal with it. Please take a look at this video and help me!
Link to the video
EDIT1: the blue message in the video will appear everytime a player connects to the server and they're all bots.
EDIT2: Every bot connects with a different IP, not the same IP. It connects real quickly, you can see the log here, as you can see, a plenty of bots can connect at the same time.
Reply
#2

I would need something like that too, no idea how to check player's ip
Reply
#3

What about IP Limit per connection/user ?
Reply
#4

Quote:
Originally Posted by Hunud
Посмотреть сообщение
What about IP Limit per connection/user ?
No idea about that, can you write an example please?
By the way, the problem would be so easy if the bots' IP address were foreign so that I could block all the foreign IPs and the problem solved.
Reply
#5

UPDATE 1: IPs log: https://pastebin.com/eSBH7YhZ
Reply
#6

There are plenty of includes / filterscripts that do the job, you only need to search.
Reply
#7

Quote:
Originally Posted by iLearner
Посмотреть сообщение
There are plenty of includes / filterscripts that do the job, you only need to search.
Every bot connects with a different IP, not the same IP. I haven't found a anti-bots that deal with this.
Reply
#8

Take a look at: YSI / y_flooding.
Edit: Ah, are you sure about they have different IP? If so, forget y_flooding
Reply
#9

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
Take a look at: YSI / y_flooding.
Edit: Ah, are you sure about they have different IP? If so, forget y_flooding
Yes, please see this log: https://pastebin.com/eSBH7YhZ
Reply
#10

one method is to check their IP and then set a limit,
lets suppose


Код:
#define MAX_CONNECTIONS_FROM_IP 5
new pip[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
       GetPlayerIp(playerid,pip[playerid],16);
	new num_players_on_ip = GetNumberOfPlayersOnThisIP(pip[playerid]);
	if(num_players_on_ip > MAX_CONNECTIONS_FROM_IP) 
       {
	    Kick( playerid );
	    return 1;
	}
}


stock GetNumberOfPlayersOnThisIP(test_ip[])
{
	new ip_count;
        for(new i;i<MAX_PLAYERS;i++)
        {
	if(!strcmp(pip[i],test_ip)) ip_count++;
	return ip_count;
        }
}
Reply
#11

Quote:
Originally Posted by iSteve
View Post
one method is to check their IP and then set a limit,
lets suppose


Code:
#define MAX_CONNECTIONS_FROM_IP 5
public OnPlayerConnect(playerid)
{
	new num_players_on_ip = GetNumberOfPlayersOnThisIP(gPlayerInfo[playerid][pIp]);
	if(num_players_on_ip > MAX_CONNECTIONS_FROM_IP) 
       {
	    Kick( playerid );
	    return 1;
	}
}


stock GetNumberOfPlayersOnThisIP(test_ip[])
{
	new ip_count;
	foreach(Player,i) if(!strcmp(gPlayerInfo[i][pIp],test_ip)) ip_count++;
	return ip_count;
}
I don't know if this will work but every bot connects with a different IP.
It connects real quickly, you can see the log with the timestamp at this link, 50 bots can connect at the same time.
Reply
#12

Quote:

I don't know if this will work but every bot connects with a different IP.

It won't work for bots with different IP,that's true

i would kick players with a known proxy by using GeoIP for a first step
Reply
#13

Quote:
Originally Posted by iSteve
View Post
It won't work for bots with different IP,that's true
Yes, that's why I created this thread for a solution. I know this is hard but still looking for it.
You just can't kick because it connects real fast.
Reply
#14

Just some solutions that you can apply here is that
1: kick players if they are using a known proxy with the help of GeoIP
2: once these bots are joining, and they join real quick, so why not have a condition that if there are say 5 joins in lets say a second, the server enters a joinfreeze for a few seconds ( say 10 seconds or maybe 30 seconds) where no one is allowed to join
Reply
#15

Quote:
Originally Posted by iSteve
View Post
Just some solutions that you can apply here is that
1: kick players if they are using a known proxy with the help of GeoIP
2: once these bots are joining, and they join real quick, so why not have a condition that if there are say 5 joins in lets say a second, the server enters a joinfreeze for a few seconds ( say 10 seconds or maybe 30 seconds) where no one is allowed to join
I will try the second one but have no idea about how to do the first.
Reply
#16

There's one thing... after doing some searches i realized that the gpci id of fake clients contain more numbers rather than letters, above 30 that is, so i did something like this and so far 0 false positives and worked against most if not all fake players, Do this at OnPlayerConnect:
PHP Code:
public OnPlayerConnect(playerid)
{
    new 
TempId[80], TempNumb;
    
gpci(playeridTempIdsizeof(TempId));
    for(new 
0strlen(TempId); i++)
    {
        if(
TempId[i] >= '0' && TempId[i] <= '9')
        {
             
TempNumb++;
            }
        }
    if(
TempNumb >= 30)
    {
        new 
BotName[MAX_PLAYER_NAME];
        
GetPlayerName(BotNamesizeof(BotName));
        
format(TempIdsizeof(TempId), "Server kicked %s, reason: suspected bot.",BotName);
        
SendClientMessageToAll(-1,TempId);
        
Kick(playerid);
        }
    return 
1;

try this against them and let me know how it goes.
Reply
#17

Usually people will use raksamp for those kind of bots, YSF has a function to detect those D: simple.
Reply
#18

Quote:
Originally Posted by iLearner
View Post
Usually people will use raksamp for those kind of bots, YSF has a function to detect those D: simple.
My function that i posted above detected raksamp the moment they connected.
Reply
#19

Quote:
Originally Posted by RogueDrifter
View Post
There's one thing... after doing some searches i realized that the gpci id of fake clients contain more numbers rather than letters, above 30 that is, so i did something like this and so far 0 false positives and worked against most if not all fake players, Do this at OnPlayerConnect:
PHP Code:
public OnPlayerConnect(playerid)
{
    new 
TempId[80], TempNumb;
    
gpci(playeridTempIdsizeof(TempId));
    for(new 
0strlen(TempId); i++)
    {
        if(
TempId[i] >= '0' && TempId[i] <= '9')
        {
             
TempNumb++;
            }
        }
    if(
TempNumb >= 30)
    {
        new 
BotName[MAX_PLAYER_NAME];
        
GetPlayerName(BotNamesizeof(BotName));
        
format(TempIdsizeof(TempId), "Server kicked %s, reason: suspected bot.",BotName);
        
SendClientMessageToAll(-1,TempId);
        
Kick(playerid);
        }
    return 
1;

try this against them and let me know how it goes.
Thank you, this seems possible, I will try this. By the way, can I put your code in public OnIncomingConnection to kick the bots right after they are requesting a connection?
Reply
#20

Quote:
Originally Posted by DuyDang2412
View Post
Thank you, this seems possible, I will try this. By the way, can I put your code in public OnIncomingConnection to kick the bots right after they are requesting a connection?
I don't think you can, before you use OnIncomingConnection you need to know that you can't even get the player's name, i didn't try gpci, but you can try it, do the following FIRST before you use this at OnIncomingConnection, go at OnIncomingConnection and use gpci and save it in a string and use print, if it doesn't return a null string and actually returns the gpci id then yes you can use it, otherwise you will need to stick with OnPlayerConnect.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)