Correct way to check for ban evaders
#1

I store bans in a table in my sqlite database like this.


Checking if the account is banned is easy because the other values don't matter. But if there is a ban set for a certain range, serial and ISP the player should only get banned for evading if all information matches. I have no idea how to properly check for this and I would appreciate it if someone could give me some tips.
Reply
#2

You could use the SQL LIKE statement to select rows which have a similar IP address to ones that are banned, then do additional checks from there to see if the person is evading a ban?

SAMP doesn't use a serial system, so IP banning is the closest you're going to get.

Код:
// Check IP Ban Evading by comparing the IP to similar banned IPs
// Assumes you have the IP of the player stored as "Player[playerid][pIP]"
new ipp[12]; format(ipp,12,"%s",Player[playerid][pIP]);
new sql[128]; format(sql,128,"SELECT * FROM bans WHERE ip LIKE %%s",ipp);
new DBResult:res = db_query(db_handle,sql);

// At this point it will basically have a set of bans for which the first 12 characters of the IP are the same.
if(db_num_rows(res) > 0)
{
// Additional checks for IP Ban Evading
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)