feat(Core/Modules): add separated lib for modules (#9281)
This commit is contained in:
@@ -56,10 +56,6 @@
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
|
||||
class LoginQueryHolder : public CharacterDatabaseQueryHolder
|
||||
{
|
||||
private:
|
||||
|
||||
@@ -39,10 +39,6 @@
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
|
||||
inline bool isNasty(uint8 c)
|
||||
{
|
||||
if (c == '\t')
|
||||
@@ -431,11 +427,13 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
if (type == CHAT_MSG_PARTY_LEADER && !group->IsLeader(sender->GetGUID()))
|
||||
return;
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(GetPlayer(), type, lang, msg, group))
|
||||
if (!sScriptMgr->CanPlayerUseChat(GetPlayer(), type, lang, msg, group))
|
||||
{
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
|
||||
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, ChatMsg(type), Language(lang), sender, nullptr, msg);
|
||||
group->BroadcastPacket(&data, false, group->GetMemberGroup(GetPlayer()->GetGUID()));
|
||||
@@ -447,12 +445,13 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
{
|
||||
if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId()))
|
||||
{
|
||||
if (!sScriptMgr->CanPlayerUseChat(GetPlayer(), type, lang, msg, guild))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, guild);
|
||||
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(GetPlayer(), type, lang, msg, guild))
|
||||
return;
|
||||
#endif
|
||||
guild->BroadcastToGuild(this, false, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
|
||||
}
|
||||
}
|
||||
@@ -464,12 +463,13 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
{
|
||||
if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId()))
|
||||
{
|
||||
if (sScriptMgr->CanPlayerUseChat(GetPlayer(), type, lang, msg, guild))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, guild);
|
||||
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(GetPlayer(), type, lang, msg, guild))
|
||||
return;
|
||||
#endif
|
||||
guild->BroadcastToGuild(this, true, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
|
||||
}
|
||||
}
|
||||
@@ -486,11 +486,13 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(GetPlayer(), type, lang, msg, group))
|
||||
if (!sScriptMgr->CanPlayerUseChat(GetPlayer(), type, lang, msg, group))
|
||||
{
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
|
||||
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID, Language(lang), sender, nullptr, msg);
|
||||
group->BroadcastPacket(&data, false);
|
||||
@@ -507,11 +509,13 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(GetPlayer(), type, lang, msg, group))
|
||||
if (!sScriptMgr->CanPlayerUseChat(GetPlayer(), type, lang, msg, group))
|
||||
{
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
|
||||
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_LEADER, Language(lang), sender, nullptr, msg);
|
||||
group->BroadcastPacket(&data, false);
|
||||
@@ -523,13 +527,15 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
if (!group || !group->isRaidGroup() || !(group->IsLeader(GetPlayer()->GetGUID()) || group->IsAssistant(GetPlayer()->GetGUID())) || group->isBGGroup())
|
||||
return;
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(GetPlayer(), type, lang, msg, group))
|
||||
if (!sScriptMgr->CanPlayerUseChat(GetPlayer(), type, lang, msg, group))
|
||||
{
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
|
||||
|
||||
// In battleground, raid warning is sent only to players in battleground - code is ok
|
||||
WorldPacket data;
|
||||
//in battleground, raid warning is sent only to players in battleground - code is ok
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_WARNING, Language(lang), sender, nullptr, msg);
|
||||
group->BroadcastPacket(&data, false);
|
||||
}
|
||||
@@ -541,11 +547,13 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
if (!group || !group->isBGGroup())
|
||||
return;
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(GetPlayer(), type, lang, msg, group))
|
||||
if (!sScriptMgr->CanPlayerUseChat(GetPlayer(), type, lang, msg, group))
|
||||
{
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
|
||||
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_BATTLEGROUND, Language(lang), sender, nullptr, msg);
|
||||
group->BroadcastPacket(&data, false);
|
||||
@@ -558,11 +566,13 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
if (!group || !group->isBGGroup() || !group->IsLeader(GetPlayer()->GetGUID()))
|
||||
return;
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(GetPlayer(), type, lang, msg, group))
|
||||
if (!sScriptMgr->CanPlayerUseChat(GetPlayer(), type, lang, msg, group))
|
||||
{
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
|
||||
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_BATTLEGROUND_LEADER, Language(lang), sender, nullptr, msg);
|
||||
group->BroadcastPacket(&data, false);
|
||||
@@ -583,12 +593,13 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
{
|
||||
if (Channel* chn = cMgr->GetChannel(channel, sender))
|
||||
{
|
||||
if (!sScriptMgr->CanPlayerUseChat(sender, type, lang, msg, chn))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerChat(sender, type, lang, msg, chn);
|
||||
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(sender, type, lang, msg, chn))
|
||||
return;
|
||||
#endif
|
||||
chn->Say(sender->GetGUID(), msg.c_str(), lang);
|
||||
}
|
||||
}
|
||||
@@ -615,11 +626,12 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
sender->ToggleAFK();
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerChat(sender, type, lang, msg);
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(sender, type, lang, msg))
|
||||
if (!sScriptMgr->CanPlayerUseChat(sender, type, lang, msg))
|
||||
{
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerChat(sender, type, lang, msg);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -642,11 +654,13 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
sender->ToggleDND();
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerChat(sender, type, lang, msg);
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(sender, type, lang, msg))
|
||||
if (!sScriptMgr->CanPlayerUseChat(sender, type, lang, msg))
|
||||
{
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerChat(sender, type, lang, msg);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -26,13 +26,10 @@
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
|
||||
void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recvData)
|
||||
{
|
||||
LOG_DEBUG("network", "WORLD: CMSG_AUTOSTORE_LOOT_ITEM");
|
||||
@@ -210,9 +207,9 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/)
|
||||
data << uint8(1); // "You loot..."
|
||||
SendPacket(&data);
|
||||
}
|
||||
#ifdef ELUNA
|
||||
sEluna->OnLootMoney(player, loot->gold);
|
||||
#endif
|
||||
|
||||
sScriptMgr->OnLootMoney(player, loot->gold);
|
||||
|
||||
loot->gold = 0;
|
||||
|
||||
// Delete the money loot record from the DB
|
||||
@@ -494,10 +491,6 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket& recvData)
|
||||
target->SendNewItem(newitem, uint32(item.count), false, false, true);
|
||||
target->UpdateLootAchievements(&item, loot);
|
||||
|
||||
#ifdef ELUNA
|
||||
sEluna->OnLootItem(target, newitem, item.count, lootguid);
|
||||
#endif
|
||||
|
||||
// mark as looted
|
||||
item.count = 0;
|
||||
item.is_looted = true;
|
||||
|
||||
@@ -51,10 +51,6 @@
|
||||
#include "WorldSession.h"
|
||||
#include <zlib.h>
|
||||
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
|
||||
void WorldSession::HandleRepopRequestOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
LOG_DEBUG("network", "WORLD: Recvd CMSG_REPOP_REQUEST Message");
|
||||
@@ -79,10 +75,6 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket& recv_data)
|
||||
GetPlayer()->KillPlayer();
|
||||
}
|
||||
|
||||
#ifdef ELUNA
|
||||
sEluna->OnRepop(GetPlayer());
|
||||
#endif
|
||||
|
||||
//this is spirit release confirm?
|
||||
GetPlayer()->RemovePet(nullptr, PET_SAVE_NOT_IN_SLOT, true);
|
||||
GetPlayer()->BuildPlayerRepop();
|
||||
|
||||
@@ -31,10 +31,6 @@
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
|
||||
void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket& recvData)
|
||||
{
|
||||
ObjectGuid guid;
|
||||
@@ -93,11 +89,6 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket& recvData)
|
||||
//if (!creature->GetTransport()) // pussywizard: reverted with new spline (old: without this check, npc would stay in place and the transport would continue moving, so the npc falls off. NPCs on transports don't have waypoints, so stopmoving is not needed)
|
||||
creature->StopMoving();
|
||||
|
||||
#ifdef ELUNA
|
||||
if (sEluna->OnGossipHello(_player, creature))
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (sScriptMgr->OnGossipHello(_player, creature))
|
||||
return;
|
||||
|
||||
@@ -425,9 +416,9 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData)
|
||||
_player->AbandonQuest(questId); // remove all quest items player received before abandoning quest.
|
||||
_player->RemoveActiveQuest(questId);
|
||||
_player->RemoveTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, questId);
|
||||
#ifdef ELUNA
|
||||
sEluna->OnQuestAbandon(_player, questId);
|
||||
#endif
|
||||
|
||||
sScriptMgr->OnQuestAbandon(_player, questId);
|
||||
|
||||
LOG_DEBUG("network.opcode", "Player %s abandoned quest %u", _player->GetGUID().ToString().c_str(), questId);
|
||||
// check if Quest Tracker is enabled
|
||||
if (sWorld->getBoolConfig(CONFIG_QUEST_ENABLE_QUEST_TRACKER))
|
||||
|
||||
@@ -32,10 +32,6 @@
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
|
||||
void WorldSession::HandleClientCastFlags(WorldPacket& recvPacket, uint8 castFlags, SpellCastTargets& targets)
|
||||
{
|
||||
// some spell cast packet including more data (for projectiles?)
|
||||
|
||||
Reference in New Issue
Block a user