01.02.2010, 20:52
Quote:
Originally Posted by Wicko
Hi there again, Ethan
![]() Simply a great update, it's a huge progress from 1.0.x. Nice to see you using C++'s operators now, but I still could find a few mistakes ![]() There's one thing I mentioned after G-Stylezz's R3 release. You both decided to return a constant number in mysql_query. Your version at least returns 1 instead of 0. I've modified this function. First of all, you still didn't make it free the allocated *query after an error from mysql_real_query(). I also allowed myself to adjust returned values a little. I hope you're okay with that ![]() I don't like going through all 20 possible mysql connections (even in a separate thread), while most of plugin's uses won't require more than just one connetion open at a time. I actually think you could reduce it to just three - if anyone needs a bigger one, they can simply modify and recompile the plugin. You didn't choose std::vector to store them - was it because of it's overhead? And there's also the thing Mike has already mentioned - use PricessTick() and another queue to call OnMysqlQuery(). Quote:
|

I never knew about the ProcessTick() callback and I'll use that, Thanks for the other heads up, I will work on it in a little while. Just got home from school and I'm going to get some lunch.

EDIT: Oh, also, it doesn't loop through all 20 connections, it will loop until it hits a null'd mysql variable, so if theirs only one connection, it will stop the loop at the next check because it will be null. But I could also lower it to maybe 5.