Thread: [Senior coder needed]SMF integration

Results 1 to 9 of 9
  1. #1 [Senior coder needed]SMF integration 
    Banned

    Join Date
    Oct 2006
    Age
    31
    Posts
    777
    Thanks given
    24
    Thanks received
    95
    Rep Power
    0
    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.
     

  2. #2  
    Extreme Donator

    Wolf's Avatar
    Join Date
    Jul 2006
    Age
    34
    Posts
    398
    Thanks given
    0
    Thanks received
    2
    Rep Power
    177
    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.

    RuneCMS member / Early Sythe member
    RS-Server ex-admin [Member #38]
    Dodian ex-admin / developer
    SRL Developer
    MITB member

    Project16/Flight creator
     

  3. #3  
    Banned

    Join Date
    Oct 2006
    Age
    31
    Posts
    777
    Thanks given
    24
    Thanks received
    95
    Rep Power
    0
    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;
    }
     

  4. #4  
    Extreme Donator

    Wolf's Avatar
    Join Date
    Jul 2006
    Age
    34
    Posts
    398
    Thanks given
    0
    Thanks received
    2
    Rep Power
    177
    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.

    RuneCMS member / Early Sythe member
    RS-Server ex-admin [Member #38]
    Dodian ex-admin / developer
    SRL Developer
    MITB member

    Project16/Flight creator
     

  5. #5  
    Banned

    Join Date
    Oct 2006
    Age
    31
    Posts
    777
    Thanks given
    24
    Thanks received
    95
    Rep Power
    0
    alright il try that
     

  6. #6  
    Banned

    Join Date
    Oct 2006
    Age
    31
    Posts
    777
    Thanks given
    24
    Thanks received
    95
    Rep Power
    0
    Alright wolf its stopping at

    while(Loading1.next()) { but uhh... i have no idea where next is :/
     

  7. #7  
    Extreme Donator

    Wolf's Avatar
    Join Date
    Jul 2006
    Age
    34
    Posts
    398
    Thanks given
    0
    Thanks received
    2
    Rep Power
    177
    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)

    RuneCMS member / Early Sythe member
    RS-Server ex-admin [Member #38]
    Dodian ex-admin / developer
    SRL Developer
    MITB member

    Project16/Flight creator
     

  8. #8  
    Registered Member

    Join Date
    Feb 2009
    Posts
    929
    Thanks given
    2
    Thanks received
    2
    Rep Power
    344
    I need to do this, did you follow a tutorial anywhere?
    After AJ de-repped me I have no intention of doing anything for free for anyone in return for rep again. I am here for PAID GFX WORK I do small GFX jobs to PSD to HTML and CSS. Currently working with Slashscape so jobs will get done when I'm free.[email protected]
     

  9. #9  
    Banned

    Join Date
    Oct 2006
    Age
    31
    Posts
    777
    Thanks given
    24
    Thanks received
    95
    Rep Power
    0
    no i got this from a guy that i havent seen in a couple years... i cant remember his name...
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •