diff --git a/server/gameserver/creature.h b/server/gameserver/creature.h index 951d6b38..4dd9faeb 100644 --- a/server/gameserver/creature.h +++ b/server/gameserver/creature.h @@ -88,6 +88,7 @@ class Creature : public MoveableEntity bool playing_skill = false; int power_idx = -1; std::function on_add_buff; + int over_delay_time = 0; Weapon second_weapon; a8::Vec2 context_pos; diff --git a/server/gameserver/httpproxy.cc b/server/gameserver/httpproxy.cc index 06af8968..42552ad2 100644 --- a/server/gameserver/httpproxy.cc +++ b/server/gameserver/httpproxy.cc @@ -18,6 +18,7 @@ struct HttpProxyRequest f8::AsyncHttpOnErrorFunc on_error; std::string url; a8::XObject url_params; + long long add_tick = 0; }; static void _ProxyCallback(f8::JsonHttpRequest* request) @@ -72,6 +73,7 @@ std::string HttpProxy::HttpGet(a8::XParams param, request->on_error = on_error; request->url = url; request->url_params = url_params; + request->add_tick = a8::XGetTickCount(); if (request_hash_.find(request->req_id) != request_hash_.end()) { abort(); } @@ -95,9 +97,11 @@ std::string HttpProxy::HttpGet(a8::XParams param, { HttpProxyRequest* req = HttpProxy::Instance()->GetRequest(param.sender.GetString()); if (req) { + long long cost_time = a8::XGetTickCount() - req->add_tick; #ifdef DEBUG - a8::UdpLog::Instance()->Debug("ProxyHttpGet ok url:%s params:%s", + a8::UdpLog::Instance()->Debug("ProxyHttpGet ok cost_time:%d url:%s params:%s", { + cost_time, req->url, req->url_params.ToJsonStr(), }); @@ -108,8 +112,10 @@ std::string HttpProxy::HttpGet(a8::XParams param, { HttpProxyRequest* req = HttpProxy::Instance()->GetRequest(param.sender.GetString()); if (req) { - a8::UdpLog::Instance()->Warning("ProxyHttpGet error url:%s params:%s response:%s", + long long cost_time = a8::XGetTickCount() - req->add_tick; + a8::UdpLog::Instance()->Warning("ProxyHttpGet error cost_time:%d url:%s params:%s response:%s", { + cost_time, req->url, req->url_params.ToJsonStr(), response diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index b5d9d2a8..3408c4d7 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -1894,7 +1894,24 @@ void Human::SendGameOver() } else { if (!sending_battlereport_) { sending_battlereport_ = true; - SendBattleReport(); + if (over_delay_time > 0) { + room->xtimer.AddDeadLineTimerAndAttach + (over_delay_time / FRAME_RATE_MS, + a8::XParams() + .SetSender(this), + [] (const a8::XParams& param) + { + Human* hum = (Human*)param.sender.GetUserData(); + hum->SendBattleReport(); + hum->over_delay_time = 0; + }, + &xtimer_attacher.timer_list_, + [] (const a8::XParams& param) + { + }); + } else { + SendBattleReport(); + } } if (!is_game_end_) { GameLog::Instance()->GameEnd((Player*)this); diff --git a/server/gameserver/skill.cc b/server/gameserver/skill.cc index e52c2c9c..f9619204 100644 --- a/server/gameserver/skill.cc +++ b/server/gameserver/skill.cc @@ -516,6 +516,9 @@ void Skill::ProcSWZB() SkillHelper::GetSwzbEffect(meta), 0 ); + if (!meta->phases.empty()) { + owner->over_delay_time = meta->phases.at(0).param1; + } #ifdef DEBUG { std::string dbg_msg = a8::Format