This commit is contained in:
aozhiwei 2023-12-28 16:18:07 +08:00
parent 4df601f35d
commit 6967cb12a5

View File

@ -42,8 +42,6 @@
static const int ROOM_NUM_UP_LIMIT = 1000;
static const int HUM_NUM_DOWN_LIMIT = 2500;
static const char CUSTOM_ROOM_TYPE = '1';
static const char MOBA_ROOM_TYPE = '2';
static RoomType_e GetHumanRoomType(const std::shared_ptr<BattleDataContext> netdata)
{
@ -1210,23 +1208,20 @@ void RoomMgr::DispatchSpecRoom(f8::MsgHdr* hdr, const cs::CMJoin& msg)
msg.payload_data().size() < 10) {
return;
}
if (msg.payload_data().at(0) == '?') {
switch (msg.payload_data().at(1)) {
case CUSTOM_ROOM_TYPE:
{
_CMJoinCustomBattle(hdr, msg);
}
break;
case MOBA_ROOM_TYPE:
{
_CMJoinMoba(hdr, msg);
}
break;
default:
{
auto pos = msg.payload_data().find('|');
std::string head;
std::string body;
if (pos == std::string::npos) {
return;
}
break;
head = msg.payload_data().substr(0, pos);
std::vector<std::string> strings;
a8::Split(head, strings, ':');
if (strings.size() > 1) {
if (strings.at(1) == "custom_room") {
_CMJoinCustomBattle(hdr, msg);
} else if (strings.at(1) == "moba_room") {
_CMJoinMoba(hdr, msg);
}
} else {
_CMJoinCustomBattle(hdr, msg);