本文整理汇总了C++中USER::GetMood方法的典型用法代码示例。如果您正苦于以下问题:C++ USER::GetMood方法的具体用法?C++ USER::GetMood怎么用?C++ USER::GetMood使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类USER
的用法示例。
在下文中一共展示了USER::GetMood方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FillOnlineList
// 填充密友在线列表
VOID USER::FillOnlineList( RETURN_ONLINE_LIST* pSend )
{
__ENTER_FUNCTION
Assert( pSend );
const _RELATION_USER* pRUser;
for( INT i=0; i<MAX_RELATION_SIZE; ++i )
{
pRUser = &(m_RelationData.m_RelationList.m_RelationUsers[i]);
if( (pRUser->m_UserGUID != INVALID_ID) && (pRUser->m_nFriendPoint >= g_Config.m_ConfigInfo.m_nPromptPoint) )
{
USER* pFriend;
pFriend = g_pOnlineUser->FindUser( pRUser->m_UserGUID );
if( pFriend != NULL && pFriend->IsGoodFriend( GetGUID() ) ) // 在线玩家
{
_RELATION_ONLINE OnlineRelation;
OnlineRelation.SetGUID( pFriend->GetGUID() );
OnlineRelation.SetMood( pFriend->GetMood() );
pSend->AddOnlineRelation( &OnlineRelation );
}
}
}
__LEAVE_FUNCTION
}
示例2: Execute
//.........这里部分代码省略.........
case REQ_DELFRIEND:
case REQ_DELFROMBLACKLIST:
pUser->DelRelation( pRelationPacket->m_RelationGUID.GetTargetGUID() );
return PACKET_EXE_CONTINUE;
case REQ_TRANSITION:
{
RELATION_GUID_UCHAR& Relation = pRelationPacket->m_TransitionRelation;
pUser->DelRelation( Relation.GetTargetGUID() );
_RELATION_USER RUser;
RUser.m_UserGUID = Relation.GetTargetGUID();
RUser.m_RelationType = (RELATION_TYPE)Relation.GetRelationType();
RUser.m_nFriendPoint = 0;
pUser->AddRelation( Relation.GetTargetGUID(), &RUser );
return PACKET_EXE_CONTINUE;
}
break;
case REQ_NEWGOODFRIEND:
{ // 加入一个亲密好友
pUser->AddGoodFriend( pRelationPacket->m_RelationGUID.GetTargetGUID() );
return PACKET_EXE_CONTINUE;
}
break;
case REQ_RELATIONONLINE:
{ // 获取密友的在线列表
Msg.GetRelation()->m_Type = RET_ONLINELIST;
RETURN_ONLINE_LIST* pSend = &(Msg.GetRelation()->m_RelationOnline);
pSend->CleanUp();
pUser->FillOnlineList(pSend);
}
break;
case REQ_MODIFYMOOD:
{
pUser->SetMood( pRelationPacket->m_ModifyMood.GetMood() );
return PACKET_EXE_CONTINUE;
}
break;
case REQ_MODIFYSETTINGS:
{
pUser->SetSettings( pRelationPacket->m_Settings.GetSettings() );
return PACKET_EXE_CONTINUE;
}
break;
case REQ_NOTIFY_ADDTEMPFRIEND:
{
REQUEST_VIEW_PLAYER& Recv = pRelationPacket->m_ViewPlayer;
if ( strlen(Recv.GetTargetName()) > 0 )
{
pTargetUser = g_pOnlineUser->FindUser( Recv.GetTargetName() );
}
if ( pTargetUser == NULL )
{ // 玩家可能不存在也可能不在线,由 Server 来判断
Log::SaveLog( WORLD_LOGFILE, "GWRelationHandler...User GUID=%s not find!",
Recv.GetTargetName() );
return PACKET_EXE_CONTINUE;
}
Msg.GetRelation()->m_Type = RET_NOTIFY_ADDTEMPFRIEND;
REQUEST_VIEW_PLAYER* pSend = &(Msg.GetRelation()->m_PlayerName);
pSend->CleanUp();
pSend->SetTargetName( pUser->GetName() );
}
break;
default :
示例3: Execute
//.........这里部分代码省略.........
}
else if ( Relation.GetRelationType() == RELATION_TYPE_FRIEND )
{// 向客户端发回该玩家已经移动到好友消息
WGRelation FriendListMsg;
FriendListMsg.GetRelation()->CleanUp();
FriendListMsg.GetRelation()->SetPlayerID( pUser->GetPlayerID() );
FriendListMsg.GetRelation()->m_Type = RET_ASKTHROWTOFRIENDLIST;
FriendListMsg.GetRelation()->m_NotifyFriend.CleanUp();
FriendListMsg.GetRelation()->m_NotifyFriend.SetGUID( Relation.GetTargetGUID() );
pServerPlayer->SendPacket( &FriendListMsg );
}
return PACKET_EXE_CONTINUE;
}
break;
case REQ_NEWGOODFRIEND:
{ // 加入一个亲密好友
pUser->AddGoodFriend( pRelationPacket->m_RelationGUID.GetTargetGUID() );
return PACKET_EXE_CONTINUE;
}
break;
case REQ_RELATIONONLINE:
{ // 获取好友的在线列表
Msg.GetRelation()->m_Type = RET_ONLINELIST;
RETURN_ONLINE_LIST* pSend = &(Msg.GetRelation()->m_RelationOnline);
pSend->CleanUp();
pUser->FillOnlineList(pSend);
}
break;
case REQ_MODIFYMOOD:
{
pUser->SetMood( pRelationPacket->m_ModifyMood.GetMood() );
return PACKET_EXE_CONTINUE;
}
break;
case REQ_MODIFYSETTINGS:
{
pUser->SetSettings( pRelationPacket->m_Settings.GetSettings() );
return PACKET_EXE_CONTINUE;
}
break;
case REQ_NOTIFY_ADDTEMPFRIEND:
{
REQUEST_VIEW_PLAYER& Recv = pRelationPacket->m_ViewPlayer;
if ( strlen(Recv.GetTargetName()) > 0 )
{
pTargetUser = g_pOnlineUser->FindUser( Recv.GetTargetName() );
}
if ( pTargetUser == NULL )
{ // 玩家可能不存在也可能不在线,由 Server 来判断
Log::SaveLog( WORLD_LOGFILE, "GWRelationHandler...User Name=%s not find!",
Recv.GetTargetName() );
return PACKET_EXE_CONTINUE;
}
Msg.GetRelation()->m_Type = RET_NOTIFY_ADDTEMPFRIEND;
REQUEST_VIEW_PLAYER* pSend = &(Msg.GetRelation()->m_PlayerName);
pSend->CleanUp();
pSend->SetTargetName( pUser->GetName() );
}
break;
//case REQ_ADD_NEW_GROUP: