This commit is contained in:
aozhiwei 2023-09-20 15:31:04 +08:00
parent 9d28ce3228
commit 4822200f39

View File

@ -855,12 +855,16 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr& hdr, const cs::CMJoin& msg)
auto ip_saddr = hdr.ip_saddr; auto ip_saddr = hdr.ip_saddr;
auto socket_handle = hdr.socket_handle; auto socket_handle = hdr.socket_handle;
auto cb = auto cb =
[join_msg, socket_handle] (int errcode, const std::string errmsg, std::shared_ptr<CustomBattle>) [join_msg, socket_handle] (int errcode, const std::string errmsg, std::shared_ptr<CustomBattle> p)
{ {
if (!errcode) { if (!errcode) {
RoomMgr::Instance()->JoinErrorHandle(*join_msg, 2, socket_handle); RoomMgr::Instance()->JoinErrorHandle(*join_msg, 2, socket_handle);
return; return;
} }
if (Global::g_nowtime - p->GetStartTime() > 30) {
RoomMgr::Instance()->JoinErrorHandle(*join_msg, 2, socket_handle);
return;
}
}; };
SendGetCustomBattleData(join_msg, cb); SendGetCustomBattleData(join_msg, cb);
} }