1
This commit is contained in:
parent
49b5a1d3db
commit
424e84b1da
@ -864,5 +864,13 @@ void RoomMgr::_CMJoinCustomBattle(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
|||||||
void RoomMgr::SendGetCustomBattleData(std::shared_ptr<cs::CMJoin> join_msg,
|
void RoomMgr::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)
|
||||||
{
|
{
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user