Originally Posted by PartialCloning
Doesn't the game constantly send messages to players (developer 1;cl_showmessages 1)? If we're hooking every messagebegin and doing our checks there, then we might as well use a repeating 0.1 task to get the permanent hud effect. It shouldnt be that less efficient, if at all.
Wouldn't you say the most elegant method is for amxx to have a hud message forward? As that only has to be called when it sends the message? While register_message can still be used to hook map/half-life mods hud messages.
I suppose you havent wrote metamod plugins ? AMXX, for example, is hooking MessageBegin() and the other message forwards (WriteByte, WriteChar, WriteShort, WriteLong, WriteAngle, WriteString, WriteCoord, WriteEntity and MessageEnd) if register_message/register_event exists. What about the AMXX timer functionality, which is using StartFrame() forward, that's called hundred times in a second with so many false if() statements and etc ?!
If you use only AMXX as a third-party metamod plugin you can compile it manually removing that channel from the "random" list, BUT if you use other plugins as well, which send HUD messages, implementing a hud message forward into AMXX will be useless (except if it hooks the game messages as well). As for the repeating 0.1 task - those are 10 more game messages send to a player = total of 320 more messages per second if the server is full. Do you still think that 0.1 task is that efficient rather than hooking MessageBegin() ?
So hooking MessageBegin is not that inefficient (again I am saying if you use other meta plugins except AMXX). If you use AMXX - a forward will be nice, yes, or compile it yourself manually to exclude that channel. But thats my point of view ...
And yes - the game is constantly sending game messages to the connected clients and those hooks are slowing the engine (having in mind that GoldSrc engine is single threaded) but that's the sad truth.