This commit is contained in:
aozhiwei 2020-06-18 14:55:18 +08:00
parent c7bea11299
commit 4318712b63

View File

@ -180,6 +180,7 @@ void Player::_CMFriendApply(f8::MsgHdr& hdr, const cs::CMFriendApply& msg)
void Player::_CMFriendApplyList(f8::MsgHdr& hdr, const cs::CMFriendApplyList& msg) void Player::_CMFriendApplyList(f8::MsgHdr& hdr, const cs::CMFriendApplyList& msg)
{ {
#if 0
if (last_apply_idx_ > 0 && if (last_apply_idx_ > 0 &&
last_apply_idx_ >= DBEngine::Instance()->GetFriendApplyCurrIdx(myself.crc32_code)) { last_apply_idx_ >= DBEngine::Instance()->GetFriendApplyCurrIdx(myself.crc32_code)) {
cs::SMFriendApplyList respmsg; cs::SMFriendApplyList respmsg;
@ -187,6 +188,7 @@ void Player::_CMFriendApplyList(f8::MsgHdr& hdr, const cs::CMFriendApplyList& ms
SendMsg(respmsg); SendMsg(respmsg);
return; return;
} }
#endif
auto on_ok = auto on_ok =
[] (a8::XParams& param, const f8::DataSet* data_set) [] (a8::XParams& param, const f8::DataSet* data_set)
@ -368,7 +370,7 @@ void Player::_CMFriendDelete(f8::MsgHdr& hdr, const cs::CMFriendDelete& msg)
{ {
Player* hum = PlayerMgr::Instance()->GetPlayerByAccountId(p->base_data.account_id); Player* hum = PlayerMgr::Instance()->GetPlayerByAccountId(p->base_data.account_id);
if (hum) { if (hum) {
hum->RemoveFriend(p->base_data.account_id); hum->RemoveFriend(AccountId());
} }
} }
#endif #endif
@ -770,6 +772,7 @@ void Player::AddFriend(Friend* p)
if (!GetFriendById(p->base_data.account_id)) { if (!GetFriendById(p->base_data.account_id)) {
Friend* friendobj = new Friend; Friend* friendobj = new Friend;
*friendobj = *p; *friendobj = *p;
INIT_LIST_HEAD(&friendobj->watch_node);
friendobj->crc32_code = a8::openssl::Crc32 friendobj->crc32_code = a8::openssl::Crc32
( (
(unsigned char*)friendobj->base_data.account_id.data(), (unsigned char*)friendobj->base_data.account_id.data(),