This commit is contained in:
azw 2023-03-22 07:13:43 +00:00
parent 28844db74d
commit 2101c68196
2 changed files with 29 additions and 0 deletions

View File

@ -1,5 +1,6 @@
#include "precompile.h"
#include <a8/mutable_xobject.h>
#include "team.h"
#include "human.h"
@ -8,6 +9,9 @@
#include "bornpoint.h"
#include "battledatacontext.h"
#include "mt/Map.h"
#include "mt/PveGemini.h"
void Team::TraverseMembers(std::function<bool (Human*)> func)
{
for (Human* member : members_) {
@ -187,3 +191,22 @@ void Team::SendTeamBattleReport(Human* sender)
return true;
});
}
void Team::GenBattleReportData(a8::MutableXObject* params)
{
params->SetVal("version", 2023030201);
params->SetVal("room_uuid", a8::XValue(room->GetRoomUuid()));
params->SetVal("room_mode", room->IsPveRoom() ? 0 : 1);
params->SetVal("team_id", GetTeamId());
params->SetVal("map_id", room->GetMapMeta()->map_id());
params->SetVal("victory", room->IsPveRoom() ? 0 : team_rank == 1);
if (room->IsPveRoom()) {
params->SetVal("pve_settelement_type", 1);
params->SetVal("pve_instance_id", room->pve_instance->gemini_id());
params->SetVal("pve_wave", room->pve_data.GetPassedWave());
params->SetVal("pve_max_wave", room->pve_data.max_wave);
} else {
}
}

View File

@ -5,6 +5,11 @@ namespace cs
class SMGameOver;
}
namespace a8
{
class MutableXObject;
}
class Room;
class Human;
class Team
@ -40,6 +45,7 @@ class Team
bool HasPlayer();
void FillSMGameOver(cs::SMGameOver& msg);
void SendTeamBattleReport(Human* sender);
void GenBattleReportData(a8::MutableXObject* params);
private:
int team_id_ = 0;