1
This commit is contained in:
parent
b79e9ce548
commit
5d6c65f2a4
@ -1664,68 +1664,6 @@ void Human::SendShowCountdown(const std::string& msg, int countdown)
|
||||
SendNotifyMsg(notifymsg);
|
||||
}
|
||||
|
||||
void Human::SendBattleSettlement()
|
||||
{
|
||||
if (!IsPlayer()) {
|
||||
return;
|
||||
}
|
||||
if (room->GetBattleStartFrameNo() <= 0) {
|
||||
return;
|
||||
}
|
||||
Player* p = (Player*)this;
|
||||
std::shared_ptr<a8::MutableXObject> params = a8::MutableXObject::CreateObject();
|
||||
{
|
||||
params->SetVal("account_id", account_id);
|
||||
params->SetVal("session_id", session_id);
|
||||
params->SetVal("battle_uuid", GetTeam()->GetBattleUuid());
|
||||
params->SetVal("__POST", f8::PbToJson(p->settlement.get()));
|
||||
}
|
||||
|
||||
std::string url;
|
||||
JsonDataMgr::Instance()->GetApiUrl(url);
|
||||
if (url.find('?') != std::string::npos) {
|
||||
url += "c=Battle&a=reportSettlement";
|
||||
} else {
|
||||
url += "?c=Battle&a=reportSettlement";
|
||||
}
|
||||
std::string data;
|
||||
params->ToUrlEncodeStr(data);
|
||||
#ifdef MYDEBUG
|
||||
{
|
||||
if (!f8::IsTestEnv()) {
|
||||
a8::XPrintf("reportSettlement %s\n", {data});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
std::string room_uuid = room->GetRoomUuid();
|
||||
std::string tmp_account_id = account_id;
|
||||
|
||||
HttpProxy::Instance()->HttpGet
|
||||
(
|
||||
[room_uuid, tmp_account_id, data]
|
||||
(bool ok, a8::XObject* rsp_obj, f8::HttpContext* ctx)
|
||||
{
|
||||
auto room = RoomMgr::Instance()->GetRoomByUuid(room_uuid);
|
||||
if (!room) {
|
||||
return;
|
||||
}
|
||||
Player* hum = room->GetPlayerByAccountId(tmp_account_id);
|
||||
if (!hum) {
|
||||
return;
|
||||
}
|
||||
if (!ok) {
|
||||
f8::UdpLog::Instance()->Error("reportSettlement error params: %s response: %s",
|
||||
{
|
||||
data,
|
||||
""
|
||||
});
|
||||
}
|
||||
},
|
||||
url.c_str(),
|
||||
*params.get()
|
||||
);
|
||||
}
|
||||
|
||||
void Human::AddItem(int item_id, int item_num)
|
||||
{
|
||||
auto itr = items_.find(item_id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user