Server crashes on login[SQL issues iguess]
#1

So to know the reason behind the crash i used crashdetect plugin .

Code:
[15:39:11] [debug] Server crashed while executing script.amx
[15:39:11] [debug] AMX backtrace:
[15:39:11] [debug] #0 native mysql_fetch_field_row () [00376710] from mysql.DLL
[15:39:11] [debug] #1 0000f894 in ?? (0x00000000) from script.amx
[15:39:11] [debug] #2 00029fb8 in public OnDialogResponse (0x00000000, 0x0000022a, 0x00000001, 0xffffffff, 0x002bf3d4) from script.amx
[15:39:12] [debug] Native backtrace:
[15:39:12] [debug] #0 739eb690 in ?? () from C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4926_none_508ed732bcbc0e5a\MSVCR90.dll
[15:39:12] [debug] #1 00379abe in ?? () from plugins\mysql.DLL
[15:39:12] [debug] #2 003767e3 in ?? () from plugins\mysql.DLL
[15:39:12] [debug] #3 004010b6 in ?? () from samp-server.exe
[15:39:12] [debug] #4 6cec9ae7 in ?? () from plugins\crashdetect.DLL
[15:39:12] [debug] #5 6ced49ca in ?? () from plugins\crashdetect.DLL
[15:39:12] [debug] #6 6ced681f in ?? () from plugins\crashdetect.DLL
[15:39:12] [debug] #7 6cec9b84 in ?? () from plugins\crashdetect.DLL
[15:39:12] [debug] #8 6ced4a1a in ?? () from plugins\crashdetect.DLL
[15:39:12] [debug] #9 6cdf49fb in ?? () from plugins\streamer.DLL
[15:39:12] [debug] #10 0046de11 in ?? () from samp-server.exe
[15:39:12] [debug] #11 00452970 in ?? () from samp-server.exe
[15:39:12] [debug] #12 6ceb5e0a in ?? () from plugins\crashdetect.DLL
[15:39:12] [debug] #13 00499cd9 in ?? () from samp-server.exe
[15:39:12] [debug] #14 0045b39a in ?? () from samp-server.exe
[15:39:12] [debug] #15 0037168f in ?? () from plugins\mysql.DLL
[15:39:12] [debug] #16 00378742 in ?? () from plugins\mysql.DLL
[15:39:12] [debug] #17 004877cb in ?? () from samp-server.exe
[15:39:12] [debug] #18 5c8b01f8 in ?? () from samp-server.exe
[15:39:12] [debug] #19 61750824 in ?? () from samp-server.exe
Can anyone help me out with the issue ?

After doing some debugging. The problem was found here

pawn Code:
if(dialogid == L_DIALOG)
   {
     if(!response) return Kick(playerid);
     if(response)
     {
     new query[200], pname[24], escapepass[100];
     GetPlayerName(playerid, pname, 24);
     mysql_real_escape_string(inputtext, escapepass);
     format(query, sizeof(query), "SELECT `user` FROM playerdata WHERE `user` = '%s' AND `password` = SHA1('%s')", pname, escapepass);
     mysql_query(query);
     mysql_store_result();

     new numrows = mysql_num_rows();
     if(numrows == 1)
     {
     MySQL_Login(playerid);
     SendClientMessage(playerid, GREEN,"[ACCOUNT]: You stats has been successfully loaded!");
     SetTimerEx("login_dialog", 100, 0, "i", playerid);
     }
     if(!numrows)
     {
       PlayerInfo[playerid][FailLogin]++;
       format(gString, SOS, "LOGIN: You have failed to login | Attempt (%d)", PlayerInfo[playerid][FailLogin] );
       SendClientMessage(playerid, red, gString);
       ShowPlayerDialog(playerid, L_DIALOG, DIALOG_STYLE_PASSWORD,"Login",""corange"Your account is already registered\nPlease type your password to login","Login","Quit");
       if(PlayerInfo[playerid][FailLogin] == MAX_FAIL_LOGINS)
       {
             format(gString, sizeof(gString), "%s has been kicked (Failed Logins)", PlayerName(playerid));
             SendClientMessageToAll(red, gString);
             Kick(playerid);
             }
       }
     }
     mysql_free_result();
   }
What could be wrong there ?

