This commit is contained in:
aozhiwei 2020-07-03 20:28:08 +08:00
parent 08f9d0d191
commit b570f177a9
3 changed files with 3 additions and 1 deletions

View File

@ -198,6 +198,7 @@ void DBHelper::SetEventStatus(long long idx,
void DBHelper::ShuaOfflineUsers(Player* hum)
{
++shua_users_offline_times;
std::set<std::string>& exclude_account_ids = hum->GetExcludeAccountIds();
if (cache_users_hash.size() < 500 && !exclude_account_ids.empty()) {
std::string fmtstr = "'',";

View File

@ -40,6 +40,7 @@ class DBHelper : public a8::Singleton<DBHelper>
public:
std::map<std::string, cs::MFUserInfo*> cache_users_hash;
std::vector<cs::MFUserInfo*> cache_users_list;
long long shua_users_offline_times = 0;
private:

View File

@ -52,7 +52,7 @@ void Player::Init()
RefreshFriendData();
NotifyOnline();
#if 1
if (DBHelper::Instance()->cache_users_hash.size() <= 20) {
if (DBHelper::Instance()->shua_users_offline_times <= 1) {
DBHelper::Instance()->ShuaOfflineUsers(this);
}
#endif