当前位置: 首页>>代码示例>>C++>>正文


C++ RETURN_META_VALUE函数代码示例

本文整理汇总了C++中RETURN_META_VALUE函数的典型用法代码示例。如果您正苦于以下问题:C++ RETURN_META_VALUE函数的具体用法?C++ RETURN_META_VALUE怎么用?C++ RETURN_META_VALUE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了RETURN_META_VALUE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: RETURN_META_VALUE

bool CForwardManager::OnSpectatorExecuteStringCommand(const char *s)
{
	if (!hltvserver)
		RETURN_META_VALUE(MRES_IGNORED, true);

	IClient *client = META_IFACEPTR(IClient);
	if (!s || !s[0])
		RETURN_META_VALUE(MRES_IGNORED, true);

	CCommand args;
	if (!args.Tokenize(s))
		RETURN_META_VALUE(MRES_IGNORED, true);

	// See if the client wants to chat.
	if (!Q_stricmp(args[0], "say") && args.ArgC() > 1)
	{
		// TODO find correct hltvserver this client is connected to!

		// Save the client index and message.
		hltvserver->SetLastChatClient(client);
		hltvserver->SetLastChatMessage(args[1]);
	}

	RETURN_META_VALUE(MRES_IGNORED, true);
}
开发者ID:peace-maker,项目名称:sourcetvmanager,代码行数:25,代码来源:forwards.cpp

示例2: RETURN_META_VALUE

EGCResults SteamWorksGCHooks::SendMessage(uint32 unMsgType, const void *pubData, uint32 cubData)
{
	if (this->pGCSendMsg->GetFunctionCount() == 0)
	{
		RETURN_META_VALUE(MRES_IGNORED, k_EGCResultOK);
	}

	cell_t Result = k_EGCResultOK;
	this->pGCSendMsg->PushCell(unMsgType);
	this->pGCSendMsg->PushStringEx(reinterpret_cast<char *>(const_cast<void *>(pubData)), cubData, SM_PARAM_STRING_BINARY | SM_PARAM_STRING_COPY, 0);
	this->pGCSendMsg->PushCell(cubData);
	this->pGCSendMsg->Execute(&Result);

	if (Result != k_EGCResultOK)
	{
		if (Result == -1)
		{
			Result = k_EGCResultOK;
		}

		RETURN_META_VALUE(MRES_SUPERCEDE, static_cast<EGCResults>(Result));
	}

	RETURN_META_VALUE(MRES_IGNORED, k_EGCResultOK);
}
开发者ID:KyleSanderson,项目名称:SteamWorks,代码行数:25,代码来源:swgchooks.cpp

示例3: UpdateValveGlobals

bool SDKTools::LevelInit(char const *pMapName, char const *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background)
{
	m_bAnyLevelInited = true;

	UpdateValveGlobals();

	const char *name;
	char key[32];
	int count, n = 1;

	if (!(name=g_pGameConf->GetKeyValue("SlapSoundCount")))
	{
		RETURN_META_VALUE(MRES_IGNORED, true);
	}

	count = atoi(name);

	while (n <= count)
	{
		snprintf(key, sizeof(key), "SlapSound%d", n);
		if ((name=g_pGameConf->GetKeyValue(key)))
		{
			engsound->PrecacheSound(name, true);
		}
		n++;
	}

	RETURN_META_VALUE(MRES_IGNORED, true);
}
开发者ID:DJLaca,项目名称:sourcemod,代码行数:29,代码来源:extension.cpp

示例4: RETURN_META_VALUE

bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_type)
{
	bool is_intercept_empty = m_msgIntercepts[msg_type].empty();
	bool is_hook_empty = m_msgHooks[msg_type].empty();

	if ((is_intercept_empty && is_hook_empty)
		|| (m_InExec && (m_CurFlags & USERMSG_BLOCKHOOKS)))
	{
		m_InHook = false;
		RETURN_META_VALUE(MRES_IGNORED, NULL);
	}

	m_CurId = msg_type;
	m_CurRecFilter = filter;
	m_InHook = true;
	m_BlockEndPost = false;

	if (!is_intercept_empty)
	{
		m_InterceptBuffer.Reset();
		RETURN_META_VALUE(MRES_SUPERCEDE, &m_InterceptBuffer);
	}

	RETURN_META_VALUE(MRES_IGNORED, NULL);
}
开发者ID:Nephyrin,项目名称:-furry-octo-nemesis,代码行数:25,代码来源:UserMessages.cpp