Found dis out from debugging
Code:
[17:35:14] [debug] Server crashed while executing script.amx
[17:35:14] [debug] AMX backtrace:
[17:35:14] [debug] #0 native mysql_fetch_field_row () [002e6710] from mysql.DLL
[17:35:14] [debug] #1 00014638 in MySQL_Login (playerid=0) at C:\Users\dell\Desktop\script\gamemodes\script.pwn:1457
[17:35:14] [debug] #2 0003503c in public OnDialogResponse (playerid=0, dialogid=554, response=1, listitem=-1, inputtext[]=@0x002c038c "mypassword") at C:\Users\dell\Desktop\script\gamemodes\script.pwn:5471
[17:35:14] [debug] Native backtrace:
[17:35:14] [debug] #0 739eb690 in ?? () from C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4926_none_508ed732bcbc0e5a\MSVCR90.dll
[17:35:14] [debug] #1 002e9abe in ?? () from plugins\mysql.DLL
[17:35:14] [debug] #2 002e67e3 in ?? () from plugins\mysql.DLL
[17:35:14] [debug] #3 004010b6 in ?? () from samp-server.exe
[17:35:14] [debug] #4 741e9ae7 in ?? () from plugins\crashdetect.DLL
[17:35:14] [debug] #5 741f49ca in ?? () from plugins\crashdetect.DLL
[17:35:14] [debug] #6 741f681f in ?? () from plugins\crashdetect.DLL
[17:35:14] [debug] #7 741e9b84 in ?? () from plugins\crashdetect.DLL
[17:35:14] [debug] #8 741f4a1a in ?? () from plugins\crashdetect.DLL
[17:35:14] [debug] #9 6d9549fb in ?? () from plugins\streamer.DLL
[17:35:14] [debug] #10 0046de11 in ?? () from samp-server.exe
[17:35:14] [debug] #11 00452970 in ?? () from samp-server.exe
[17:35:14] [debug] #12 741d5e0a in ?? () from plugins\crashdetect.DLL
[17:35:14] [debug] #13 00499cd9 in ?? () from samp-server.exe
[17:35:14] [debug] #14 0045b39a in ?? () from samp-server.exe
[17:35:14] [debug] #15 002e168f in ?? () from plugins\mysql.DLL
[17:35:14] [debug] #16 002e8742 in ?? () from plugins\mysql.DLL
[17:35:14] [debug] #17 004877cb in ?? () from samp-server.exe
[17:35:14] [debug] #18 5c8b01f8 in ?? () from samp-server.exe
[17:35:14] [debug] #19 61750824 in ?? () from samp-server.exe
The line of error stated over debug
pawn Code:
stock MySQL_Login(playerid)
{
    new query[300], pname[24], savingstring[20];
    GetPlayerName(playerid, pname, 24);
    format(query, sizeof(query), "SELECT * FROM playerdata WHERE user = '%s'", pname);
    mysql_query(query);
    mysql_store_result();
    while(mysql_fetch_row_format(query,"|"))
    {
        mysql_fetch_field_row(savingstring, "scores"); SetPlayerScore(playerid, strval(savingstring));
        mysql_fetch_field_row(savingstring, "money"); GivePlayerMoney(playerid, strval(savingstring));
        mysql_fetch_field_row(savingstring, "adminlevel"); PlayerInfo[playerid][pAdmin] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "helperlevel"); PlayerInfo[playerid][pHelper] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "kills"); PlayerInfo[playerid][pKills] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "deaths"); PlayerInfo[playerid][pDeaths] = strval(savingstring);
    }
    mysql_free_result();
    MySQL_vLogin(playerid); //vip log in
    PlayerInfo[playerid][pLogged] = 1;
    return 1;
}
Quote:

[17:35:14] [debug] #1 00014638 in MySQL_Login (playerid=0) at C:\Users\dell\Desktop\script\gamemodes\script.pwn: 1457

Reply
#2

Bump :/
Reply
#3

I think your plugins are out of date. Download nativechecker plugin, put it at the end of your plugins line in server.cfg and it'll tell you whether your plugins are all up to date.
Reply
#4

They're not outdated, because i have same problem on Windows. I fixed installing a Debian Virtual Server trough Virtual Box Software so hosting the server inside.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)