From ceaf83f9e30ece8c5213e915c65d5e90ebd66c22 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 8 Jun 2023 19:20:21 +0800 Subject: [PATCH] 1 --- server/gameserver/human.cc | 28 +++++++++++++++++++++++++++- server/gameserver/pbutils.cc | 2 +- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index ccb9711c..b2ec1ae9 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -3662,5 +3662,31 @@ void Human::ShiledBreak() void Human::SendPersonalBattleReport() { - + std::shared_ptr 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() + ); } diff --git a/server/gameserver/pbutils.cc b/server/gameserver/pbutils.cc index e3fe7c02..d405aa35 100644 --- a/server/gameserver/pbutils.cc +++ b/server/gameserver/pbutils.cc @@ -1552,7 +1552,7 @@ void Human::SendGameOver() FillSMGameOver(msg); SendNotifyMsg(msg); } - if (sent_personal_report_) { + if (IsPlayer() && sent_personal_report_) { SendPersonalBattleReport(); sent_personal_report_ = true; }