1
This commit is contained in:
parent
93d19816de
commit
ef3bdcf123
@ -2636,7 +2636,21 @@ void Room::NotifyKillList(const std::vector<int>& uniid_list)
|
||||
|
||||
void Room::SendSMTeamFull(Human* hum)
|
||||
{
|
||||
|
||||
if (!IsMobaModeRoom()) {
|
||||
return;
|
||||
}
|
||||
cs::SMTeamFullNotify notify_msg;
|
||||
std::vector<Team*> team_list = {GetMobaTeamA(), GetMobaTeamB()};
|
||||
for (Team* team : team_list) {
|
||||
team->FillMFTeamFull(notify_msg.add_team_list());
|
||||
}
|
||||
TraversePlayerList
|
||||
(
|
||||
[¬ify_msg] (Player* hum) -> bool
|
||||
{
|
||||
hum->SendNotifyMsg(notify_msg);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
void Room::OnTeamPartChg(Human* hum)
|
||||
@ -2644,15 +2658,15 @@ void Room::OnTeamPartChg(Human* hum)
|
||||
if (!IsMobaModeRoom()) {
|
||||
return;
|
||||
}
|
||||
if (hpchg_human_hash_.empty()) {
|
||||
hpchg_human_hash_[hum->GetUniId()] = hum;
|
||||
if (team_part_chg_human_hash_.empty()) {
|
||||
team_part_chg_human_hash_[hum->GetUniId()] = hum;
|
||||
xtimer.SetTimeoutWpEx
|
||||
(SERVER_FRAME_RATE * 0.5,
|
||||
[this] (int event, const a8::Args* args)
|
||||
{
|
||||
if (a8::TIMER_EXEC_EVENT == event) {
|
||||
cs::SMTeamPartNotify notify_msg;
|
||||
for (auto& pair : hpchg_human_hash_) {
|
||||
for (auto& pair : team_part_chg_human_hash_) {
|
||||
pair.second->FillMFTeamPart(notify_msg.add_members());
|
||||
}
|
||||
TraversePlayerList
|
||||
@ -2662,11 +2676,12 @@ void Room::OnTeamPartChg(Human* hum)
|
||||
hum->SendNotifyMsg(notify_msg);
|
||||
return true;
|
||||
});
|
||||
hpchg_human_hash_.clear();
|
||||
team_part_chg_human_hash_.clear();
|
||||
}
|
||||
},
|
||||
&xtimer_attacher_);
|
||||
hpchg_human_hash_[hum->GetUniId()] = hum;
|
||||
} else {
|
||||
team_part_chg_human_hash_[hum->GetUniId()] = hum;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2997,6 +2997,7 @@ void Room::OnBattleStart()
|
||||
return true;
|
||||
});
|
||||
battle_starting_ = false;
|
||||
SendSMTeamFull(nullptr);
|
||||
}
|
||||
|
||||
bool Room::CanAddObstacle(const glm::vec3& pos, int obstacle_id)
|
||||
|
@ -399,7 +399,7 @@ private:
|
||||
std::map<int, Human*> alive_human_hash_;
|
||||
std::map<int, Human*> alive_player_hash_;
|
||||
std::map<int, Human*> last_human_hash_;
|
||||
std::map<int, Human*> hpchg_human_hash_;
|
||||
std::map<int, Human*> team_part_chg_human_hash_;
|
||||
std::map<int, std::shared_ptr<BornPoint>> born_point_hash_;
|
||||
std::map<int, std::shared_ptr<a8::CommonCbProcEx>> task_hash_;
|
||||
|
||||
|
@ -2005,6 +2005,8 @@ message SMUiUpdate
|
||||
optional int32 alive_count = 1; //存活数量
|
||||
optional int32 kill_count = 2; //击杀数
|
||||
repeated MFMapCarInfo car_list = 3; //载具列表
|
||||
optional int32 dead_count = 4; //死亡次数(被杀数)
|
||||
optional int32 assist_count = 5; //助攻次数
|
||||
|
||||
//一下只有pve模式有意义
|
||||
optional int32 score = 10; //积分
|
||||
|
Loading…
x
Reference in New Issue
Block a user