本文整理汇总了C++中USER::AddRelationDelPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ USER::AddRelationDelPoint方法的具体用法?C++ USER::AddRelationDelPoint怎么用?C++ USER::AddRelationDelPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类USER
的用法示例。
在下文中一共展示了USER::AddRelationDelPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
//.........这里部分代码省略.........
// 如果要添加到仇人列表中的玩家是自己的好友或者黑名单中的人物,则双方先都把对方删除
if ( RelationType == RELATION_TYPE_FRIEND || RelationType == RELATION_TYPE_BLACKNAME )
{
pUser->DelRelation( pTargetUser->GetGUID() );
pTargetUser->DelRelation( pUser->GetGUID() );
WGRelation MyDelFriendMsg;
MyDelFriendMsg.GetRelation()->CleanUp();
MyDelFriendMsg.GetRelation()->SetPlayerID( pUser->GetPlayerID() );
MyDelFriendMsg.GetRelation()->m_Type = RET_DELFRIENDFORADDENEMY;
MyDelFriendMsg.GetRelation()->m_RelationGUID.CleanUp();
MyDelFriendMsg.GetRelation()->m_RelationGUID.SetTargetGUID( pTargetUser->GetGUID() );
pServerPlayer->SendPacket( &MyDelFriendMsg );
WGRelation DelFriendMsg;
DelFriendMsg.GetRelation()->CleanUp();
DelFriendMsg.GetRelation()->SetPlayerID( pTargetUser->GetPlayerID() );
DelFriendMsg.GetRelation()->m_Type = RET_DELFRIENDFORADDENEMY;
DelFriendMsg.GetRelation()->m_RelationGUID.CleanUp();
DelFriendMsg.GetRelation()->m_RelationGUID.SetTargetGUID( pUser->GetGUID() );
ServerPlayer* pTServerPlayer = g_pServerManager->GetServerPlayer( pTargetUser->GetServerID() );
if( pTServerPlayer==NULL )
{
Assert(FALSE);
break;
}
pTServerPlayer->SendPacket( &DelFriendMsg );
// 将删除的好友加入到好友递减列表
time_t NowTime = g_pTimeManager->GetANSITime();
pUser->AddRelationDelPoint( pTargetUser->GetGUID(), NowTime );
pTargetUser->AddRelationDelPoint( pUser->GetGUID(), NowTime );
}
// 加入仇人名单
_RELATION_USER RUser;
RUser.m_UserGUID = pTargetUser->GetGUID();
RUser.m_RelationType = RELATION_TYPE_ENEMY;
pUser->AddRelation( pTargetUser->GetGUID(), &RUser );
// 传回去在线信息
Msg.GetRelation()->m_Type = RET_ADDENEMY;
RETURN_ADD_RELATION& Relation = Msg.GetRelation()->m_AddRelation;
Relation.CleanUp();
Relation.SetRelationType( ReqRelation.GetRelationType() );
pRelationData = Relation.GetRelationData();
// pRelationData 的数据在 switch 之后填充
Log::SaveLog( WORLD_LOGFILE, "GWRelationHandler...User Name=%s added to enemy list!",
ReqRelation.GetTargetName() );
}
break;
case REQ_DELFROMENEMY:
{
pUser->DelRelation( pRelationPacket->m_RelationGUID.GetTargetGUID() );
return PACKET_EXE_CONTINUE;
}
break;