Or then set it client-side![]()
|
|

Description: This makes it where if your username isn't over 2 characters long or your password isn't over 3 character's long, it will disconnect you and won't save your file...and possibly crash your client. (But I've only tested using Silab client and it didn't crash it...so..) Mind you this is my first tutorial so constructive criticism is appreciated. Also, I know this can be done better by just requiring the lengths through a client but this is for people who still use silab and crap. By the way, the reason there's a timer and such, is to let the player know why they're about to disconnect.
Difficulty: 1
Assumed Knowledge: How to declare an int, C+P.
Tested Server: Project Czar (Oh jebus)
Files/Classes Modified: Client.java
Step #1: Declare this int in client.javaStep #2: FindCode:public int disTimer = 0;and inside it putCode:public void initialize() {Step #3: FindCode:if(playerPass.length() <= 3) { sendMessage("WARNING: Your !!password!! MUST be OVER 3 characters long."); sendMessage("WARNING: Disconnecting..."); savefile = false; disTimer = 20; } if(playerName.length() <= 2) { sendMessage("WARNING: Your **username** MUST be OVER 2 characters long."); sendMessage("WARNING: Disconnecting..."); savefile = false; disTimer = 20; }and inside it putCode:public void process() { // is being called regularly every 500msAnd some of you are done!Code:if (disTimer > 0) { savefile = false; disTimer -= 1; } if (disTimer == 1) { savefile = false; showInterface(999999); destruct(); }
For anyone that has a starter (without the command) you'll need to addtoCode:&& disTimer == 0IF it saves after it gives them items. (Your starter crap may be different, but if it saves you'll need to add that)Code:if (accountnew==1 && accountloaded==1 && charscreen<=5)
Credits: Me
Anyways, I know it's pretty crappy. Constructive criticism is welcome.

Or then set it client-side![]()


=/ (smiley too short sts)Also, I know this can be done better by just requiring the lengths through a client but this is for people who still use silab and crap.

dude just add that in your void run makes it alot easier, if(playerName.lenght() > 13) return; and same for playerpassword
i lol'd at
why not haveCode:if(playerPass.length() <= 3) { sendMessage("WARNING: Your !!password!! MUST be OVER 3 characters long."); sendMessage("WARNING: Disconnecting..."); savefile = false; disTimer = 20; } if(playerName.length() <= 2) { sendMessage("WARNING: Your **username** MUST be OVER 2 characters long."); sendMessage("WARNING: Disconnecting..."); savefile = false; disTimer = 20; }
Also why not make this before the player registery.Code:if(playerPass.length() < 3) { sendMessage("WARNING: Your !!password!! MUST be OVER " + playerPass.length() + " characters long."); sendMessage("WARNING: Disconnecting..."); savefile = false; disTimer = 20; }

Player registry? And wouldn't that make it say "over 1 characters long" if their pass is only 1 letter? Isn't just putting "over 3" simpler?
I just got into this RSPS crap two weeks ago so I'm not really sure what you mean by player registry.
Anyway, thanks for the advice.
Wouldn't that make it where they don't know why they're getting DC'ed? I don't think anyone would play long if they can't figure out why they're DCing lol

| « Dodian Fix: Fishing animation when you can't fish | Dangerous Stars Mini-Game 100% Custom » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |