28.06.2012, 21:02
Hi all, i have a problem with my samp server(0.3e).... it run on Debian 32-bit with mysql Plugin R7 by https://sampforum.blast.hk/showthread.php?tid=56564 ... if i have mysql_format in OnPlayerConnect then it crash server when i connect to it, but when i remove mysql_format line then it works.
Please whatґs wrong ?
Thank you
There is my Code:
Errors:
Mysql Log:
Please whatґs wrong ?
Thank you There is my Code:
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <a_mysql>
new mysql;
stock GetName(playerid)
{
new PlayerName[200];
GetPlayerName(playerid, PlayerName, 200);
return PlayerName;
}
forward CheckPlayer(playerid);
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
public OnGameModeInit()
{
mysql = mysql_connect("localhost", "samp", "samp", "12345");
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
new szDestination[100];
mysql_format(mysql, szDestination,"SELECT * FROM `users` WHERE 'Username' = '%e'", GetName(playerid));
mysql_function_query(mysql, szDestination , false, "CheckPlayer", "d" ,playerid);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
public CheckPlayer(playerid)
{
new string[200];
mysql_store_result();
if(mysql_num_rows() == 1)
{
format(string, sizeof(string),"Dobrodosao %s\nMolimo prijavite se!",GetName(playerid));
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_PASSWORD,"Prijava",string, "Ok", "Izlaz");
}else
{
format(string, sizeof(string)," Dobrodosao %s\nRegistriraj se!", GetName(playerid));
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD,"Registracija",string, "Ok", "Izlaz");
}
mysql_free_result();
return 1;
}
Код:
*** glibc detected *** ./samp03svr: free(): invalid pointer: 0xbfc12a24 *** ======= Backtrace: ========= /lib/libc.so.6(+0x6b19a)[0xb755419a] /lib/libc.so.6(+0x6c9e8)[0xb75559e8] /lib/libc.so.6(cfree+0x6d)[0xb7558b2d] plugins/mysql.so(_ZN7Natives14n_mysql_formatEP6tagAMXPi+0x91f)[0xb74dcacf] ./samp03svr[0x80503e4] plugins/crashdetect.so(_ZN11crashdetect17HandleAmxCallbackEiPiS0_+0x73)[0xb6a567f7] plugins/crashdetect.so(+0x1801a)[0xb6a5a01a] plugins/crashdetect.so(amx_Exec+0x2fb)[0xb6a5d03e] plugins/crashdetect.so(_ZN11crashdetect13HandleAmxExecEPii+0x72)[0xb6a566d6] plugins/crashdetect.so(+0x18053)[0xb6a5a053] ./samp03svr[0x806f499] ./samp03svr[0x809f73f] ./samp03svr[0x80833ed] ./samp03svr[0x80adbe1] ./samp03svr[0x80adcd2] ./samp03svr[0x80b79c0] ./samp03svr[0x807d78d] ./samp03svr[0x807d962] ./samp03svr[0x8077c23] /lib/libc.so.6(__libc_start_main+0xe6)[0xb74ffc96] ./samp03svr(__gxx_personality_v0+0xf5)[0x804b4c1] ======= Memory map: ======== 08048000-08051000 r-xp 00000000 08:01 38781268 /home/sampserver/samp03svr 08051000-08055000 rwxp 00009000 08:01 38781268 /home/sampserver/samp03svr 08055000-0816f000 r-xp 0000d000 08:01 38781268 /home/sampserver/samp03svr 0816f000-0818b000 rw-p 00126000 08:01 38781268 /home/sampserver/samp03svr 0818b000-08196000 rw-p 00000000 00:00 0 09321000-0956c000 rw-p 00000000 00:00 0 [heap] b5b00000-b5b21000 rw-p 00000000 00:00 0 b5b21000-b5c00000 ---p 00000000 00:00 0 b5c71000-b6146000 rw-p 00000000 00:00 0 b6146000-b6147000 ---p 00000000 00:00 0 b6147000-b6a42000 rw-p 00000000 00:00 0 b6a42000-b6a65000 r-xp 00000000 08:01 38782733 /home/sampserver/plugins/crashdetect.so b6a65000-b6a66000 rw-p 00023000 08:01 38782733 /home/sampserver/plugins/crashdetect.so b6a66000-b6a70000 r-xp 00000000 08:01 38765547 /lib/libnss_files-2.11.3.so b6a70000-b6a71000 r--p 00009000 08:01 38765547 /lib/libnss_files-2.11.3.so b6a71000-b6a72000 rw-p 0000a000 08:01 38765547 /lib/libnss_files-2.11.3.so b6a72000-b6a73000 ---p 00000000 00:00 0 b6a73000-b7272000 rw-p 00000000 00:00 0 b7272000-b7285000 r-xp 00000000 08:01 36790572 /usr/lib/libz.so.1.2.3.4 b7285000-b7286000 rw-p 00013000 08:01 36790572 /usr/lib/libz.so.1.2.3.4 b7286000-b7299000 r-xp 00000000 08:01 38765554 /lib/libnsl-2.11.3.so b7299000-b729a000 r--p 00012000 08:01 38765554 /lib/libnsl-2.11.3.so b729a000-b729b000 rw-p 00013000 08:01 38765554 /lib/libnsl-2.11.3.so b729b000-b729d000 rw-p 00000000 00:00 0 b729d000-b72a6000 r-xp 00000000 08:01 38765565 /lib/libcrypt-2.11.3.so b72a6000-b72a7000 r--p 00008000 08:01 38765565 /lib/libcrypt-2.11.3.so b72a7000-b72a8000 rw-p 00009000 08:01 38765565 /lib/libcrypt-2.11.3.so b72a8000-b72cf000 rw-p 00000000 00:00 0 b72cf000-b747e000 r-xp 00000000 08:01 36790675 /usr/lib/libmysqlclient_r.so.16.0.0 b747e000-b7482000 r--p 001af000 08:01 36790675 /usr/lib/libmysqlclient_r.so.16.0.0 b7482000-b74c8000 rw-p 001b3000 08:01 36790675 /usr/lib/libmysqlclient_r.so.16.0.0 b74c8000-b74c9000 rw-p 00000000 00:00 0 b74ce000-b74e6000 r-xp 00000000 08:01 38782732 /home/sampserver/plugins/mysql.so b74e6000-b74e7000 rw-p 00017000 08:01 38782732 /home/sampserver/plugins/mysql.so b74e7000-b74e9000 rw-p 00000000 00:00 0 b74e9000-b7627000 r-xp 00000000 08:01 38765409 /lib/libc-2.11.3.so b7627000-b7628000 ---p 0013e000 08:01 38765409 /lib/libc-2.11.3.so b7628000-b762a000 r--p 0013e000 08:01 38765409 /lib/libc-2.11.3.so b762a000-b762b000 rw-p 00140000 08:01 38765409 /lib/libc-2.11.3.so b762b000-b762e000 rw-p 00000000 00:00 0 b762e000-b764b000 r-xp 00000000 08:01 38765601 /lib/libgcc_s.so.1 b764b000-b764c000 rw-p 0001c000 08:01 38765601 /lib/libgcc_s.so.1 b764c000-b7670000 r-xp 00000000 08:01 38765795 /lib/libm-2.11.3.so b7670000-b7671000 r--p 00023000 08:01 38765795 /lib/libm-2.11.3.so b7671000-b7672000 rw-p 00024000 08:01 38765795 /lib/libm-2.11.3.so b7672000-b775b000 r-xp 00000000 08:01 36790518 /usr/lib/libstdc++.so.6.0.13 b775b000-b775f000 r--p 000e9000 08:01 36790518 /usr/lib/libstdc++.so.6.0.13 b775f000-b7760000 rw-p 000ed000 08:01 36790518 /usr/lib/libstdc++.so.6.0.13 b7760000-b7768000 rw-p 00000000 00:00 0 b7768000-b777c000 r-xp 00000000 08:01 38765560 /lib/libpthread-2.11.3.so b777c000-b777d000 ---p 00014000 08:01 38765560 /lib/libpthread-2.11.3.so b777d000-b777e000 r--p 00014000 08:01 38765560 /lib/libpthread-2.11.3.so b777e000-b777f000 rw-p 00015000 08:01 38765560 /lib/libpthread-2.11.3.so b777f000-b7781000 rw-p 00000000 00:00 0 b7781000-b7783000 r-xp 00000000 08:01 38765415 /lib/libdl-2.11.3.so b7783000-b7784000 r--p 00001000 08:01 38765415 /lib/libdl-2.11.3.so b7784000-b7785000 rw-p 00002000 08:01 38765415 /lib/libdl-2.11.3.so b7787000-b778c000 rw-p 00000000 00:00 0 b778c000-b77a7000 r-xp 00000000 08:01 38765649 /lib/ld-2.11.3.so b77a7000-b77a8000 r--p 0001b000 08:01 38765649 /lib/ld-2.11.3.so b77a8000-b77a9000 rw-p 0001c000 08:01 38765649 /lib/ld-2.11.3.so bfc03000-bfc18000 rw-p 00000000 00:00 0 [stack] Aborted
Код:
[00:30:25] >> mysql_connect(localhost, samp, samp, ******) on port 3306 [00:30:25] CMySQLHandler::CMySQLHandler() - constructor called. [00:30:25] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "samp" | Username: "samp" [00:30:25] CMySQLHandler::Connect() - Connection was successful. [00:30:25] CMySQLHandler::Connect() - Auto-Reconnect has been enabled. [00:30:25] [00:30:25] ** MySQL Debugging enabled (06/29/12)


are those errors or something the fs/gamemode looks fine i dont know whatsong...

,mmm... Can Server communicate with Website through HTTP function ? ... Examp..Receives Requests SMS system or something like that ?