core/smn_usermsgs.h
author David Anderson <dvander@alliedmods.net>
Sun Jul 29 02:44:37 2007 +0000 (2007-07-29)
changeset 1209 abcf0a55a177
parent 653 ef60870067ff
child 1231 17badaf66ce4
permissions -rw-r--r--
fixed linux build for mysql
     1 /**
     2  * vim: set ts=4 :
     3  * ===============================================================
     4  * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
     5  * ===============================================================
     6  *
     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
    11  *
    12  * Version: $Id$
    13  */
    14 
    15 #ifndef _INCLUDE_SOURCEMOD_CMSGLISTENERWRAPPER_H_
    16 #define _INCLUDE_SOURCEMOD_CMSGLISTENERWRAPPER_H_
    17 
    18 extern int g_MsgPlayers[256];
    19 
    20 class MsgListenerWrapper : public IUserMessageListener
    21 {
    22 public:
    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);
    32 private:
    33 	size_t _FillInPlayers(int *pl_array, IRecipientFilter *pFilter);
    34 private:
    35 	IPluginFunction *m_Hook;
    36 	IPluginFunction *m_Intercept;
    37 	IPluginFunction *m_Notify;
    38 	bool m_IsInterceptHook;
    39 	int m_MsgId;
    40 };
    41 
    42 #endif //_INCLUDE_SOURCEMOD_CMSGLISTENERWRAPPER_H_