This commit is contained in:
aozhiwei 2023-09-16 16:22:22 +08:00
parent 899d3220d1
commit 727a33a05a
2 changed files with 9 additions and 0 deletions

View File

@ -828,3 +828,9 @@ void RoomMgr::AdjustCMJoin(cs::CMJoin* msg)
return; return;
} }
} }
std::shared_ptr<CustomBattle> RoomMgr::GetCustomRoom(const std::string& room_uuid)
{
auto itr = custom_room_hash_.find(room_uuid);
return itr != custom_room_hash_.end() ? itr->second : nullptr;
}

View File

@ -24,6 +24,7 @@ class GridService;
class MapService; class MapService;
class MapInstance; class MapInstance;
class Building; class Building;
class CustomBattle;
struct RoomInitInfo struct RoomInitInfo
{ {
int room_idx = 0; int room_idx = 0;
@ -114,6 +115,7 @@ class RoomMgr : public a8::Singleton<RoomMgr>
void OnJoinRoomOk(const cs::CMJoin& msg, Player* hum); void OnJoinRoomOk(const cs::CMJoin& msg, Player* hum);
void TeamRoomTimeOut(const std::string& team_uuid); void TeamRoomTimeOut(const std::string& team_uuid);
void AdjustCMJoin(cs::CMJoin* msg); void AdjustCMJoin(cs::CMJoin* msg);
std::shared_ptr<CustomBattle> GetCustomRoom(const std::string& room_uuid);
private: private:
int current_room_idx_ = 0; int current_room_idx_ = 0;
@ -126,4 +128,5 @@ class RoomMgr : public a8::Singleton<RoomMgr>
f8::Attacher reportstate_timer_attacher_; f8::Attacher reportstate_timer_attacher_;
std::map<std::string, int> gm_hash_; std::map<std::string, int> gm_hash_;
std::map<std::string, std::map<std::string, long long>> team_room_hash_; std::map<std::string, std::map<std::string, long long>> team_room_hash_;
std::map<std::string, std::shared_ptr<CustomBattle>> custom_room_hash_;
}; };