Use BfRead or Protobuf tags in umsg hook callbacks, rather than a generic Handle.
This commit is contained in:
parent
6be9c770fe
commit
b1353e2ca4
@ -151,19 +151,39 @@ native Handle:StartMessageEx(UserMsg:msg, clients[], numClients, flags=0);
|
|||||||
native EndMessage();
|
native EndMessage();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a message is hooked
|
* Hook function types for user messages.
|
||||||
*
|
*/
|
||||||
* @param msg_id Message index.
|
typeset MsgHook
|
||||||
* @param msg Handle to the input bit buffer or protobuf.
|
{
|
||||||
* @param players Array containing player indexes.
|
/**
|
||||||
* @param playersNum Number of players in the array.
|
* Called when a bit buffer based usermessage is hooked
|
||||||
* @param reliable True if message is reliable, false otherwise.
|
*
|
||||||
* @param init True if message is an initmsg, false otherwise.
|
* @param msg_id Message index.
|
||||||
* @return Ignored for normal hooks. For intercept hooks, Plugin_Handled
|
* @param msg Handle to the input bit buffer.
|
||||||
* blocks the message from being sent, and Plugin_Continue
|
* @param players Array containing player indexes.
|
||||||
* resumes normal functionality.
|
* @param playersNum Number of players in the array.
|
||||||
*/
|
* @param reliable True if message is reliable, false otherwise.
|
||||||
typedef MsgHook = function Action (UserMsg msg_id, Handle msg, const int[] players, int playersNum, bool reliable, bool init);
|
* @param init True if message is an initmsg, false otherwise.
|
||||||
|
* @return Ignored for normal hooks. For intercept hooks, Plugin_Handled
|
||||||
|
* blocks the message from being sent, and Plugin_Continue
|
||||||
|
* resumes normal functionality.
|
||||||
|
*/
|
||||||
|
function Action (UserMsg msg_id, BfRead msg, const int[] players, int playersNum, bool reliable, bool init);
|
||||||
|
/**
|
||||||
|
* Called when a protobuf based usermessage is hooked
|
||||||
|
*
|
||||||
|
* @param msg_id Message index.
|
||||||
|
* @param msg Handle to the input protobuf.
|
||||||
|
* @param players Array containing player indexes.
|
||||||
|
* @param playersNum Number of players in the array.
|
||||||
|
* @param reliable True if message is reliable, false otherwise.
|
||||||
|
* @param init True if message is an initmsg, false otherwise.
|
||||||
|
* @return Ignored for normal hooks. For intercept hooks, Plugin_Handled
|
||||||
|
* blocks the message from being sent, and Plugin_Continue
|
||||||
|
* resumes normal functionality.
|
||||||
|
*/
|
||||||
|
function Action (UserMsg msg_id, Protobuf msg, const int[] players, int playersNum, bool reliable, bool init);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a message hook has completed.
|
* Called when a message hook has completed.
|
||||||
|
Loading…
Reference in New Issue
Block a user