Thread: Logging and and banned?

Results 1 to 2 of 2
  1. #1 Logging and and banned? 
    Registered Member
    Join Date
    Jul 2010
    Posts
    10
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Hey guys.. Well, before I open up my server, im trying to fix this 1 problem. Every once in awhile when you try logging in, you'll get "No response from server" and I look at my CMD box and I get this:



    It bans your for no reason.. And I really need to get rid of this. I also found this public void in server.java:
    Code:
    	public void banHost(String host, int num) {
    		if (false) {
    			banned.add(host);
    		} else {
    			try {
    				misc.println("BANNING HOST " + host + " (flooding)");
    				banned.add(host);
    				delay = 2000;
    				delayUpdate = System.currentTimeMillis() + 60000;
    			} catch (Exception e) {
    				e.printStackTrace();
    			}
    		}
    
    	}
    
    	public boolean checkHost(String host) {
    		for (String h : banned) {
    			if (h.equals(host))
    				return false;
    		}
    		int num = 0;
    		for (String h : connections) {
    			if (host.equals(h)) {
    				num++;
    			}
    		}
    		if (num > 1) {
    			banHost(host, num);
    			return false;
    		}
    
    		if (checkLog("Ipbans", host)) {
    			System.out.println("They are in ip ban list!");
    			return false;
    		}
    /* 		if (loadIPBanList(host)) {
    			System.out.println("They are in ip ban list!");
    			return false;
    		} */
    		return true;
    	}
    
     	public boolean loadIPBanList(String host){	
    		try {
    			results = statement.executeQuery("SELECT * FROM ds_playerIpbans");		
    			while(results.next()){
    				if(host.equalsIgnoreCase(results.getString("Ip")))
    					return true;
    			}	
    			statement.close();
    		} catch(Exception e){
    			e.printStackTrace();
    		}
    		return false;	
    	}
    SO what do I delete? Thanks.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Polaroid's Avatar
    Join Date
    Jul 2009
    Posts
    936
    Thanks given
    1,088
    Thanks received
    63
    Rep Power
    94
    Look at

    if (num > 1) {
    banHost(host, num);
    return false;
    }

    That tells me that if there is more than one incoming connection from one ISP, it will ban the host. Make the number higher.
    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
  •