From 5df4dbe901e898c5685992129ad7664b7cda6ba6 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 18 Nov 2022 14:20:23 +0800 Subject: [PATCH 1/2] 1 --- server/gameserver/human.cc | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index f6fdfd70..1cb93616 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -4501,21 +4501,25 @@ void Human::InternalBeKill(int killer_id, const std::string& killer_name, int we SetHP(0.0f); KillMgr::Instance()->OnHumanDead(this, &info); room->frame_event.AddDead(GetWeakPtrRef(), 1000 * 15); - dead_timer = room->xtimer.AddDeadLineTimerAndAttach - (MetaMgr::Instance()->revive_time * SERVER_FRAME_RATE, - a8::XParams() - .SetSender(this), - [] (const a8::XParams& param) - { - Human* hum = (Human*)param.sender.GetUserData(); - hum->real_dead = true; - }, - &xtimer_attacher.timer_list_, - [] (const a8::XParams& param) - { - Human* hum = (Human*)param.sender.GetUserData(); - hum->dead_timer = nullptr; - }); + if (GetBattleContext()->GetReviveCoin() > 0) { + dead_timer = room->xtimer.AddDeadLineTimerAndAttach + (MetaMgr::Instance()->revive_time * SERVER_FRAME_RATE, + a8::XParams() + .SetSender(this), + [] (const a8::XParams& param) + { + Human* hum = (Human*)param.sender.GetUserData(); + hum->real_dead = true; + }, + &xtimer_attacher.timer_list_, + [] (const a8::XParams& param) + { + Human* hum = (Human*)param.sender.GetUserData(); + hum->dead_timer = nullptr; + }); + } else { + real_dead = true; + } } else { dead = true; real_dead = true; From ecfd46ccc2eca4383429a23c4e326e4ae1901a72 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 18 Nov 2022 14:27:34 +0800 Subject: [PATCH 2/2] 1 --- server/gameserver/human.cc | 3 +++ server/gameserver/player.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 1cb93616..1667e697 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -1132,6 +1132,9 @@ void Human::FillSMGameOver(cs::SMGameOver& msg) msg.set_my_rank(0); } #endif + if (IsPlayer()) { + + } } void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id, diff --git a/server/gameserver/player.h b/server/gameserver/player.h index db572343..fbe99576 100644 --- a/server/gameserver/player.h +++ b/server/gameserver/player.h @@ -14,6 +14,7 @@ namespace cs class MFActivePlayerData; class MFGasData; class MFPair; + class MFSettlement; } class Room; @@ -76,6 +77,8 @@ class Player : public Human int trace_target_uniid = 0; + std::shared_ptr settlement; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > interaction_objids; virtual ~Player() override;