添加准备时间
This commit is contained in:
parent
fd2a513a36
commit
ff5438b568
@ -1985,17 +1985,6 @@ void Room::NotifyGameStart()
|
|||||||
for (auto& pair : accountid_hash_) {
|
for (auto& pair : accountid_hash_) {
|
||||||
pair.second->SendNotifyMsg(msg);
|
pair.second->SendNotifyMsg(msg);
|
||||||
}
|
}
|
||||||
for (int buff_id : map_meta_->buff_list) {
|
|
||||||
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(buff_id);
|
|
||||||
if (buff_meta) {
|
|
||||||
for (auto& pair : human_hash_) {
|
|
||||||
pair.second->AddBuff(pair.second,
|
|
||||||
buff_meta,
|
|
||||||
1,
|
|
||||||
nullptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
waiting_start_ = true;
|
waiting_start_ = true;
|
||||||
xtimer.AddDeadLineTimerAndAttach
|
xtimer.AddDeadLineTimerAndAttach
|
||||||
@ -2008,6 +1997,26 @@ void Room::NotifyGameStart()
|
|||||||
room->waiting_start_ = false;
|
room->waiting_start_ = false;
|
||||||
},
|
},
|
||||||
&xtimer_attacher_.timer_list_);
|
&xtimer_attacher_.timer_list_);
|
||||||
|
xtimer.AddDeadLineTimerAndAttach
|
||||||
|
(MetaMgr::Instance()->GetSysParamAsInt("prepare_time", 3000) / FRAME_RATE_MS,
|
||||||
|
a8::XParams()
|
||||||
|
.SetSender(this),
|
||||||
|
[] (const a8::XParams& param)
|
||||||
|
{
|
||||||
|
Room* room = (Room*)param.sender.GetUserData();
|
||||||
|
for (int buff_id : room->map_meta_->buff_list) {
|
||||||
|
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(buff_id);
|
||||||
|
if (buff_meta) {
|
||||||
|
for (auto& pair : room->human_hash_) {
|
||||||
|
pair.second->AddBuff(pair.second,
|
||||||
|
buff_meta,
|
||||||
|
1,
|
||||||
|
nullptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
&xtimer_attacher_.timer_list_);
|
||||||
xtimer.AddDeadLineTimerAndAttach
|
xtimer.AddDeadLineTimerAndAttach
|
||||||
(SERVER_FRAME_RATE * 1,
|
(SERVER_FRAME_RATE * 1,
|
||||||
a8::XParams()
|
a8::XParams()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user