fix(Core/ScriptsMgr): correct hooks name (#6434)
## Changes Proposed: - Added `virtual` for `CanSendJoinMessageArenaQueue` and `CanSendExitMessageArenaQueue` - Rename `CanExitJoinMessageArenaQueue` to `CanSendExitMessageArenaQueue`
This commit is contained in:
parent
53ab534f0b
commit
fbad1f3d6c
10
doc/changelog/pendings/changes_1624109504178983100.md
Normal file
10
doc/changelog/pendings/changes_1624109504178983100.md
Normal file
@ -0,0 +1,10 @@
|
||||
### Added
|
||||
- new hook `OnBeforeSendJoinMessageArenaQueue` and `OnBeforeSendExitMessageArenaQueue`
|
||||
|
||||
### Changed
|
||||
- Rename `CanExitJoinMessageArenaQueue` to `OnBeforeSendExitMessageArenaQueue`
|
||||
- Rename `CanSendJoinMessageArenaQueue` to `OnBeforeSendJoinMessageArenaQueue`
|
||||
|
||||
### How to upgrade
|
||||
- Just rename all hooks from `CanExitJoinMessageArenaQueue` and `CanSendMessageArenaQueue`, to `OnBeforeSendExitMessageArenaQueue`
|
||||
- Just rename all hooks from `CanSendJoinMessageArenaQueue` and `OnBeforeSendJoinMessageArenaQueue`
|
||||
@ -1015,7 +1015,7 @@ void BattlegroundQueue::SendJoinMessageArenaQueue(Player* leader, GroupQueueInfo
|
||||
if (!sWorld->getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
|
||||
return;
|
||||
|
||||
if (!sScriptMgr->CanSendJoinMessageArenaQueue(this, leader, ginfo, bracketEntry, isRated))
|
||||
if (!sScriptMgr->OnBeforeSendJoinMessageArenaQueue(this, leader, ginfo, bracketEntry, isRated))
|
||||
return;
|
||||
|
||||
if (!isRated)
|
||||
@ -1080,7 +1080,7 @@ void BattlegroundQueue::SendExitMessageArenaQueue(GroupQueueInfo* ginfo)
|
||||
if (!sWorld->getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
|
||||
return;
|
||||
|
||||
if (!sScriptMgr->CanExitJoinMessageArenaQueue(this, ginfo))
|
||||
if (!sScriptMgr->OnBeforeSendExitMessageArenaQueue(this, ginfo))
|
||||
return;
|
||||
|
||||
ArenaTeam* team = sArenaTeamMgr->GetArenaTeamById(ginfo->ArenaTeamId);
|
||||
|
||||
@ -2809,23 +2809,23 @@ bool ScriptMgr::CanSendMessageBGQueue(BattlegroundQueue* queue, Player* leader,
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool ScriptMgr::CanSendJoinMessageArenaQueue(BattlegroundQueue* queue, Player* leader, GroupQueueInfo* ginfo, PvPDifficultyEntry const* bracketEntry, bool isRated)
|
||||
bool ScriptMgr::OnBeforeSendJoinMessageArenaQueue(BattlegroundQueue* queue, Player* leader, GroupQueueInfo* ginfo, PvPDifficultyEntry const* bracketEntry, bool isRated)
|
||||
{
|
||||
bool ret = true;
|
||||
|
||||
FOR_SCRIPTS_RET(BGScript, itr, end, ret) // return true by default if not scripts
|
||||
if (!itr->second->CanSendJoinMessageArenaQueue(queue, leader, ginfo, bracketEntry, isRated))
|
||||
if (!itr->second->OnBeforeSendJoinMessageArenaQueue(queue, leader, ginfo, bracketEntry, isRated))
|
||||
ret = false; // we change ret value only when scripts return false
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool ScriptMgr::CanExitJoinMessageArenaQueue(BattlegroundQueue* queue, GroupQueueInfo* ginfo)
|
||||
bool ScriptMgr::OnBeforeSendExitMessageArenaQueue(BattlegroundQueue* queue, GroupQueueInfo* ginfo)
|
||||
{
|
||||
bool ret = true;
|
||||
|
||||
FOR_SCRIPTS_RET(BGScript, itr, end, ret) // return true by default if not scripts
|
||||
if (!itr->second->CanExitJoinMessageArenaQueue(queue, ginfo))
|
||||
if (!itr->second->OnBeforeSendExitMessageArenaQueue(queue, ginfo))
|
||||
ret = false; // we change ret value only when scripts return false
|
||||
|
||||
return ret;
|
||||
|
||||
@ -1199,9 +1199,26 @@ public:
|
||||
|
||||
[[nodiscard]] virtual bool CanSendMessageBGQueue(BattlegroundQueue* /*queue*/, Player* /*leader*/, Battleground* /*bg*/, PvPDifficultyEntry const* /*bracketEntry*/) { return true; }
|
||||
|
||||
[[nodiscard]] bool CanSendJoinMessageArenaQueue(BattlegroundQueue* /*queue*/, Player* /*leader*/, GroupQueueInfo* /*ginfo*/, PvPDifficultyEntry const* /*bracketEntry*/, bool /*isRated*/) { return true; }
|
||||
/**
|
||||
* @brief This hook runs before sending the join message during the arena queue, allowing you to run extra operations or disabling the join message
|
||||
*
|
||||
* @param queue Contains information about the Arena queue
|
||||
* @param leader Contains information about the player leader
|
||||
* @param ginfo Contains information about the group of the queue
|
||||
* @param bracketEntry Contains information about the bracket
|
||||
* @param isRated Contains information about rated arena or skirmish
|
||||
* @return True if you want to continue sending the message, false if you want to disable the message
|
||||
*/
|
||||
[[nodiscard]] virtual bool OnBeforeSendJoinMessageArenaQueue(BattlegroundQueue* /*queue*/, Player* /*leader*/, GroupQueueInfo* /*ginfo*/, PvPDifficultyEntry const* /*bracketEntry*/, bool /*isRated*/) { return true; }
|
||||
|
||||
[[nodiscard]] bool CanExitJoinMessageArenaQueue(BattlegroundQueue* /*queue*/, GroupQueueInfo* /*ginfo*/) { return true; }
|
||||
/**
|
||||
* @brief This hook runs before sending the exit message during the arena queue, allowing you to run extra operations or disabling the exit message
|
||||
*
|
||||
* @param queue Contains information about the Arena queue
|
||||
* @param ginfo Contains information about the group of the queue
|
||||
* @return True if you want to continue sending the message, false if you want to disable the message
|
||||
*/
|
||||
[[nodiscard]] virtual bool OnBeforeSendExitMessageArenaQueue(BattlegroundQueue* /*queue*/, GroupQueueInfo* /*ginfo*/) { return true; }
|
||||
};
|
||||
|
||||
class ArenaTeamScript : public ScriptObject
|
||||
@ -1802,8 +1819,8 @@ public: /* BGScript */
|
||||
BattlegroundBracketId thisBracketId, BattlegroundQueue* specificQueue, BattlegroundBracketId specificBracketId);
|
||||
void OnCheckNormalMatch(BattlegroundQueue* queue, uint32& Coef, Battleground* bgTemplate, BattlegroundBracketId bracket_id, uint32& minPlayers, uint32& maxPlayers);
|
||||
bool CanSendMessageBGQueue(BattlegroundQueue* queue, Player* leader, Battleground* bg, PvPDifficultyEntry const* bracketEntry);
|
||||
bool CanSendJoinMessageArenaQueue(BattlegroundQueue* queue, Player* leader, GroupQueueInfo* ginfo, PvPDifficultyEntry const* bracketEntry, bool isRated);
|
||||
bool CanExitJoinMessageArenaQueue(BattlegroundQueue* queue, GroupQueueInfo* ginfo);
|
||||
bool OnBeforeSendJoinMessageArenaQueue(BattlegroundQueue* queue, Player* leader, GroupQueueInfo* ginfo, PvPDifficultyEntry const* bracketEntry, bool isRated);
|
||||
bool OnBeforeSendExitMessageArenaQueue(BattlegroundQueue* queue, GroupQueueInfo* ginfo);
|
||||
|
||||
public: /* Arena Team Script */
|
||||
void OnGetSlotByType(const uint32 type, uint8& slot);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user