1
This commit is contained in:
commit
e27cd603db
@ -593,6 +593,7 @@ void Player::OnDataVersion1Change()
|
||||
{
|
||||
Player* hum = (Player*)param.sender.GetUserData();
|
||||
hum->InternalUpdateUserInfo();
|
||||
hum->SyncOtherFriend();
|
||||
},
|
||||
&timer_attacher.timer_list_,
|
||||
[] (const a8::XParams& param)
|
||||
@ -616,6 +617,7 @@ void Player::OnTempCustomDataChange()
|
||||
{
|
||||
Player* hum = (Player*)param.sender.GetUserData();
|
||||
hum->InternalUpdateUserInfo();
|
||||
hum->SyncOtherFriend();
|
||||
},
|
||||
&timer_attacher.timer_list_,
|
||||
[] (const a8::XParams& param)
|
||||
@ -753,3 +755,18 @@ void Player::PushFriendList()
|
||||
FillFriendList(respmsg.mutable_friend_list());
|
||||
SendMsg(respmsg);
|
||||
}
|
||||
|
||||
void Player::SyncOtherFriend()
|
||||
{
|
||||
cs::SMUserInfoUpdate msg;
|
||||
auto p = msg.add_user_infos();
|
||||
TypeConvert::Convert(myself.base_data, *p->mutable_base_data());
|
||||
TypeConvert::Convert(myself.temp_custom_data, *p->mutable_temp_custom_data());
|
||||
|
||||
for (auto& pair : friend_hash_) {
|
||||
Player* hum = PlayerMgr::Instance()->GetPlayerByAccountId(pair.second->base_data.account_id);
|
||||
if (hum) {
|
||||
hum->SendMsg(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -114,6 +114,7 @@ private:
|
||||
int AddFriend(Friend* friendobj);
|
||||
void RemoveFriend(const std::string& account_id);
|
||||
void PushFriendList();
|
||||
void SyncOtherFriend();
|
||||
|
||||
private:
|
||||
bool dirty_ = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user