So that line of code is where it's stopping you to complete your login? If so then somewhere in your 'LoadSMF' method, where ever that might be.
|
Well.... I did it it connects to the mysql server and everything but when i go to connect to the server it displays that it has accepted my connection but nothing more... It is stopping the connection at the Run method in client.java.
if(server.SMF.LoadSMF(playerId) == true) { <-- this is the piece of code in the run method.
So that line of code is where it's stopping you to complete your login? If so then somewhere in your 'LoadSMF' method, where ever that might be.
heres the loadsmf method do you see anything obviously wrong with it?
Code:public boolean LoadSMF(int pID) { client c = (client) server.playerHandler.players[pID]; String RealPass = "555555555555555555555"; String EnteredPass_Hash = "555555555555"; try { if(Connected == true) { ResultSet Loading1 = myStmt.executeQuery("SELECT * FROM "+Table_Prefix+"members WHERE member_name = '"+c.playerName+"'"); while(Loading1.next()) { RealPass = Loading1.getString("passwd"); String tempName = c.playerName.toLowerCase(); String toEncode = tempName+c.playerPass; String UsergroupID_String = Loading1.getString("id_group"); int UsergroupID_INT = Integer.parseInt(UsergroupID_String); EnteredPass_Hash = SHA1(toEncode); if(RealPass.equals(EnteredPass_Hash)) { int Usergroup = ConvertUsergroupToServer_SMF(UsergroupID_INT, c.playerName); print("passed"); if(Usergroup == 1 || Usergroup == 2) { c.playerRights = Usergroup; } else if (Usergroup == 10) { c.Banned = true; } else { c.playerRights = 0; } } else{ return false; } } } } catch (Exception sqlEx) { if(!Connected) { Disconnect(); Connect(); LoadSMF(pID); } } if(!RealPass.equals(EnteredPass_Hash)) return false; return true; }
Making a simple debug system is good for precisely tracking down exactly where your error is, try something like this:
Under "if(Connected == true) {" put something simple like "misc.println("Stage 1: Pass");"
Then after "while(Loading1.next()) {" put "misc.println("Stage 2: Pass");"
Also after "if(RealPass.equals(EnteredPass_Hash)) {" put "misc.println("Stage 3: Pass");"
Anyways you get the idea, if everything is checking out successful it'll display all your debug messages in the command prompt, but if it doesn't display one of them, then you know exactly where it's hanging up at.
This is the debug method I use and it works like a charm for me.
alright il try that
Alright wolf its stopping at
while(Loading1.next()) { but uhh... i have no idea where next is :/
Eh I dunno what to tell you from this point on, but atleast that gives you a rough idea on how to track down something going wrong in your code.
W.D.M
[W]olf's [D]ebug [M]ethod (Insert_copyright_symbol_here)
I need to do this, did you follow a tutorial anywhere?
no i got this from a guy that i havent seen in a couple years... i cant remember his name...
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |