Thread: Fixing crash when no name is inserted at login

Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1 Fixing crash when no name is inserted at login 
    Registered Member
    Join Date
    Nov 2009
    Posts
    3,056
    Thanks given
    113
    Thanks received
    838
    Rep Power
    740
    What your adding:


    If you do this tutorial your players wont crash if they accidently click on login without entering their usernames

    In your client.java search this:
    Code:
    method84(String s, String s1, boolean flag) {
    U should see one or two line sbelow it try {, under try { add:
    Code:
            if(s == "" && s1 == "") {
                    aString1266 = "@[email protected]'re supposed to type your username ";
                    aString1267 = "@[email protected] password down there.";
                    return;
            }
            if(s != "" && s1 == "") {
                    aString1266 = "@[email protected]'re supposed to type";
                    aString1267 = "@redyour password down there.";
                    return;
            }
            if(s == "" && s1 != "") {
                    aString1266 = "@[email protected]'re supposed to type";
                    aString1267 = "@[email protected] username down there.";
                    return;
            }
            if(s1 == "") {
                    aString1266 = "@[email protected]'re supposed to type";
                    aString1267 = "@[email protected] password down there.";
                    return;
            }
            if(s == "") {
                    aString1266 = "@[email protected]'re supposed to type";
                    aString1267 = "@[email protected] username down there.";
                    return;
            }
    Reply With Quote  
     

  2. #2  
    Community Veteran

    Dust R I P's Avatar
    Join Date
    Jan 2008
    Posts
    2,556
    Thanks given
    183
    Thanks received
    198
    Rep Power
    561
    Good job
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Nov 2009
    Posts
    3,056
    Thanks given
    113
    Thanks received
    838
    Rep Power
    740
    yes i didnt work out the text very well, thats why i said you could change it urself
    Reply With Quote  
     

  4. #4  
    Community Veteran

    Dust R I P's Avatar
    Join Date
    Jan 2008
    Posts
    2,556
    Thanks given
    183
    Thanks received
    198
    Rep Power
    561
    And no problem mate
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Nov 2009
    Posts
    3,056
    Thanks given
    113
    Thanks received
    838
    Rep Power
    740
    Done thanks dust
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Oct 2008
    Posts
    1,540
    Thanks given
    27
    Thanks received
    71
    Rep Power
    465
    Better:

    Code:
    			if(myUsername.length() < 4 && myPassword.length() < 4) {
    				loginMessage1 = "Your username & password must be";
    				loginMessage2 = "4 to 12 characters long to login!";
                    return;
    			}
    			if(myUsername.length() > 4 && myPassword.length() < 4) {
    				loginMessage1 = "Your password must be";
    				loginMessage2 = "4 to 12 characters long";
                    return;
    			}
    			if(myUsername.length() < 4 && myPassword.length() > 4) {
    				loginMessage1 = "Your username must be";
    				loginMessage2 = "4 to 12 characters or long to login!";
                    return;
    			}
    			if(myPassword.length() < 4) {
    				loginMessage1 = "Your password must be";
    				loginMessage2 = "4 to 12 characters long";
                    return;
    			}
    			if(myUsername.length() < 4) {
    				loginMessage1 = "Your username must be";
    				loginMessage2 = "4 to 12 characters long";
                    return;
    			}
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Nov 2009
    Posts
    3,056
    Thanks given
    113
    Thanks received
    838
    Rep Power
    740
    Ok phantasm, nothing else to say?
    Reply With Quote  
     

  8. #8  
    Registered Member

    Join Date
    Oct 2008
    Posts
    1,540
    Thanks given
    27
    Thanks received
    71
    Rep Power
    465
    What else is there to say? It's not hard and you could of at least added length requirements to it as I did.
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Nov 2009
    Posts
    3,056
    Thanks given
    113
    Thanks received
    838
    Rep Power
    740
    i didnt knew about length();, now i do thanks for that .
    Reply With Quote  
     

  10. #10  
    Shake n Bake

    Organic's Avatar
    Join Date
    Apr 2010
    Posts
    2,501
    Thanks given
    204
    Thanks received
    322
    Rep Power
    588
    oo good shit ty

    Just live life at its fullest.

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

Page 1 of 2 12 LastLast

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
  •