PHP код:
|
[07:40:23] >> mysql_connect(localhost, root, fc-rp, ******) on port 3306 [07:40:23] CMySQLHandler::CMySQLHandler() - constructor called. [07:40:23] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "fc-rp" | Username: "root" [07:40:23] CMySQLHandler::Connect() - Connection was successful. [07:40:23] CMySQLHandler::Connect() - Auto-Reconnect has been enabled. [07:40:48] >> mysql_format( Connection handle: 1 ) [07:40:48] CMySQLHandler::EscapeString(Karim_Squallisss); - Escaped 16 characters to Karim_Squallisss. [07:40:48] >> mysql_query_callback( Connection handle: 1 ) [07:40:48] Passing query SELECT * FROM `banList` WHERE `bannedName` = 'Karim_Squallisss' OR bannedIp = '127.0.0.1' | i [07:40:48] ProcessQueryThread(OnCheckBanList) - Query was successful. (SELECT * FROM `banList` WHERE `bannedName` = 'Karim_Squallisss' OR bannedIp = '127.0.0.1') [07:40:48] ProcessQueryThread(OnCheckBanList) - Data caching enabled. [07:40:48] CMySQLHandler::StoreResult() - Result was stored. [07:40:48] CMySQLHandler::FreeResult() - Result was successfully free'd. [07:40:48] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick() [07:40:48] OnCheckBanList(i) - Threaded function called. [07:40:48] ProcessTick() - The cache has been cleared. [07:40:58] >> mysql_format( Connection handle: 1 ) [07:40:58] CMySQLHandler::EscapeString(Karim_Squallisss); - Escaped 16 characters to Karim_Squallisss. [07:40:58] >> mysql_query_callback( Connection handle: 1 ) [07:40:58] Passing query SELECT * FROM `banList` WHERE `bannedName` = 'Karim_Squallisss' OR bannedIp = '127.0.0.1' | i [07:40:58] ProcessQueryThread(OnCheckBanList) - Query was successful. (SELECT * FROM `banList` WHERE `bannedName` = 'Karim_Squallisss' OR bannedIp = '127.0.0.1') [07:40:58] ProcessQueryThread(OnCheckBanList) - Data caching enabled. [07:40:58] CMySQLHandler::StoreResult() - Result was stored. [07:40:58] CMySQLHandler::FreeResult() - Result was successfully free'd. [07:40:58] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick() [07:40:58] OnCheckBanList(i) - Threaded function called. [07:40:58] ProcessTick() - The cache has been cleared. [07:41:14] >> mysql_format( Connection handle: 1 ) [07:41:14] CMySQLHandler::EscapeString(Karim_Squallisss); - Escaped 16 characters to Karim_Squallisss. [07:41:14] >> mysql_query_callback( Connection handle: 1 ) [07:41:14] Passing query SELECT * FROM `banList` WHERE `bannedName` = 'Karim_Squallisss' OR bannedIp = '127.0.0.1' | i [07:41:14] ProcessQueryThread(OnCheckBanList) - Query was successful. (SELECT * FROM `banList` WHERE `bannedName` = 'Karim_Squallisss' OR bannedIp = '127.0.0.1') [07:41:14] ProcessQueryThread(OnCheckBanList) - Data caching enabled. [07:41:14] CMySQLHandler::StoreResult() - Result was stored. [07:41:14] CMySQLHandler::FreeResult() - Result was successfully free'd. [07:41:14] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick() [07:41:14] OnCheckBanList(i) - Threaded function called. [07:41:14] ProcessTick() - The cache has been cleared. |
SA-MP Dedicated Server ---------------------- v0.3e, ©2005-2012 SA-MP Team [07:40:23] filterscripts = "" (string) [07:40:23] [07:40:23] Server Plugins [07:40:23] -------------- [07:40:23] Loading plugin: mysql [07:40:23] > MySQL plugin R7 successfully loaded. [07:40:23] Loaded. [07:40:23] Loading plugin: sscanf [07:40:23] [07:40:23] =============================== [07:40:23] sscanf plugin loaded. [07:40:23] © 2009 Alex "******" Cole [07:40:23] 0.3d-R2 500 Players "dnee" [07:40:23] =============================== [07:40:23] Loaded. [07:40:23] Loading plugin: streamer [07:40:23] *** Streamer Plugin v2.6.1 by Incognito loaded *** [07:40:23] Loaded. [07:40:23] Loading plugin: regex [07:40:23] [07:40:23] ______________________________________ [07:40:23] Regular Expression Plugin v0.2.1 loaded [07:40:23] ______________________________________ [07:40:23] By: Fro © Copyright <TBG> 2009-2011 [07:40:23] ______________________________________ [07:40:23] Loaded. [07:40:23] Loaded 4 plugins. [07:40:23] [07:40:23] Filterscripts [07:40:23] --------------- [07:40:23] Loaded 0 filterscripts. [07:40:23] ---------------------------------- [07:40:23] Blank Gamemode by your name here [07:40:23] ---------------------------------- [07:40:23] Number of vehicle models: 0 [07:40:48] Incoming connection: 127.0.0.1:56395 [07:40:48] [join] Karim_Squallisss has joined the server (0:127.0.0.1) [07:40:48] [part] Karim_Squallisss has left the server (0:2) [07:40:58] Incoming connection: 127.0.0.1:56396 [07:40:58] [join] Karim_Squallisss has joined the server (0:127.0.0.1) [07:40:58] [part] Karim_Squallisss has left the server (0:2) [07:41:13] Incoming connection: 127.0.0.1:56397 [07:41:14] [join] Karim_Squallisss has joined the server (0:127.0.0.1) [07:41:14] [part] Karim_Squallisss has left the server (0:2) |
public OnCheckBanList(playerid) // just a test code without verification
{
SendClientMessage(playerid, COLOR_ERROR, "Your are banned");
SetTimerEx("KickPlayer", 4500, false, "d", playerid);
}
// Somewhere in the script..
forward KickPlayer(playerid);
public KickPlayer(playerid)
{
return Kick(playerid);
}
Threaded queries work fine in the R6 plugin, but there is a bug in the logging messages. However I suggest all scripters that want to start using this plugin to take on R7 immediately. Even more since you want threaded queries. R7 provides more functionality for those.
|
Thank you, but i need a linux version to our server too.
Where can i download it? Because the R7 version eat much much ram :S |
Thank you, but i need a linux version to our server too.
Where can i download it? Because the R7 version eat much much ram :S |
Thanks for all your feedback. I've recently fixed some of the known bugs (memory leaks as well as mysql_format() crashes while using the '%e' specifier) with the help of CHC and Zeex on IRC. I would like to share the source and get some feedback before I fully release it (to avoid future bugs).
http://www.file-upload.net/download-.../R7-2.rar.html |
stock fromUnixTime(time) { new unbantime[25]; format(str, sizeof(str), "SELECT FROM_UNIXTIME( %d )", time); if(mysql_query(str) && mysql_store_result()) { mysql_fetch_row_format(unbantime); } mysql_free_result(); return unbantime; } |
mysql_function_query(dbHandle, "UPDATE players SET kills = 10 WHERE id = 1", false, "", ""); |
mysql_function_query( 1, "INSERT INTO `Houses` (`House ID`,`House Name`,`House Owner`,`House Price`) VALUES(1,`stuntman`,`[SG]stuntman`,300000)", false, "", "" ); |
'Error 1054: Unknown column `stuntman` in `field list`
Do you have any code in OnQueryError ? if yes, comment it and try again.
|
public OnQueryError(errorid, error[], callback[], query[], connectionHandle)
{
/*printf("EID: %d | Error: %s | Query: %s", errorid, error, query);
switch(errorid)
{
case CR_COMMAND_OUT_OF_SYNC: {
mysql_free_result();
printf("[Mysql: Error - Callback: %s] - Commands Out Of Sync For - Query: %s", callback, query);
}
case ER_UNKNOWN_TABLE: printf("[Mysql: Error - Callback: %s] - Unknown table '%s' in %s - callback: %s", callback, error, query);
case ER_SYNTAX_ERROR: printf("[Mysql: Error - Callback: %s] - Something is wrong in your syntax, query: %s", callback, query);
case CR_SERVER_GONE_ERROR, CR_SERVER_LOST, CR_SERVER_LOST_EXTENDED: mysql_reconnect();
}*/
return 1;
}
@costel_nistor96 use 'stuntman' in place of ` ` when you insert VALUES !
|