added new block_message flag in the message system
authorBorja Ferrer <faluco@alliedmods.net>
Thu Aug 02 00:47:47 2007 +0000 (2007-08-02)
changeset 12508241c207b514
parent 1249 54fbd318a660
child 1251 7f9d418693a8
added new block_message flag in the message system
core/UserMessages.cpp
plugins/include/usermessages.inc
public/IUserMessages.h
     1.1 --- a/core/UserMessages.cpp	Thu Aug 02 00:28:32 2007 +0000
     1.2 +++ b/core/UserMessages.cpp	Thu Aug 02 00:47:47 2007 +0000
     1.3 @@ -163,11 +163,11 @@
     1.4  
     1.5  	m_InExec = true;
     1.6  
     1.7 -	if (m_CurFlags & (USERMSG_PASSTHRU_ALL|USERMSG_PASSTHRU))
     1.8 +	if (m_CurFlags & USERMSG_BLOCKHOOKS)
     1.9  	{
    1.10 +		buffer = ENGINE_CALL(UserMessageBegin)(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id);
    1.11 +	} else {
    1.12  		buffer = engine->UserMessageBegin(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id);
    1.13 -	} else {
    1.14 -		buffer = ENGINE_CALL(UserMessageBegin)(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id);
    1.15  	}
    1.16  
    1.17  	return buffer;
    1.18 @@ -180,11 +180,11 @@
    1.19  		return false;
    1.20  	}
    1.21  
    1.22 -	if (m_CurFlags & (USERMSG_PASSTHRU_ALL|USERMSG_PASSTHRU))
    1.23 +	if (m_CurFlags & USERMSG_BLOCKHOOKS)
    1.24  	{
    1.25 +		ENGINE_CALL(MessageEnd)();
    1.26 +	} else {
    1.27  		engine->MessageEnd();
    1.28 -	} else {
    1.29 -		ENGINE_CALL(MessageEnd)();
    1.30  	}
    1.31  
    1.32  	m_InExec = false;
    1.33 @@ -286,7 +286,7 @@
    1.34  	bool is_hook_empty = m_msgHooks[msg_type].empty();
    1.35  
    1.36  	if ((is_intercept_empty && is_hook_empty)
    1.37 -		|| (m_InExec && !(m_CurFlags & USERMSG_PASSTHRU_ALL)))
    1.38 +		|| (m_InExec && (m_CurFlags & USERMSG_BLOCKHOOKS)))
    1.39  	{
    1.40  		m_InHook = false;
    1.41  		RETURN_META_VALUE(MRES_IGNORED, NULL);
     2.1 --- a/plugins/include/usermessages.inc	Thu Aug 02 00:28:32 2007 +0000
     2.2 +++ b/plugins/include/usermessages.inc	Thu Aug 02 00:47:47 2007 +0000
     2.3 @@ -33,9 +33,10 @@
     2.4  #define USERMSG_PASSTHRU_ALL		(1<<1)		/**< (DEPRECATED, NO EFFECT) */
     2.5  #define USERMSG_RELIABLE		(1<<2)		/**< Message will be set on the reliable stream */
     2.6  #define USERMSG_INITMSG			(1<<3)		/**< Message will be considered to be an initmsg */
     2.7 -#define USERMSG_BLOCK_MM		(1<<4)		/**< Message will be blocked from going through MM:S hooks */
     2.8 -#define USERMSG_BLOCK_SM		(1<<5)		/**< Message will be blocked from going through SourceMod hooks */
     2.9 -#define USERMSG_BLOCK_ALL		(1<<6)		/**< Message will be blocked from going through any hooks */
    2.10 +#define USERMSG_BLOCK_MM		(1<<4)		/**< (DEPRECATED, NO EFFECT) */
    2.11 +#define USERMSG_BLOCK_SM		(1<<5)		/**< (DEPRECATED, NO EFFECT) */
    2.12 +#define USERMSG_BLOCK_ALL		(1<<6)		/**< (DEPRECATED, NO EFFECT) */
    2.13 +#define USERMSG_BLOCKHOOKS		(1<<7)		/**< Prevents the message from triggering SourceMod and Metamod hooks */
    2.14  
    2.15  /**
    2.16   * @endsection
     3.1 --- a/public/IUserMessages.h	Thu Aug 02 00:28:32 2007 +0000
     3.2 +++ b/public/IUserMessages.h	Thu Aug 02 00:47:47 2007 +0000
     3.3 @@ -89,10 +89,9 @@
     3.4  		}
     3.5  	};
     3.6  
     3.7 -	#define USERMSG_PASSTHRU			(1<<0)		/**< Message will pass through other SourceMM plugins */
     3.8 -	#define USERMSG_PASSTHRU_ALL		(1<<1)		/**< Message will pass through other SourceMM plugins AND SourceMod */
     3.9  	#define USERMSG_RELIABLE			(1<<2)		/**< Message will be set to reliable */
    3.10  	#define USERMSG_INITMSG				(1<<3)		/**< Message will be considered to be an initmsg */
    3.11 +	#define USERMSG_BLOCKHOOKS			(1<<7)		/**< Prevents the message from triggering SourceMod and Metamod hooks */
    3.12  
    3.13  	/**
    3.14  	 * @brief Contains functions for hooking user messages.