feat(Core/Modules): add separated lib for modules (#9281)

This commit is contained in:
Kargatum
2021-12-02 20:28:58 +07:00
committed by GitHub
parent 8668a03e14
commit 51adbffae4
56 changed files with 1904 additions and 1014 deletions

View File

@@ -51,10 +51,6 @@
#include "WorldSocket.h"
#include <zlib.h>
#ifdef ELUNA
#include "LuaEngine.h"
#endif
namespace
{
std::string const DefaultPlayerName = "<none>";
@@ -254,12 +250,10 @@ void WorldSession::SendPacket(WorldPacket const* packet)
}
#endif // !ACORE_DEBUG
sScriptMgr->OnPacketSend(this, *packet);
#ifdef ELUNA
if (!sEluna->OnPacketSend(this, *packet))
if (!sScriptMgr->CanPacketSend(this, *packet))
{
return;
#endif
}
LOG_TRACE("network.opcode", "S->C: %s %s", GetPlayerInfo().c_str(), GetOpcodeNameForLogging(static_cast<OpcodeServer>(packet->GetOpcode())).c_str());
m_Socket->SendPacket(*packet);
@@ -346,11 +340,11 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
}
else if (_player->IsInWorld() && AntiDOS.EvaluateOpcode(*packet, currentTime))
{
sScriptMgr->OnPacketReceive(this, *packet);
#ifdef ELUNA
if (!sEluna->OnPacketReceive(this, *packet))
if (!sScriptMgr->CanPacketReceive(this, *packet))
{
break;
#endif
}
opHandle->Call(this, *packet);
LogUnprocessedTail(packet);
}
@@ -358,11 +352,11 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
case STATUS_TRANSFER:
if (_player && !_player->IsInWorld() && AntiDOS.EvaluateOpcode(*packet, currentTime))
{
sScriptMgr->OnPacketReceive(this, *packet);
#ifdef ELUNA
if (!sEluna->OnPacketReceive(this, *packet))
if (!sScriptMgr->CanPacketReceive(this, *packet))
{
break;
#endif
}
opHandle->Call(this, *packet);
LogUnprocessedTail(packet);
}
@@ -373,11 +367,11 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
if (AntiDOS.EvaluateOpcode(*packet, currentTime))
{
sScriptMgr->OnPacketReceive(this, *packet);
#ifdef ELUNA
if (!sEluna->OnPacketReceive(this, *packet))
if (!sScriptMgr->CanPacketReceive(this, *packet))
{
break;
#endif
}
opHandle->Call(this, *packet);
LogUnprocessedTail(packet);
}