-
-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PF_Message(Begin|End)_I
, PF_Write*_I
hooks
#1019
Conversation
Close as fixes c9f9bbf |
Could have still worth it to still have those hooks additionally to your new hooking system, in case of coders would like to build their own message manager with a few more features. |
It's very inefficient to have hook on every PF_Write*
I see no reason not to add these more features directly to the current impl message manager |
If this feasible and you O.K. to do it, yeah, will worth more.
I think I thought on the past to one or two more things but I forgot about it, just some ideas I forgot to note when I was working on something over a year ago. |
Message manager uses a hookchain, which means that both PRE and POST events can be used
I do not think it is possible to implement this in the current impl of the message manager,
This looks very unsafe, how to handle cases when the vanilla code does a loop on the players with destination MSG_ONE, but the hook altered it to MSG_ALL?
This can be added |
Ah yeah you are right (the "SendUserMessageData" as chain), I forgot about the fact it uses a hook chain!
Well, need to create extra data to copy/store it, sure this will use some "extra memory", but maybe it could only be allocated when we start to alter something on the message (for a lot of calls we will not do it), however, if not modified, redirect to actual data.
Well, obviously we must use it in conjonction of the target/entity alteration to avoid crash etc. (in case we change from MSG_ONE to MSG_ALL & vice-versa, but in some situations it could be used. At least if you add it, people will have the possibility to use it if needed, after that, that is up to them to make a proper use of such feature, there are supposed to be "responsible" of that they are doing!
Good! But if in case you implement modification of destination (MSG_*) + origin + entity/edict, add the related functions too! |
Nice update, @s1lentq! |
Closes #284