1
This commit is contained in:
parent
ecfd46ccc2
commit
99995ee3dd
@ -1133,7 +1133,12 @@ void Human::FillSMGameOver(cs::SMGameOver& msg)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (IsPlayer()) {
|
if (IsPlayer()) {
|
||||||
|
Player* p = (Player*)this;
|
||||||
|
if (!p->settlement) {
|
||||||
|
p->settlement = std::make_shared<cs::MFSettlement>();
|
||||||
|
FillMFSettlement(&msg, p->settlement.get());
|
||||||
|
}
|
||||||
|
*msg.mutable_settlement() = *p->settlement;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2194,6 +2199,7 @@ void Human::GenBattleReportData(a8::MutableXObject* params)
|
|||||||
}
|
}
|
||||||
params->SetVal("account_id", account_id);
|
params->SetVal("account_id", account_id);
|
||||||
params->SetVal("session_id", session_id);
|
params->SetVal("session_id", session_id);
|
||||||
|
params->SetVal("team_id", team_id);
|
||||||
params->SetVal("pve_instance_id", room->IsPveRoom() ? room->pve_instance->pb->gemini_id() : 0);
|
params->SetVal("pve_instance_id", room->IsPveRoom() ? room->pve_instance->pb->gemini_id() : 0);
|
||||||
params->SetVal("pve_instance_mode", room->IsPveRoom() ? room->pve_mode_meta->pb->id() : 0);
|
params->SetVal("pve_instance_mode", room->IsPveRoom() ? room->pve_mode_meta->pb->id() : 0);
|
||||||
params->SetVal("battle_uuid", battle_uuid);
|
params->SetVal("battle_uuid", battle_uuid);
|
||||||
@ -4541,3 +4547,57 @@ int Human::GetTeamMode()
|
|||||||
{
|
{
|
||||||
return GetTeam()->GetMemberNum() <= 1 ? 0 : 1;
|
return GetTeam()->GetMemberNum() <= 1 ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Human::FillMFSettlement(cs::SMGameOver* msg, cs::MFSettlement* s)
|
||||||
|
{
|
||||||
|
s->set_version(2022111801);
|
||||||
|
s->set_room_uuid(a8::XValue(room->GetRoomUuid()).GetString());
|
||||||
|
s->set_room_mode(room->GetRoomMode());
|
||||||
|
s->set_match_mode(GetBattleContext()->GetMatchMode());
|
||||||
|
s->set_team_mode(GetTeamMode());
|
||||||
|
s->set_game_over(msg->game_over() ? 1 : 0);
|
||||||
|
s->set_victory(stats.victory);
|
||||||
|
if (stats.victory) {
|
||||||
|
s->set_watchable(false);
|
||||||
|
} else {
|
||||||
|
if (room->GetAliveTeamNum() > 1) {
|
||||||
|
s->set_watchable(true);
|
||||||
|
} else {
|
||||||
|
if (room->IsPveRoom()) {
|
||||||
|
s->set_watchable(!room->IsGameOver());
|
||||||
|
} else {
|
||||||
|
s->set_watchable(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
s->set_team_id(team_id);
|
||||||
|
s->set_account_id(account_id);
|
||||||
|
s->set_temmate_all_dead(1);
|
||||||
|
|
||||||
|
s->set_map_id(room->GetMapMeta()->i->map_id());
|
||||||
|
s->set_map_name("");
|
||||||
|
s->set_rank_chg(0);
|
||||||
|
for (auto item : msg->spoils_items()) {
|
||||||
|
auto p = s->add_spoils_items();
|
||||||
|
p->set_item_id(a8::XValue(item.values(0)));
|
||||||
|
p->set_item_num(a8::XValue(item.values(1)));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (room->IsPveRoom()) {
|
||||||
|
s->set_pve_wave(room->pve_data.GetWave() + 1);
|
||||||
|
s->set_pve_max_wave(room->pve_data.max_wave);
|
||||||
|
s->set_pve_instance_id(room->pve_instance->pb->gemini_id());
|
||||||
|
s->set_pve_boss_killed(room->pve_data.boss_state == 2 ? 1 : 0);
|
||||||
|
} else {
|
||||||
|
s->set_pvp_team_rank(GetTeam()->team_rank);
|
||||||
|
s->set_pvp_personal_rank(stats.rank);
|
||||||
|
s->set_pvp_my_rank(msg->my_rank());
|
||||||
|
s->set_pvp_max_rank(msg->max_rank());
|
||||||
|
s->set_pvp_total_human_num(msg->total_human_num());
|
||||||
|
s->set_pvp_alive_human_num(msg->alive_human_num());
|
||||||
|
s->set_pvp_total_team_num(msg->total_team_num());
|
||||||
|
}
|
||||||
|
|
||||||
|
*s->mutable_reward() = msg->reward();
|
||||||
|
}
|
||||||
|
@ -405,6 +405,7 @@ private:
|
|||||||
virtual void OnBuffRemove(Buff& buff) override;
|
virtual void OnBuffRemove(Buff& buff) override;
|
||||||
virtual void DoSkillPreProc(int skill_id, int target_id, const a8::Vec2& target_pos) override;
|
virtual void DoSkillPreProc(int skill_id, int target_id, const a8::Vec2& target_pos) override;
|
||||||
virtual void DoSkillPostProc(bool used, int skill_id, int target_id, const a8::Vec2& target_pos) override;
|
virtual void DoSkillPostProc(bool used, int skill_id, int target_id, const a8::Vec2& target_pos) override;
|
||||||
|
void FillMFSettlement(cs::SMGameOver* msg, cs::MFSettlement* settlement);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
long long hide_frameno_ = 0;
|
long long hide_frameno_ = 0;
|
||||||
|
@ -948,6 +948,8 @@ message MFSettlement
|
|||||||
optional int32 victory = 7; //是否胜利
|
optional int32 victory = 7; //是否胜利
|
||||||
optional int32 watchable = 8; //是否可观战
|
optional int32 watchable = 8; //是否可观战
|
||||||
optional int32 team_id = 9; //队伍id
|
optional int32 team_id = 9; //队伍id
|
||||||
|
optional string account_id = 50; //自己的账号id
|
||||||
|
optional int32 temmate_all_dead = 51; //队友是否全部阵亡
|
||||||
|
|
||||||
optional int32 map_id = 10; //地图id
|
optional int32 map_id = 10; //地图id
|
||||||
optional string map_name = 12; //地图名称
|
optional string map_name = 12; //地图名称
|
||||||
|
Loading…
x
Reference in New Issue
Block a user