本文整理汇总了C++中USER::DelRelationDelPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ USER::DelRelationDelPoint方法的具体用法?C++ USER::DelRelationDelPoint怎么用?C++ USER::DelRelationDelPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类USER
的用法示例。
在下文中一共展示了USER::DelRelationDelPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
//.........这里部分代码省略.........
uErr = RET_ERR_ISBLACKNAME;
Log::SaveLog( WORLD_LOGFILE, "GWRelationHandler...User Name=%s can't be added2!",
ReqRelation.GetTargetName() );
break;
}
else
{
uErr = RET_ERR_ISFRIEND;//(temp)如果被邀请的人已经是好友了
Log::SaveLog( WORLD_LOGFILE, "GWRelationHandler...User Name=%s can't be added2!",
ReqRelation.GetTargetName() );
break;
}
}
// 判断确定加好友的玩家在对方关系列表中的关系,如果在对方的仇人列表中,在对方也要将玩家从仇人列表中删除
RELATION_TYPE TargetRelationType = pTargetUser->GetRelationType( pUser->GetGUID() );
if ( TargetRelationType == RELATION_TYPE_ENEMY )
{
pTargetUser->DelRelation( pUser->GetGUID() );
}
// 加入好友名单
_RELATION_USER RUser;
RUser.m_UserGUID = pTargetUser->GetGUID();
RUser.m_RelationType = RELATION_TYPE_FRIEND;
RUser.m_nFriendPoint = pUser->GetPoint( pTargetUser->GetGUID() ); // 通过好友度递减列表来获得好友度
UserPoint = RUser.m_nFriendPoint;
// 从好友度递减列表中移除
if ( RUser.m_nFriendPoint != 0)
{
pUser->DelRelationDelPoint( pTargetUser->GetGUID() );
}
pUser->AddRelation( pTargetUser->GetGUID(), &RUser );
// 双方都将对方加为好友,而不是单向的添加好友
_RELATION_USER RTarUser;
RTarUser.m_UserGUID = pUser->GetGUID();
RTarUser.m_RelationType = RELATION_TYPE_FRIEND;
RTarUser.m_nFriendPoint = pTargetUser->GetPoint( pUser->GetGUID() );
TargetUserPoint = RTarUser.m_nFriendPoint;
// 从好友递减列表中移除
if ( RTarUser.m_nFriendPoint != 0 )
{
pTargetUser->DelRelationDelPoint( pUser->GetGUID() );
}
pTargetUser->AddRelation( pUser->GetGUID(), &RTarUser );
// 传回去在线信息
if ( pRelationPacket->m_Type == REQ_SUREADDFRIEND )
{
Msg.GetRelation()->m_Type = RET_ADDFRIEND;
TargetMsg.GetRelation()->m_Type = RET_ADDFRIEND;
}
RETURN_ADD_RELATION& Relation = Msg.GetRelation()->m_AddRelation;
Relation.CleanUp();
Relation.SetRelationType( ReqRelation.GetRelationType() );
Relation.SetGroup( ReqRelation.GetGroup() );