This commit is contained in:
aozhiwei 2020-06-22 14:17:08 +08:00
parent 2836f7c213
commit 36fbb3a574
4 changed files with 14 additions and 0 deletions

View File

@ -775,6 +775,11 @@ void Player::RemoveFriend(const std::string& account_id)
} }
} }
void Player::Update()
{
}
const std::string Player::AccountId() const std::string Player::AccountId()
{ {
return myself.base_data.account_id; return myself.base_data.account_id;

View File

@ -98,6 +98,7 @@ class Player
void NotifyOffline(); void NotifyOffline();
void NotifyUserInfoUpdate(Friend* friend_data); void NotifyUserInfoUpdate(Friend* friend_data);
void FillIMMsgConext(ss::MFIMMsgConext* context); void FillIMMsgConext(ss::MFIMMsgConext* context);
void Update();
const std::string AccountId(); const std::string AccountId();

View File

@ -143,6 +143,13 @@ int PlayerMgr::OnlineNum()
return socket_hash_.size(); return socket_hash_.size();
} }
void PlayerMgr::Update()
{
for (auto& pair : accountid_hash_) {
pair.second->Update();
}
}
Player* PlayerMgr::GetPlayerBySocket(int socket) Player* PlayerMgr::GetPlayerBySocket(int socket)
{ {
auto itr = socket_hash_.find(socket); auto itr = socket_hash_.find(socket);

View File

@ -48,6 +48,7 @@ class PlayerMgr : public a8::Singleton<PlayerMgr>
void WatchPlayer(Friend* friend_data); void WatchPlayer(Friend* friend_data);
void UnWatchPlayer(Friend* friend_data); void UnWatchPlayer(Friend* friend_data);
int OnlineNum(); int OnlineNum();
void Update();
private: private:
void OnClientDisconnect(a8::XParams& param); void OnClientDisconnect(a8::XParams& param);