This commit is contained in:
aozhiwei 2022-08-26 11:40:21 +08:00
parent af6955400f
commit 7dcc460ea2
3 changed files with 49 additions and 0 deletions

View File

@ -951,6 +951,7 @@ void Human::FillSMGameOver(cs::SMGameOver& msg)
} }
msg.set_team_id(team_id); msg.set_team_id(team_id);
msg.set_team_rank(stats.rank); msg.set_team_rank(stats.rank);
msg.set_personal_rank(stats.rank);
msg.set_team_allcnt(1); msg.set_team_allcnt(1);
msg.set_game_over(room->IsGameOver() || (alive_team_num == 1)); msg.set_game_over(room->IsGameOver() || (alive_team_num == 1));
msg.set_victory(!dead); msg.set_victory(!dead);
@ -974,12 +975,54 @@ void Human::FillSMGameOver(cs::SMGameOver& msg)
cs::MFPlayerStats* p = msg.add_player_stats(); cs::MFPlayerStats* p = msg.add_player_stats();
FillMFPlayerStats(p); FillMFPlayerStats(p);
} }
{
msg.set_total_team_num(room->GetTeamNum());
if (room->IsPveRoom()) {
msg.set_pve_wave(room->pve_data.wave);
msg.set_pve_max_wave(room->pve_data.max_wave);
msg.set_pve_instance_id(room->pve_instance->pb->gemini_id());
}
}
{ {
for (auto& pair : spoils_items) { for (auto& pair : spoils_items) {
auto p = msg.add_spoils_items(); auto p = msg.add_spoils_items();
p->add_values(pair.first); p->add_values(pair.first);
p->add_values(pair.second); p->add_values(pair.second);
} }
#ifdef DEBUG
{
{
auto p = msg.add_spoils_items();
p->add_values(10001);
p->add_values(1000);
}
{
int items[] = {
110101,
110111,
110121,
110131,
110141,
110151,
110161,
110171,
110181,
110201,
110211,
110221,
110231,
110241,
110251,
110261,
110271,
110281
};
auto p = msg.add_spoils_items();
p->add_values(10001);
p->add_values(1000);
}
}
#endif
} }
stats.CalcReward(this, stats.rank, stats.kills); stats.CalcReward(this, stats.rank, stats.kills);
TypeConvert::ToPb(stats.over_reward, msg.mutable_reward()); TypeConvert::ToPb(stats.over_reward, msg.mutable_reward());

View File

@ -949,6 +949,11 @@ int Room::GetAliveTeamNum()
return num; return num;
} }
int Room::GetTeamNum()
{
return team_hash_.size();
}
bool Room::CanJoin(const std::string& accountid, bool Room::CanJoin(const std::string& accountid,
RoomType_e self_room_type, RoomType_e self_room_type,
RoomMode_e self_room_mode, RoomMode_e self_room_mode,

View File

@ -188,6 +188,7 @@ public:
bool OverBorder(const a8::Vec2& pos, ColliderComponent* collider); bool OverBorder(const a8::Vec2& pos, ColliderComponent* collider);
Human* GetWatchWarTarget(Human* hum); Human* GetWatchWarTarget(Human* hum);
bool BattleStarted(); bool BattleStarted();
int GetTeamNum();
int GetAliveTeamNum(); int GetAliveTeamNum();
Team* GetAliveTeam(); Team* GetAliveTeam();
bool CanJoin(const std::string& accountid, bool CanJoin(const std::string& accountid,