1
This commit is contained in:
commit
e27cd603db
@ -593,6 +593,7 @@ void Player::OnDataVersion1Change()
|
|||||||
{
|
{
|
||||||
Player* hum = (Player*)param.sender.GetUserData();
|
Player* hum = (Player*)param.sender.GetUserData();
|
||||||
hum->InternalUpdateUserInfo();
|
hum->InternalUpdateUserInfo();
|
||||||
|
hum->SyncOtherFriend();
|
||||||
},
|
},
|
||||||
&timer_attacher.timer_list_,
|
&timer_attacher.timer_list_,
|
||||||
[] (const a8::XParams& param)
|
[] (const a8::XParams& param)
|
||||||
@ -616,6 +617,7 @@ void Player::OnTempCustomDataChange()
|
|||||||
{
|
{
|
||||||
Player* hum = (Player*)param.sender.GetUserData();
|
Player* hum = (Player*)param.sender.GetUserData();
|
||||||
hum->InternalUpdateUserInfo();
|
hum->InternalUpdateUserInfo();
|
||||||
|
hum->SyncOtherFriend();
|
||||||
},
|
},
|
||||||
&timer_attacher.timer_list_,
|
&timer_attacher.timer_list_,
|
||||||
[] (const a8::XParams& param)
|
[] (const a8::XParams& param)
|
||||||
@ -753,3 +755,18 @@ void Player::PushFriendList()
|
|||||||
FillFriendList(respmsg.mutable_friend_list());
|
FillFriendList(respmsg.mutable_friend_list());
|
||||||
SendMsg(respmsg);
|
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);
|
int AddFriend(Friend* friendobj);
|
||||||
void RemoveFriend(const std::string& account_id);
|
void RemoveFriend(const std::string& account_id);
|
||||||
void PushFriendList();
|
void PushFriendList();
|
||||||
|
void SyncOtherFriend();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool dirty_ = false;
|
bool dirty_ = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user