This commit is contained in:
aozhiwei 2020-05-04 23:37:59 +08:00
parent 15afd14d88
commit 2132b1f008
3 changed files with 17 additions and 1 deletions

View File

@ -7,6 +7,7 @@
void Player::Init() void Player::Init()
{ {
SyncLocToMasterServer(); SyncLocToMasterServer();
NotifyOnline();
} }
void Player::UnInit() void Player::UnInit()
@ -81,3 +82,13 @@ void Player::SyncLocToMasterServer()
{ {
} }
void Player::NotifyOnline()
{
}
void Player::NotifyOffline()
{
}

View File

@ -34,4 +34,6 @@ class Player
void ReLogin(f8::MsgHdr& hdr, const cs::CMLogin& msg); void ReLogin(f8::MsgHdr& hdr, const cs::CMLogin& msg);
void SyncLocToMasterServer(); void SyncLocToMasterServer();
void NotifyOnline();
void NotifyOffline();
}; };

View File

@ -298,7 +298,10 @@ void PlayerMgr::OnClientSocketDisconnect(int socket_handle)
{ {
Player* hum = GetPlayerBySocket(socket_handle); Player* hum = GetPlayerBySocket(socket_handle);
if (hum) { if (hum) {
hum->NotifyOffline();
hum->UnInit();
socket_hash_.erase(socket_handle);
accountid_hash_.erase(hum->account_id);
} }
} }
} }