From 326637c93b19fd54c71fb16940947ffee83c86eb Mon Sep 17 00:00:00 2001 From: sudlud Date: Sat, 22 Feb 2025 23:38:26 +0100 Subject: [PATCH] add enabled hook lists for performance improvement (#1004) --- src/Playerbots.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Playerbots.cpp b/src/Playerbots.cpp index 2b33feed..042cfd17 100644 --- a/src/Playerbots.cpp +++ b/src/Playerbots.cpp @@ -75,7 +75,16 @@ public: class PlayerbotsPlayerScript : public PlayerScript { public: - PlayerbotsPlayerScript() : PlayerScript("PlayerbotsPlayerScript") {} + PlayerbotsPlayerScript() : PlayerScript("PlayerbotsPlayerScript", { + PLAYERHOOK_ON_LOGIN, + PLAYERHOOK_ON_AFTER_UPDATE, + PLAYERHOOK_CAN_PLAYER_USE_PRIVATE_CHAT, + PLAYERHOOK_CAN_PLAYER_USE_GROUP_CHAT, + PLAYERHOOK_CAN_PLAYER_USE_CHAT, + PLAYERHOOK_CAN_PLAYER_USE_CHANNEL_CHAT, + PLAYERHOOK_ON_BEFORE_CRITERIA_PROGRESS, + PLAYERHOOK_ON_BEFORE_ACHI_COMPLETE + }) {} void OnPlayerLogin(Player* player) override { @@ -225,7 +234,9 @@ public: class PlayerbotsServerScript : public ServerScript { public: - PlayerbotsServerScript() : ServerScript("PlayerbotsServerScript") {} + PlayerbotsServerScript() : ServerScript("PlayerbotsServerScript", { + SERVERHOOK_CAN_PACKET_RECEIVE + }) {} void OnPacketReceived(WorldSession* session, WorldPacket const& packet) override { @@ -238,7 +249,9 @@ public: class PlayerbotsWorldScript : public WorldScript { public: - PlayerbotsWorldScript() : WorldScript("PlayerbotsWorldScript") {} + PlayerbotsWorldScript() : WorldScript("PlayerbotsWorldScript", { + WORLDHOOK_ON_BEFORE_WORLD_INITIALIZED + }) {} void OnBeforeWorldInitialized() override {