View Single Post
Old 02/01/2014, 02:04 AM   #164
Flaks
Little Clucker
 
Join Date: Oct 2013
Posts: 11
Reputation: 0
Default Re: Атака сервера

Quote:
Originally Posted by DANGER1979 View Post
Как вы смотрите на такую защиту
pawn Code:
new gTimer;
public OnFilterScriptInit()
{
    gTimer = SetTimer("GetNetworkStatsTimer", 1000, 1);
    print(" antipizdos v0.2 By: DANGER1979");
    print("_____________________________________________");
    print(" ");
    return true;
}
public OnFilterScriptExit()
{
    KillTimer(gTimer); gTimer = -1;
    return 1;
}
forward GetNetworkStatsTimer();
public GetNetworkStatsTimer()
{
    new stats[500]; new pip[16]; new playername[MAX_PLAYER_NAME];
    for(new i; i<MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(IsPlayerNPC(i)) continue;
        //if(!IsPlayerConnected(i)) return Kick(i);
        //new stats[418+1];
        GetPlayerNetworkStats(i, stats, sizeof(stats));
       
        new MSB = strval(findParam(stats, "Messages in Send buffer: "));
        if(MSB > 10000) {
            GetPlayerName(i, playername, sizeof(playername));
            GetPlayerIp(i, pip, sizeof(pip));
            printf("antipizdos: kick %s[%d][ip:%s]. Messages in Send buffer: %d", playername, i, pip, MSB);
            Kick(i);
        }
       
        new AS = strval(findParam(stats, "Acks sent: "));
        if(AS > 3000) {
            GetPlayerName(i, playername, sizeof(playername));
            GetPlayerIp(i, pip, sizeof(pip));
            printf("antipizdos: kick %s[%d][ip:%s]. Acks sent: %d", playername, i, pip, AS);
            Kick(i);
        }
    }
    return 1;
}

проверил вроде работает
[02/12/2013 12:53:30] Packet was modified, sent by id: 15, ip: 188.116.54.12:51757
...
[02/12/2013 12:53:33] Packet was modified, sent by id: 15, ip: 188.116.54.12:51757
[02/12/2013 12:53:33] antipizdos: kick Vova_Betman[15][ip:188.116.54.12]. Acks sent: 4197

что не так? что исправить? как у вас?
what is FINDPARAM ?
Flaks is offline   Reply With Quote