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


C++ CDPSrvr::ReceiveMessage方法代码示例

本文整理汇总了C++中CDPSrvr::ReceiveMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ CDPSrvr::ReceiveMessage方法的具体用法?C++ CDPSrvr::ReceiveMessage怎么用?C++ CDPSrvr::ReceiveMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CDPSrvr的用法示例。


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

示例1: Run

void CRunObject::Run( void )
{
	HANDLE hHeartbeat;
	if( !( hHeartbeat = CreateEvent( NULL, FALSE, FALSE, g_sHeartbeat ) ) )
		hHeartbeat	= OpenEvent( EVENT_MODIFY_STATE, FALSE, g_sHeartbeat );
	if( NULL == hHeartbeat )
		Error( "MAPI_E_NOT_ENOUGH_RESOURCES" );
	DWORD dwTickHearbeat = timeGetTime() + SEC( 2 );

	CTimeout	timeoutObject( 67, 0 );
	CTimeout	timeoutReadAgent( 67, 20 );
	CTimeout	timeoutReadCore( 67, 40 );
	CTimeout	timeoutReadTrans( 67, 50 );
	CTimeout	timeoutReadAccount( 67, 60 );
	CTimeout	timeoutRespawn( 1000, 200 );
	CTimeout	timeout( 1000, 600 );
#ifdef __EVENT_1101
	CTimeout	timeoutCallTheRoll( MIN( 1 ), 70 );
#endif	// __EVENT_1101

	DWORD dwCur, dwOld;

	while( WaitForSingleObject( m_hClose, 1 ) != WAIT_OBJECT_0 )
	{
		{
			_PROFILE( "CRunObject::Run()" );
			g_tmCurrent		= timeGetTime();
			g_tCurrent	= time( NULL );
			
			dwCur = g_tmCurrent;
			dwOld = dwCur;

			if( timeoutObject.TimeoutReset( g_tmCurrent ) )
			{
				_PROFILE( "CWorldMng::Process()" );
				g_WorldMng.Process();
				if( g_tmCurrent > dwTickHearbeat )
				{
					SetEvent( hHeartbeat );
					dwTickHearbeat = g_tmCurrent + SEC( 2 );
				}
			}
			
			PROFILE_RUN( r1 );

			if( timeoutReadAgent.TimeoutReset( g_tmCurrent ) )
			{
				_PROFILE( "g_DPSrvr.ReceiveMessage()" );
				g_DPSrvr.ReceiveMessage();
			}

			PROFILE_RUN( r2 );

			if( timeoutReadCore.TimeoutReset( g_tmCurrent ) )
			{
				_PROFILE( "g_DPCoreClient.ReceiveMessage()" );
				g_DPCoreClient.ReceiveMessage();
			}

			PROFILE_RUN( r3 );

			if( timeoutReadTrans.TimeoutReset( g_tmCurrent ) )
			{
				_PROFILE( "g_dpDBClient.ReceiveMessage()" );
				g_dpDBClient.ReceiveMessage();
			}

			PROFILE_RUN( r4 );
		
/*
		#ifdef __GIFTBOX0213
			if( timeoutReadAccount.TimeoutReset( g_tmCurrent ) )
				CDPAccountClient::GetInstance()->ReceiveMessage();
		#endif	// __GIFTBOX0213
*/
		#ifdef __EVENTLUA_KEEPCONNECT
			if( timeoutReadAccount.TimeoutReset( g_tmCurrent ) )
				prj.m_EventLua.KeepConnectEventProcess();
		#endif // __EVENTLUA_KEEPCONNECT
			PROFILE_RUN( r5 );

			if( timeoutRespawn.TimeoutReset( g_tmCurrent ) )
			{
				_PROFILE( "g_WorldMng.Respawn()" );
				u_long uRespawned = g_WorldMng.Respawn();
//				if( uRespawned > 0 )
					SetLogInfo( LOGTYPE_RESPAWN, "Respawn:%d Object:%d", uRespawned, g_WorldMng.GetObjCount() );
			}

			PROFILE_RUN( r6 );
			

			if( timeout.TimeoutReset( g_tmCurrent ) )
			{
				_PROFILE( "1SEC_Process" );
				g_GameTimer.Compute();
				CGuildQuestProcessor::GetInstance()->Process();
				CPartyQuestProcessor::GetInstance()->Process();

				PROFILE_RUN( r7 );
//.........这里部分代码省略.........
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:101,代码来源:ThreadMng.cpp


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