Help me with anti bot-players -
DuyDang2412 - 28.01.2018
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.
Re: Help me with anti bot-players -
wallen - 28.01.2018
I would need something like that too, no idea how to check player's ip
Re: Help me with anti bot-players -
Hunud - 28.01.2018
What about IP Limit per connection/user ?
Re: Help me with anti bot-players -
DuyDang2412 - 28.01.2018
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.
Re: Help me with anti bot-players -
DuyDang2412 - 28.01.2018
UPDATE 1: IPs log:
https://pastebin.com/eSBH7YhZ
Re: Help me with anti bot-players -
iLearner - 28.01.2018
There are plenty of includes / filterscripts that do the job, you only need to search.
Re: Help me with anti bot-players -
DuyDang2412 - 28.01.2018
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.
Re: Help me with anti bot-players -
Dayrion - 28.01.2018
Take a look at: YSI / y_flooding.
Edit: Ah, are you sure about they have different IP? If so, forget y_flooding
Re: Help me with anti bot-players -
DuyDang2412 - 28.01.2018
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
Re: Help me with anti bot-players -
iSteve - 28.01.2018
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;
}
}
Re: Help me with anti bot-players -
DuyDang2412 - 28.01.2018
Quote:
Originally Posted by iSteve
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.
Re: Help me with anti bot-players -
iSteve - 28.01.2018
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
Re: Help me with anti bot-players -
DuyDang2412 - 28.01.2018
Quote:
Originally Posted by iSteve
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.
Re: Help me with anti bot-players -
iSteve - 28.01.2018
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
Re: Help me with anti bot-players -
DuyDang2412 - 28.01.2018
Quote:
Originally Posted by iSteve
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.
Re: Help me with anti bot-players -
RogueDrifter - 28.01.2018
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(playerid, TempId, sizeof(TempId));
for(new i = 0; i < strlen(TempId); i++)
{
if(TempId[i] >= '0' && TempId[i] <= '9')
{
TempNumb++;
}
}
if(TempNumb >= 30)
{
new BotName[MAX_PLAYER_NAME];
GetPlayerName(BotName, sizeof(BotName));
format(TempId, sizeof(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.
Re: Help me with anti bot-players -
iLearner - 28.01.2018
Usually people will use raksamp for those kind of bots, YSF has a function to detect those D: simple.
Re: Help me with anti bot-players -
RogueDrifter - 28.01.2018
Quote:
Originally Posted by iLearner
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.
Re: Help me with anti bot-players -
DuyDang2412 - 29.01.2018
Quote:
Originally Posted by RogueDrifter
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(playerid, TempId, sizeof(TempId));
for(new i = 0; i < strlen(TempId); i++)
{
if(TempId[i] >= '0' && TempId[i] <= '9')
{
TempNumb++;
}
}
if(TempNumb >= 30)
{
new BotName[MAX_PLAYER_NAME];
GetPlayerName(BotName, sizeof(BotName));
format(TempId, sizeof(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?
Re: Help me with anti bot-players -
RogueDrifter - 29.01.2018
Quote:
Originally Posted by DuyDang2412
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.