From 0aee4bad677b0e3e5c275c52e277a9661f3d5b22 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 22 Jun 2020 20:38:14 +0800 Subject: [PATCH] 1 --- server/imserver/player.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/server/imserver/player.cc b/server/imserver/player.cc index dc71478..e93a058 100644 --- a/server/imserver/player.cc +++ b/server/imserver/player.cc @@ -550,7 +550,8 @@ void Player::_SS_IM_FriendDeleteRequest(f8::MsgHdr& hdr, const ss::SS_IM_FriendD void Player::_SS_IM_FriendApply(f8::MsgHdr& hdr, const ss::SS_IM_FriendApply& msg) { - + a8::SetBitFlag(red_point_flags_, RPF_Apply); + SyncRedPoint(); } void Player::ReLogin(f8::MsgHdr& hdr, const cs::CMLogin& msg) @@ -1034,6 +1035,18 @@ bool Player::CanAddFriend(const std::string& account_id) if (GetFriendById(account_id)) { return false; } + int target_channel = f8::ExtractGameIdFromAccountId(account_id); + int target_gameid = f8::ExtractChannelIdFromAccountId(account_id); + int self_channel = f8::ExtractGameIdFromAccountId(AccountId()); + int self_gameid = f8::ExtractChannelIdFromAccountId(AccountId()); + if (target_gameid != self_gameid) { + return false; + } + if (self_channel != 6000 && target_channel != 6000) { + if (self_channel != target_channel) { + return false; + } + } return true; }