Honestly, do not use dynasty. Dynasty was not a very good source, the features may of been an impact towards you though. If you want a source that is stable and has features, use Riotscape.
|
Server base: Dynasty..
okay so.. if you create a account. then relog into that account with the wrong password.. it will let you Log into the account.. when u log into a account with the false password, it resets that account..
how can this be fixed?
i though maybe something like
but i have no idea how to make it search the char file for the line with the password.Code:if (playerPass != readcharfile.(Character-Password) { return code 3; etc; }
or where the code would be placed (im guessing void Run)
but i'm no-where near experienced enough to do what im trying to do here.
so if someone could help me out, i would appreciate it a bunch!
Honestly, do not use dynasty. Dynasty was not a very good source, the features may of been an impact towards you though. If you want a source that is stable and has features, use Riotscape.
it may be a bad source, but if i use something that is stable and has tons of features the same as dynasty, i learn nothing. i would like to learn some stuff..
and everyone saying dont use it, only makes me want to use it that much more..
soo.. back on topic.
how would you get it to read a line from a file? :O
Get another source, DeltaCleaned for example.
The password verification should not happen in the run() method. Rather do it when you receive a login request.
You'll have to do something similar as when loading a character (do this in a seperate method with a boolean return type for easy understandable code), but ONLY for the password.
When that's read close the file (very important (might need a flush before too)). Then it's just a matter of comparing the given password with the read password.
Like:
Code:if(verifyPassword(givenPlayername, givenPassword) //password is okay. else //password is not okay.If they match, you may continue as it's done at the moment.Code:private boolean verifyPassword(String givenPlayername, String givenPassword){ String readpassword = ""; //File reading bit here return givenPassword.equalsIgnoreCase(readpassword); //Any password fixing like space to underscore should be applied too (otherwise "pass word" will not equals "pass_word"). }
If they don't match, you'll have to send a packet with the wrong password code in it (don't ask me which one it is).
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |