1
This commit is contained in:
parent
8a67dda32c
commit
c240b72f13
@ -51,6 +51,7 @@ void InGameVoice::UnInit()
|
|||||||
void InGameVoice::OnHumanBeKill(int killer_id, Human* deader)
|
void InGameVoice::OnHumanBeKill(int killer_id, Human* deader)
|
||||||
{
|
{
|
||||||
personal_nodead_series_kills_.erase(deader->GetUniId());
|
personal_nodead_series_kills_.erase(deader->GetUniId());
|
||||||
|
personal_nodead_timer_attacher_.erase(deader->GetUniId());
|
||||||
if (killer_id == deader->GetUniId()) {
|
if (killer_id == deader->GetUniId()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -88,18 +89,18 @@ void InGameVoice::OnHumanBeKill(int killer_id, Human* deader)
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
&room_->xtimer_attacher_);
|
&room_->xtimer_attacher_);
|
||||||
#if 0
|
if (!killer->dead) {
|
||||||
room_->xtimer.SetTimeoutWpEx
|
room_->xtimer.SetTimeoutWpEx
|
||||||
(
|
(
|
||||||
SERVER_FRAME_RATE * mt::InGameVoice::s_series_kill_interval,
|
SERVER_FRAME_RATE * mt::InGameVoice::s_series_kill_interval,
|
||||||
[room = room_, killer_id] (int event, const a8::Args* args)
|
[room = room_, killer_id] (int event, const a8::Args* args)
|
||||||
{
|
{
|
||||||
if (a8::TIMER_EXEC_EVENT == event) {
|
if (a8::TIMER_EXEC_EVENT == event) {
|
||||||
DecIntMap(room->GetInGameVoice()->personal_nodead_series_kills_, killer_id);
|
DecIntMap(room->GetInGameVoice()->personal_nodead_series_kills_, killer_id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
&room_->xtimer_attacher_);
|
GetNoDeadTimerAttacher(killer_id));
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,3 +108,14 @@ void InGameVoice::Notify(Human* killer, Human* deader, const mt::InGameVoice* me
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a8::Attacher* InGameVoice::GetNoDeadTimerAttacher(int killer_id)
|
||||||
|
{
|
||||||
|
auto itr = personal_nodead_timer_attacher_.find(killer_id);
|
||||||
|
if (itr == personal_nodead_timer_attacher_.end()) {
|
||||||
|
personal_nodead_timer_attacher_[killer_id] = a8::Attacher();
|
||||||
|
itr = personal_nodead_timer_attacher_.find(killer_id);
|
||||||
|
itr->second.SetOwner(&room_->xtimer);
|
||||||
|
}
|
||||||
|
return &itr->second;
|
||||||
|
}
|
||||||
|
@ -17,6 +17,7 @@ class InGameVoice : public std::enable_shared_from_this<InGameVoice>
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void UpdateTeamBeKillLastTime(int team_id);
|
void UpdateTeamBeKillLastTime(int team_id);
|
||||||
|
a8::Attacher* GetNoDeadTimerAttacher(int killer_id);
|
||||||
|
|
||||||
void Notify(Human* killer, Human* deader, const mt::InGameVoice* meta);
|
void Notify(Human* killer, Human* deader, const mt::InGameVoice* meta);
|
||||||
|
|
||||||
@ -27,5 +28,6 @@ private:
|
|||||||
std::map<int, int> personal_kills_;
|
std::map<int, int> personal_kills_;
|
||||||
std::map<int, int> personal_series_kills_;
|
std::map<int, int> personal_series_kills_;
|
||||||
std::map<int, int> personal_nodead_series_kills_;
|
std::map<int, int> personal_nodead_series_kills_;
|
||||||
|
std::map<int, a8::Attacher> personal_nodead_timer_attacher_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user