示例5: META_IFACEPTR

bool HolidayManager::Hook_IsHolidayActive(int holiday)
{
	void *pGameRules = META_IFACEPTR(void *);

	bool actualres = SH_MCALL(pGameRules, IsHolidayActive)(holiday);
	if (!m_isHolidayForward)
	{
		g_pSM->LogMessage(myself, "Invalid Forward");
		RETURN_META_VALUE(MRES_IGNORED, true);
	}

	cell_t result = 0;
	cell_t newres = actualres ? 1 : 0;

	m_isHolidayForward->PushCell(holiday);
	m_isHolidayForward->PushCellByRef(&newres);
	m_isHolidayForward->Execute(&result);

	if (result > Pl_Continue)
	{
		RETURN_META_VALUE(MRES_SUPERCEDE, (newres == 0) ? false : true);
	}

	RETURN_META_VALUE(MRES_IGNORED, true);
}
开发者ID:404UserNotFound,项目名称:sourcemod,代码行数:25,代码来源:holiday.cpp

示例6: OnClientConnectPost

qboolean OnClientConnectPost( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] )
{
    if( Initialized && sv_allowdownload->value > 0 )
    {
        if( cvar_enable_debug->value > 0 )
        {
            ModuleDebug.append( UTIL_VarArgs( "\n\"%s\" (index = %d, address = %s) is connecting.\n", pszName, ENTINDEX( pEntity ), pszAddress ) );
        }

        if( rm_enable_downloadfix.value <= 0 )
        {
            NotifyClientDisconnectHook->Restore();
            RETURN_META_VALUE( MRES_IGNORED, TRUE );
        }
        else
        {
            NotifyClientDisconnectHook->Patch();
        }

        char	ip[ 16 ];
        uint32	player				= ENTINDEX( pEntity );
        time_t	timeSystem			= getSysTime();
        time_t*	nextReconnectTime	= &PlayerNextReconnectTime[ player ];
        String*	currentPlayerIp		= &PlayerCurrentIp[ player ];

        // Retrieve server IP one time from there because
        // we need to let server.cfg be executed in case
        // a specific ip is provided and because I have not
        // found forward to use to put this call at this time.
        retrieveServerIp( &ServerInternetIp );

        // Retrieve the current client's IP without the port.
        retrieveClientIp( ip, pszAddress );

        // Sanity IP address check to make sure the index
        // is our expected player. If not, we consider it
        // as a new player and we reset variables to the default.
        if( currentPlayerIp->compare( ip ) )
        {
            *nextReconnectTime = 0;

            currentPlayerIp->clear();
            currentPlayerIp->assign( ip );
        }

        // We are allowed to reconnect the player.
        // We put a cool down of 3 seconds minimum to avoid possible
        // infinite loop since depending where it will download resources,
        // it can connect/disconnect several times.
        if( *nextReconnectTime < timeSystem )
        {
            *nextReconnectTime = timeSystem + 3;
            CLIENT_COMMAND( pEntity, "Connect %s %d\n", isLocalIp( ip ) ? ServerLocalIp.c_str() : ServerInternetIp.c_str(), RANDOM_LONG( 1, 9999 ) );
        }
    }

    RETURN_META_VALUE( MRES_IGNORED, TRUE );
}
开发者ID:Arkshine,项目名称:HTTP-Resources-Manager,代码行数:58,代码来源:moduleMain.cpp

示例7: RETURN_META_VALUE

