Thread: Range Ban

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 40
  1. #1 Range Ban 
    Registered Member
    Join Date
    Dec 2011
    Posts
    706
    Thanks given
    9
    Thanks received
    3
    Rep Power
    30
    I tried adding this to my rs2loginprotocoldecoder, but it didn't work. It's suppose to ban all of the ips that start with that.
    Code:
    if (cl.connectedFrom.startsWith("11.11")) {
    returnCode = 4;
    }
    Reply With Quote  
     

  2. #2  
    Donator
    Smile Cow's Avatar
    Join Date
    Apr 2014
    Posts
    214
    Thanks given
    51
    Thanks received
    34
    Rep Power
    40
    You are just setting a variable, you actually need to prevent the person from going past this if statement with a "return;"
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Dec 2011
    Posts
    706
    Thanks given
    9
    Thanks received
    3
    Rep Power
    30
    Like this?

    if (cl.connectedFrom.startsWith("11.11")) {
    returnCode = 4;
    return;
    }
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Dec 2011
    Posts
    706
    Thanks given
    9
    Thanks received
    3
    Rep Power
    30
    I tried that and it didn't work.
    Reply With Quote  
     

  5. #5  
    Donator
    Smile Cow's Avatar
    Join Date
    Apr 2014
    Posts
    214
    Thanks given
    51
    Thanks received
    34
    Rep Power
    40
    Are you sure that you're actually making it into the if statement?.. because it's unlikely your IP starts with "11.11", anyways check what that variable is equal to anyways with a simple
    Code:
    System.out.println(c1.connectedFrom);
    right above it
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Dec 2011
    Posts
    706
    Thanks given
    9
    Thanks received
    3
    Rep Power
    30
    Quote Originally Posted by Smile Cow View Post
    Are you sure that you're actually making it into the if statement?.. because it's unlikely your IP starts with "11.11", anyways check what that variable is equal to anyways with a simple
    Code:
    System.out.println(c1.connectedFrom);
    right above it
    My ip isn't that. I just put that for precautions, haha.
    I will try that.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Project's Avatar
    Join Date
    Dec 2010
    Posts
    2,669
    Thanks given
    1,043
    Thanks received
    820
    Rep Power
    1101
    I believe you could do

    Code:
    for (int i = 1; i < 255; i++) {
    	if (cl.connectedFrom.startsWith("11.11.i.i")) {
            returnCode = 4;
    	}
    }
    Let me know if this works.
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Dec 2011
    Posts
    706
    Thanks given
    9
    Thanks received
    3
    Rep Power
    30
    Quote Originally Posted by Smile Cow View Post
    Are you sure that you're actually making it into the if statement?.. because it's unlikely your IP starts with "11.11", anyways check what that variable is equal to anyways with a simple
    Code:
    System.out.println(c1.connectedFrom);
    right above it
    I put that in and nothing prints out on cmd.
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Dec 2011
    Posts
    706
    Thanks given
    9
    Thanks received
    3
    Rep Power
    30
    Quote Originally Posted by Project View Post
    I believe you could do

    Code:
    for (int i = 1; i < 255; i++) {
    	if (cl.connectedFrom.startsWith("11.11.i.i")) {
            returnCode = 4;
    	}
    }
    Let me know if this works.
    Tried it and doesn't work.
    Reply With Quote  
     

  10. #10  
    Registered Member
    Project's Avatar
    Join Date
    Dec 2010
    Posts
    2,669
    Thanks given
    1,043
    Thanks received
    820
    Rep Power
    1101
    Are you sure that method is returning the IP? Try
    Code:
    for (int i = 1; i < 255; i++) {
    	if (cl.connectedFrom.startsWith("11.11.i.i")) {
            returnCode = 4;
            return;
    	}
    }
    I don't know what your revision is, I generally stick with 503+

    Edit :

    If you're using PI, you could try adding this tutorial which is probably a better way to ban someone.
    http://www.rune-server.org/runescape...d-banning.html
    Reply With Quote  
     

Page 1 of 4 123 ... LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. 718 ip range ban and mac ban
    By helpMe in forum Requests
    Replies: 31
    Last Post: 08-12-2013, 07:36 PM
  2. [pi] ip range ban?
    By n1ck3vans in forum Help
    Replies: 4
    Last Post: 06-16-2012, 05:48 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •