This commit is contained in:
aozhiwei 2022-09-15 21:54:19 +08:00
parent 13d71b06cb
commit 544691e71c

View File

@ -1909,11 +1909,29 @@ void Room::AddObjectLater(RoomEntity* entity)
void Room::OnGameOver()
{
for (auto& pair : human_hash_) {
#if 1
pair.second->SendGameOver();
#else
if (IsGameOver() && game_over_frameno_ == GetFrameNo()) {
pair.second->SendGameOver();
}
#endif
}
RoomMgr::Instance()->AddOverRoom(room_uuid_);
xtimer.AddRepeatTimerAndAttach
(
1,
a8::XParams()
.SetSender(this)
.SetParam1(1),
[] (const a8::XParams& param)
{
Room* room = (Room*)param.sender.GetUserData();
a8::XParams* mut_param = room->xtimer.MutableParams(room->xtimer.GetRunningTimer());
mut_param->param1 = mut_param->param1.GetInt() + 1;
RoomMgr::Instance()->AddOverRoom(room->room_uuid_);
},
&xtimer_attacher_.timer_list_);
}
void Room::RandRemoveAndroid()