25.06.2012, 15:37
Hello.
That is quite a big query there. I can't seem to find something that looks wrong on it, and since the part that processes the result is such a long piece of code, I'd recommend you try debugging and eliminating the problem.
First:
Change
to
and change
to
This will basically disable all the code that recovers the information received from the query.
Ignore any warnings you may get about "Nested comments" and compile the code.
Now connect with a registered account and see if you still crash.
If you crash, the problem is caused by something before this point.
If you don't crash, then there is something in your code which recovers the query information which is causing the crash.
That is quite a big query there. I can't seem to find something that looks wrong on it, and since the part that processes the result is such a long piece of code, I'd recommend you try debugging and eliminating the problem.
First:
Change
pawn Код:
//found in your query result processing code
switch(resultid)
{
case THREAD_USERNAME_LOOKUP:
{
// We need to store the result in memory. This may be multiple rows, or 1, or even none. But we haven't checked yet, but we can now.
mysql_store_result(connectionHandle);
if(mysql_num_rows(connectionHandle) > 0)
{
pawn Код:
//found in your query result processing code
switch(resultid)
{
case THREAD_USERNAME_LOOKUP:
{
// We need to store the result in memory. This may be multiple rows, or 1, or even none. But we haven't checked yet, but we can now.
mysql_store_result(connectionHandle);
/*
if(mysql_num_rows(connectionHandle) > 0)
{
pawn Код:
//Found in your query processing code
// We're setting the status to 2 here. The player hasn't logged in yet, but we're getting the information now so we don't have to later.
PlayerInfo[extraid][pStatus] = 2;
// In most languages, using mysql_free_result can seem insignificant. However, in PAWN, with the plugins we have available, the best thing to do is to use this when you've finished
// with some data from MySQL. You only need to use mysql_free_result when you're dealing with SELECT queries or any other query that is designed to return information.
mysql_free_result(connectionHandle);
format(szMessage, sizeof(szMessage), "SERVER: This account (%s) is registered. Please enter the account password to login, otherwise please pick another name.", PlayerInfo[extraid][pUsername]);
SendClientMessage(extraid, COLOR_YELLOW, szMessage);
format(string,sizeof(string), "Welcome to Liberation Group Roleplay, %s.\n\nIP: %s\n\nThe account you are using is registered, please enter your password to login.", GetPlayerNameEx(extraid), PlayerInfo[extraid][pIP]);
ShowPlayerDialog(extraid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"{0049FF}Liberation Group Roleplay Login", string,"Login","Quit");
}
pawn Код:
//Found in your query processing code
// We're setting the status to 2 here. The player hasn't logged in yet, but we're getting the information now so we don't have to later.
PlayerInfo[extraid][pStatus] = 2;
*/
// In most languages, using mysql_free_result can seem insignificant. However, in PAWN, with the plugins we have available, the best thing to do is to use this when you've finished
// with some data from MySQL. You only need to use mysql_free_result when you're dealing with SELECT queries or any other query that is designed to return information.
mysql_free_result(connectionHandle);/*
format(szMessage, sizeof(szMessage), "SERVER: This account (%s) is registered. Please enter the account password to login, otherwise please pick another name.", PlayerInfo[extraid][pUsername]);
SendClientMessage(extraid, COLOR_YELLOW, szMessage);
format(string,sizeof(string), "Welcome to Liberation Group Roleplay, %s.\n\nIP: %s\n\nThe account you are using is registered, please enter your password to login.", GetPlayerNameEx(extraid), PlayerInfo[extraid][pIP]);
ShowPlayerDialog(extraid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"{0049FF}Liberation Group Roleplay Login", string,"Login","Quit");
*/
SendClientMessage(extraid,0xFF0000FF,"Test complete. Query ran without crash");
}
Ignore any warnings you may get about "Nested comments" and compile the code.
Now connect with a registered account and see if you still crash.
If you crash, the problem is caused by something before this point.
If you don't crash, then there is something in your code which recovers the query information which is causing the crash.