diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 5f11cef8..a0d17459 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -1443,73 +1443,6 @@ void Human::DeadDrop() MarkSyncActivePlayer(__FILE__, __LINE__, __func__); } -void Human::SendBattleReport() -{ - if (room->GetBattleStartFrameNo() <= 0) { - return; - } - if (room->GetCustomBattle()) { - return; - } - - 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=battleReport"; - } else { - url += "?c=Battle&a=battleReport"; - } - std::string data; - params->ToUrlEncodeStr(data); - if (stats->is_run_away) { - sending_battlereport_ = false; - already_report_battle_ = true; - SendGameOver(); - } else { - std::string room_uuid = room->GetRoomUuid(); - std::string sender_id = account_id; - HttpProxy::Instance()->HttpGet - ( - [room_uuid, sender_id, data] - (bool ok, a8::XObject* rsp_obj, f8::HttpContext* ctx) - { - if (!ok) { - f8::UdpLog::Instance()->Error("battleReport http error params: %s response: %s", - { - data, - "" - }); - } - auto room = RoomMgr::Instance()->GetRoomByUuid(room_uuid); - if (!room) { - return; - } - Player* hum = room->GetPlayerByAccountId(sender_id); - if (!hum) { - return; - } - if (ok) { - hum->sending_battlereport_ = false; - hum->already_report_battle_ = true; - #if 0 - hum->stats->ParseReward(hum, *rsp_obj); - #endif - hum->SendGameOver(); - #if 0 - hum->SendBattleSettlement(); - #endif - } else { - hum->sending_battlereport_ = false; - } - }, - url.c_str(), - *params.get() - ); - } -} - void Human::ProcLootSkin(AddItemDTO& dto) { switch (dto.item_meta->equip_subtype()) { diff --git a/server/gameserver/human.h b/server/gameserver/human.h index 1030bdfd..1728c110 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -321,7 +321,6 @@ private: void GenBattleReportData(a8::MutableXObject* params); void FillSMGameOver(cs::SMGameOver& msg); void SendBattleSettlement(); - void SendBattleReport(); void SendPersonalBattleReport(); void Revive(); void AdjustDecHp(float old_health, float& new_health);