本文整理汇总了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;
}
示例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;
}