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


C++ USER::RecvMail方法代码示例

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


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

示例1: Execute

uint GWMailHandler::Execute( GWMail* pPacket, Player* pPlayer )
{
__ENTER_FUNCTION

	USER* pUser = g_pOnlineUser->FindUser( pPacket->GetMail()->m_szDestName );
	if( pUser  && (pUser->UserStatus() != US_OFFLINE) )
	{//当前用户在线
		if( pUser->RecvMail( pPacket->GetMail() ) == FALSE )
		{
			Log::SaveLog( WORLD_LOGFILE, "GWMailHandler...dName=%s refuse sName=%s's mail.",
				pUser->GetName(), pPacket->GetMail()->m_szSourName );

			return PACKET_EXE_CONTINUE;
		}
	}
	else
	{
		g_pMailCenter->MailTo( pPacket->GetMail() );
	}

	Log::SaveLog( WORLD_LOGFILE, "GWMailHandler...sName=%s dName=%s",
		(pPacket->GetMail()->m_SourSize > 0)?pPacket->GetMail()->m_szSourName:"",
		pPacket->GetMail()->m_szDestName );

	return PACKET_EXE_CONTINUE;

__LEAVE_FUNCTION

	return PACKET_EXE_ERROR;
}
开发者ID:uvbs,项目名称:wx2Server,代码行数:30,代码来源:GWMailHandler.cpp

示例2: Execute

uint GWBatchMailHandler::Execute( GWBatchMail* pPacket, Player* pPlayer )
{
__ENTER_FUNCTION

	USER* pUser = NULL;
	BATCH_MAIL* pBatchMail = pPacket->GetBatchMail();

	MAIL mail;
	mail.m_GUID = pBatchMail->GetGUID();
	strncpy( mail.m_szSourName, pBatchMail->GetSourName(), MAX_CHARACTER_NAME - 1 );
	mail.m_SourSize = (BYTE)strlen( mail.m_szSourName );
	strncpy( mail.m_szContex, pBatchMail->GetMailContent(), MAX_MAIL_CONTEX - 1 );
	mail.m_ContexSize = (WORD)strlen( mail.m_szContex );
	mail.m_uFlag = pBatchMail->GetMailFlag();
	mail.m_uCreateTime = pBatchMail->GetCreateTime();

	for( BYTE i=0; i<pBatchMail->GetReceiverCount(); ++i )
	{
		strncpy( mail.m_szDestName, pBatchMail->GetDestName(i), MAX_CHARACTER_NAME - 1 );
		mail.m_DestSize = (BYTE)strlen( mail.m_szDestName );

		pUser = g_pOnlineUser->FindUser( mail.m_szDestName );
		if( pUser )
		{//当前用户在线
			if( pUser->RecvMail( &mail ) == FALSE )
			{
				Log::SaveLog( WORLD_LOGFILE, "GWBatchMailHandler...dName=%s refuse sName=%s's mail.",
					pUser->GetName(), mail.m_szSourName );

				return PACKET_EXE_CONTINUE;
			}
		}
		else
		{
			g_pMailCenter->MailTo( &mail );
		}

		Log::SaveLog( WORLD_LOGFILE, "GWBatchMailHandler...sName=%s dName=%s",
			mail.m_szSourName, mail.m_szDestName );

	}

	return PACKET_EXE_CONTINUE;

__LEAVE_FUNCTION

	return PACKET_EXE_ERROR;
}
开发者ID:xu561865,项目名称:TL_Server,代码行数:48,代码来源:GWBatchMailHandler.cpp


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