3 * ===============================================================
4 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
5 * ===============================================================
7 * This file is not open source and may not be copied without explicit
8 * written permission of AlliedModders LLC. This file may not be redistributed
9 * in whole or significant part.
10 * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
15 #ifndef _INCLUDE_SOURCEMOD_CMSGLISTENERWRAPPER_H_
16 #define _INCLUDE_SOURCEMOD_CMSGLISTENERWRAPPER_H_
18 extern int g_MsgPlayers[256];
20 class MsgListenerWrapper : public IUserMessageListener
23 void Initialize(int msgid, IPluginFunction *hook, IPluginFunction *notify, bool intercept);
24 bool IsInterceptHook() const;
25 int GetMessageId() const;
26 IPluginFunction *GetHookedFunction() const;
27 IPluginFunction *GetNotifyFunction() const;
28 public: //IUserMessageListener
29 void OnUserMessage(int msg_id, bf_write *bf, IRecipientFilter *pFilter);
30 ResultType InterceptUserMessage(int msg_id, bf_write *bf, IRecipientFilter *pFilter);
31 void OnUserMessageSent(int msg_id);
33 size_t _FillInPlayers(int *pl_array, IRecipientFilter *pFilter);
35 IPluginFunction *m_Hook;
36 IPluginFunction *m_Intercept;
37 IPluginFunction *m_Notify;
38 bool m_IsInterceptHook;
42 #endif //_INCLUDE_SOURCEMOD_CMSGLISTENERWRAPPER_H_