/* IGameEventManager2::FireEvent hook */
bool EventManager::OnFireEvent(IGameEvent *pEvent, bool bDontBroadcast)
{
	EventHook *pHook;
	IChangeableForward *pForward;
	const char *name;
	cell_t res = Pl_Continue;

	/* The engine accepts NULL without crashing, so to prevent a crash in SM we ignore these */
	if (!pEvent)
	{
		RETURN_META_VALUE(MRES_IGNORED, false);
	}

	name = pEvent->GetName();
	
	if (sm_trie_retrieve(m_EventHooks, name, reinterpret_cast<void **>(&pHook)))
	{
		/* Push the event onto the event stack.  The reference count is increased to make sure 
		 * the structure is not garbage collected in between now and the post hook.
		 */
		pHook->refCount++;
		m_EventStack.push(pHook);

		pForward = pHook->pPreHook;

		if (pForward)
		{
			EventInfo info(pEvent, NULL);
			HandleSecurity sec(NULL, g_pCoreIdent);
			Handle_t hndl = g_HandleSys.CreateHandle(m_EventType, &info, NULL, g_pCoreIdent, NULL);

			pForward->PushCell(hndl);
			pForward->PushString(name);
			pForward->PushCell(bDontBroadcast);
			pForward->Execute(&res, NULL);

			g_HandleSys.FreeHandle(hndl, &sec);
		}

		if (pHook->postCopy)
		{
			m_EventCopies.push(gameevents->DuplicateEvent(pEvent));
		}

		if (res)
		{
			gameevents->FreeEvent(pEvent);
			RETURN_META_VALUE(MRES_SUPERCEDE, false);
		}
	}
	else
	{
		m_EventStack.push(NULL);
	}

	RETURN_META_VALUE(MRES_IGNORED, true);
}
开发者ID:asceth,项目名称:synapi,代码行数:58,代码来源:EventManager.cpp

示例8: RETURN_META_VALUE

bool HLTVServerWrapper::OnHLTVBotExecuteStringCommand_Post(const char *s)
{
	if (!host_client || !g_HostClientOverridden)
		RETURN_META_VALUE(MRES_IGNORED, 0);

	*(void **)host_client = old_host_client;
	g_HostClientOverridden = false;
	RETURN_META_VALUE(MRES_IGNORED, 0);
}
开发者ID:joeystandrew,项目名称:sourcetvmanager,代码行数:9,代码来源:hltvserverwrapper.cpp

示例9: RETURN_META_VALUE

bool	ManiSMMHooks::Weapon_CanUse(CBaseCombatWeapon *pWeapon)
{
	if (!gpManiWeaponMgr->CanPickUpWeapon(META_IFACEPTR(CBasePlayer), pWeapon))
	{
		RETURN_META_VALUE(MRES_SUPERCEDE, false);
	}
	
	RETURN_META_VALUE(MRES_IGNORED, true);
}
开发者ID:gunslinger23,项目名称:maniadminplugin,代码行数:9,代码来源:mani_callback_sourcemm.cpp

示例10: TestKeyValue

bool TestKeyValue( const char *szKeyName, const char *szValue )
{
    if(!strcmp(szKeyName, "sophooktest"))
    {
        //Msg("You've been hooked already!\n");
        g_hookTest = 1;
        RETURN_META_VALUE(MRES_SUPERCEDE, 0);
    }
    RETURN_META_VALUE(MRES_HANDLED, 0);
}
开发者ID:apaloma,项目名称:sourceop,代码行数:10,代码来源:CAOPEntity.cpp

示例11: RETURN_META_VALUE

/* IGameEventManager2::FireEvent post hook */
bool EventManager::OnFireEvent_Post(IGameEvent *pEvent, bool bDontBroadcast)
{
	IGameEvent *pEventCopy = NULL;
	EventHook *pHook;
	IChangeableForward *pForward;
	const char *name;
	Handle_t hndl = 0;

	/* The engine accepts NULL without crashing, so to prevent a crash in SM we ignore these */
	if (!pEvent)
	{
		RETURN_META_VALUE(MRES_IGNORED, false);
	}

	name = m_EventNames.front();

	if (sm_trie_retrieve(m_EventHooks, name, reinterpret_cast<void **>(&pHook)))
	{
		pForward = pHook->pPostHook;

		if (pForward)
		{
			EventInfo info = { pHook->pEventCopy, NULL };

			if (pHook->postCopy)
			{
				hndl = g_HandleSys.CreateHandle(m_EventType, &info, NULL, g_pCoreIdent, NULL);

				pForward->PushCell(hndl);
			} else {
				pForward->PushCell(BAD_HANDLE);
			}

			pForward->PushString(name);
			pForward->PushCell(bDontBroadcast);
			pForward->Execute(NULL);

			if (pHook->postCopy)
			{
				/* Free handle */
				HandleSecurity sec(NULL, g_pCoreIdent);
				g_HandleSys.FreeHandle(hndl, &sec);

				/* Free event structure */
				gameevents->FreeEvent(pEventCopy);
				pHook->pEventCopy = NULL;
			}
		}
	}

	m_EventNames.pop();

	RETURN_META_VALUE(MRES_IGNORED, true);
}
开发者ID:Nephyrin,项目名称:-furry-octo-nemesis,代码行数:55,代码来源:EventManager.cpp

