core/smn_usermsgs.h
author David Anderson <dvander@alliedmods.net>
Thu Mar 15 20:44:23 2007 +0000 (2007-03-15)
changeset 619 6934bf39171e
parent 593 507e74843261
child 653 ef60870067ff
permissions -rw-r--r--
random touchups that might not be so great
faluco@552
     1
/**
faluco@552
     2
* vim: set ts=4 :
faluco@552
     3
* ===============================================================
faluco@552
     4
* SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
faluco@552
     5
* ===============================================================
faluco@552
     6
*
faluco@552
     7
* This file is not open source and may not be copied without explicit
faluco@552
     8
* written permission of AlliedModders LLC.  This file may not be redistributed 
faluco@552
     9
* in whole or significant part.
faluco@552
    10
* For information, see LICENSE.txt or http://www.sourcemod.net/license.php
faluco@552
    11
*
faluco@552
    12
* Version: $Id$
faluco@552
    13
*/
faluco@552
    14
faluco@552
    15
#ifndef _INCLUDE_SOURCEMOD_CMSGLISTENERWRAPPER_H_
faluco@552
    16
#define _INCLUDE_SOURCEMOD_CMSGLISTENERWRAPPER_H_
faluco@552
    17
faluco@552
    18
extern int g_MsgPlayers[256];
faluco@552
    19
faluco@552
    20
class MsgListenerWrapper : public IUserMessageListener
faluco@552
    21
{
faluco@552
    22
public:
faluco@593
    23
	void Initialize(int msgid, IPluginFunction *hook, IPluginFunction *notify, bool intercept);
faluco@552
    24
	bool IsInterceptHook() const;
faluco@552
    25
	int GetMessageId() const;
faluco@552
    26
	IPluginFunction *GetHookedFunction() const;
faluco@552
    27
	IPluginFunction *GetNotifyFunction() const;
faluco@552
    28
public: //IUserMessageListener
faluco@552
    29
	void OnUserMessage(int msg_id, bf_write *bf, IRecipientFilter *pFilter);
faluco@552
    30
	ResultType InterceptUserMessage(int msg_id, bf_write *bf, IRecipientFilter *pFilter);
faluco@552
    31
	void OnUserMessageSent(int msg_id);
faluco@552
    32
private:
faluco@593
    33
	size_t _FillInPlayers(int *pl_array, IRecipientFilter *pFilter);
faluco@552
    34
private:
faluco@552
    35
	IPluginFunction *m_Hook;
faluco@552
    36
	IPluginFunction *m_Intercept;
faluco@552
    37
	IPluginFunction *m_Notify;
faluco@552
    38
	bool m_IsInterceptHook;
faluco@552
    39
	int m_MsgId;
faluco@552
    40
};
faluco@552
    41
faluco@552
    42
#endif //_INCLUDE_SOURCEMOD_CMSGLISTENERWRAPPER_H_