This commit is contained in:
aozhiwei 2023-09-20 14:14:57 +08:00
parent 7d94a6af73
commit 21616022a0

View File

@ -928,6 +928,20 @@ void RoomMgr::SendGetCustomBattleData(std::shared_ptr<cs::CMJoin> join_msg,
}
int errcode = rsp_obj->Get("errcode", "").GetInt();
std::string errmsg = rsp_obj->Get("errmsg", "").GetString();
if (!errcode) {
cb(1, "", nullptr);
return;
}
std::string room_uuid = rsp_obj->Get("team_uuid", "").GetString();
if (room_uuid.empty()) {
cb(1, "custom battle data error", nullptr);
return;
}
auto cur_room = RoomMgr::Instance()->GetCustomRoom(room_uuid);
if (cur_room) {
cb(0, "", cur_room);
return;
}
auto custom_battle = std::make_shared<CustomBattle>();
if (rsp_obj->GetType() == a8::XOT_OBJECT) {