core/smn_usermsgs.h
author David Anderson <dvander@alliedmods.net>
Sun Jun 17 07:32:31 2007 +0000 (2007-06-17)
changeset 969 0cd7fc27e054
parent 653 ef60870067ff
child 1231 17badaf66ce4
permissions -rw-r--r--
fixed a state bug in the gameconf parser that would break parsing after a signature section was done
faluco@552
     1
/**
ds@653
     2
 * vim: set ts=4 :
ds@653
     3
 * ===============================================================
ds@653
     4
 * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
ds@653
     5
 * ===============================================================
ds@653
     6
 *
ds@653
     7
 * This file is not open source and may not be copied without explicit
ds@653
     8
 * written permission of AlliedModders LLC.  This file may not be redistributed 
ds@653
     9
 * in whole or significant part.
ds@653
    10
 * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
ds@653
    11
 *
ds@653
    12
 * Version: $Id$
ds@653
    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_