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

View File

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