I think you could save alot of CPU cycles if the function check_say were splitted into one function for each thing. Right now you have 12 if that it goes thru ever time someone says something and that is bad in my opinion.
Oh, I know how to do it. It simply hasn't been at the top of my priority list. This bit of code is some of the oldest in the plugin.
On the same note though, you won't truly save MUCH performance by splitting it up. AMXX will just register x more commands which all have to be checked against as a match. But AMXX will do it slightly faster that way and you'll probably see it next release.
Lazarus Long: And I know you didn't because the Server Files are version 2.2.6 and the file you posted is version 2.2.5, so do as I told you above and don't ever lie to me again or help is gone!
ferret wrote:Oh, I know how to do it. It simply hasn't been at the top of my priority list. This bit of code is some of the oldest in the plugin.
On the same note though, you won't truly save MUCH performance by splitting it up. AMXX will just register x more commands which all have to be checked against as a match. But AMXX will do it slightly faster that way and you'll probably see it next release.
Yes I know and that was my point with it, better to move it down the chain. I also know that you can do it, just simply wanted to help so you get some time over for other things.
Geesu wrote:12 if statements is not a lot of CPU cycles....
Checked a log and it had 159 say/team_say in it for a 20 minutes time span. That make a totalt of 1908 checks that is not needed. Even if they would be needed they could be executed at a lower level than checking them in a plugin.
Or am I wrong when I assume that register a command like say /command would be faster than doing a check with if/else statements?