32 #ifndef _INCLUDE_SOURCEMOD_INTERFACE_USERMESSAGES_H_
33 #define _INCLUDE_SOURCEMOD_INTERFACE_USERMESSAGES_H_
36 #include <sp_vm_api.h>
38 #include <irecipientfilter.h>
40 namespace google {
namespace protobuf {
51 #define SMINTERFACE_USERMSGS_NAME "IUserMessages"
52 #define SMINTERFACE_USERMSGS_VERSION 4
85 return SMINTERFACE_USERMSGS_VERSION;
100 virtual UserMessageType GetUserMessageType()
const =0;
114 virtual void OnUserMessage(
int msg_id, bf_write *bf, IRecipientFilter *pFilter)
131 virtual UserMessageType GetUserMessageType()
const
148 virtual void OnUserMessage(
int msg_id, google::protobuf::Message *msg, IRecipientFilter *pFilter)
165 virtual UserMessageType GetUserMessageType()
const
171 #define USERMSG_RELIABLE (1<<2)
172 #define USERMSG_INITMSG (1<<3)
173 #define USERMSG_BLOCKHOOKS (1<<7)
178 class IUserMessages : public SMInterface
183 return SMINTERFACE_USERMSGS_VERSION;
187 return SMINTERFACE_USERMSGS_NAME;
196 virtual int GetMessageIndex(
const char *msg) =0;
206 virtual bool HookUserMessage(
int msg_id,
208 bool intercept=
false) =0;
219 virtual bool UnhookUserMessage(
int msg_id,
221 bool intercept=
false) =0;
232 virtual bf_write *StartBitBufMessage(
int msg_id,
233 const cell_t players[],
234 unsigned int playersNum,
237 virtual google::protobuf::Message *StartProtobufMessage(
int msg_id,
238 const cell_t players[],
239 unsigned int playersNum,
246 virtual bool EndMessage() =0;
256 virtual bool HookUserMessage2(
int msg_id,
258 bool intercept=
false) =0;
269 virtual bool UnhookUserMessage2(
int msg_id,
271 bool intercept=
false) =0;
281 virtual bool GetMessageName(
int msgid,
char *buffer,
size_t maxlength)
const =0;
288 virtual UserMessageType GetUserMessageType()
const =0;
292 #endif //_INCLUDE_SOURCEMOD_INTERFACE_USERMESSAGES_H_
Defines the interface for managing collections ("forwards") of plugin calls.
virtual void OnPostUserMessage(int msg_id, bool sent)
Called when a hooked user message hook is finished, regardless of the hook type.
Definition: IUserMessages.h:96
Defines the Share System, responsible for shared resources and dependencies.
virtual const char * GetInterfaceName()
Must return a string defining the interface's unique name.
Definition: IUserMessages.h:185
virtual void OnUserMessage(int msg_id, bf_write *bf, IRecipientFilter *pFilter)
Called when a hooked user message is being sent and all interceptions have finished.
Definition: IUserMessages.h:114
virtual void OnUserMessage(int msg_id, google::protobuf::Message *msg, IRecipientFilter *pFilter)
Called when a hooked user message is being sent and all interceptions have finished.
Definition: IUserMessages.h:148
virtual ResultType InterceptUserMessage(int msg_id, google::protobuf::Message *msg, IRecipientFilter *pFilter)
Called when a hooked user message is intercepted.
Definition: IUserMessages.h:160
virtual ResultType InterceptUserMessage(int msg_id, bf_write *bf, IRecipientFilter *pFilter)
Called when a hooked user message is intercepted.
Definition: IUserMessages.h:126
virtual unsigned int GetUserMessageAPIVersion()
Returns the user message API version.
Definition: IUserMessages.h:83
Definition: IAdminSystem.h:63
virtual void OnUserMessageSent(int msg_id)
Called when a hooked user message is sent, regardless of the hook type.
Definition: IUserMessages.h:76
Definition: IUserMessages.h:103
virtual unsigned int GetInterfaceVersion()
Must return an integer defining the interface's version.
Definition: IUserMessages.h:181
Definition: IUserMessages.h:40
Listens to user messages sent from the server.
Definition: IUserMessages.h:65
Definition: IUserMessages.h:137