Bots Flooding the server
#9

I've had problems with this same thing, here's how I got rid of it on my server

pawn Код:
public OnPlayerConnect(playerid)
{
    ResetVars(playerid);
    new time = gettime();
    new IP[16];
    GetPlayerIp(playerid,IP,sizeof(IP));
    //server flooders
    new joins;
    for(new i=0;i<10;i++)
    {
        if(LastTenJoinTimes[i] + 10 >= time)
        {
            if(!strcmp(LastTenJoinIps[i],IP,false) &&
            LastTenJoinIps[i][0] != '\0')
            {
                joins++;
            }
        }
    }
    joins += 1;//so it counts itself
    if(joins >= 3)
    {
        //3 connects from the same IP within 10 seconds
        BanEx(playerid,"Server Flooder");
    }
   
    new index;
    new ttime = time;
    for(new i=0;i<10;i++)
    {
        if(LastTenJoinTimes[i] <= ttime)
        {
            ttime = LastTenJoinTimes[i];
            index = i;
        }
    }
    LastTenJoinTimes[index] = time;
    LastTenJoinIps[index] = IP;
}


public OnPlayerText(playerid,text[])
{
    if(strfind(text,"<insert site here>",true) != -1) return 0;
}
Reply


Messages In This Thread
Bots Flooding the server - by Kitten - 22.01.2012, 23:23
Re: Bots Flooding the server - by Snowman12 - 22.01.2012, 23:26
Re: Bots Flooding the server - by Silentfood - 22.01.2012, 23:28
Re: Bots Flooding the server - by Kitten - 22.01.2012, 23:31
Re: Bots Flooding the server - by Polomikey - 22.01.2012, 23:50
Re: Bots Flooding the server - by Kitten - 22.01.2012, 23:58
Re: Bots Flooding the server - by Polomikey - 23.01.2012, 00:00
Re: Bots Flooding the server - by Lorenc_ - 23.01.2012, 00:29
Re: Bots Flooding the server - by cessil - 23.01.2012, 01:56
Re: Bots Flooding the server - by Richie - 23.01.2012, 06:17

Forum Jump:


Users browsing this thread: 2 Guest(s)