This commit is contained in:
aozhiwei 2020-07-02 19:01:39 +08:00
parent e46d0d2629
commit 330ec02da9

View File

@ -1226,18 +1226,20 @@ bool Player::CanAddFriend(const std::string& account_id)
if (GetFriendById(account_id)) { if (GetFriendById(account_id)) {
return false; return false;
} }
int target_channel = f8::ExtractGameIdFromAccountId(account_id); int target_channel = f8::ExtractChannelIdFromAccountId(account_id);
int target_gameid = f8::ExtractChannelIdFromAccountId(account_id); int target_gameid = f8::ExtractGameIdFromAccountId(account_id);
int self_channel = f8::ExtractGameIdFromAccountId(AccountId()); int self_channel = f8::ExtractChannelIdFromAccountId(AccountId());
int self_gameid = f8::ExtractChannelIdFromAccountId(AccountId()); int self_gameid = f8::ExtractGameIdFromAccountId(AccountId());
if (target_gameid != self_gameid) { if (target_gameid != self_gameid) {
return false; return false;
} }
#if 0
if (self_channel != 6000 && target_channel != 6000) { if (self_channel != 6000 && target_channel != 6000) {
if (self_channel != target_channel) { if (self_channel != target_channel) {
return false; return false;
} }
} }
#endif
return true; return true;
} }