优化NotifyGameStart
This commit is contained in:
parent
c8e8c92889
commit
a0de81fcf2
@ -1580,11 +1580,21 @@ void Room::NotifyGameStart()
|
||||
cs::SMGameStart msg;
|
||||
for (auto& pair : accountid_hash_) {
|
||||
pair.second->SendNotifyMsg(msg);
|
||||
if (room_type_ == RT_NewBrid) {
|
||||
first_newbie_ = pair.second;
|
||||
}
|
||||
}
|
||||
xtimer.AddDeadLineTimerAndAttach(SERVER_FRAME_RATE * 1,
|
||||
|
||||
waiting_start_ = true;
|
||||
xtimer.AddDeadLineTimerAndAttach
|
||||
(SERVER_FRAME_RATE * 2,
|
||||
a8::XParams()
|
||||
.SetSender(this),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
Room* room = (Room*)param.sender.GetUserData();
|
||||
room->waiting_start_ = false;
|
||||
},
|
||||
&xtimer_attacher_.timer_list_);
|
||||
xtimer.AddDeadLineTimerAndAttach
|
||||
(SERVER_FRAME_RATE * 1,
|
||||
a8::XParams()
|
||||
.SetSender(this),
|
||||
[] (const a8::XParams& param)
|
||||
@ -1594,44 +1604,9 @@ void Room::NotifyGameStart()
|
||||
room->SecondRandPoint();
|
||||
},
|
||||
&xtimer_attacher_.timer_list_);
|
||||
waiting_start_ = true;
|
||||
xtimer.AddDeadLineTimerAndAttach(SERVER_FRAME_RATE * 2,
|
||||
a8::XParams()
|
||||
.SetSender(this),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
Room* room = (Room*)param.sender.GetUserData();
|
||||
room->waiting_start_ = false;
|
||||
},
|
||||
&xtimer_attacher_.timer_list_);
|
||||
if (room_type_ == RT_NewBrid) {
|
||||
xtimer.AddDeadLineTimerAndAttach
|
||||
(SERVER_FRAME_RATE * MetaMgr::Instance()->level0room_robot_protect_time,
|
||||
a8::XParams()
|
||||
.SetSender(this),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
Room* room = (Room*)param.sender.GetUserData();
|
||||
if (room->GetFirstNewBie()) {
|
||||
room->GetFirstNewBie()->ProcNewBieLogic();
|
||||
}
|
||||
},
|
||||
&xtimer_attacher_.timer_list_);
|
||||
}
|
||||
if (room_type_ == RT_MidBrid) {
|
||||
xtimer.AddDeadLineTimerAndAttach
|
||||
(SERVER_FRAME_RATE * MetaMgr::Instance()->level1room_shua_robot_min_time,
|
||||
a8::XParams()
|
||||
.SetSender(this),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
Room* room = (Room*)param.sender.GetUserData();
|
||||
#if 0
|
||||
room->ShuaAndroidTimerFunc();
|
||||
#endif
|
||||
room->DieAndroidTimerFunc();
|
||||
},
|
||||
&xtimer_attacher_.timer_list_);
|
||||
|
||||
if (room_type == RT_NewBrid || room_type == RT_MidBrid) {
|
||||
NewBieRoomStart();
|
||||
}
|
||||
}
|
||||
|
||||
@ -2454,3 +2429,37 @@ void Room::ForceSetBornPoint(Human* hum, BornPoint* born_point)
|
||||
grid_service->MoveHuman(hum);
|
||||
}
|
||||
}
|
||||
|
||||
void Room::NewBieRoomStart()
|
||||
{
|
||||
if (room_type_ == RT_NewBrid) {
|
||||
for (auto& pair : accountid_hash_) {
|
||||
first_newbie_ = pair.second;
|
||||
break;
|
||||
}
|
||||
xtimer.AddDeadLineTimerAndAttach
|
||||
(SERVER_FRAME_RATE * MetaMgr::Instance()->level0room_robot_protect_time,
|
||||
a8::XParams()
|
||||
.SetSender(this),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
Room* room = (Room*)param.sender.GetUserData();
|
||||
if (room->GetFirstNewBie()) {
|
||||
room->GetFirstNewBie()->ProcNewBieLogic();
|
||||
}
|
||||
},
|
||||
&xtimer_attacher_.timer_list_);
|
||||
}
|
||||
if (room_type_ == RT_MidBrid) {
|
||||
xtimer.AddDeadLineTimerAndAttach
|
||||
(SERVER_FRAME_RATE * MetaMgr::Instance()->level1room_shua_robot_min_time,
|
||||
a8::XParams()
|
||||
.SetSender(this),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
Room* room = (Room*)param.sender.GetUserData();
|
||||
room->DieAndroidTimerFunc();
|
||||
},
|
||||
&xtimer_attacher_.timer_list_);
|
||||
}
|
||||
}
|
||||
|
@ -178,6 +178,7 @@ private:
|
||||
void AddPlayerPostProc(Player* hum);
|
||||
void CombineTeamBornPoint();
|
||||
void ForceSetBornPoint(Human* hum, BornPoint* born_point);
|
||||
void NewBieRoomStart();
|
||||
|
||||
#ifdef DEBUG
|
||||
void InitDebugInfo();
|
||||
|
Loading…
x
Reference in New Issue
Block a user