This commit is contained in:
aozhiwei 2020-06-22 17:10:46 +08:00
commit 6995184d29
4 changed files with 20 additions and 0 deletions

View File

@ -44,6 +44,10 @@ void Player::Init()
},
&timer_attacher.timer_list_
);
#ifdef DEBUG
red_point_flags_ = 1;
SyncRedPoint();
#endif
}
void Player::UnInit()
@ -994,3 +998,10 @@ bool Player::CanAddFriend(const std::string& account_id)
}
return true;
}
void Player::SyncRedPoint()
{
cs::SMUpdateRedPointNotify notifymsg;
notifymsg.set_red_point_flags(red_point_flags_);
SendMsg(notifymsg);
}

View File

@ -127,6 +127,7 @@ private:
void OnFriendAgreeEvent(Event& event);
void OnFriendDeleteEvent(Event& event);
bool CanAddFriend(const std::string& account_id);
void SyncRedPoint();
private:
bool dirty_ = false;
@ -137,6 +138,7 @@ private:
long long curr_max_event_idx_ = 0;
long long last_run_tick_ = 0;
std::map<long long, Event> event_hash_;
int red_point_flags_ = 0;
std::map<std::string, Friend*> friend_hash_;
std::map<long long, FriendApply*> apply_hash_;

View File

@ -64,4 +64,5 @@ enum SMMessageId_e
_SMUserTempCustomDataUpdate = 504;
_SMDeleteFriendNotify = 505;
_SMUpdateAccountInfo = 506;
_SMUpdateRedPointNotify = 507;
}

View File

@ -376,3 +376,9 @@ message SMUpdateAccountInfo
{
}
//
message SMUpdateRedPointNotify
{
optional int32 red_point_flags = 1; // 1<<0:
}