diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 15db2c16..0a6bcc4f 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -974,6 +974,7 @@ void Human::FillSMGameOver(cs::SMGameOver& msg) if (stats.pve_kill_boss) { stats.victory = true; } + } else { } if (stats.victory) { @@ -1046,6 +1047,29 @@ void Human::FillSMGameOver(cs::SMGameOver& msg) p->add_values(std::get<1>(tuple)); } } + { + if (room->IsPveRoom()) { + msg.set_mode(GetTeam()->GetMemberNum() <= 1 ? 1 : 2); + msg.set_my_rank(room->pve_data.wave); + msg.set_max_rank(room->pve_data.max_wave); + } else { + if (GetTeam()->GetMemberNum() <= 1) { + msg.set_mode(1); + msg.set_my_rank(stats.rank); + msg.set_max_rank(room->GetHumanNum()); + } else { + if (GetTeam()->team_rank <= 0) { + msg.set_mode(1); + msg.set_my_rank(stats.rank); + msg.set_max_rank(room->GetHumanNum()); + } else { + msg.set_mode(2); + msg.set_my_rank(GetTeam()->team_rank); + msg.set_max_rank(room->GetTeamNum()); + } + } + } + } } void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id) diff --git a/server/gameserver/team.h b/server/gameserver/team.h index 1ab3b87d..a670722d 100644 --- a/server/gameserver/team.h +++ b/server/gameserver/team.h @@ -6,6 +6,7 @@ class Team { public: Room* room = nullptr; + int team_rank = 0; void SetInitTeamMemberNum(int init_num) { init_team_member_num_ = init_num; }; void SetAutoFill(bool auto_fill) { auto_fill_ = auto_fill; }; diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index d2bd2ff5..b1738021 100755 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -1144,6 +1144,11 @@ message SMGameOver optional int32 pve_max_wave = 18; //pve总波次 optional int32 pve_instance_id = 19; //pve副本id optional int32 map_id = 20; //地图id + + optional int32 mode = 21; //1:个人 2:组队 + optional int32 my_rank = 22; //我的排名 + optional int32 max_rank = 23; //最大排名 + } //离开