diff --git a/server/gameserver/roommgr.cc b/server/gameserver/roommgr.cc index 496a7eae..8c656a74 100644 --- a/server/gameserver/roommgr.cc +++ b/server/gameserver/roommgr.cc @@ -864,5 +864,13 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr& hdr, const cs::CMJoin& msg) void RoomMgr::SendGetCustomBattleData(std::shared_ptr join_msg, std::function)> cb) { - + auto pos = join_msg->custom_room_payload().find('|'); + std::string head; + std::string body; + if (pos == std::string::npos) { + cb(1, "custom battle data error", nullptr); + return; + } + head = join_msg->custom_room_payload().substr(0, pos - 1); + body = join_msg->custom_room_payload().substr(pos); }