This commit is contained in:
aozhiwei 2024-01-31 14:30:34 +08:00
parent ad36c2f8cf
commit f88b77ecad
2 changed files with 8 additions and 5 deletions

View File

@ -44,6 +44,9 @@
static const int ROOM_NUM_UP_LIMIT = 1000; static const int ROOM_NUM_UP_LIMIT = 1000;
static const int HUM_NUM_DOWN_LIMIT = 2500; 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<BattleDataContext> netdata) static RoomType_e GetHumanRoomType(const std::shared_ptr<BattleDataContext> netdata)
{ {
long long hero_uniid = 0; long long hero_uniid = 0;
@ -1026,7 +1029,7 @@ std::shared_ptr<MobaBattle> RoomMgr::GetHisMobaRoom(const std::string& room_uuid
return itr != his_moba_room_hash_.end() ? itr->second : nullptr; 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()) { if (msg.payload_data().empty()) {
return; return;
@ -1300,12 +1303,12 @@ void RoomMgr::DispatchSpecRoom(f8::MsgHdr* hdr, const cs::CMJoin& msg)
a8::Split(head, strings, ':'); a8::Split(head, strings, ':');
if (strings.size() > 1) { if (strings.size() > 1) {
if (strings.at(1) == "custom_room") { if (strings.at(1) == "custom_room") {
_CMJoinCustomBattle(hdr, msg); _CMJoinCustomBattle(hdr, msg, CUSTOM_ROOM_PVP);
} else if (strings.at(1) == "moba_room") { } else if (strings.at(1) == "moba_room") {
_CMJoinMoba(hdr, msg); _CMJoinCustomBattle(hdr, msg, CUSTOM_ROOM_MOBA);
} }
} else { } else {
_CMJoinCustomBattle(hdr, msg); _CMJoinCustomBattle(hdr, msg, CUSTOM_ROOM_PVP);
} }
} }

View File

@ -123,7 +123,7 @@ class RoomMgr : public a8::Singleton<RoomMgr>
std::shared_ptr<CustomBattle> GetHisCustomRoom(const std::string& room_uuid); std::shared_ptr<CustomBattle> GetHisCustomRoom(const std::string& room_uuid);
std::shared_ptr<MobaBattle> GetMobaRoom(const std::string& room_uuid); std::shared_ptr<MobaBattle> GetMobaRoom(const std::string& room_uuid);
std::shared_ptr<MobaBattle> GetHisMobaRoom(const std::string& room_uuid); std::shared_ptr<MobaBattle> 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 _CMJoinMoba(f8::MsgHdr* hdr, const cs::CMJoin& msg);
void SendGetCustomBattleData(std::shared_ptr<cs::CMJoin> join_msg, void SendGetCustomBattleData(std::shared_ptr<cs::CMJoin> join_msg,
std::function<void(int, const std::string, std::shared_ptr<CustomBattle>)> cb); std::function<void(int, const std::string, std::shared_ptr<CustomBattle>)> cb);