From c44d5b4a5b3c2ac54a3c463de3a48b856845f012 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 23 Oct 2019 15:56:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=8F=E5=A4=A9=E7=AC=AC=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E7=8E=A9=E5=85=81=E8=AE=B8=E5=A4=8D=E6=B4=BB=E4=B8=A4=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/gameserver/human.cc | 3 +++ server/gameserver/human.h | 1 + server/gameserver/playermgr.cc | 1 + server/tools/protobuild/cs_proto.proto | 1 + 4 files changed, 6 insertions(+) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 6ade176..a384d94 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -749,6 +749,9 @@ void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id) dead_frameno = room->frame_no; ++dead_times; int max_revive_times = MetaMgr::Instance()->GetSysParamAsInt("max_revive_times", 1); + if (today_enter_times == 0) { + ++max_revive_times; + } if (weapon_id != VW_Spectate && dead_times <= max_revive_times && room->AliveCount() > 2 && diff --git a/server/gameserver/human.h b/server/gameserver/human.h index 1175294..494fb34 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -44,6 +44,7 @@ class Human : public Entity std::string from_appid; std::string team_uuid; bool auto_fill = false; + int today_enter_times = 0; int account_registertime = 0; MetaData::Player* meta = nullptr; MetaData::Equip* helmet_meta = nullptr; diff --git a/server/gameserver/playermgr.cc b/server/gameserver/playermgr.cc index 53f066d..f6172d2 100644 --- a/server/gameserver/playermgr.cc +++ b/server/gameserver/playermgr.cc @@ -51,6 +51,7 @@ Player* PlayerMgr::CreatePlayerByCMJoin(long ip_saddr, int socket, const cs::CMJ hum->use_touch = msg.use_touch(); hum->avatar_url = msg.avatar_url(); hum->energy_shield = msg.energy_shield(); + hum->today_enter_times = msg.today_enter_times(); hum->create_tick = a8::XGetTickCount(); hum->account_registertime = f8::ExtractRegisterTimeFromSessionId(msg.session_id()); hum->atk_add = msg.atk_add(); diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index 27a56af..d6faee2 100755 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -655,6 +655,7 @@ message CMJoin optional int32 emoji2 = 25; //表情2 optional int32 parachute = 26; //降落伞 optional bool has_pass = 27; //是否有通行证 + optional int32 today_enter_times = 28; //今天进入游戏的次数 } //移动