Skip to content

Commit 996497f

Browse files
committed
refactor: not delay onServerStartedEvent and command registration
1 parent d186b14 commit 996497f

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/legacy/api/EventAPI.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -851,20 +851,14 @@ void InitBasicEventListeners() {
851851

852852
// ===== onServerStarted =====
853853
bus.emplaceListener<ServerStartedEvent>([](ServerStartedEvent&) {
854-
ll::coro::keepThis([]() -> ll::coro::CoroTask<> {
855-
using namespace ll::chrono_literals;
856-
co_await 1_tick;
857-
858-
IF_LISTENED(EVENT_TYPES::onServerStarted) {
859-
CallEvent(EVENT_TYPES::onServerStarted); // Not cancellable
860-
}
861-
IF_LISTENED_END(EVENT_TYPES::onServerStarted);
854+
IF_LISTENED(EVENT_TYPES::onServerStarted) {
855+
CallEvent(EVENT_TYPES::onServerStarted); // Not cancellable
856+
}
857+
IF_LISTENED_END(EVENT_TYPES::onServerStarted);
862858

863-
isCmdRegisterEnabled = true;
859+
isCmdRegisterEnabled = true;
864860

865-
// 处理延迟注册
866-
ProcessRegCmdQueue();
867-
}).launch(ll::thread::ServerThreadExecutor::getDefault());
861+
ProcessRegCmdQueue();
868862
});
869863

870864
// 植入tick

0 commit comments

Comments
 (0)