From 544691e71c5383ccaf46c575bd282ba2d9c7d11e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 15 Sep 2022 21:54:19 +0800 Subject: [PATCH] 1 --- server/gameserver/room.cc | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 09fabfdc..c49fb69d 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -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()