27.06.2013, 23:09
having a similar problem to ReVo I think:
after it restarted, it wouldn't even properly open the database:
the code:
for now, I just won't use prepared statements.
Works on windows, doesn't work on Linux, www.hostspree.org
Код:
[10:25:27] [debug] Server crashed while executing attdef.amx [10:25:27] [debug] AMX backtrace: [10:25:27] [debug] #0 00005554 in bool:stmt_fetch_row (&DBStatement:stStatement=@0x001f1170) at C:\Users\Dracule\Dropbox\AADeathZone\pawno\include\sqlitei.inc:1724 [10:25:27] [debug] #1 0004a9e4 in public S@@_OnDialogResponse (playerid=0, dialogid=21, response=1, listitem=-1, inputtext[]=@0x001eddf8 "REMOVED PASSWORD") at C:\Users\Dracule\Dropbox\AADeathZone\gamemodes\attdef.pwn:2420 [10:25:27] [debug] Native backtrace: [10:25:27] [debug] #0 f7dbf60b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so [10:25:27] [debug] #1 f7db6e92 in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so [10:25:27] [debug] #2 f7db88d9 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so [10:25:27] [debug] #3 f7dbf2a0 in ?? () from plugins/crashdetect.so [10:25:27] [debug] #4 ffffe600 in ?? () [10:25:27] [debug] #5 f7dc1a27 in amx_Exec () from plugins/crashdetect.so [10:25:27] [debug] #6 f7db8abb in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so [10:25:27] [debug] #7 f7dbb100 in ?? () from plugins/crashdetect.so [10:25:27] [debug] #8 080ae33f in ?? () from /home/tcagame/MaiwandM/148/samp03svr [10:25:27] [debug] #9 080b97da in ?? () from /home/tcagame/MaiwandM/148/samp03svr [10:25:27] [debug] #10 08071ae8 in ?? () from /home/tcagame/MaiwandM/148/samp03svr [10:25:27] [debug] #11 08071be2 in ?? () from /home/tcagame/MaiwandM/148/samp03svr [10:25:27] [debug] #12 0807ba00 in ?? () from /home/tcagame/MaiwandM/148/samp03svr [10:25:27] [debug] #13 080b59ad in ?? () from /home/tcagame/MaiwandM/148/samp03svr [10:25:27] [debug] #14 080b5b42 in ?? () from /home/tcagame/MaiwandM/148/samp03svr [10:25:27] [debug] #15 080b1453 in ?? () from /home/tcagame/MaiwandM/148/samp03svr [10:25:27] [debug] #16 00272ebc in __libc_start_main () from /lib/libc.so.6 [10:25:27] [debug] #17 0804b521 in ?? () from /home/tcagame/MaiwandM/148/samp03svr
Код:
[10:25:29] SQLitei Error: (db_query) Invalid persistent database given (F71EB748). [10:25:29] SQLitei Notice: (db_free_result_hook) Invalid result given. [10:25:29] Server Config Loaded. [10:25:29] SQLitei Error: (db_query) Invalid persistent database given (F71EB748). [10:25:29] SQLitei Notice: (db_free_result_hook) Invalid result given. [10:25:29] Bases Loaded: 0 [10:25:29] SQLitei Error: (db_query) Invalid persistent database given (F71EB748). [10:25:29] Arenas Loaded: 0 [10:25:29] SQLitei Error: (db_query) Invalid persistent database given (F71EB748). [10:25:29] DMs Loaded: 0 [10:25:29] SQLitei Error: (db_query) Invalid persistent database given (F71EB748). [10:25:29] Duels Loaded: 0 [10:25:29] SQLitei Error: (db_query) Invalid persistent database given (F71EB748). [10:25:29] SQLitei Notice: (db_free_result_hook) Invalid result given. [10:25:29] Bases Loaded: 0
pawn Код:
new Query[256];
format(Query, sizeof(Query), "SELECT * FROM `Players` WHERE `Name` = '%s' AND `Password` = '%s'", Player[playerid][Name], HashPass);
new DBStatement:stmt = db_prepare(sqliteconnection, Query);
new level, weather, time, chatchannel, netcheck;
stmt_bind_result_field(stmt, 1, DB::TYPE_STRING, CurrentPassword, sizeof(CurrentPassword));
stmt_bind_result_field(stmt, 2, DB::TYPE_INT, level);
stmt_bind_result_field(stmt, 3, DB::TYPE_INT, weather);
stmt_bind_result_field(stmt, 4, DB::TYPE_INT, time);
stmt_bind_result_field(stmt, 5, DB::TYPE_INT, chatchannel);
stmt_bind_result_field(stmt, 6, DB::TYPE_INT, netcheck);
if(stmt_execute(stmt)) {
if(stmt_fetch_row(stmt)) {
Player[playerid][Level] = level;
Player[playerid][Weather] = weather;
Player[playerid][Time] = time;
Player[playerid][ChatChannel] = chatchannel;
Player[playerid][NetCheck] = netcheck;
Player[playerid][Logged] = true;
SendClientMessage(playerid,-1, "You have successfully logged in.");
format(Query, sizeof(Query), "Level: %d | Weather: %d | Time: %d | Chat Channel: %d | Net Check: %d", level, weather, time, chatchannel, netcheck);
SendClientMessage(playerid, -1, Query);
} else {
SendClientMessage(playerid,-1,"{FFFFFF}Error: {0099FF}Wrong Password. Please try again.");
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"{FFFFFF}Login Dialog","{FFFFFF}Type your password below to log in:","Login","Leave");
}
}
stmt_close(stmt);
Works on windows, doesn't work on Linux, www.hostspree.org