Quote:
Originally Posted by Natsheh
So basically i need to copy all the message subsequent values and msg type then block the message then send the message to the desired clients, right?
|
Yes, so how I would do it is:
1. pfnMessageBegin called, initialize a structure to save message arguments. I would save it a list of (arg type, arg value) where arg type is short, string, entity, coord etc. Also save the message type(MSG_ALL/BROADCAST). Block the call.
2. On each call of pfnWrite* functions add an entry to your list/array, in the format (type, value). Block the calls.
3. On pfnMessageEnd block the original call, send a new message using MSG_ONE/MSG_ONE_UNRELIABLE(depending on if the original message was broadcast/all) to all players EXCEPT the ones you want to ignore. Compose the message back using the information you saved. Clear the list to prepare for a new message.
From pfnMessageEnd hook you may be unable to immediately send another message(needs to be tested). If you can't, add a small delay of 0.1 seconds.
__________________