This commit is contained in:
aozhiwei 2024-03-25 20:38:03 +08:00
parent 70302e90ab
commit e3c390ad6d
2 changed files with 12 additions and 0 deletions

View File

@ -766,3 +766,13 @@ std::shared_ptr<CustomMember> RoomMgr::GetCustomMemberBySocket(int socket_handle
auto itr = socket_hash_.find(socket_handle);
return itr != socket_hash_.end() ? itr->second : nullptr;
}
void RoomMgr::ReBindCustomMemberSocket(std::shared_ptr<CustomMember> p)
{
socket_hash_[p->GetSocketHandle()] = p;
}
void RoomMgr::UnBindCustomMemberSocket(int socket_handle)
{
socket_hash_.erase(socket_handle);
}

View File

@ -84,6 +84,8 @@ class RoomMgr : public a8::Singleton<RoomMgr>
bool HasTask();
void OnJoinRoomOk(const cs::CMJoin& msg, Player* hum);
std::shared_ptr<CustomMember> GetCustomMemberBySocket(int socket_handle);
void ReBindCustomMemberSocket(std::shared_ptr<CustomMember> p);
void UnBindCustomMemberSocket(int socket_handle);
private:
void InstallReportStateTimer();