This commit is contained in:
aozhiwei 2024-04-03 10:58:55 +08:00
parent a2de56c187
commit 12379921ca
3 changed files with 27 additions and 1 deletions

View File

@ -44,6 +44,7 @@ Android::~Android()
void Android::Initialize()
{
Human::Initialize();
account_id = a8::Format("2006_0000_%d", {robot_meta->id()});
RandSkin();
GiveEquip();
RecalcBaseAttr();

View File

@ -2213,7 +2213,30 @@ void Room::OnGameOver()
});
return;
} else {
TryRoomReport(0);
xtimer.SetIntervalEx
(SERVER_FRAME_RATE / 0.5,
[this, frameno = GetFrameNo()] (int event, const a8::Args* args)
{
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 (all_sent) {
TryRoomReport(0);
xtimer.DeleteCurrentTimer();
}
}
},
&xtimer_attacher_);
}
}
@ -3955,6 +3978,7 @@ void Room::TryRoomReport(int try_count)
if (room) {
room->already_room_report_battle_ = true;
room->sending_room_report_battle_ = false;
room->StartOverTimer();
}
},
url.c_str(),

View File

@ -64,6 +64,7 @@ class Team : public std::enable_shared_from_this<Team>
void FillMFTeamFull(cs::MFTeamFull* p);
bool AllIsDead();
void TrySendTeamBattleReport(Human* sender);
bool IsAlreadyReportBattle() { return already_report_battle_;}
private:
void SendTeamBattleReport(Human* sender);