1
This commit is contained in:
parent
5146211e4e
commit
5651e3ff9a
@ -859,6 +859,53 @@ void Human::FillSMGameOver(cs::SMGameOver& msg)
|
||||
if (GetTeam()->already_report_battle) {
|
||||
msg.mutable_settlement_new()->set_settlement_status(1);
|
||||
return;
|
||||
} else {
|
||||
msg.mutable_settlement_new()->set_settlement_status(0);
|
||||
auto p = msg.mutable_settlement_new();
|
||||
p->set_version(20230321);
|
||||
p->set_team_id(GetTeam()->GetTeamId());
|
||||
p->set_room_uuid(a8::XValue(room->GetRoomUuid()).GetString());
|
||||
p->set_room_mode(room->IsPveRoom() ? 1 : 0);
|
||||
p->set_team_mode(1);
|
||||
p->set_game_over(room->IsGameOver() ? 1 : 0);
|
||||
p->set_victory(stats.victory ? 1 : 0);
|
||||
{
|
||||
int alive_team_num = room->GetAliveTeamNum();
|
||||
|
||||
if (stats.victory) {
|
||||
p->set_watchable(false);
|
||||
} else {
|
||||
if (room->GetAliveTeamNum() > 1) {
|
||||
p->set_watchable(true);
|
||||
} else {
|
||||
if (room->IsPveRoom()) {
|
||||
p->set_watchable(!room->IsGameOver());
|
||||
} else {
|
||||
p->set_watchable(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
p->set_map_id(room->GetMapMeta()->map_id());
|
||||
p->set_battle_uuid(a8::XValue(battle_uuid).GetString());
|
||||
|
||||
if (room->IsPveRoom()) {
|
||||
p->set_pve_settlement_color(stats.settlement_color);
|
||||
p->set_pve_wave(room->pve_data.GetPassedWave());
|
||||
p->set_pve_max_wave(room->pve_data.max_wave);
|
||||
p->set_pve_instance_id(room->pve_instance->gemini_id());
|
||||
} else {
|
||||
p->set_pvp_settlement_type(stats.pvp_settlement_type);
|
||||
p->set_pvp_settlement_color(stats.settlement_color);
|
||||
p->set_pvp_team_rank(GetTeam()->team_rank);
|
||||
p->set_pvp_total_human_num(room->GetHumanNum());
|
||||
p->set_pvp_alive_human_num(room->AliveCount());
|
||||
p->set_pvp_total_team_num(room->GetTeamNum());
|
||||
p->set_pvp_match_mode(0);
|
||||
}
|
||||
GetTeam()->FillSMGameOver(msg);
|
||||
return;
|
||||
}
|
||||
int alive_team_num = room->GetAliveTeamNum();
|
||||
|
||||
@ -1845,3 +1892,8 @@ void PlayerMgr::_SS_Ping(f8::MsgHdr& hdr, const ss::SS_Ping& msg)
|
||||
ss::SS_Pong respmsg;
|
||||
GGListener::Instance()->SendToClient(hdr.socket_handle, 0, respmsg);
|
||||
}
|
||||
|
||||
void Team::FillSMGameOver(cs::SMGameOver& msg)
|
||||
{
|
||||
auto p = msg.mutable_settlement_new();
|
||||
}
|
||||
|
@ -1,5 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
namespace cs
|
||||
{
|
||||
class SMGameOver;
|
||||
}
|
||||
|
||||
class Room;
|
||||
class Human;
|
||||
class Team
|
||||
@ -33,6 +38,7 @@ class Team
|
||||
bool HasReviveCoin(Human* member);
|
||||
bool IsFreeTeam();
|
||||
bool HasPlayer();
|
||||
void FillSMGameOver(cs::SMGameOver& msg);
|
||||
|
||||
private:
|
||||
int team_id_ = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user