Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Add missing addon chat handlers
Browse files Browse the repository at this point in the history
-TCPP has dedicated handling of these messages that don't get caught by the usual handler.
  • Loading branch information
Niam5 committed Nov 6, 2023
1 parent 6dc3ee9 commit 9596c35
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/server/game/Handlers/ChatHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,10 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData)
Group* group = sender->GetGroup();
if (!group || !group->isBGGroup())
return;
#ifdef ELUNA
if (!sEluna->OnChat(sender, type, LANG_ADDON, message, group))
return;
#endif

WorldPacket data;
ChatHandler::BuildChatPacket(data, type, LANG_ADDON, sender, nullptr, message, 0U, "", DEFAULT_LOCALE, prefix);
Expand All @@ -727,7 +731,13 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData)
{
if (sender->GetGuildId())
if (Guild* guild = sGuildMgr->GetGuildById(sender->GetGuildId()))
{
#ifdef ELUNA
if (!sEluna->OnChat(sender, type, LANG_ADDON, message, guild))
return;
#endif
guild->BroadcastAddonToGuild(this, type == CHAT_MSG_OFFICER, message, prefix);
}
break;
}
case CHAT_MSG_WHISPER:
Expand All @@ -737,6 +747,10 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData)
Player* receiver = ObjectAccessor::FindPlayerByName(targetName);
if (!receiver)
break;
#ifdef ELUNA
if (!sEluna->OnChat(sender, type, LANG_ADDON, message, receiver))
return;
#endif

sender->WhisperAddon(message, prefix, receiver);
break;
Expand All @@ -748,6 +762,10 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData)
Group* group = sender->GetGroup();
if (!group || group->isBGGroup())
break;
#ifdef ELUNA
if (!sEluna->OnChat(sender, type, LANG_ADDON, message, group))
return;
#endif

WorldPacket data;
ChatHandler::BuildChatPacket(data, type, LANG_ADDON, sender, nullptr, message, 0U, "", DEFAULT_LOCALE, prefix);
Expand Down

0 comments on commit 9596c35

Please sign in to comment.