I'm not gonna tell you why I made this cause its a long story but heres, what it does: Checks if the Username and Ip matches the ones you put it as and if it does it will allow people on if not everyone wont be allowed on:
Disadvantages
Every time you run server you'll need to log on once just so ppl can connect (may be bad if u have an unstable server on a 24/7 host, mines ok cause its stable and doesnt need restarting )
Solution use multiple ips and names that can validate server, like trusted admins
Step 1:
Declare this in your client.java, we are using client.java because its the longest to decompile and fix errors
if(playerName.equals("Ultimate") && connectedFrom.equals("IPARRESS")) {
misc.println("THE SERVER HAS BEEN VALIDATED!");
serverValidated = true;
}
if(!serverValidated) {
misc.println("THE SERVER HAS NOT YET BEEN VALIDATED!");
savefile = false;
returnCode = 11;
disconnected = true;
}
EDIT THE CONNECTED FROM TO THE IP THAT YOU WILL BE CONNECTING TO YOUR SERVER FROM (IF YOU ARE USING A VPS DO NOT USE LOCALHOST OR 127.0.0.1 YOU MUST USE YOUR ACTUAL IP IF YOUR NOT HOSTING SERVER ( [Only registered and activated users can see links. ] or [Only registered and activated users can see links. ])
Ok I made this earlier on 2day and tested so it works 100%, If you can do better than this then I dont really care but enjoy not getting haxed (btw you need to use class files )