diff --git a/server/gameserver/roommgr.cc b/server/gameserver/roommgr.cc index 76b7c1dd..96801d91 100644 --- a/server/gameserver/roommgr.cc +++ b/server/gameserver/roommgr.cc @@ -828,3 +828,9 @@ void RoomMgr::AdjustCMJoin(cs::CMJoin* msg) return; } } + +std::shared_ptr RoomMgr::GetCustomRoom(const std::string& room_uuid) +{ + auto itr = custom_room_hash_.find(room_uuid); + return itr != custom_room_hash_.end() ? itr->second : nullptr; +} diff --git a/server/gameserver/roommgr.h b/server/gameserver/roommgr.h index 548fb314..34dee96e 100644 --- a/server/gameserver/roommgr.h +++ b/server/gameserver/roommgr.h @@ -24,6 +24,7 @@ class GridService; class MapService; class MapInstance; class Building; +class CustomBattle; struct RoomInitInfo { int room_idx = 0; @@ -114,6 +115,7 @@ class RoomMgr : public a8::Singleton void OnJoinRoomOk(const cs::CMJoin& msg, Player* hum); void TeamRoomTimeOut(const std::string& team_uuid); void AdjustCMJoin(cs::CMJoin* msg); + std::shared_ptr GetCustomRoom(const std::string& room_uuid); private: int current_room_idx_ = 0; @@ -126,4 +128,5 @@ class RoomMgr : public a8::Singleton f8::Attacher reportstate_timer_attacher_; std::map gm_hash_; std::map> team_room_hash_; + std::map> custom_room_hash_; };