This commit is contained in:
aozhiwei 2020-06-22 14:20:58 +08:00
parent 36fbb3a574
commit d7a36501f1
5 changed files with 6 additions and 5 deletions

View File

@ -230,6 +230,7 @@ void App::QuickExecute()
{ {
ProcessIMMsg(); ProcessIMMsg();
DispatchMsg(); DispatchMsg();
PlayerMgr::Instance()->Update(a8::XGetTickCount());
a8::Timer::Instance()->Update(); a8::Timer::Instance()->Update();
} }

View File

@ -775,7 +775,7 @@ void Player::RemoveFriend(const std::string& account_id)
} }
} }
void Player::Update() void Player::Update(long long tick)
{ {
} }

View File

@ -98,7 +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(); void Update(long long tick);
const std::string AccountId(); const std::string AccountId();

View File

@ -143,10 +143,10 @@ int PlayerMgr::OnlineNum()
return socket_hash_.size(); return socket_hash_.size();
} }
void PlayerMgr::Update() void PlayerMgr::Update(long long tick)
{ {
for (auto& pair : accountid_hash_) { for (auto& pair : accountid_hash_) {
pair.second->Update(); pair.second->Update(tick);
} }
} }

View File

@ -48,7 +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(); void Update(long long tick);
private: private:
void OnClientDisconnect(a8::XParams& param); void OnClientDisconnect(a8::XParams& param);