diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 4441d784..52455264 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -111,21 +111,6 @@ void Room::InitData(RoomInitInfo& init_info) poly_ext_datas_ = map_instance->GetPolyExtDatas(); custom_battle_ = init_info.custom_battle; rank_match_conf_ = mt::Param::GetRankModeConfByRoomType(room_type_); - if (IsMobaModeRoom()) { - moba_over_timer = xtimer.SetTimeoutWpEx - (SERVER_FRAME_RATE * mt::Param::s().moba_room_time, - [this] (int event, const a8::Args* args) - { - if (a8::TIMER_EXEC_EVENT == event) { - if (!IsGameOver()) { - game_over_ = true; - game_over_frameno_ = GetFrameNo(); - OnGameOver(); - } - } - }, - &xtimer_attacher_); - } } void Room::Init() @@ -150,6 +135,21 @@ void Room::Init() #ifdef DEBUG InitDebugInfo(); #endif + if (IsMobaModeRoom()) { + moba_over_timer = xtimer.SetTimeoutWpEx + (SERVER_FRAME_RATE * mt::Param::s().moba_room_time, + [this] (int event, const a8::Args* args) + { + if (a8::TIMER_EXEC_EVENT == event) { + if (!IsGameOver()) { + game_over_ = true; + game_over_frameno_ = GetFrameNo(); + OnGameOver(); + } + } + }, + &xtimer_attacher_); + } } void Room::UnInit()