diff --git a/server/gameserver/roommgr.cc b/server/gameserver/roommgr.cc index 8781dd3c..c38691eb 100644 --- a/server/gameserver/roommgr.cc +++ b/server/gameserver/roommgr.cc @@ -44,6 +44,9 @@ static const int ROOM_NUM_UP_LIMIT = 1000; static const int HUM_NUM_DOWN_LIMIT = 2500; +static const int CUSTOM_ROOM_PVP = 0; +static const int CUSTOM_ROOM_MOBA = 1; + static RoomType_e GetHumanRoomType(const std::shared_ptr netdata) { long long hero_uniid = 0; @@ -1026,7 +1029,7 @@ std::shared_ptr RoomMgr::GetHisMobaRoom(const std::string& room_uuid return itr != his_moba_room_hash_.end() ? itr->second : nullptr; } -void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr* hdr, const cs::CMJoin& msg) +void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr* hdr, const cs::CMJoin& msg, int custom_room_type) { if (msg.payload_data().empty()) { return; @@ -1300,12 +1303,12 @@ void RoomMgr::DispatchSpecRoom(f8::MsgHdr* hdr, const cs::CMJoin& msg) a8::Split(head, strings, ':'); if (strings.size() > 1) { if (strings.at(1) == "custom_room") { - _CMJoinCustomBattle(hdr, msg); + _CMJoinCustomBattle(hdr, msg, CUSTOM_ROOM_PVP); } else if (strings.at(1) == "moba_room") { - _CMJoinMoba(hdr, msg); + _CMJoinCustomBattle(hdr, msg, CUSTOM_ROOM_MOBA); } } else { - _CMJoinCustomBattle(hdr, msg); + _CMJoinCustomBattle(hdr, msg, CUSTOM_ROOM_PVP); } } diff --git a/server/gameserver/roommgr.h b/server/gameserver/roommgr.h index 9e345699..cfea01ed 100644 --- a/server/gameserver/roommgr.h +++ b/server/gameserver/roommgr.h @@ -123,7 +123,7 @@ class RoomMgr : public a8::Singleton std::shared_ptr GetHisCustomRoom(const std::string& room_uuid); std::shared_ptr GetMobaRoom(const std::string& room_uuid); std::shared_ptr GetHisMobaRoom(const std::string& room_uuid); - void _CMJoinCustomBattle(f8::MsgHdr* hdr, const cs::CMJoin& msg); + void _CMJoinCustomBattle(f8::MsgHdr* hdr, const cs::CMJoin& msg, int custom_room_type); void _CMJoinMoba(f8::MsgHdr* hdr, const cs::CMJoin& msg); void SendGetCustomBattleData(std::shared_ptr join_msg, std::function)> cb);