Connected. Joining the server...
#1

I've recently converted my script to MySQL. Until a while ago everything was going smoothly.
I can't understand what's wrong.
I can't log into my server now, it says:

[22:25:54] Connected. Joining the game...
[22:26:24] Server closed the connection.

I didn't know where to post this, so I guessed I'd post it here, since it's related to my script.

Anybody got a clue, I mean, it HAS to be the code, since a my script before conversion still works.
If you need code, I'll provide it.

EDIT: At first I only converted my registration/login system and it all worked nice. Then I started converting it a bit by bit and testing, it all worked, so I thought I'd just do it all at once. So I did. And.. it isn't working and I have no clue where to start looking.
Reply
#2

Is it connecting to the database even ?
Reply
#3

Yes it does, it successfully connects to the database.

EDIT: It has to be the code I edited in the last time, so I'll be going around that. I'll appreciate any reply here, anything might be helpful.
Reply
#4

If you restart the server, does it work for a while then start hanging?
When you connect and it's hanged/hung (not sure of the correct word in this case) does the problem in the OP occur? Does the server logs say "XX did not login in time"?
Reply
#5

When I start the server, and click it just once on the SA-MP program, the ping changes, means it is working.
When I double click it and enter it. It says as shown above, and after 30 seconds, it kicks me and says "Kicking player, didn't login in time", yes.
That's pretty much it. It works with the old version of my script, before shifting to MySQL.
Reply
#6

Have you run crashdetect yet?
Reply
#7

EDIT: I locked onto the area. It's somewhere in my OnGameModeInit public. I'll go over it a few times, over the callbacks I have which are called from within it and get back to you with a response. Thanks for your time.


EDIT:

I've this callback:
pawn Код:
forward FillReportsTable(pp);

public FillReportsTable(pp)
{
    new rows, fields;
   
    cache_get_data(rows, fields, mysql);
   
    if(rows)
    {
        for(i = 0; i < MAX_PLAYERS; i++)
            ReportDialog[i] = cache_get_field_content_int(0, "report", mysql);
        reportss++;
        if(reportss == 100) print("\nAll reports have been successfully loaded.");
    }
    else
    {
        mysql_format(mysql, query, sizeof(query), "INSERT INTO `reports` (`report`, `ID`) VALUES ('%d', '%d')", 0, pp);
        mysql_query(mysql, query);
       
        for(i = 0; i < MAX_PLAYERS; i++)
            ReportDialog[i] = 0;
           
        printf("report %d has been created and loaded successfully.", pp);
    }
}
It's called this way:
pawn Код:
for(new pp = 1; pp < 101; pp++)
    {
        mysql_format(mysql, query, sizeof(query), "SELECT `reporter` FROM `reports` WHERE `ID` = '%d' LIMIT 1", pp);
        mysql_tquery(mysql, query, "FillReportsTable", "i", pp);
    }
It might not look efficient, but when I've an idea, that's just how I script it. (Btw, it worked at the beginning, I just changed "reportid" to pp instead, gonna change back and post results.

EDIT3: didn't think it'd make a change and it didn't. Anyway, I'll probably just re-do that part. Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)