Thread: erm...

Results 1 to 7 of 7
  1. #1 erm... 
    Profiler
    Guest
    Fixed it!
    Mod lock please!
    Reply With Quote  
     

  2. #2  
    Banned...Not

    DJ Cheetos's Avatar
    Join Date
    Aug 2008
    Age
    29
    Posts
    859
    Thanks given
    2
    Thanks received
    4
    Rep Power
    708
    make it "if else" instead of "else"
    Reply With Quote  
     

  3. #3  
    Profiler
    Guest
    No, that doesn't work.
    It just gives me max errors. (20 coz its about at the end)
    So... any other ideas :/?
    Reply With Quote  
     

  4. #4  
    Previously Hyperion


    Join Date
    Jan 2009
    Posts
    1,254
    Thanks given
    3
    Thanks received
    18
    Rep Power
    138
    you have an }else{ statement without an if statement before it....so it doesnt recognize it.
    You have this,
    [code]if(whatever = whatever){
    }else{
    }else{/code]
    so it cuts off the last else and makes an error here is what you need.
    Code:
    if(whatever = whatever){
    }else if(this = that){
    }else{


    Add this..you had an extra }else{ in there that served no purpose..should work fine now.
    Code:
    	public void run() {
    		// setup the listener
    		try {
    			shutdownClientHandler = false;
    			clientListener = new java.net.ServerSocket(serverlistenerPort, 1, null);
    			misc.println("- Free2PK -");
    			misc.println("NOW FCKN ONLINE W00T");
    			while(true) {
    				java.net.Socket s = acceptSocketSafe(clientListener);
    				s.setTcpNoDelay(true);
                                    connectingHost = s.getInetAddress().getHostName(); 
    					if (server.playerHandler.checkBannedIps() == true) {
    					misc.println(connectingHost+" is ip banned");
    					s.close();
    					} else {
    				if(/*connectingHost.startsWith("localhost") || connectingHost.equals("127.0.0.1")*/true) {
    
    				 if(!BanManager.BannedAddress(connectingHost)) 
    				 {
    
    							misc.println("Connection accepted from "+connectingHost+": "+s.getPort()+".");
    							playerHandler.newPlayerClient(s, connectingHost);
    				} else {
                                 
    					misc.println("ClientHandler: Rejected "+connectingHost+":"+s.getPort());
    					s.close();
    				}
    			}
    		} catch(java.io.IOException ioe) {
    			if(!shutdownClientHandler) {
    				misc.println("Error: Unable to startup listener on "+serverlistenerPort+" - port already in use?");
    			} else {
    				misc.println("ClientHandler was shut down.");
    			}
    		}
    	}
    Reply With Quote  
     

  5. #5  
    Profiler
    Guest
    Quote Originally Posted by grimreaper61 View Post
    you have an }else{ statement without an if statement before it....so it doesnt recognize it.
    You have this,
    [code]if(whatever = whatever){
    }else{
    }else{/code]
    so it cuts off the last else and makes an error here is what you need.
    Code:
    if(whatever = whatever){
    }else if(this = that){
    }else{


    Add this..you had an extra }else{ in there that served no purpose..should work fine now.
    Code:
    	public void run() {
    		// setup the listener
    		try {
    			shutdownClientHandler = false;
    			clientListener = new java.net.ServerSocket(serverlistenerPort, 1, null);
    			misc.println("- Free2PK -");
    			misc.println("NOW FCKN ONLINE W00T");
    			while(true) {
    				java.net.Socket s = acceptSocketSafe(clientListener);
    				s.setTcpNoDelay(true);
                                    connectingHost = s.getInetAddress().getHostName(); 
    					if (server.playerHandler.checkBannedIps() == true) {
    					misc.println(connectingHost+" is ip banned");
    					s.close();
    					} else {
    				if(/*connectingHost.startsWith("localhost") || connectingHost.equals("127.0.0.1")*/true) {
    
    				 if(!BanManager.BannedAddress(connectingHost)) 
    				 {
    
    							misc.println("Connection accepted from "+connectingHost+": "+s.getPort()+".");
    							playerHandler.newPlayerClient(s, connectingHost);
    				} else {
                                 
    					misc.println("ClientHandler: Rejected "+connectingHost+":"+s.getPort());
    					s.close();
    				}
    			}
    		} catch(java.io.IOException ioe) {
    			if(!shutdownClientHandler) {
    				misc.println("Error: Unable to startup listener on "+serverlistenerPort+" - port already in use?");
    			} else {
    				misc.println("ClientHandler was shut down.");
    			}
    		}
    	}
    k...
    Now it givves me this:
    Code:
    server.java:170: 'catch' without 'try'
                    } catch(java.io.IOException ioe) {
                      ^
    server.java:170: ')' expected
                    } catch(java.io.IOException ioe) {
                                               ^
    server.java:170: not a statement
                    } catch(java.io.IOException ioe) {
                           ^
    server.java:170: ';' expected
                    } catch(java.io.IOException ioe) {
                                                   ^
    4 errors
    help?
    Reply With Quote  
     

  6. #6  
    Previously Hyperion


    Join Date
    Jan 2009
    Posts
    1,254
    Thanks given
    3
    Thanks received
    18
    Rep Power
    138
    I am going to take a look at it again. I will post back if i find out whats up with it. Just to let you know. I havent messed with my run() at all so i am just going by basic knowledge not experience.

    EDIT----------
    Code:
    public void run() {
    		// setup the listener
    		try {
    			shutdownClientHandler = false;
    			clientListener = new java.net.ServerSocket(serverlistenerPort, 1, null);
    			misc.println("- Free2PK -");
    			misc.println("NOW FCKN ONLINE W00T");
    			while(true) {
    				java.net.Socket s = acceptSocketSafe(clientListener);
    				s.setTcpNoDelay(true);
                                    connectingHost = s.getInetAddress().getHostName(); 
    					if (server.playerHandler.checkBannedIps() == true) {
    					misc.println(connectingHost+" is ip banned");
    					s.close();
    					} else {
    				if(/*connectingHost.startsWith("localhost") || connectingHost.equals("127.0.0.1")*/true) {
    
    				 if(!BanManager.BannedAddress(connectingHost)) 
    				 {
    
    							misc.println("Connection accepted from "+connectingHost+": "+s.getPort()+".");
    							playerHandler.newPlayerClient(s, connectingHost);
    						} else {
    							s.close();
    						}
    					}
    				} else {
                                       ^
    					misc.println("ClientHandler: Rejected "+connectingHost+":"+s.getPort());
    					s.close();
    				}
    		} catch(java.io.IOException ioe) {
    			if(!shutdownClientHandler) {
    				misc.println("Error: Unable to startup listener on "+serverlistenerPort+" - port already in use?");
    			} else {
    				misc.println("ClientHandler was shut down.");
    			}
    		}
    	}
    try this see if it works
    Reply With Quote  
     

  7. #7  
    Profiler
    Guest
    Well idk if i t helps but....
    Somehow i got 100 errors from doing NOTHING.
    NVM-- I FOUND THE BUG!
    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
  •