This commit is contained in:
aozhiwei 2024-04-02 17:32:26 +08:00
parent f06c381fde
commit 0e223cb263
3 changed files with 18 additions and 9 deletions

View File

@ -1098,7 +1098,7 @@ void Human::FillSMGameOver(cs::SMGameOver& msg)
data->ToJsonStr();
msg.mutable_settlement_new()->set_box_payload(custom_data);
}
if (GetTeam()->already_report_battle_) {
if (room->IsAlreadyRoomReportBattle()) {
msg.mutable_settlement_new()->set_settlement_status(1);
auto p = msg.mutable_settlement_new();
p->set_version(20230321);
@ -1695,7 +1695,7 @@ void Human::SendUpdateMsg()
void Human::SendGameOver()
{
if (stats->abandon_battle == 1 || (GetTeam()->HasPlayer()) || GetTeam()->MemberHasOb()) {
if (GetTeam()->already_report_battle_) {
if (room->IsAlreadyRoomReportBattle()) {
cs::SMGameOver msg;
FillSMGameOver(msg);
#if 0
@ -1721,10 +1721,7 @@ void Human::SendGameOver()
}
if (GetTeam()->team_rank && GetTeam()->HasPlayer() && !GetTeam()->IsViewTeam() &&
stats->abandon_battle != 1) {
if (!GetTeam()->sending_battlereport_) {
GetTeam()->sending_battlereport_ = true;
GetTeam()->SendTeamBattleReport(this);
}
GetTeam()->TrySendTeamBattleReport(this);
} else {
cs::SMGameOver msg;
FillSMGameOver(msg);

View File

@ -620,3 +620,11 @@ bool Team::AllIsDead()
}
return true;
}
void Team::TrySendTeamBattleReport(Human* sender)
{
if (!sending_battlereport_) {
sending_battlereport_ = true;
SendTeamBattleReport(sender);
}
}

View File

@ -21,8 +21,6 @@ class Team : public std::enable_shared_from_this<Team>
int team_rank = 0;
std::map<int, glm::vec3> target_pos;
int settlement_color = 0;
bool sending_battlereport_ = false;
bool already_report_battle_ = false;
Team();
~Team();
@ -51,7 +49,6 @@ class Team : public std::enable_shared_from_this<Team>
bool HasPlayer();
int GetPlayerNum();
void FillSMGameOver(cs::SMGameOver& msg);
void SendTeamBattleReport(Human* sender);
void GenBattleReportData(Human* player, a8::MutableXObject* params);
void GenBattleUuid();
void RunAway(Human* hum);
@ -65,6 +62,10 @@ class Team : public std::enable_shared_from_this<Team>
void FillMFMobaBattleDataTeam(cs::MFMobaBattleDataTeam* p);
void FillMFTeamFull(cs::MFTeamFull* p);
bool AllIsDead();
void TrySendTeamBattleReport(Human* sender);
private:
void SendTeamBattleReport(Human* sender);
private:
int team_id_ = 0;
@ -76,4 +77,7 @@ class Team : public std::enable_shared_from_this<Team>
bool auto_fill_ = false;
int kill_count_ = 0;
long long last_kill_frameno_ = 0;
bool sending_battlereport_ = false;
bool already_report_battle_ = false;
};