First of all, thanks for the update!
I could get it to compile on CentOS, but not without making any changes to the code. I don't know if my changes broke anything or I'm just very stupid, but it definitely compiles now. I was experiencing an error like
error: expected primary-expression before ā{ā token. I just prepended pthread_mutex_t to line 14 in source/CMutex.cpp.
And I say again, I'm not an expert of any sort or even anything close to it when it comes to C++, but it did get the code to compile in my environment. And apparently, it works too.
The compiled plugin can be found here:
http://sf-se.net/dev/mysql_r7_centos.so (and for anyone who cannot be bothered to read what's above, try this out if you're using
linux).
I also tested out some of the code. I have no idea about the cache functions but the function
mysql_function_query(connectionHandle, query[], bool:cache, callback[], format[], {Float,_}:...) does have a cache parameter, so go figure what it could do!
What I love the most about the updates, and what I think you guys will love as well is the ability to pass custom parameters to your callback!
pawn Код:
stock some_func()
{
mysql_function_query(1, "SELECT * FROM players WHERE reg_id = 1", false, "OnPlayerDataReceived", "si", "Hello there!", 9977);
return 1;
}
forward OnPlayerDataReceived(string[], number);
public OnPlayerDataReceived(string[], number)
{
printf("OnPlayerDataReceived(%s, %d)", string, number);
mysql_store_result();
new row[256];
mysql_fetch_row(row);
printf("Result: %s", row);
return true;
}
This is very nice. If anyone could come up with some usage/help for the cache functions it would be just awesome!