本文整理汇总了C++中USER::SetSettings方法的典型用法代码示例。如果您正苦于以下问题:C++ USER::SetSettings方法的具体用法?C++ USER::SetSettings怎么用?C++ USER::SetSettings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类USER
的用法示例。
在下文中一共展示了USER::SetSettings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
//.........这里部分代码省略.........
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 :
{
Assert(FALSE);
return PACKET_EXE_CONTINUE;
}
}
示例2: Execute
//.........这里部分代码省略.........
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:
// {
//// 检查需要添加的是否在线,并发回详细信息,这里不做合法性判断
//REQUEST_ADD_NEW_GROUP& NewGroup = pRelationPacket->m_AddNewGroup;
//_RELATION_DB_LOAD &pRelation = pUser->GetFullUserData()->m_Relation;
////检查玩家自定义组情况