Hello, I know must of you will say this is EzPz but this is purposely made for new beginners.
What you're doing!
Username:
Simply making the username have a minimum of three characters long.
Example: Your username must be 3 or 12 characters long. (Rsp / RuneScape12)
What you're doing!
Password:
Simply making the password have a minimum of six characters long.
Example: Your password must be 6 or 20 characters long. (ekj348 / joeynealstrong553819)
What you're adding!
[ USERNAME ]
[ PASSWORD ]
(CLIENT SIDED)
Client class:
Search for:
public void login
under:
Code:
if (k == 3) {
loginMessage1 = "";
loginMessage2 = "Invalid username or password.";
return;
}
add:
Code:
if (k == 26) {
loginMessage1 = "Your username must be longer than 2 characters.";
loginMessage2 = "Please retry!";
return;
}
if (k == 27) {
loginMessage1 = "Your password must be longer than 6 characters.";
loginMessage2 = "Please retry!";
return;
}
Save & Exit!
We're now done with the client side.
(SERVER SIDED)
RS2LoginProtocol class:
Search for:
private static Player login
under:
Code:
if (name.length() > 12) {
returnCode = 8;
}
add:
Code:
if (name.length() < 3) {
returnCode = 26;
}
if (pass.length() < 6) {
returnCode = 27;
}
Save & Exit!
We're now done with the server side.
Now test it for yourself, if you get any errors or have any problems with this just shoot me a message!