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; //今天进入游戏的次数 } //移动