示例12: defined

bf_write *ManiSMMHooks::UserMessageBegin(IRecipientFilter *filter, int msg_type)
#endif
{

	if ( mani_hint_sounds.GetBool() ) 
	{
#if defined ( GAME_CSGO )
		RETURN_META(MRES_IGNORED);
#else	
		RETURN_META_VALUE(MRES_IGNORED,NULL);
#endif		
	}

	player_t player;
	if ( msg_type == hintMsg_message_index ) 
	{
#if defined ( GAME_CSGO )
		for ( int i = 0; i < filter.GetRecipientCount(); i++ ) 
		{
			player.index = filter.GetRecipientIndex(i);
#else	
		for ( int i = 0; i < filter->GetRecipientCount(); i++ ) 
		{
			player.index = filter->GetRecipientIndex(i);
#endif			
			if ( !FindPlayerByIndex(&player) ) continue;

			//Stop Sound!!!
#if defined ( GAME_CSGO )
			esounds->StopSound( player.index, 6, "UI/hint.wav", 0 );
#else
			esounds->StopSound( player.index, 6, "UI/hint.wav");
#endif
		}
	}
#if defined ( GAME_CSGO )
	RETURN_META(MRES_IGNORED);
#else	
	RETURN_META_VALUE(MRES_IGNORED,NULL);
#endif	
}
#endif // GAME_ORANGE

#ifdef GAME_ORANGE
void RespawnEntities_handler(const CCommand &command)
#else
void RespawnEntities_handler()
#endif
{
	//Override exploit
	RETURN_META(MRES_SUPERCEDE);
} 
开发者ID:gunslinger23,项目名称:maniadminplugin,代码行数:52,代码来源:mani_sourcehook.cpp

示例13: ENGINE_TRACE

void *PvAllocEntPrivateData(edict_t *pEdict, long cb) {
#else
void *PvAllocEntPrivateData(edict_t *pEdict, int32 cb) {
#endif
	ENGINE_TRACE(pfnPvAllocEntPrivateData, P_PRE, (""));
	RETURN_META_VALUE(MRES_IGNORED, NULL);
}
开发者ID:CecilHarvey,项目名称:RealBot,代码行数:7,代码来源:engine_api.cpp

示例14: OnCreateNamedEntity

edict_s* OnCreateNamedEntity(int classname)
{
	if (NoKifesMode)
	{
		if (!strcmp(STRING(classname), "weapon_knife"))
		{
			RETURN_META_VALUE(MRES_SUPERCEDE, nullptr);
		}
	}
	else
	{
		g_pengfuncsTable->pfnCreateNamedEntity = nullptr;
	}

	RETURN_META_VALUE(MRES_IGNORED, 0);
}
开发者ID:VasilVasilev93,项目名称:amxmodx,代码行数:16,代码来源:CstrikeHacks.cpp

示例15: RETURN_META_VALUE

float [!output PLUGIN_CLASS]::HookedProcessUsercmds(edict_t* player, bf_read* buf, int num_cmds, int total_cmds, 
                                                    int dropped_packets, bool ignore, bool paused)
{
  // TODO: Implement Method

  RETURN_META_VALUE(MRES_IGNORED, 0.0f);
}
开发者ID:DeadZoneLuna,项目名称:metamod-source,代码行数:7,代码来源:plugin_hooks.cpp


注:本文中的RETURN_META_VALUE函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。