Thank you again for your patience.
Quote:
Originally Posted by HamletEagle
You did not understand me, micro optimizations give you nothing, you don't get rid of lag with them or whatever you are thinking.
|
Sorry. I was think about things that could let the server and the client's needing to exchange some extra packages before the actually existents ones, because of bad code implementation.
Quote:
Originally Posted by HamletEagle
About the Damage thing, I think you are confused a bit. It's not more powerfull or whatever. Look at it's description:
Ham only hooks virtual functions, that are implemented differently in every class. So, for another entity class you must register the hook with this classname(if you register for "player", then only entities with player will be afected). I am not sure what bots are you talking about, but there are for sure ways to hook damage for them too. Also, as you can see for the Damage event, you can't modify the damage on the fly, you must create another entity that does damage, while with Ham you alter the damage directly. I would say Ham is more powerfull considering this.
PHP Code:
efficiently micro optimized
Again, micro optimizations does not give you anything.
Your title ask if it is irrelevant or not, you got your answer, but you still act like you know already. If so, why asking ?
|
Sorry, this was my irresponsibility, instead of going here bother everybody, I should go throw the API I am using, and learn throw they documentation, and if its was not good enough, throw implementation. And only after that, came here and ask about yours experience, but even this will be done when you analyse and approve the plugin at 'New Plugin Submissions' sub-forum. I will try to behave myself better to avoid forum harassing.
Quote:
Originally Posted by HamletEagle
Lol, what you understand from "every time" ? You are not working per frame, this happens once at 2/3 seconds or so, it's nothing for the server.
|
I was thinking about, a server at a small map, with gun-game for example, everybody is shooting every time. And a bad implementation could let to exchange some extra packages before normal actual exchange.
Quote:
Originally Posted by HamletEagle
Now, more about your code:
1.In a Ham forward you should use HAM_ return constants + this function is not mean to return booleans, but integers.
2.Do not hardcode a string array size, you have charsmax() for retrieving it. It helps on readability.
3.default: return PLUGIN_HANDLED you can remove this, but not like it matters much.
4.Something you should care about is the use of FM_CmdStart, which is called per frame, and if you have alternatives you should avoid it. I think that now you can hook WeaponIdle with ham, disable it right after hooking, enable it on deploy and disable on holster. It should work, test and see.
5.For Fakemeta forwards you should return FMRES_* constants, not PLUGIN_.
|
Thank you for you improvements. As soon as I can I will apply them to work.