1
This commit is contained in:
parent
55722adecd
commit
3e9b34cbe0
@ -9,6 +9,8 @@
|
|||||||
#include "bornpoint.h"
|
#include "bornpoint.h"
|
||||||
#include "battledatacontext.h"
|
#include "battledatacontext.h"
|
||||||
#include "stats.h"
|
#include "stats.h"
|
||||||
|
#include "jsondatamgr.h"
|
||||||
|
#include "httpproxy.h"
|
||||||
|
|
||||||
#include "mt/Map.h"
|
#include "mt/Map.h"
|
||||||
#include "mt/Hero.h"
|
#include "mt/Hero.h"
|
||||||
@ -185,6 +187,42 @@ bool Team::HasPlayer()
|
|||||||
|
|
||||||
void Team::SendTeamBattleReport(Human* sender)
|
void Team::SendTeamBattleReport(Human* sender)
|
||||||
{
|
{
|
||||||
|
Human* player = nullptr;
|
||||||
|
for (Human* hum : members_) {
|
||||||
|
if (hum->IsPlayer()) {
|
||||||
|
player = hum;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!player) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<a8::MutableXObject> post_data = a8::MutableXObject::CreateObject();
|
||||||
|
GenBattleReportData(post_data.get());
|
||||||
|
std::string url;
|
||||||
|
JsonDataMgr::Instance()->GetApiUrl(url);
|
||||||
|
if (url.find('?') != std::string::npos) {
|
||||||
|
url += "c=Battle&a=teamReport";
|
||||||
|
} else {
|
||||||
|
url += "?c=Battle&a=teamReport";
|
||||||
|
}
|
||||||
|
std::shared_ptr<a8::MutableXObject> params = a8::MutableXObject::CreateObject();
|
||||||
|
params->SetVal("account_id", player->account_id);
|
||||||
|
params->SetVal("session_id", player->session_id);
|
||||||
|
params->SetVal("__POST", post_data->ToJsonStr());
|
||||||
|
|
||||||
|
long long room_uuid = room->GetRoomUuid();
|
||||||
|
int team_id = GetTeamId();
|
||||||
|
HttpProxy::Instance()->HttpGet
|
||||||
|
(
|
||||||
|
[room_uuid, team_id]
|
||||||
|
(bool ok, a8::XObject* rsp_obj, f8::HttpContext* ctx)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
url.c_str(),
|
||||||
|
*params.get()
|
||||||
|
);
|
||||||
already_report_battle = true;
|
already_report_battle = true;
|
||||||
sending_battlereport = false;
|
sending_battlereport = false;
|
||||||
TraverseMembers
|
TraverseMembers
|
||||||
|
Loading…
x
Reference in New Issue
Block a user