This commit is contained in:
aozhiwei 2023-09-20 13:13:46 +08:00
parent 9da86d6e8f
commit a3b084a924

View File

@ -874,5 +874,24 @@ void RoomMgr::SendGetCustomBattleData(std::shared_ptr<cs::CMJoin> join_msg,
head = join_msg->custom_room_payload().substr(0, pos - 1);
body = join_msg->custom_room_payload().substr(pos);
auto data = std::make_shared<a8::XObject>();
data->ReadFromJsonString(body);
if (!data->ReadFromJsonString(body) ||
!data->IsObject()) {
cb(1, "custom battle data error", nullptr);
return;
}
std::string room_uuid = data->Get("team_uuid", "").GetString();
int start_time = data->Get("start_time", "").GetInt();
if (room_uuid.empty()) {
cb(1, "custom battle data error", nullptr);
return;
}
auto his_room = GetHisCustomRoom(room_uuid);
if (his_room) {
cb(2, "custom battle is dissolution", nullptr);
return;
}
auto cur_room = GetCustomRoom(room_uuid);
if (cur_room) {
}
}