1
This commit is contained in:
parent
abf27b8923
commit
1f4ff08d57
@ -691,6 +691,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)
|
||||||
@ -714,6 +715,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)
|
||||||
@ -846,3 +848,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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -115,6 +115,7 @@ private:
|
|||||||
int msgid,
|
int msgid,
|
||||||
::google::protobuf::Message& msg);
|
::google::protobuf::Message& msg);
|
||||||
void InternalUpdateUserInfo();
|
void InternalUpdateUserInfo();
|
||||||
|
void SyncOtherFriend();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool dirty_ = false;
|
bool dirty_ = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user