1
This commit is contained in:
parent
a12cddfe49
commit
51a78394a3
@ -911,259 +911,6 @@ void Human::UpdateMove()
|
||||
Creature::UpdateMove();
|
||||
}
|
||||
|
||||
#if 0
|
||||
void Human::GenBattleReportData(a8::MutableXObject* params)
|
||||
{
|
||||
params->SetVal("room_mode", room->GetRoomMode());
|
||||
int rank = 0;
|
||||
{
|
||||
std::vector<Human*> human_list;
|
||||
room->TraverseHumanList(
|
||||
[&human_list] (Human* hum) -> bool
|
||||
{
|
||||
human_list.push_back(hum);
|
||||
return true;
|
||||
});
|
||||
std::sort(human_list.begin(), human_list.end(),
|
||||
[] (Human* a, Human* b )
|
||||
{
|
||||
if (a->real_dead && b->real_dead) {
|
||||
if (a->dead_frameno == b->dead_frameno) {
|
||||
return a->GetUniId() < b->GetUniId();
|
||||
} else {
|
||||
return a->dead_frameno == 0 ||
|
||||
(b->dead_frameno != 0 && a->dead_frameno > b->dead_frameno);
|
||||
}
|
||||
} else {
|
||||
if (a->real_dead) {
|
||||
return false;
|
||||
}
|
||||
if (b->real_dead) {
|
||||
return true;
|
||||
}
|
||||
return a->GetUniId() < b->GetUniId();
|
||||
}
|
||||
});
|
||||
rank = human_list.size();
|
||||
for (size_t i = 0; i < human_list.size(); ++i) {
|
||||
if (human_list[i] == this) {
|
||||
rank = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (room->GetAliveTeamNum() == 1) {
|
||||
if (room->GetAliveTeam() == GetTeam()) {
|
||||
rank = 1;
|
||||
}
|
||||
}
|
||||
stats->rank = rank;
|
||||
if (room->IsPveRoom()) {
|
||||
if (stats->pve_kill_boss) {
|
||||
stats->victory = true;
|
||||
stats->settlement_color = 1;
|
||||
}
|
||||
} else {
|
||||
stats->victory = stats->rank == 1;
|
||||
if (GetTeam()->GetAliveNum() <= 0) {
|
||||
GetTeam()->team_rank = room->GetAliveTeamNum();
|
||||
stats->pvp_settlement_type = GetTeam()->GetMemberNum() > 1 ? 1 : 0;
|
||||
stats->settlement_color = 1;
|
||||
} else {
|
||||
if (room->GetAliveTeamNum() == 1) {
|
||||
if (room->GetAliveTeam() == GetTeam()) {
|
||||
GetTeam()->team_rank = 1;
|
||||
stats->pvp_settlement_type = GetTeam()->GetMemberNum() > 1 ? 1 : 0;
|
||||
stats->settlement_color = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (rank < 10) {
|
||||
stats->settlement_color = 1;
|
||||
}
|
||||
if (stats->victory) {
|
||||
GetTeam()->team_rank = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!stats->statemented) {
|
||||
stats->Statement(this);
|
||||
}
|
||||
params->SetVal("account_id", account_id);
|
||||
params->SetVal("session_id", session_id);
|
||||
params->SetVal("team_id", team_id);
|
||||
params->SetVal("pve_instance_id", room->IsPveRoom() ? room->pve_instance->gemini_id() : 0);
|
||||
params->SetVal("pve_instance_mode", room->IsPveRoom() ? room->pve_mode_meta->id() : 0);
|
||||
params->SetVal("battle_uuid", GetTeam()->GetBattleUuid());
|
||||
params->SetVal("match_mode", room->IsPveRoom() ? 2 : 0);
|
||||
params->SetVal("is_valid_battle", is_valid_battle);
|
||||
params->SetVal("payload", payload);
|
||||
params->SetVal("map_id", room->GetMapMeta()->map_id());
|
||||
params->SetVal("map_name", room->GetMapMeta()->map_name());
|
||||
params->SetVal("team_mode", GetTeam() && GetTeam()->GetMemberNum() > 1 ? 1 : 0);
|
||||
//params->SetVal("map_tpl_name", room->GetMapTplName());
|
||||
params->SetVal("room_uuid", room->GetRoomUuid());
|
||||
params->SetVal("room_mode", room->GetRoomMode());
|
||||
params->SetVal("hero_id", meta->id());
|
||||
params->SetVal("hero_uniid", hero_uniid);
|
||||
params->SetVal("game_time", f8::App::Instance()->GetNowTime()); //?
|
||||
int alive_time = room->GetFrameNo() * FRAME_RATE_MS;
|
||||
if (!dead) {
|
||||
params->SetVal("alive_time", alive_time);
|
||||
} else {
|
||||
alive_time = (dead_frameno - room->GetBattleStartFrameNo()) * FRAME_RATE_MS;
|
||||
if (room->GetBattleStartFrameNo() <= 0) {
|
||||
alive_time = 0;
|
||||
}
|
||||
params->SetVal("alive_time", alive_time);
|
||||
}
|
||||
params->SetVal("weapon_uuid1", spec_weapons.size() > 0 ? spec_weapons[0].weapon_uniid : 0);
|
||||
params->SetVal("weapon_uuid2", spec_weapons.size() > 1 ? spec_weapons[1].weapon_uniid : 0);
|
||||
params->SetVal("ranked", rank);
|
||||
params->SetVal("kills", stats->kills);
|
||||
params->SetVal("damage_out", stats->damage_amount_out);
|
||||
params->SetVal("rescue_teammate_times", stats->rescue_member);
|
||||
params->SetVal("diving_times", stats->diving_times);
|
||||
params->SetVal("damage_in", stats->damage_amount_in);
|
||||
params->SetVal("recover_hp", stats->heal_amount);
|
||||
params->SetVal("open_airdrop_times", stats->open_airdrop_times);
|
||||
params->SetVal("use_medicine_times", stats->use_medicine_times);
|
||||
params->SetVal("destory_car_times", stats->destory_car_times);
|
||||
params->SetVal("use_camouflage_times", stats->use_camouflage_times);
|
||||
params->SetVal("use_skill_times", stats->use_skill_times);
|
||||
params->SetVal("ride_car_move_distance", stats->ride_car_move_distance);
|
||||
params->SetVal("ride_car_kills", stats->ride_car_kills);
|
||||
params->SetVal("max_hero_skill_lv", stats->max_hero_skill_lv);
|
||||
{
|
||||
params->SetVal("pve_rank_score", stats->pve_rank_score);
|
||||
params->SetVal("pve_kill_boss", stats->pve_kill_boss);
|
||||
}
|
||||
{
|
||||
std::string weapons_type;
|
||||
std::string weapons_slot;
|
||||
for (auto& pair : stats->weapon_stats) {
|
||||
auto& weapon = pair.second;
|
||||
if (weapon.kills || weapon.damage_out || weapon.obtain_count) {
|
||||
weapons_type += a8::Format("%d:%d:%d:%d|",
|
||||
{
|
||||
weapon.weapon_id,
|
||||
weapon.kills,
|
||||
weapon.damage_out,
|
||||
weapon.obtain_count
|
||||
});
|
||||
}
|
||||
if (weapon.use_times) {
|
||||
weapons_slot += a8::Format("%d:%d|",
|
||||
{
|
||||
weapon.weapon_id,
|
||||
weapon.use_times
|
||||
});
|
||||
}
|
||||
}
|
||||
params->SetVal("weapons_type", weapons_type);
|
||||
params->SetVal("weapons_slot", weapons_slot);
|
||||
}
|
||||
{
|
||||
std::string heros;
|
||||
for (auto& pair : stats->hero_stats) {
|
||||
auto& hero = pair.second;
|
||||
if (hero.skill_lv || hero.weapon_lv) {
|
||||
heros += a8::Format("%d:%d:%d|",
|
||||
{
|
||||
hero.hero_id,
|
||||
hero.skill_lv,
|
||||
hero.weapon_lv,
|
||||
});
|
||||
}
|
||||
}
|
||||
params->SetVal("heros", heros);
|
||||
}
|
||||
{
|
||||
float rank_param = mt::RankReward::GetRankRewardParam(rank);
|
||||
float kill_param = mt::KillReward::GetKillRewardParam(stats->kills);
|
||||
int coin_num = (rank_param * mt::Param::s().rank_param) +
|
||||
(kill_param * mt::Param::s().kill_param);
|
||||
stats->gold = coin_num;
|
||||
params->SetVal("coin_num", coin_num);
|
||||
}
|
||||
{
|
||||
std::string items_str;
|
||||
for (auto& pair : battlein_items) {
|
||||
items_str += a8::Format("%d:%d|",
|
||||
{pair.first,
|
||||
pair.second
|
||||
});
|
||||
}
|
||||
params->SetVal("items", items_str);
|
||||
}
|
||||
{
|
||||
stats->pass_score = mt::KillPoint::GetKillPointParam1(stats->kills);
|
||||
stats->pass_score += mt::RankPoint::GetRankPointParam1(rank);
|
||||
stats->rank_score = mt::KillPoint::GetKillPointParam2(stats->kills);
|
||||
stats->rank_score += mt::RankPoint::GetRankPointParam2(rank);
|
||||
}
|
||||
params->SetVal("score", 0);
|
||||
params->SetVal("pass_score", has_pass ? stats->pass_score * 2 : stats->pass_score);
|
||||
params->SetVal("rank_score", stats->rank_score);
|
||||
{
|
||||
params->SetVal("ranked_topx", stats->ranked_topx);
|
||||
params->SetVal("kills_topx", stats->kills_topx);
|
||||
params->SetVal("hero_topx", stats->hero_topx);
|
||||
params->SetVal("weapon_topx", stats->weapon_topx);
|
||||
params->SetVal("survival_topx", stats->survival_topx);
|
||||
|
||||
params->SetVal("hero_stats_uniid", stats->pb_hero_stats.hero_uniid);
|
||||
params->SetVal("hero_stats_name", stats->pb_hero_stats.hero_name);
|
||||
params->SetVal("hero_stats_hero_id", stats->pb_hero_stats.hero_id);
|
||||
params->SetVal("hero_stats_reward_ceg", stats->pb_hero_stats.reward_ceg);
|
||||
params->SetVal("hero_stats_today_get_ceg", stats->pb_hero_stats.today_get_ceg);
|
||||
params->SetVal("hero_stats_ceg_uplimit", stats->pb_hero_stats.ceg_uplimit);
|
||||
|
||||
for (int i = 0; i < stats->pb_weapons_stats.size(); ++i) {
|
||||
auto& p = stats->pb_weapons_stats.at(i);
|
||||
std::string i_str = a8::XValue(i).GetString();
|
||||
params->SetVal("weapon_stats_uniid" + i_str, p.weapon_uniid);
|
||||
params->SetVal("weapon_stats_name" + i_str, p.weapon_name);
|
||||
params->SetVal("weapon_stats_weapon_id" + i_str, p.weapon_id);
|
||||
params->SetVal("weapon_stats_reward_ceg" + i_str, p.reward_ceg);
|
||||
params->SetVal("weapon_stats_today_get_ceg" + i_str, p.today_get_ceg);
|
||||
params->SetVal("weapon_stats_ceg_uplimit" + i_str, p.ceg_uplimit);
|
||||
}
|
||||
}
|
||||
params->SetVal("is_team_statemented", GetTeam()->GetAliveNum() <= 0 ? 1 : 0);
|
||||
params->SetVal("team_rank", GetTeam()->GetAliveNum() <= 0 ? GetTeam()->team_rank : 0);
|
||||
{
|
||||
std::shared_ptr<a8::MutableXObject> post_data = a8::MutableXObject::CreateObject();
|
||||
std::shared_ptr<a8::MutableXObject> team_list = a8::MutableXObject::CreateArray();
|
||||
room->TraverseTeams
|
||||
(
|
||||
[team_list] (Team* team)
|
||||
{
|
||||
std::shared_ptr<a8::MutableXObject> team_data = a8::MutableXObject::CreateObject();
|
||||
std::shared_ptr<a8::MutableXObject> members_list = a8::MutableXObject::CreateArray();
|
||||
|
||||
team->TraverseMembers
|
||||
(
|
||||
[members_list] (Human* hum)
|
||||
{
|
||||
std::shared_ptr<a8::MutableXObject> member = a8::MutableXObject::CreateObject();
|
||||
member->SetVal("account_id", hum->account_id);
|
||||
if (hum->GetTeam()->GetAliveNum() <= 0) {
|
||||
member->SetVal("kills", hum->stats->kills);
|
||||
}
|
||||
members_list->Push(*member.get());
|
||||
return true;
|
||||
});
|
||||
|
||||
team_data->SetVal("team_id", team->GetTeamId());
|
||||
team_data->SetVal("members", *members_list.get());
|
||||
team_list->Push(*team_data.get());
|
||||
return true;
|
||||
});
|
||||
post_data->SetVal("team_list", *team_list.get());
|
||||
params->SetVal("__POST", post_data->ToJsonStr());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
void Human::DeadDrop()
|
||||
{
|
||||
if (room->IsMobaModeRoom()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user