Shutting down the server during authorization.
#1

Good day, I immediately apologize for my English.
The essence of the matter is this, when two players turn on, and after they enter the password, and the server confirms its correctness, for some reason the server is turned off.

My codes:
PHP Code:
GetPlayerName(playeridPlayerInfo[playerid][pName], MAX_PLAYER_NAME);
        new 
query121[75+MAX_PLAYER_NAME+4];
        
format(query121sizeof(query121), "SELECT `acc_id`,`pass`,`salt_pass` FROM `account` WHERE `nick`='%s'"PlayerInfo[playerid][pName]);
        
mysql_function_query(MysqlConnectquery121true"OnRegCheckCallBack","d",playerid); 
Answer CallBack:
PHP Code:
forward OnRegCheckCallBack(playerid);
public 
OnRegCheckCallBack(playerid)
{
    new 
rowsfields;    
    
cache_get_data(rowsfields,MysqlConnect);
    if(
rows)
    {
        
PlayerInfo[playerid][pID] = cache_get_field_content_int(0"acc_id"MysqlConnect);
        
cache_get_field_content(0"pass"PlayerInfo[playerid][pPassword], MysqlConnect33);
        
cache_get_field_content(0"salt_pass"PlayerInfo[playerid][salt_pass], MysqlConnect11);
        
printf("ID: %d",PlayerInfo[playerid][pID]);
        
printf("Password: %s",PlayerInfo[playerid][pPassword]);
        
printf("salt_pass: %s",PlayerInfo[playerid][salt_pass]);
        
OnPlayerDialogD_REG_AUTOS(playerid,1);// authorization dialog
    
}
    else 
OnPlayerDialogD_REG_AUTOS(playerid,2);// registration dialog
    
return 1;

After the player has entered the correct password, and pressed the button: 'Enter'

PHP Code:
new query2[51+11+2];
format(query2sizeof(query2), "SELECT * FROM `account` WHERE `acc_id`='%d'"PlayerInfo[playerid][pID]);
mysql_function_query(MysqlConnectquery2,true,"OnPlayerLoginCallBack","dd",PlayerInfo[playerid[pID],playerid); 
Answer LoginCallBack
PHP Code:
forward OnPlayerLoginCallBack(playermysqlid,playerid);
public 
OnPlayerLoginCallBack(playermysqlid,playerid)
{
    if(
playermysqlid != PlayerInfo[playerid][pID]) return 1;
    if(
playerid == INVALID_PLAYER_ID) return 1;
    if(
cache_get_row_count(MysqlConnect) > 0)
    {
        
TogglePlayerSpectating(playeridfalse);
        
PlayerInfo[playerid][pID] = cache_get_field_content_int(0"acc_id"MysqlConnect);
        
cache_get_field_content(0"nick"PI[playerid][pName], MysqlConnectMAX_PLAYER_NAME);
        
cache_get_field_content(0"pass"PI[playerid][pPassword], MysqlConnect33);
        
cache_get_field_content(0"salt_pass"PI[playerid][pass_salt], MysqlConnect11);
                
SpawnPlayer(playerid);
        }
        return 
1;

Connecting: crashdetect:

PHP Code:
[02:38:34] [debugServer crashed due to an unknown error
[02:38:34] [debugNative backtrace:
[
02:38:34] [debug#0 00481ff3 in ?? () in samp-server-cr.exe
[02:38:34] [debugRegisters:
[
02:38:34] [debugEAX00000001 EBX00000000 ECX059d3bc8 EDX0101a8c0
[02:38:34] [debugESI059d3bc8 EDI059d3bc8 EBP0019fc4c ESP0019f818
[02:38:34] [debugEIP00481ff3 EFLAGS00010206
[02:38:34] [debugStack:
[
02:38:34] [debugESP+0000000000000001 0048a155 02ffe578 0249c7a0
[02:38:34] [debugESP+0000002005888168 0249c7a0 02490096 00000081
[02:38:34] [debugESP+000000401a8faaca fffffffe 0019f88c 77e4b4e8
[02:38:34] [debugESP+0000006000000006 ffffffff 00000000 0048763b
[02:38:34] [debugESP+0000008000000000 004921f6 0019f9ac 00000001
[02:38:34] [debugESP+000000a00019fb18 004965f8 004b1230 ffffffff
[02:38:34] [debugESP+000000c030467b0a 43383645 e0e2d37d ece5e0e6
[02:38:34] [debugESP+000000e030303030 2d50497d e5f0e4e0 467b20f1
[02:38:34] [debugESP+00000100f620c20a f5ffebe5 e7e5e120 f1e0efee
[02:38:34] [debugESP+00000120e8e4e5e2 7b20e5f2 0000002b 00000800
[02:38:34] [debugESP+0000014030467b2e 43383645 cf0a0a7d e5e2eef0
[02:38:34] [debugESP+00000160e2e220fc 20e0e4ee f7feebea 20e820e0
[02:38:34] [debugESP+000001804332337b 7d323344 eee2c227 0a0a27e4
[02:38:34] [debugESP+000001a00047cd00 3443447b 7d373437 ece8edc2
[02:38:34] [debugESP+000001c002956bb8 00000bf9 000017f2 00000000
[02:38:34] [debugESP+000001e0e8edc27d e8ede0ec c20421e5 06e4eee2
[02:38:34] [debugESP+0000020060636361 54455320 6e6f6020 656e696c
[02:38:34] [debugESP+0000022060204552 64695f70 30273d60 02e10027
[02:38:34] [debugESP+0000024000000800 00000000 0019fa65 040f3b01
[02:38:34] [debugESP+0000026002956bb8 00000fca 00000005 00000000
[02:38:34] [debugESP+0000028000000000 00000000 00000000 00000000
[02:38:34] [debugESP+000002a00019fad4 00000000 0046878a 00000044
[02:38:34] [debugESP+000002c00019fb24 059d3bc8 059ec650 0048322e
[02:38:34] [debugESP+000002e00019fb04 0000007e b368d696 00000000
[02:38:34] [debugESP+0000030068965f61 0019fb34 00000001 00000000
[02:38:34] [debugESP+0000032000000000 00000001 0019fc5c 689792ef
[02:38:34] [debugESP+0000034068979309 00000000 02e140c0 00000000
[02:38:34] [debugESP+0000036000000000 6d667a7e c000007a 0019fc50
[02:38:34] [debugESP+0000038077e57bdf 02e140c0 0019fc80 0019fbfc
[02:38:34] [debugESP+000003a000000000 00000086 0067c0e8 00e140c0
[02:38:34] [debugESP+000003c00019fc04 68965f61 0019fbf8 00000001
[02:38:34] [debugESP+000003e002956388 77e4c6a9 6d667d02 00660000 
I am using mysql version r39-6
Reply
#2

You could try to add "prints" between each line to see where it cancels to do anything. Please post the line that crashes your server when you found it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)