core/smn_usermsgs.h
changeset 590 cb5add383a86
parent 589 5c1dd0ca6191
child 593 507e74843261
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/core/smn_usermsgs.h	Sat Mar 10 21:12:40 2007 +0000
     1.3 @@ -0,0 +1,42 @@
     1.4 +/**
     1.5 +* vim: set ts=4 :
     1.6 +* ===============================================================
     1.7 +* SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
     1.8 +* ===============================================================
     1.9 +*
    1.10 +* This file is not open source and may not be copied without explicit
    1.11 +* written permission of AlliedModders LLC.  This file may not be redistributed 
    1.12 +* in whole or significant part.
    1.13 +* For information, see LICENSE.txt or http://www.sourcemod.net/license.php
    1.14 +*
    1.15 +* Version: $Id$
    1.16 +*/
    1.17 +
    1.18 +#ifndef _INCLUDE_SOURCEMOD_CMSGLISTENERWRAPPER_H_
    1.19 +#define _INCLUDE_SOURCEMOD_CMSGLISTENERWRAPPER_H_
    1.20 +
    1.21 +extern int g_MsgPlayers[256];
    1.22 +
    1.23 +class MsgListenerWrapper : public IUserMessageListener
    1.24 +{
    1.25 +public:
    1.26 +	void InitListener(int msgid, IPluginFunction *hook, IPluginFunction *notify, bool intercept);
    1.27 +	bool IsInterceptHook() const;
    1.28 +	int GetMessageId() const;
    1.29 +	IPluginFunction *GetHookedFunction() const;
    1.30 +	IPluginFunction *GetNotifyFunction() const;
    1.31 +public: //IUserMessageListener
    1.32 +	void OnUserMessage(int msg_id, bf_write *bf, IRecipientFilter *pFilter);
    1.33 +	ResultType InterceptUserMessage(int msg_id, bf_write *bf, IRecipientFilter *pFilter);
    1.34 +	void OnUserMessageSent(int msg_id);
    1.35 +private:
    1.36 +	size_t PreparePlArray(int *pl_array, IRecipientFilter *pFilter);
    1.37 +private:
    1.38 +	IPluginFunction *m_Hook;
    1.39 +	IPluginFunction *m_Intercept;
    1.40 +	IPluginFunction *m_Notify;
    1.41 +	bool m_IsInterceptHook;
    1.42 +	int m_MsgId;
    1.43 +};
    1.44 +
    1.45 +#endif //_INCLUDE_SOURCEMOD_CMSGLISTENERWRAPPER_H_