This commit is contained in:
aozhiwei 2023-06-08 19:20:21 +08:00
parent 38f9689c25
commit ceaf83f9e3
2 changed files with 28 additions and 2 deletions

View File

@ -3662,5 +3662,31 @@ void Human::ShiledBreak()
void Human::SendPersonalBattleReport() void Human::SendPersonalBattleReport()
{ {
std::shared_ptr<a8::MutableXObject> params = a8::MutableXObject::CreateObject();
GenBattleReportData(params.get());
std::string url;
JsonDataMgr::Instance()->GetApiUrl(url);
if (url.find('?') != std::string::npos) {
url += "c=Battle&a=personalReport";
} else {
url += "?c=Battle&a=personalReport";
}
std::string data;
params->ToUrlEncodeStr(data);
HttpProxy::Instance()->HttpGet
(
[data]
(bool ok, a8::XObject* rsp_obj, f8::HttpContext* ctx)
{
if (!ok) {
f8::UdpLog::Instance()->Error("personalReport http error params: %s response: %s",
{
data,
""
});
}
},
url.c_str(),
*params.get()
);
} }

View File

@ -1552,7 +1552,7 @@ void Human::SendGameOver()
FillSMGameOver(msg); FillSMGameOver(msg);
SendNotifyMsg(msg); SendNotifyMsg(msg);
} }
if (sent_personal_report_) { if (IsPlayer() && sent_personal_report_) {
SendPersonalBattleReport(); SendPersonalBattleReport();
sent_personal_report_ = true; sent_personal_report_ = true;
} }