Jump to content

Question

7 answers to this question

Recommended Posts

Posted

can i have the script?

///Its a bit simple.. use this script
///http://www.eathena.ws/board/index.php?showtopic=217704

///Now what the post says..
///Open file src/common/socket.h
///Find:
CODE
size_t rdata_pos;
    time_t rdata_tick; // time of last recv (for detecting timeouts); zero when timeout is disabled

Paste after this :
CODE
    // Anti-WPE v2.0 by Zohan
    // Optimized and DIFF fixed by Zigbigidorlu (14293)
    int lastTick;
    int thisTick;
    int thisDiff;
    int lastDiff;
    uint32 warning_number;

Open file src/common/socket.c
///Find:
CODE
time_t last_tick;
time_t stall_time = 60;

///Paste after:
CODE
uint32 max_frequency_warning = 15; //Max number of packets user can have that are within a certain interval of each other before the program kicks
int diff_tolerance = 5; //In microseconds

///Find:
CODE
    session[fd]->rdata_size += len;
    session[fd]->rdata_tick = last_tick;

//Paste this after above codes:
CODE
    // Anti-WPE script: v2.0 Parappa the Anti-WPE by Zohan
    // Optimized and DIFF fixed by Zigbigidorlu (14293)
    if(!session[fd]->flag.server && RFIFOW(fd,2) != 0x05 && (RFIFOW(fd,0) == 0x0438 || RFIFOW(fd,0) == 0x0116))
    {
        session[fd]->lastTick = session[fd]->thisTick;
        session[fd]->thisTick = gettick();
        session[fd]->lastDiff = session[fd]->thisDiff;
        session[fd]->thisDiff = session[fd]->thisTick - session[fd]->lastTick;
        if(abs(session[fd]->thisDiff - session[fd]->lastDiff) < diff_tolerance)
            session[fd]->warning_number++;
        if(session[fd]->warning_number > max_frequency_warning)
            set_eof(fd);
        else if(session[fd]->thisTick - session[fd]->lastTick > 5000)
            session[fd]->warning_number = 0;
        else
            if(session[fd]->warning_number > 0)
                session[fd]->warning_number--;
    }

this is originaly from there /no1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...