Thread: How can I stop flooding?

Results 1 to 3 of 3
  1. #1 How can I stop flooding? 
    Registered Member
    Join Date
    Apr 2008
    Posts
    506
    Thanks given
    26
    Thanks received
    0
    Rep Power
    35
    Someone has my server's ip, and he's flooding my server, and for some players, it won't let them connect. Any ideas how to fix this? Delta source.
    Reply With Quote  
     

  2. #2  
    Austin_
    Guest
    Server.java num > 1


    or shut down the server, get his ip, ipbans.txt in config and ban him.
    Reply With Quote  
     

  3. #3  
    Registered Member
    PSNB's Avatar
    Join Date
    Aug 2009
    Posts
    885
    Thanks given
    8
    Thanks received
    103
    Rep Power
    590
    Or do as I do.

    The moment you received a connection request, check the ip against the other connections.

    If that IP matches, write a value of '9'. Like this

    Code:
    socket = serverSocket.accept();
    if(connections.contains(s.getInetAddress().getHostName())) {
        for(int i = 0; i < 8; i++)
            socket.getOutputStream().write(0);
    
        socket.getOutputStream().write(9);
        socket.close();
        continue;
    }
    The reason this works is because the login process is setup.

    Code:
    stream.putByte(14);
                stream.putByte(i);
                socketStream.queueBytes(2, stream.buffer);
                for(int j = 0; j < 8; j++)
                    socketStream.read();
    
                int k = socketStream.read();
    You can just ignore the stuff that the client writes, and skip directly to sending the first 8 bytes, (To be honest, I forgot what they're for. They're 'nulled' out in the Client though, so they're not assigned to any particular value.)

    The 9th byte that's sent is the initial login response. Typically you would use a value of '0' to indicate that the login credentials should be sent next, but you can use any login response that denotes a 'failed' login attempt. So, by sending 9, the client takes it as a failed attempt response, and aborts the login attempt.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •