This commit is contained in:
aozhiwei 2024-05-30 19:11:08 +08:00
parent 63649f40e6
commit 9503ffd985
2 changed files with 33 additions and 16 deletions

View File

@ -1113,9 +1113,22 @@ void Human::FillSMGameOver(cs::SMGameOver& msg)
msg.set_star_num(mt::Param::GetStarNum(stats->rank));
}
#endif
auto p = new cs::MFSettlementNew();
GetTeam()->FillMFSettlementNew(p);
*msg.mutable_settlement_new() = *p;
{
auto p = new cs::MFSettlementNew();
GetTeam()->FillMFSettlementNew(p);
*msg.mutable_settlement_new() = *p;
*msg.mutable_common_settlement()->add_team_list() = *p;
}
if (room->IsMobaModeRoom()) {
auto p = new cs::MFSettlementNew();
if (room->GetMobaTeamA() == GetTeam()) {
room->GetMobaTeamB()->FillMFSettlementNew(p);
*msg.mutable_common_settlement()->add_team_list() = *p;
} else {
room->GetMobaTeamB()->FillMFSettlementNew(p);
*msg.mutable_common_settlement()->add_team_list() = *p;
}
}
}
void Human::FillMFActivePlayerData(cs::MFActivePlayerData* player_data)
@ -1518,6 +1531,7 @@ void Human::SendUpdateMsg()
void Human::SendGameOver()
{
CalcStats();
if (stats->abandon_battle == 1 || (GetTeam()->HasPlayer()) || GetTeam()->MemberHasOb()) {
if (room->IsAlreadyRoomReportBattle()) {
cs::SMGameOver msg;
@ -1538,7 +1552,6 @@ void Human::SendGameOver()
}
#endif
} else {
CalcStats();
if (IsPlayer() && !sent_personal_report_) {
SendPersonalBattleReport();
sent_personal_report_ = true;

View File

@ -2283,7 +2283,6 @@ void Room::OnGameOver()
});
return;
} else {
CalcMvp();
TraverseHumanList
(
[] (Human* ele_hum) -> bool
@ -2291,6 +2290,7 @@ void Room::OnGameOver()
ele_hum->SendGameOver();
return true;
});
CalcMvp();
if (IsMobaModeRoom()) {
TryMobaReport(0);
}
@ -2300,17 +2300,21 @@ void Room::OnGameOver()
{
if (a8::TIMER_EXEC_EVENT == event) {
bool all_sent = true;
TraverseTeams
(
[&all_sent] (Team* team) -> bool
{
if (team->HasPlayer() && !team->IsViewTeam() &&
!team->IsAlreadyReportBattle()) {
all_sent = false;
return false;
}
return true;
});
if (IsMobaModeRoom()) {
all_sent = already_moba_report_battle_;
} else {
TraverseTeams
(
[&all_sent] (Team* team) -> bool
{
if (team->HasPlayer() && !team->IsViewTeam() &&
!team->IsAlreadyReportBattle()) {
all_sent = false;
return false;
}
return true;
});
}
if (all_sent) {
TryRoomReport(0);
xtimer.DeleteCurrentTimer();