Hallo,
mein Problem ist, dass ich gerade versuche meinen Server auf MySQL umzustellen.
Das einzige Problem ist, wie der Titel bereits sagt ab dem Befehl mysql_get_field() der Server abstürtzt.
PAWN-Code:
public OnPlayerConnect(playerid)
{
if(IsPlayerNPC(playerid))return 1;
new query[512], data[512];
format(query, sizeof(query), "SELECT * FROM `user` WHERE `name` = '%s'", SpielerName(playerid));
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() == 0) Kick(playerid);
mysql_get_field("banned", data); // Hier ist Zeile 406, welche Crashdetect auch angibt(glaube ich) ==> [15:33:54] [debug] #1 0000896c in public OnPlayerConnect (playerid=0) at free.p:407
printf("nach get field");
if(strval(data) == 1)
{
new dialog_text[1024], msg[256], Name[256], Grund[256], Zeit[256], Dauer[256];
mysql_get_field("ban_admin", data);
format(Name, sizeof(Name), "%s", data);
mysql_get_field("ban_grund", data);
format(Grund, sizeof(Grund), "%s", data);
mysql_get_field("ban_zeit", data);
format(Zeit, sizeof(Zeit), "%s", data);
mysql_get_field("ban_dauer", data);
format(Dauer, sizeof(Dauer), "%s", data);
mysql_free_result();
format(msg, sizeof(msg), "{FFFFFF}Admin: {AAAAAA}%s\n{FFFFFF}Grund: {AAAAAA}%s\n{FFFFFF}Zeitpunkt: {AAAAAA}%s\n{FFFFFF}Dauer: {AAAAAA}%s", Name, Grund, Zeit, Dauer);
format(dialog_text, sizeof(dialog_text), "{FFFFFF}Dein Account {EA1616}%s{FFFFFF} ist auf diesem Server gesperrt!\nEtwas weiter unten findest du alle wichtigen Informationen über deine Accountsperre.\nWenn du meinst, dass dein Account zu Unrecht gebannt wurde, wende dich bitte an einen Administrator. \n\n%s", SpielerName(playerid), msg);
ShowPlayerDialog(playerid, DIALOG_BAN, DIALOG_STYLE_MSGBOX, "LPFreaks11 Freeroam - Account gesperrt!", dialog_text, "Schließen", "");
SetTimerEx("KickPlayer", 1000, 0, "i", playerid);
return 1;
}
MySQL Debug Datei:
[15:33:32] ---------------------------
[15:33:32] MySQL Debugging activated (05/18/13)
[15:33:32] ---------------------------
[15:33:32]
[15:33:32] >> mysql_connect( )
[15:33:32] CMySQLHandler::CMySQLHandler() - constructor called.
[15:33:32] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "samp2637_server" | Username: "samp2637" ...
[15:33:32] CMySQLHandler::Connect() - Connection was successful.
[15:33:32] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.
[15:33:54] >> mysql_real_escape_string( Connection handle: 1 )
[15:33:54] CMySQLHandler::EscapeString(Andre); - Escaped 5 characters to Andre.
[15:33:54] >> mysql_query( Connection handle: 1 )
[15:33:54] CMySQLHandler::Query(SELECT * FROM `user` WHERE `name` = 'Andre') - Successfully executed.
[15:33:54] >> mysql_store_result( Connection handle: 1 )
[15:33:54] CMySQLHandler::StoreResult() - Result was stored.
[15:33:54] >> mysql_num_rows( Connection handle: 1 )
[15:33:54] CMySQLHandler::NumRows() - Returned 1 row(s)
[15:33:54] >> mysql_fetch_field_row( Connection handle: 1 )
Alles anzeigen
Und auchnoch der Serverlog mit Crashdetect...
SA-MP Dedicated Server
----------------------
v0.3x, (C)2005-2013 SA-MP Team
[15:33:32]
[15:33:32] Server Plugins
[15:33:32] --------------
[15:33:32] Loading plugin: crashdetect.so
[15:33:32] crashdetect v4.8.4 is OK.
[15:33:32] Loaded.
[15:33:32] Loading plugin: mysql_r6.so
[15:33:32]
> MySQL plugin R6 successfully loaded.
[15:33:32] Loaded.
[15:33:32] Loaded 2 plugins.
[15:33:32]
[15:33:32] Filterscripts
[15:33:32] ---------------
[15:33:32] Loading filterscript 'wbb_connect.amx'...
[15:33:32]
=== WBB_Connect: ===
WBB_Connect v. 2.0
was successfully loaded!
Copyright (c) by Hauke Marquardt
====================
[15:33:32] Loading filterscript 'Report-System.amx'...
[15:33:32]
[15:33:32]
[15:33:32] ========== Report-System by John.Parker ==========
[15:33:32] # #
[15:33:32] # Das Filterscript wurde erfolgreich geladen! #
[15:33:32] # #
[15:33:32] ==================================================
[15:33:32]
[15:33:32]
[15:33:32] Loaded 2 filterscripts.
[15:33:32]
----------------------------------
[15:33:32] FreeRoam by LPFreaks11
[15:33:32] ----------------------------------
[15:33:32] •••
[15:33:32] Number of vehicle models: 17
[15:33:32]
=== WBB_Connect: ===
WBB_Connect v. 2.0 successfully initialized
====================
[15:33:54] Incoming connection: 217.83.132.187:63261
[15:33:54] [join] Andre has joined the server (0:217.83.132.187)
[15:33:54] [debug] Server crashed while executing free.amx
[15:33:54] [debug] AMX backtrace:
[15:33:54] [debug] #0 native mysql_fetch_field_row () [f736de20] from mysql_r6.so
[15:33:54] [debug] #1 0000896c in public OnPlayerConnect (playerid=0) at free.p:407
[15:33:54] [debug] System backtrace:
[15:33:54] [debug] #0 f75240f3 in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[15:33:54] [debug] #1 f751bb61 in _ZN11crashdetect20PrintSystemBacktraceEPv () from plugins/crashdetect.so
[15:33:54] [debug] #2 f751e405 in _ZN11crashdetect15SystemExceptionEPv () from plugins/crashdetect.so
[15:33:54] [debug] #3 f7523c42 in ?? () from plugins/crashdetect.so
[15:33:54] [debug] #4 f77d6400 in ?? ()
[15:33:54] [debug] #5 f7368fe1 in _ZN13CMySQLHandler10FetchFieldESs () from plugins/mysql_r6.so
[15:33:54] [debug] #6 f736dea0 in _ZN7Natives23n_mysql_fetch_field_rowEP6tagAMXPi () from plugins/mysql_r6.so
[15:33:54] [debug] #7 08093c94 in ?? () from ./samp7777_2637
[15:33:54] [debug] #8 f751e9d5 in _ZN11crashdetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[15:33:54] [debug] #9 f75221ca in ?? () from plugins/crashdetect.so
[15:33:54] [debug] #10 f7526136 in amx_Exec () from plugins/crashdetect.so
[15:33:54] [debug] #11 f751e8b4 in _ZN11crashdetect9DoAmxExecEPii () from plugins/crashdetect.so
[15:33:54] [debug] #12 f7522203 in ?? () from plugins/crashdetect.so
[15:33:54] [debug] #13 080acdd9 in ?? () from ./samp7777_2637
[15:33:54] [debug] #14 080c4bdf in ?? () from ./samp7777_2637
[15:33:54] [debug] #15 080bbb9c in ?? () from ./samp7777_2637
[15:33:54] [debug] #16 08071ae8 in ?? () from ./samp7777_2637
[15:33:54] [debug] #17 08071be2 in ?? () from ./samp7777_2637
[15:33:54] [debug] #18 0807ba00 in ?? () from ./samp7777_2637
[15:33:54] [debug] #19 080b59ad in ?? () from ./samp7777_2637
[15:33:54] [debug] #20 080b5b42 in ?? () from ./samp7777_2637
[15:33:54] [debug] #21 080b1453 in ?? () from ./samp7777_2637
[15:33:54] [debug] #22 f7549ca6 in __libc_start_main () from /lib32/libc.so.6
[15:33:54] [debug] #23 0804b521 in ?? () from ./samp7777_2637
Alles anzeigen
PS: Ich kann selber auch PHP scripten und da verwende ich immer mysql_fetch_object()...
Link zum Plugin: Hier
(Ich verwendet Version R6.)